feat(runner): add runner page in repo and org settings

This commit is contained in:
fuxiaohei
2022-11-25 17:48:45 +08:00
committed by Jason Song
parent c3530bf47c
commit 38b36edc5c
11 changed files with 85 additions and 97 deletions
+85
View File
@@ -0,0 +1,85 @@
{{template "base/head" .}}
<div class="page-content admin runners">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{.locale.Tr "admin.runners.runner_title"}} #{{.Runner.ID}} {{.Runner.Name}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{template "base/disable_form_autofill"}}
{{.CsrfTokenHtml}}
<div class="runner-basic-info">
<div class="field dib">
<label>{{.locale.Tr "admin.runners.status"}}</label>
<span class="runner-status-{{.Runner.StatusType}}">{{.Runner.StatusType}}</span>
</div>
<div class="field dib">
<label>{{.locale.Tr "admin.runners.latest_online"}}</label>
<span>{{TimeSinceUnix .Runner.LastOnline $.locale}}</span>
</div>
<div class="field dib">
<label>{{.locale.Tr "admin.runners.agent_labels"}}</label>
<span>
{{range .Runner.AgentLabels}}
<span>{{.}}</span>
{{end}}
</span>
</div>
<div class="field dib">
<label>{{.locale.Tr "admin.runners.owner_type"}}</label>
<span>{{.Runner.OwnType}}</span>
</div>
</div>
<div class="ui divider"></div>
<div class="field">
<label for="description">{{.locale.Tr "admin.runners.description"}}</label>
<input id="description" name="description" value="{{.Runner.Description}}">
</div>
<div class="field">
<label for="custom_labels">{{.locale.Tr "admin.runners.custom_labels"}}</label>
<input id="custom_labels" name="custom_labels" value="{{Join .Runner.CustomLabels `,`}}">
<p class="help">{{.locale.Tr "admin.runners.custom_labels_helper"}}</p>
</div>
<div class="ui divider"></div>
<div class="field">
<button type="submit" class="ui green button">{{.locale.Tr "admin.runners.update_runner"}}</button>
<button type="button" class="ui red button delete-button show-modal" data-modal="#runner-delete-modal">
{{.locale.Tr "admin.runners.delete_runner"}}</button>
</div>
</form>
</div>
<h4 class="ui top attached header">
{{.locale.Tr "admin.runners.task_list"}}
</h4>
<div class="ui attached segment">
Comming soon
</div>
</div>
</div>
<div class="ui small modal" id="runner-delete-modal">
<div class="header">
{{.locale.Tr "admin.runners.delete_runner_header"}}
</div>
<div class="content">
<div class="ui warning message text left">
{{.locale.Tr "admin.runners.delete_runner_notice" | Safe}}
</div>
<form class="ui form" action="{{.Link}}/delete" method="post">
{{.CsrfTokenHtml}}
<input type="hidden" name="action" value="delete">
<div class="text right actions">
<div class="ui cancel button">{{.locale.Tr "settings.cancel"}}</div>
<button class="ui red button">{{.locale.Tr "admin.runners.delete_runner_confirm"}}</button>
</div>
</form>
</div>
</div>
{{template "base/footer" .}}
+92
View File
@@ -0,0 +1,92 @@
{{template "base/head" .}}
<div class="page-content admin runners">
{{template "admin/navbar" .}}
<div class="ui container">
{{template "base/alert" .}}
<h4 class="ui top attached header">
{{.locale.Tr "admin.runners.runner_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
<div class="ui right">
<!--<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/runners/new">{{.locale.Tr "admin.runners.new"}}</a>-->
<div class="ui top right pointing dropdown">
<button class="ui button primary">
{{.locale.Tr "admin.runners.new"}}
<i class="dropdown icon"></i>
</button>
<div class="menu">
<div class="item">
<a href="#">{{.locale.Tr "admin.runners.new_notice"}}</a>
</div>
<div class="divider"></div>
<div class="header">
Registration Token
</div>
<div class="ui input">
<input type="text" value="{{.RegistrationToken}}">
<div class="ui basic label button" data-clipboard-text="{{.RegistrationToken}}">
{{svg "octicon-copy" 14}}
</div>
</div>
<div class="divider"></div>
<div class="item">
<a href="{{$.Link}}/reset_registration_token">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}}">
<!-- Search Text -->
<div class="ui fluid action input" style="max-width: 70%;">
<input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus>
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
</div>
</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">{{.locale.Tr "admin.runners.status"}}</th>
<th data-sortt-asc="alphabetically">
{{.locale.Tr "admin.runners.id"}}
</th>
<th>{{.locale.Tr "admin.runners.owner_type"}}</th>
<th>{{.locale.Tr "admin.runners.labels"}}</th>
<th>{{.locale.Tr "admin.runners.latest_online"}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{range .Runners}}
<tr>
<td><span class="runner-status-{{.StatusType}}">{{.StatusType}}</span></td>
<td>
<a href="{{$.Link}}/{{.ID}}" class="tooltip" data-content="{{.Description}}">
<span class="runner-id">#{{.ID}}</span>
<span class="runner-name">{{.Name}}</span>
</a>
</td>
<td>{{.OwnType}}</td>
<td class="runner-tags">
{{range .AllLabels}}
<span class="ui label">{{.}}</span>
{{end}}
</td>
<td>{{TimeSinceUnix .LastOnline $.locale}}</td>
<td class="runner-ops">
<a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a>
<!--<a class="runner-ops-delete show-modal" data-modal="#runner-delete-modal">{{svg "octicon-x-circle"}}</a>-->
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
{{template "base/paginate" .}}
</div>
</div>
{{template "base/footer" .}}