mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-18 15:37:48 +00:00
feat: view authorized integration (generic)
This commit is contained in:
parent
2a0df7474a
commit
c1000624c6
14 changed files with 377 additions and 2 deletions
|
|
@ -28,6 +28,12 @@
|
|||
<p>{{ctx.Locale.Tr "settings.added_on" (DateUtils.AbsoluteShort .CreatedUnix)}} — {{svg "octicon-info"}} {{if .HasBeenUsed}}{{ctx.Locale.Tr "settings.last_used"}} <span {{if .HasRecentActivity}}class="text green"{{end}}>{{DateUtils.AbsoluteShort .UpdatedUnix}}</span>{{else}}{{ctx.Locale.Tr "settings.no_activity"}}{{end}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-item-trailing">
|
||||
<a class="ui primary tiny button" href="{{AppSubUrl}}/user/settings/authorized-integrations/{{.UI}}/{{.ID}}">
|
||||
{{svg "octicon-pencil" 16 "tw-mr-1"}}
|
||||
{{ctx.Locale.Tr "settings.authorized_integration.view"}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="flex-item">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
{{template "user/settings/authorized_integrations/view_head" .}}
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.authorized_integration.claims.generic"}}
|
||||
</h4>
|
||||
<div class="ui attached bottom segment">
|
||||
<div class="field">
|
||||
<label for="issuer">{{ctx.Locale.Tr "settings.authorized_integration.field.issuer"}}</label>
|
||||
<input id="issuer" name="issuer" value="{{.Form.Issuer}}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="content">{{ctx.Locale.Tr "settings.authorized_integration.field.claim_rules"}}</label>
|
||||
<textarea id="content" name="content" class="tw-hidden">{{.Form.ClaimRules}}</textarea>
|
||||
{{template "shared/codemirror_container" .}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{template "user/settings/authorized_integrations/view_footer" .}}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.authorized_integration.perms.title"}}
|
||||
</h4>
|
||||
<div class="ui attached bottom segment">
|
||||
|
||||
<div class="field">
|
||||
<fieldset>
|
||||
<label>{{ctx.Locale.Tr "settings.repo_and_org_access"}}</label>
|
||||
<div class="field">
|
||||
<div class="field ui radio checkbox">
|
||||
<input id="resource-all" class="enable-system" type="radio" name="resource" value="all" {{if eq .Form.Resource "all"}}checked{{end}} disabled>
|
||||
<label for="resource-all">{{ctx.Locale.Tr "settings.permissions_access_all"}}</label>
|
||||
<p class="help">{{ctx.Locale.Tr "settings.access_token.resource_all_help"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="field ui radio checkbox">
|
||||
<input id="resource-public-only" class="enable-system" type="radio" name="resource" value="public-only" {{if eq .Form.Resource "public-only"}}checked{{end}} disabled>
|
||||
<label for="resource-public-only">{{ctx.Locale.Tr "settings.permissions_public_only"}}</label>
|
||||
<p class="help">
|
||||
{{ctx.Locale.Tr "settings.access_token.resource_public_only_help"}}
|
||||
{{if $.IsAdmin}}{{ctx.Locale.Tr "settings.access_token.admin_disabled"}}{{end}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="field ui radio checkbox">
|
||||
<input id="resource-repo-specific" class="enable-system" type="radio" name="resource" value="repo-specific" {{if eq .Form.Resource "repo-specific"}}checked{{end}} disabled>
|
||||
<label for="resource-repo-specific">{{ctx.Locale.Tr "settings.permissions_access_specific_repositories"}}</label>
|
||||
<p class="help">
|
||||
{{ctx.Locale.Tr "settings.access_token.resource_specific_repo_help"}}
|
||||
{{if $.IsAdmin}}{{ctx.Locale.Tr "settings.access_token.admin_disabled"}}{{end}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<label>
|
||||
{{ctx.Locale.Tr "settings.select_permissions"}}
|
||||
</label>
|
||||
<p class="activity meta">
|
||||
<p>{{ctx.Locale.Tr "settings.access_token_desc" (printf "%s/api/swagger" AppSubUrl) "https://forgejo.org/docs/latest/user/token-scope/"}}</p>
|
||||
</p>
|
||||
|
||||
{{range .Categories}}
|
||||
<div class="field tw-pl-1 tw-pb-1">
|
||||
<label for="scope-{{.}}">
|
||||
{{.}}
|
||||
</label>
|
||||
<div class="gitea-select">
|
||||
<select class="ui selection" name="scope" id="scope-{{.}}" disabled>
|
||||
<option value="">
|
||||
{{ctx.Locale.Tr "settings.permission_no_access"}}
|
||||
</option>
|
||||
<option value="read:{{.}}" {{if (SliceUtils.Contains $.Form.Scope (printf "read:%s" .))}} selected {{end}}>
|
||||
{{ctx.Locale.Tr "settings.permission_read"}}
|
||||
</option>
|
||||
<option value="write:{{.}}" {{if or $.Form.ScopeAll (SliceUtils.Contains $.Form.Scope (printf "write:%s" .))}} selected {{end}}>
|
||||
{{ctx.Locale.Tr "settings.permission_write"}}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{template "user/settings/layout_footer" .}}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings applications authorized-integrations")}}
|
||||
|
||||
<div class="user-setting-content">
|
||||
<form id="scoped-access-form" class="ui form" action="{{.Link}}" method="post">
|
||||
|
||||
<h4 class="ui top attached header">
|
||||
{{ctx.Locale.Tr "settings.authorized_integration.view_page_title" .Form.Name}}
|
||||
</h4>
|
||||
<div class="ui attached bottom segment">
|
||||
<div class="field">
|
||||
<label for="name">{{ctx.Locale.Tr "settings.authorized_integration.field.name"}}</label>
|
||||
<input id="name" name="name" value="{{.Form.Name}}" maxlength="255" readonly>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="description">{{ctx.Locale.Tr "settings.authorized_integration.field.description"}}</label>
|
||||
<textarea name="description" rows="5" placeholder="{{ctx.Locale.Tr "settings.authorized_integration.field.description.placeholder"}}" readonly>{{.Form.Description}}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="audience">{{ctx.Locale.Tr "settings.authorized_integration.field.audience"}}</label>
|
||||
<div class="ui fluid action input">
|
||||
<input id="audience" name="audience" value="{{.Form.Audience}}" readonly>
|
||||
<button class="ui small icon button" title="{{ctx.Locale.Tr "settings.authorized_integration.copy_audience"}}" aria-label="{{ctx.Locale.Tr "settings.authorized_integration.copy_audience"}}" type="button" data-clipboard-target="#audience">{{svg "octicon-copy" 16}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue