feat: improve 'download diagnosis report' ui

- Use `<label>`.
- Switch the order to ensure the action button is the last item in the form.
- Rename seconds to duration.
- Set `type="number"` to the duration input field.
This commit is contained in:
Gusted 2025-01-04 05:09:00 +01:00
parent ebe6ebe3f3
commit ba8ebcbd68
No known key found for this signature in database
GPG key ID: FD821B732837125F
2 changed files with 8 additions and 8 deletions

View file

@ -3464,6 +3464,7 @@ monitor.process = Running Processes
monitor.stacktrace = Stacktrace
monitor.processes_count = %d Processes
monitor.download_diagnosis_report = Download diagnosis report
monitor.duration = Duration (s)
monitor.desc = Description
monitor.start = Start Time
monitor.execute_time = Execution Time
@ -3921,6 +3922,4 @@ filepreview.lines = Lines %[1]d to %[2]d in %[3]s
filepreview.truncated = Preview has been truncated
[translation_meta]
test = This is a test string. It is not displayed in Forgejo UI but is used for testing purposes. Feel free to enter "ok" to save time (or a fun fact of your choice) to hit that sweet 100% completion mark :)
test = This is a test string. It is not displayed in Forgejo UI but is used for testing purposes. Feel free to enter "ok" to save time (or a fun fact of your choice) to hit that sweet 100% completion mark :)

View file

@ -8,11 +8,12 @@
<a class="{{if eq .ShowGoroutineList "stacktrace"}}active {{end}}item" href="?show=stacktrace">{{ctx.Locale.Tr "admin.monitor.stacktrace"}}</a>
</div>
</div>
<form target="_blank" action="{{AppSubUrl}}/admin/monitor/diagnosis" class="ui form">
<div class="ui inline field">
<button class="ui primary small button">{{ctx.Locale.Tr "admin.monitor.download_diagnosis_report"}}</button>
<input name="seconds" size="3" maxlength="3" value="10"> {{ctx.Locale.Tr "tool.raw_seconds"}}
</div>
<form target="_blank" action="{{AppSubUrl}}/admin/monitor/diagnosis" class="ui form tw-flex tw-gap-3">
<label class="tw-flex tw-gap-2 tw-items-center tw-whitespace-nowrap">
{{ctx.Locale.Tr "admin.monitor.duration"}}
<input type="number" name="seconds" max="300" min="0" value="10">
</label>
<button class="ui primary small button">{{ctx.Locale.Tr "admin.monitor.download_diagnosis_report"}}</button>
</form>
</div>