2020-01-07 16:53:09 +05:30
|
|
|
{{template "base/head" .}}
|
2023-02-02 04:26:10 +05:30
|
|
|
<div role="main" aria-label="{{.Title}}" class="page-content admin monitor">
|
2020-01-07 16:53:09 +05:30
|
|
|
{{template "admin/navbar" .}}
|
|
|
|
<div class="ui container">
|
|
|
|
{{template "base/alert" .}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue" .Queue.Name}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached table segment">
|
|
|
|
<table class="ui very basic striped table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-06-28 02:28:46 +05:30
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.name"}}</th>
|
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.type"}}</th>
|
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.exemplar"}}</th>
|
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</th>
|
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th>
|
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
|
2020-01-07 16:53:09 +05:30
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>{{.Queue.Name}}</td>
|
|
|
|
<td>{{.Queue.Type}}</td>
|
|
|
|
<td>{{.Queue.ExemplarType}}</td>
|
|
|
|
<td>{{$sum := .Queue.NumberOfWorkers}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
|
|
|
|
<td>{{if lt $sum 0}}-{{else}}{{.Queue.MaxNumberOfWorkers}}{{end}}</td>
|
2022-02-12 11:01:26 +05:30
|
|
|
<td>{{$sum := .Queue.NumberInQueue}}{{if lt $sum 0}}-{{else}}{{$sum}}{{end}}</td>
|
2020-01-07 16:53:09 +05:30
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2022-08-26 03:25:52 +05:30
|
|
|
{{if lt $sum 0}}
|
2020-01-07 16:53:09 +05:30
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.nopool.title"}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2022-08-26 03:25:52 +05:30
|
|
|
{{if eq .Queue.Type "wrapped"}}
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.wrapped.desc"}}</p>
|
2020-01-07 16:53:09 +05:30
|
|
|
{{else if eq .Queue.Type "persistable-channel"}}
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.persistable-channel.desc"}}</p>
|
2020-01-07 16:53:09 +05:30
|
|
|
{{else}}
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.nopool.desc"}}</p>
|
2020-01-07 16:53:09 +05:30
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.settings.title"}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.settings.desc"}}</p>
|
2020-01-07 16:53:09 +05:30
|
|
|
<form method="POST" action="{{.Link}}/set">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<div class="ui form">
|
|
|
|
<div class="inline field">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label for="max-number">{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label>
|
|
|
|
<input name="max-number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.MaxNumberOfWorkers}}">
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
<div class="inline field">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label for="timeout">{{.locale.Tr "admin.monitor.queue.settings.timeout"}}</label>
|
2022-08-26 03:25:52 +05:30
|
|
|
<input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.timeout.placeholder" .Queue.BoostTimeout}}">
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
<div class="inline field">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label for="number">{{.locale.Tr "admin.monitor.queue.settings.numberworkers"}}</label>
|
|
|
|
<input name="number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.settings.numberworkers.placeholder" .Queue.BoostWorkers}}">
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
<div class="inline field">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label>{{.locale.Tr "admin.monitor.queue.settings.blocktimeout"}}</label>
|
|
|
|
<span>{{.locale.Tr "admin.monitor.queue.settings.blocktimeout.value" .Queue.BlockTimeout}}</span>
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
2022-06-28 02:28:46 +05:30
|
|
|
<button class="ui submit button">{{.locale.Tr "admin.monitor.queue.settings.submit"}}</button>
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.pool.addworkers.title"}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.pool.addworkers.desc"}}</p>
|
2020-01-07 16:53:09 +05:30
|
|
|
<form method="POST" action="{{.Link}}/add">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<div class="ui form">
|
|
|
|
<div class="fields">
|
|
|
|
<div class="field">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</label>
|
|
|
|
<input name="number" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.pool.addworkers.numberworkers.placeholder"}}">
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label>{{.locale.Tr "admin.monitor.queue.pool.timeout"}}</label>
|
|
|
|
<input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.pool.addworkers.timeout.placeholder"}}">
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-28 02:28:46 +05:30
|
|
|
<button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.addworkers.submit"}}</button>
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2022-01-23 02:52:14 +05:30
|
|
|
{{if .Queue.Pausable}}
|
|
|
|
{{if .Queue.IsPaused}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.pool.resume.title"}}
|
2022-01-23 02:52:14 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.pool.resume.desc"}}</p>
|
2022-01-23 02:52:14 +05:30
|
|
|
<form method="POST" action="{{.Link}}/resume">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<div class="ui form">
|
2022-06-28 02:28:46 +05:30
|
|
|
<button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.resume.submit"}}</button>
|
2022-01-23 02:52:14 +05:30
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.pool.pause.title"}}
|
2022-01-23 02:52:14 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.pool.pause.desc"}}</p>
|
2022-01-23 02:52:14 +05:30
|
|
|
<form method="POST" action="{{.Link}}/pause">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<div class="ui form">
|
2022-06-28 02:28:46 +05:30
|
|
|
<button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.pause.submit"}}</button>
|
2022-01-23 02:52:14 +05:30
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2020-01-29 06:31:06 +05:30
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.pool.flush.title"}}
|
2020-01-29 06:31:06 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{.locale.Tr "admin.monitor.queue.pool.flush.desc"}}</p>
|
2020-01-29 06:31:06 +05:30
|
|
|
<form method="POST" action="{{.Link}}/flush">
|
|
|
|
{{$.CsrfTokenHtml}}
|
|
|
|
<div class="ui form">
|
|
|
|
<div class="fields">
|
|
|
|
<div class="field">
|
2022-06-28 02:28:46 +05:30
|
|
|
<label>{{.locale.Tr "admin.monitor.queue.pool.timeout"}}</label>
|
|
|
|
<input name="timeout" type="text" placeholder="{{.locale.Tr "admin.monitor.queue.pool.addworkers.timeout.placeholder"}}">
|
2020-01-29 06:31:06 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-28 02:28:46 +05:30
|
|
|
<button class="ui submit button">{{.locale.Tr "admin.monitor.queue.pool.flush.submit"}}</button>
|
2020-01-29 06:31:06 +05:30
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
2020-01-07 16:53:09 +05:30
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.pool.workers.title"}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached table segment">
|
|
|
|
<table class="ui very basic striped table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-06-28 02:28:46 +05:30
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.numberworkers"}}</th>
|
|
|
|
<th>{{.locale.Tr "admin.monitor.start"}}</th>
|
|
|
|
<th>{{.locale.Tr "admin.monitor.queue.pool.timeout"}}</th>
|
2020-01-07 16:53:09 +05:30
|
|
|
<th></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{range .Queue.Workers}}
|
|
|
|
<tr>
|
2022-09-20 06:23:39 +05:30
|
|
|
<td>{{.Workers}}{{if .IsFlusher}}<span title="{{$.locale.Tr "admin.monitor.queue.flush"}}">{{svg "octicon-sync"}}</span>{{end}}</td>
|
2023-04-11 04:31:20 +05:30
|
|
|
<td>{{template "shared/datetime/full" (dict "Datetime" (DateFmtLong .Start) "Fallback" (DateFmtLong .Start) )}}</td>
|
|
|
|
<td>{{if .HasTimeout}}{{template "shared/datetime/full" (dict "Datetime" (DateFmtLong .Timeout) "Fallback" (DateFmtLong .Timeout) )}}{{else}}-{{end}}</td>
|
2020-01-07 16:53:09 +05:30
|
|
|
<td>
|
2022-11-22 04:40:42 +05:30
|
|
|
<a class="delete-button" href="" data-url="{{$.Link}}/cancel/{{.PID}}" data-id="{{.PID}}" data-name="{{.Workers}}" title="{{$.locale.Tr "remove"}}">{{svg "octicon-trash"}}</a>
|
2020-01-07 16:53:09 +05:30
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{else}}
|
|
|
|
<tr>
|
2022-08-26 03:25:52 +05:30
|
|
|
<td colspan="4">{{.locale.Tr "admin.monitor.queue.pool.workers.none"}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
<h4 class="ui top attached header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.configuration"}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</h4>
|
|
|
|
<div class="ui attached segment">
|
|
|
|
<pre>{{.Queue.Configuration | JsonPrettyPrint}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-04-23 14:54:19 +05:30
|
|
|
<div class="ui gitea-confirm-modal delete modal">
|
|
|
|
<div class="header">
|
2022-06-28 02:28:46 +05:30
|
|
|
{{.locale.Tr "admin.monitor.queue.pool.cancel"}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
<div class="content">
|
2022-06-28 02:28:46 +05:30
|
|
|
<p>{{$.locale.Tr "admin.monitor.queue.pool.cancel_notices" `<span class="name"></span>` | Safe}}</p>
|
|
|
|
<p>{{$.locale.Tr "admin.monitor.queue.pool.cancel_desc"}}</p>
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
2023-04-23 14:54:19 +05:30
|
|
|
{{template "base/modal_actions_confirm" .}}
|
2020-01-07 16:53:09 +05:30
|
|
|
</div>
|
|
|
|
|
|
|
|
{{template "base/footer" .}}
|