summaryrefslogtreecommitdiffstats
path: root/templates/shared/actions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-10-18 20:33:49 +0200
committerDaniel Baumann <daniel@debian.org>2024-12-12 23:57:56 +0100
commite68b9d00a6e05b3a941f63ffb696f91e554ac5ec (patch)
tree97775d6c13b0f416af55314eb6a89ef792474615 /templates/shared/actions
parentInitial commit. (diff)
downloadforgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.tar.xz
forgejo-e68b9d00a6e05b3a941f63ffb696f91e554ac5ec.zip
Adding upstream version 9.0.3.
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'templates/shared/actions')
-rw-r--r--templates/shared/actions/runner_edit.tmpl96
-rw-r--r--templates/shared/actions/runner_list.tmpl95
2 files changed, 191 insertions, 0 deletions
diff --git a/templates/shared/actions/runner_edit.tmpl b/templates/shared/actions/runner_edit.tmpl
new file mode 100644
index 0000000..d60f10b
--- /dev/null
+++ b/templates/shared/actions/runner_edit.tmpl
@@ -0,0 +1,96 @@
+<div class="runner-container">
+ <h4 class="ui top attached header">
+ {{ctx.Locale.Tr "actions.runners.runner_title"}} {{.Runner.ID}} {{.Runner.Name}}
+ </h4>
+ <div class="ui attached segment">
+ <form class="ui form" method="post">
+ {{template "base/disable_form_autofill"}}
+ {{.CsrfTokenHtml}}
+ <div class="runner-basic-info">
+ <div class="field tw-inline-block tw-mr-4">
+ <label>{{ctx.Locale.Tr "actions.runners.status"}}</label>
+ <span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName ctx.Locale}}</span>
+ </div>
+ <div class="field tw-inline-block tw-mr-4">
+ <label>{{ctx.Locale.Tr "actions.runners.last_online"}}</label>
+ <span>{{if .Runner.LastOnline}}{{TimeSinceUnix .Runner.LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</span>
+ </div>
+ <div class="field tw-inline-block tw-mr-4">
+ <label>{{ctx.Locale.Tr "actions.runners.labels"}}</label>
+ <span>
+ {{range .Runner.AgentLabels}}
+ <span class="ui label">{{.}}</span>
+ {{end}}
+ </span>
+ </div>
+ <div class="field tw-inline-block tw-mr-4">
+ <label>{{ctx.Locale.Tr "actions.runners.owner_type"}}</label>
+ <span data-tooltip-content="{{.Runner.BelongsToOwnerName}}">{{.Runner.BelongsToOwnerType.LocaleString ctx.Locale}}</span>
+ </div>
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="field">
+ <label for="description">{{ctx.Locale.Tr "actions.runners.description"}}</label>
+ <input id="description" name="description" value="{{.Runner.Description}}">
+ </div>
+
+ <div class="divider"></div>
+
+ <div class="field">
+ <button class="ui primary button" data-url="{{.Link}}">{{ctx.Locale.Tr "actions.runners.update_runner"}}</button>
+ <button class="ui red button delete-button show-modal" data-url="{{.Link}}/delete" data-modal="#runner-delete-modal">
+ {{ctx.Locale.Tr "actions.runners.delete_runner"}}</button>
+ </div>
+ </form>
+ </div>
+
+ <h4 class="ui top attached header">
+ {{ctx.Locale.Tr "actions.runners.task_list"}}
+ </h4>
+ <div class="ui attached segment">
+ <table class="ui very basic striped table unstackable">
+ <thead>
+ <tr>
+ <th>{{ctx.Locale.Tr "actions.runners.task_list.run"}}</th>
+ <th>{{ctx.Locale.Tr "actions.runners.task_list.status"}}</th>
+ <th>{{ctx.Locale.Tr "actions.runners.task_list.repository"}}</th>
+ <th>{{ctx.Locale.Tr "actions.runners.task_list.commit"}}</th>
+ <th>{{ctx.Locale.Tr "actions.runners.task_list.done_at"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{range .Tasks}}
+ <tr>
+ <td><a href="{{.GetRunLink}}" target="_blank">{{.ID}}</a></td>
+ <td><span class="ui label task-status-{{.Status.String}}">{{.Status.LocaleString ctx.Locale}}</span></td>
+ <td><a href="{{.GetRepoLink}}" target="_blank">{{.GetRepoName}}</a></td>
+ <td>
+ <strong><a href="{{.GetCommitLink}}" target="_blank">{{ShortSha .CommitSHA}}</a></strong>
+ </td>
+ <td>{{if .IsStopped}}
+ <span>{{TimeSinceUnix .Stopped ctx.Locale}}</span>
+ {{else}}-{{end}}</td>
+ </tr>
+ {{end}}
+ {{if not .Tasks}}
+ <tr>
+ <td colspan="5">{{ctx.Locale.Tr "actions.runners.task_list.no_tasks"}}</td>
+ </tr>
+ {{end}}
+ </tbody>
+ </table>
+ {{template "base/paginate" .}}
+ </div>
+ <div class="ui g-modal-confirm delete modal" id="runner-delete-modal">
+ <div class="header">
+ {{svg "octicon-trash"}}
+ {{ctx.Locale.Tr "actions.runners.delete_runner_header"}}
+ </div>
+ <div class="content">
+ <p>{{ctx.Locale.Tr "actions.runners.delete_runner_notice"}}</p>
+ </div>
+ {{template "base/modal_actions_confirm" .}}
+ </div>
+</div>
diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl
new file mode 100644
index 0000000..abbf220
--- /dev/null
+++ b/templates/shared/actions/runner_list.tmpl
@@ -0,0 +1,95 @@
+<div class="runner-container">
+
+ <h4 class="ui top attached header">
+ {{ctx.Locale.Tr "actions.runners.runner_manage_panel"}} ({{ctx.Locale.Tr "admin.total" .Total}})
+ <div class="ui right">
+ <div class="ui top right pointing dropdown">
+ <button class="ui primary tiny button">
+ {{ctx.Locale.Tr "actions.runners.new"}}
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
+ </button>
+ <div class="menu">
+ <div class="item">
+ <a href="https://forgejo.org/docs/next/admin/actions/#forgejo-runner">{{ctx.Locale.Tr "actions.runners.new_notice"}}</a>
+ </div>
+ <div class="divider"></div>
+ <div class="header">
+ Registration Token
+ </div>
+ <div class="ui input">
+ <input type="text" value="{{.RegistrationToken}}">
+ <button class="ui basic label button" aria-label="{{ctx.Locale.Tr "copy"}}" data-clipboard-text="{{.RegistrationToken}}">
+ {{svg "octicon-copy" 14}}
+ </button>
+ </div>
+ <div class="divider"></div>
+ <div class="item">
+ <a href="{{$.Link}}/reset_registration_token">{{ctx.Locale.Tr "actions.runners.reset_registration_token"}}</a>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </h4>
+ <div class="ui attached segment">
+ <form class="ui form ignore-dirty" id="user-list-search-form" action="{{$.Link}}">
+ {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.runner_kind")}}
+ </form>
+ </div>
+ <div class="ui attached table segment">
+ <table class="ui very basic striped table unstackable">
+ <thead>
+ <tr>
+ <th data-sortt-asc="online" data-sortt-desc="offline">
+ {{ctx.Locale.Tr "actions.runners.status"}}
+ {{SortArrow "online" "offline" .SortType false}}
+ </th>
+ <th data-sortt-asc="newest" data-sortt-desc="oldest">
+ {{ctx.Locale.Tr "actions.runners.id"}}
+ {{SortArrow "oldest" "newest" .SortType false}}
+ </th>
+ <th data-sortt-asc="alphabetically" data-sortt-desc="reversealphabetically">
+ {{ctx.Locale.Tr "actions.runners.name"}}
+ {{SortArrow "alphabetically" "reversealphabetically" .SortType false}}
+ </th>
+ <th>{{ctx.Locale.Tr "actions.runners.version"}}</th>
+ <th>{{ctx.Locale.Tr "actions.runners.owner_type"}}</th>
+ <th>{{ctx.Locale.Tr "actions.runners.labels"}}</th>
+ <th>{{ctx.Locale.Tr "actions.runners.last_online"}}</th>
+ <th>{{ctx.Locale.Tr "edit"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{if .Runners}}
+ {{range .Runners}}
+ <tr>
+ <td>
+ <span class="ui {{if .IsOnline}}green{{end}} label">{{.StatusLocaleName ctx.Locale}}</span>
+ </td>
+ <td>{{.ID}}</td>
+ <td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td>
+ <td>{{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}}</td>
+ <td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString ctx.Locale}}</span></td>
+ <td class="tw-flex tw-flex-wrap tw-gap-2 runner-tags">
+ {{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}}
+ </td>
+ <td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td>
+ <td class="runner-ops">
+ {{if .Editable $.RunnerOwnerID $.RunnerRepoID}}
+ <a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
+ {{end}}
+ </td>
+ </tr>
+ {{end}}
+ {{else}}
+ <tr>
+ <td class="center aligned" colspan="8">{{ctx.Locale.Tr "actions.runners.none"}}</td>
+ </tr>
+ {{end}}
+ </tbody>
+ </table>
+ </div>
+
+ {{template "base/paginate" .}}
+
+</div>