mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-03-25 23:33:03 -04:00
Some checks are pending
/ release (push) Waiting to run
testing-integration / test-unit (push) Waiting to run
testing-integration / test-sqlite (push) Waiting to run
testing-integration / test-mariadb (v10.6) (push) Waiting to run
testing-integration / test-mariadb (v11.8) (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-e2e (push) Blocked by required conditions
testing / test-remote-cacher (redis) (push) Blocked by required conditions
testing / test-remote-cacher (valkey) (push) Blocked by required conditions
testing / test-remote-cacher (garnet) (push) Blocked by required conditions
testing / test-remote-cacher (redict) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions
Replace the anti-CSRF token with a [cross origin protection by Go](https://go.dev/doc/go1.25#nethttppkgnethttp) that uses a stateless way of verifying if a request was cross origin or not. This allows is to remove al lot of code and replace it with a few lines of code and we no longer have to hand roll this protection. The new protection uses indicators by the browser itself that indicate if the request is cross-origin, thus we no longer have to take care of ensuring the generated CSRF token is passed back to the server any request by the the browser will have send this indicator. Resolves forgejo/forgejo#3538 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/9830 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
59 lines
2.2 KiB
Go HTML Template
59 lines
2.2 KiB
Go HTML Template
{{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin monitor")}}
|
|
<div class="admin-setting-content">
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "admin.monitor.queue" .Queue.GetName}}
|
|
</h4>
|
|
<div class="ui attached table segment">
|
|
<table class="ui very basic striped table">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ctx.Locale.Tr "admin.monitor.queue.name"}}</th>
|
|
<th>{{ctx.Locale.Tr "admin.monitor.queue.type"}}</th>
|
|
<th>{{ctx.Locale.Tr "admin.monitor.queue.exemplar"}}</th>
|
|
<th>{{ctx.Locale.Tr "admin.monitor.queue.numberworkers"}}</th>
|
|
<th>{{ctx.Locale.Tr "admin.monitor.queue.activeworkers"}}</th>
|
|
<th>{{ctx.Locale.Tr "admin.monitor.queue.maxnumberworkers"}}</th>
|
|
<th>{{ctx.Locale.Tr "admin.monitor.queue.numberinqueue"}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>{{.Queue.GetName}}</td>
|
|
<td>{{.Queue.GetType}}</td>
|
|
<td>{{.Queue.GetItemTypeName}}</td>
|
|
<td>{{.Queue.GetWorkerNumber}}</td>
|
|
<td>{{.Queue.GetWorkerActiveNumber}}</td>
|
|
<td>{{.Queue.GetWorkerMaxNumber}}</td>
|
|
<td>
|
|
{{$sum := .Queue.GetQueueItemNumber}}
|
|
{{if lt $sum 0}}
|
|
-
|
|
{{else}}
|
|
{{$sum}}
|
|
<form action="{{$.Link}}/remove-all-items" method="post" class="tw-inline-block tw-ml-4">
|
|
<button class="ui tiny basic red button">{{ctx.Locale.Tr "admin.monitor.queue.settings.remove_all_items"}}</button>
|
|
</form>
|
|
{{end}}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h4 class="ui top attached header">
|
|
{{ctx.Locale.Tr "admin.monitor.queue.settings.title"}}
|
|
</h4>
|
|
<div class="ui attached segment">
|
|
<p>{{ctx.Locale.Tr "admin.monitor.queue.settings.desc"}}</p>
|
|
<form method="post" action="{{.Link}}/set">
|
|
<div class="ui form">
|
|
<div class="inline field">
|
|
<label for="max-number">{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers"}}</label>
|
|
<input name="max-number" type="text" placeholder="{{ctx.Locale.Tr "admin.monitor.queue.settings.maxnumberworkers.placeholder" .Queue.GetWorkerMaxNumber}}">
|
|
</div>
|
|
<button class="ui submit button">{{ctx.Locale.Tr "admin.monitor.queue.settings.submit"}}</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{template "admin/layout_footer" .}}
|