mirror of
https://github.com/go-gitea/gitea.git
synced 2025-05-09 17:10:42 +02:00
improve UI
This commit is contained in:
parent
ab4f539453
commit
e43e3f9518
@ -36,7 +36,7 @@ type Secret struct {
|
||||
Name string
|
||||
Data string
|
||||
PullRequest bool
|
||||
CreatedUnix timeutil.TimeStamp
|
||||
CreatedUnix timeutil.TimeStamp `xorm:"created"`
|
||||
}
|
||||
|
||||
// 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_info = Allow this deploy key to <strong>push</strong> to the repository.
|
||||
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.deploy_key_content = Content
|
||||
settings.key_been_used = A deploy key with identical content is already in use.
|
||||
|
@ -75,8 +75,8 @@
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "settings/tokens" .}}
|
||||
<br/>
|
||||
{{template "repo/settings/secrets" .}}
|
||||
</div>
|
||||
|
||||
<div class="ui small basic delete modal">
|
||||
|
@ -1,50 +1,46 @@
|
||||
<div class="ui container">
|
||||
{{template "base/alert" .}}
|
||||
<h4 class="ui top attached header">
|
||||
{{.locale.Tr "repo.settings.deploy_keys"}}
|
||||
{{.locale.Tr "repo.settings.secrets"}}
|
||||
<div class="ui right">
|
||||
{{if not .DisableSSH}}
|
||||
<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 class="ui primary tiny show-panel button" data-panel="#add-secret-panel">{{.locale.Tr "repo.settings.add_secret"}}</div>
|
||||
</div>
|
||||
</h4>
|
||||
<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">
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field">
|
||||
{{.locale.Tr "repo.settings.deploy_key_desc"}}
|
||||
{{.locale.Tr "repo.settings.secret_desc"}}
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
<div class="field {{if .Err_Content}}error{{end}}">
|
||||
<label for="content">{{.locale.Tr "repo.settings.deploy_key_content"}}</label>
|
||||
<textarea id="ssh-key-content" name="content" placeholder="{{.locale.Tr "settings.key_content_ssh_placeholder"}}" required>{{.content}}</textarea>
|
||||
<label for="content">{{.locale.Tr "repo.settings.secret_content"}}</label>
|
||||
<textarea id="ssh-key-content" name="content" placeholder="{{.locale.Tr "settings.secret_value_content_placeholder"}}" required>{{.content}}</textarea>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui checkbox {{if .Err_IsWritable}}error{{end}}">
|
||||
<input id="ssh-key-is-writable" name="is_writable" class="hidden" type="checkbox" value="1">
|
||||
<label for="is_writable">
|
||||
{{.locale.Tr "repo.settings.is_writable"}}
|
||||
{{.locale.Tr "repo.settings.pull_request_read"}}
|
||||
</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>
|
||||
<button class="ui green button">
|
||||
{{.locale.Tr "repo.settings.add_deploy_key"}}
|
||||
{{.locale.Tr "repo.settings.add_secret"}}
|
||||
</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"}}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{{if .Deploykeys}}
|
||||
{{if .Secrets}}
|
||||
<div class="ui key list">
|
||||
{{range .Deploykeys}}
|
||||
{{range .Secrets}}
|
||||
<div class="item">
|
||||
<div class="right floated content">
|
||||
<button class="ui red tiny button delete-button" data-url="{{$.Link}}/delete" data-id="{{.ID}}">
|
||||
@ -67,7 +63,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
{{.locale.Tr "repo.settings.no_deploy_keys"}}
|
||||
{{.locale.Tr "repo.settings.no_secret"}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user