mirror of
https://github.com/go-gitea/gitea.git
synced 2025-05-11 10:00:39 +02:00
improve UI
This commit is contained in:
parent
ab4f539453
commit
e43e3f9518
@ -36,7 +36,7 @@ type Secret struct {
|
|||||||
Name string
|
Name string
|
||||||
Data string
|
Data string
|
||||||
PullRequest bool
|
PullRequest bool
|
||||||
CreatedUnix timeutil.TimeStamp
|
CreatedUnix timeutil.TimeStamp `xorm:"created"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates the required fields and formats.
|
// Validate validates the required fields and formats.
|
||||||
|
25
models/migrations/v226.go
Normal file
25
models/migrations/v226.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Copyright 2022 The Gitea Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package migrations
|
||||||
|
|
||||||
|
import (
|
||||||
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
|
|
||||||
|
"xorm.io/xorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
func createSecretsTable(x *xorm.Engine) error {
|
||||||
|
type Secret struct {
|
||||||
|
ID int64
|
||||||
|
UserID int64 `xorm:"index"`
|
||||||
|
RepoID int64 `xorm:"index"`
|
||||||
|
Name string
|
||||||
|
Data string
|
||||||
|
PullRequest bool
|
||||||
|
CreatedUnix timeutil.TimeStamp `xorm:"created"`
|
||||||
|
}
|
||||||
|
|
||||||
|
return x.Sync(new(Secret))
|
||||||
|
}
|
@ -2072,6 +2072,15 @@ settings.deploy_key_desc = Deploy keys have read-only pull access to the reposit
|
|||||||
settings.is_writable = Enable Write Access
|
settings.is_writable = Enable Write Access
|
||||||
settings.is_writable_info = Allow this deploy key to <strong>push</strong> to the repository.
|
settings.is_writable_info = Allow this deploy key to <strong>push</strong> to the repository.
|
||||||
settings.no_deploy_keys = There are no deploy keys yet.
|
settings.no_deploy_keys = There are no deploy keys yet.
|
||||||
|
settings.secrets = Secrets
|
||||||
|
settings.pull_request_read = Pull Request Read
|
||||||
|
settings.pull_request_read_info = "If allow pull request read the secret, it's security related."
|
||||||
|
settings.add_secret = Add Secret
|
||||||
|
settings.secret_value_content_placeholder = Input any content
|
||||||
|
settings.secret_desc = Secrets could be visited by repository events
|
||||||
|
settings.secret_content = Value
|
||||||
|
settings.secret_key = Key
|
||||||
|
settings.no_secret = There are no secrets yet.
|
||||||
settings.title = Title
|
settings.title = Title
|
||||||
settings.deploy_key_content = Content
|
settings.deploy_key_content = Content
|
||||||
settings.key_been_used = A deploy key with identical content is already in use.
|
settings.key_been_used = A deploy key with identical content is already in use.
|
||||||
|
@ -75,8 +75,8 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<br/>
|
||||||
{{template "settings/tokens" .}}
|
{{template "repo/settings/secrets" .}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui small basic delete modal">
|
<div class="ui small basic delete modal">
|
||||||
|
@ -1,50 +1,46 @@
|
|||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
{{template "base/alert" .}}
|
{{template "base/alert" .}}
|
||||||
<h4 class="ui top attached header">
|
<h4 class="ui top attached header">
|
||||||
{{.locale.Tr "repo.settings.deploy_keys"}}
|
{{.locale.Tr "repo.settings.secrets"}}
|
||||||
<div class="ui right">
|
<div class="ui right">
|
||||||
{{if not .DisableSSH}}
|
<div class="ui primary tiny show-panel button" data-panel="#add-secret-panel">{{.locale.Tr "repo.settings.add_secret"}}</div>
|
||||||
<div class="ui primary tiny show-panel button" data-panel="#add-deploy-key-panel">{{.locale.Tr "repo.settings.add_deploy_key"}}</div>
|
|
||||||
{{else}}
|
|
||||||
<div class="ui primary tiny button disabled">{{.locale.Tr "settings.ssh_disabled"}}</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
</div>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="ui attached segment">
|
<div class="ui attached segment">
|
||||||
<div class="{{if not .HasError}}hide{{end}} mb-4" id="add-deploy-key-panel">
|
<div class="{{if not .HasError}}hide{{end}} mb-4" id="add-secret-panel">
|
||||||
<form class="ui form" action="{{.Link}}" method="post">
|
<form class="ui form" action="{{.Link}}" method="post">
|
||||||
{{.CsrfTokenHtml}}
|
{{.CsrfTokenHtml}}
|
||||||
<div class="field">
|
<div class="field">
|
||||||
{{.locale.Tr "repo.settings.deploy_key_desc"}}
|
{{.locale.Tr "repo.settings.secret_desc"}}
|
||||||
</div>
|
</div>
|
||||||
<div class="field {{if .Err_Title}}error{{end}}">
|
<div class="field {{if .Err_Title}}error{{end}}">
|
||||||
<label for="title">{{.locale.Tr "repo.settings.title"}}</label>
|
<label for="title">{{.locale.Tr "repo.settings.secret_key"}}</label>
|
||||||
<input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
|
<input id="ssh-key-title" name="title" value="{{.title}}" autofocus required>
|
||||||
</div>
|
</div>
|
||||||
<div class="field {{if .Err_Content}}error{{end}}">
|
<div class="field {{if .Err_Content}}error{{end}}">
|
||||||
<label for="content">{{.locale.Tr "repo.settings.deploy_key_content"}}</label>
|
<label for="content">{{.locale.Tr "repo.settings.secret_content"}}</label>
|
||||||
<textarea id="ssh-key-content" name="content" placeholder="{{.locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
|
<textarea id="ssh-key-content" name="content" placeholder="{{.locale.Tr "settings.secret_value_content_placeholder"}}" required>{{.content}}</textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="ui checkbox {{if .Err_IsWritable}}error{{end}}">
|
<div class="ui checkbox {{if .Err_IsWritable}}error{{end}}">
|
||||||
<input id="ssh-key-is-writable" name="is_writable" class="hidden" type="checkbox" value="1">
|
<input id="ssh-key-is-writable" name="is_writable" class="hidden" type="checkbox" value="1">
|
||||||
<label for="is_writable">
|
<label for="is_writable">
|
||||||
{{.locale.Tr "repo.settings.is_writable"}}
|
{{.locale.Tr "repo.settings.pull_request_read"}}
|
||||||
</label>
|
</label>
|
||||||
<small style="padding-left: 26px;">{{$.locale.Tr "repo.settings.is_writable_info" | Str2html}}</small>
|
<small style="padding-left: 26px;">{{$.locale.Tr "repo.settings.pull_request_read_info" | Str2html}}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="ui green button">
|
<button class="ui green button">
|
||||||
{{.locale.Tr "repo.settings.add_deploy_key"}}
|
{{.locale.Tr "repo.settings.add_secret"}}
|
||||||
</button>
|
</button>
|
||||||
<button class="ui hide-panel button" data-panel="#add-deploy-key-panel">
|
<button class="ui hide-panel button" data-panel="#add-secret-panel">
|
||||||
{{.locale.Tr "cancel"}}
|
{{.locale.Tr "cancel"}}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{{if .Deploykeys}}
|
{{if .Secrets}}
|
||||||
<div class="ui key list">
|
<div class="ui key list">
|
||||||
{{range .Deploykeys}}
|
{{range .Secrets}}
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="right floated content">
|
<div class="right floated content">
|
||||||
<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
|
<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
|
||||||
@ -67,7 +63,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{.locale.Tr "repo.settings.no_deploy_keys"}}
|
{{.locale.Tr "repo.settings.no_secret"}}
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
x
Reference in New Issue
Block a user