Browse Source

admin/config: add UI for [http] section (#3987)

pull/4722/merge
Unknwon 7 years ago
parent
commit
e1e76d3f88
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 4
      conf/locale/locale_en-US.ini
  2. 4
      pkg/bindata/bindata.go
  3. 3
      public/css/gogs.css
  4. 3
      public/less/_admin.less
  5. 3
      routes/admin/admin.go
  6. 35
      templates/admin/config.tmpl

4
conf/locale/locale_en-US.ini

@ -1139,6 +1139,7 @@ auths.still_in_used = This authentication is still used by some users, please de
auths.deletion_success = Authentication has been deleted successfully! auths.deletion_success = Authentication has been deleted successfully!
auths.login_source_exist = Login source '%s' already exists. auths.login_source_exist = Login source '%s' already exists.
config.not_set = (not set)
config.server_config = Server Configuration config.server_config = Server Configuration
config.app_name = Application Name config.app_name = Application Name
config.app_ver = Application Version config.app_ver = Application Version
@ -1175,6 +1176,9 @@ config.disable_http_git = Disable HTTP Git
config.enable_local_path_migration = Enable Local Path Migration config.enable_local_path_migration = Enable Local Path Migration
config.commits_fetch_concurrency = Commits Fetch Concurrency config.commits_fetch_concurrency = Commits Fetch Concurrency
config.http_config = HTTP Configuration
config.http_access_control_allow_origin = Access Control Allow Origin
config.db_config = Database Configuration config.db_config = Database Configuration
config.db_type = Type config.db_type = Type
config.db_host = Host config.db_host = Host

4
pkg/bindata/bindata.go

File diff suppressed because one or more lines are too long

3
public/css/gogs.css

@ -3127,6 +3127,9 @@ footer .ui.language .menu {
background-color: #f7f7f7; background-color: #f7f7f7;
padding: 5px; padding: 5px;
} }
.admin.config code {
color: #db2828;
}
.admin.config .log-config table tbody tr td:first-child { .admin.config .log-config table tbody tr td:first-child {
width: 100px; width: 100px;
} }

3
public/less/_admin.less

@ -65,6 +65,9 @@
background-color: #f7f7f7; background-color: #f7f7f7;
padding: 5px; padding: 5px;
} }
code {
color: #db2828;
}
.log-config { .log-config {
table tbody tr td { table tbody tr td {
&:first-child { &:first-child {

3
routes/admin/admin.go

@ -208,9 +208,10 @@ func Config(c *context.Context) {
c.Data["RepoRootPath"] = setting.RepoRootPath c.Data["RepoRootPath"] = setting.RepoRootPath
c.Data["ScriptType"] = setting.ScriptType c.Data["ScriptType"] = setting.ScriptType
c.Data["Repository"] = setting.Repository c.Data["Repository"] = setting.Repository
c.Data["HTTP"] = setting.HTTP
c.Data["Service"] = setting.Service
c.Data["DbCfg"] = models.DbCfg c.Data["DbCfg"] = models.DbCfg
c.Data["Service"] = setting.Service
c.Data["Webhook"] = setting.Webhook c.Data["Webhook"] = setting.Webhook
c.Data["MailerEnabled"] = false c.Data["MailerEnabled"] = false

35
templates/admin/config.tmpl

@ -33,11 +33,11 @@
<div class="ui divider"></div> <div class="ui divider"></div>
<dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt> <dt>{{.i18n.Tr "admin.config.static_file_root_path"}}</dt>
<dd>{{.StaticRootPath}}</dd> <dd><code>{{.StaticRootPath}}</code></dd>
<dt>{{.i18n.Tr "admin.config.log_file_root_path"}}</dt> <dt>{{.i18n.Tr "admin.config.log_file_root_path"}}</dt>
<dd>{{.LogRootPath}}</dd> <dd><code>{{.LogRootPath}}</code></dd>
<dt>{{.i18n.Tr "admin.config.reverse_auth_user"}}</dt> <dt>{{.i18n.Tr "admin.config.reverse_auth_user"}}</dt>
<dd>{{.ReverseProxyAuthUser}}</dd> <dd><code>{{.ReverseProxyAuthUser}}</code></dd>
</dl> </dl>
</div> </div>
@ -76,30 +76,49 @@
</dl> </dl>
</div> </div>
<!-- Repository Configuration -->
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.i18n.Tr "admin.config.repo_config"}} {{.i18n.Tr "admin.config.repo_config"}}
</h4> </h4>
<div class="ui attached table segment"> <div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal"> <dl class="dl-horizontal admin-dl-horizontal">
<dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt> <dt>{{.i18n.Tr "admin.config.repo_root_path"}}</dt>
<dd>{{.RepoRootPath}}</dd> <dd><code>{{.RepoRootPath}}</code></dd>
<dt>{{.i18n.Tr "admin.config.script_type"}}</dt> <dt>{{.i18n.Tr "admin.config.script_type"}}</dt>
<dd><code>{{.ScriptType}}</code></dd> <dd>{{.ScriptType}}</dd>
<dt>{{.i18n.Tr "admin.config.repo_force_private"}}</dt> <dt>{{.i18n.Tr "admin.config.repo_force_private"}}</dt>
<dd><i class="fa fa{{if .Repository.ForcePrivate}}-check{{end}}-square-o"></i></dd> <dd><i class="fa fa{{if .Repository.ForcePrivate}}-check{{end}}-square-o"></i></dd>
<dt>{{.i18n.Tr "admin.config.max_creation_limit"}}</dt> <dt>{{.i18n.Tr "admin.config.max_creation_limit"}}</dt>
<dd><code>{{.Repository.MaxCreationLimit}}</code></dd> <dd>{{.Repository.MaxCreationLimit}}</dd>
<dt>{{.i18n.Tr "admin.config.preferred_licenses"}}</dt> <dt>{{.i18n.Tr "admin.config.preferred_licenses"}}</dt>
<dd><code>{{Join .Repository.PreferredLicenses ", "}}</code></dd> <dd>{{Join .Repository.PreferredLicenses ", "}}</dd>
<dt>{{.i18n.Tr "admin.config.disable_http_git"}}</dt> <dt>{{.i18n.Tr "admin.config.disable_http_git"}}</dt>
<dd><i class="fa fa{{if .Repository.DisableHTTPGit}}-check{{end}}-square-o"></i></dd> <dd><i class="fa fa{{if .Repository.DisableHTTPGit}}-check{{end}}-square-o"></i></dd>
<dt>{{.i18n.Tr "admin.config.enable_local_path_migration"}}</dt> <dt>{{.i18n.Tr "admin.config.enable_local_path_migration"}}</dt>
<dd><i class="fa fa{{if .Repository.EnableLocalPathMigration}}-check{{end}}-square-o"></i></dd> <dd><i class="fa fa{{if .Repository.EnableLocalPathMigration}}-check{{end}}-square-o"></i></dd>
<dt>{{.i18n.Tr "admin.config.commits_fetch_concurrency"}}</dt> <dt>{{.i18n.Tr "admin.config.commits_fetch_concurrency"}}</dt>
<dd><code>{{.Repository.CommitsFetchConcurrency}}</code></dd> <dd>{{.Repository.CommitsFetchConcurrency}}</dd>
</dl> </dl>
</div> </div>
<!-- HTTP Configuration -->
<h4 class="ui top attached header">
{{.i18n.Tr "admin.config.http_config"}}
</h4>
<div class="ui attached table segment">
<dl class="dl-horizontal admin-dl-horizontal">
<dt>{{.i18n.Tr "admin.config.http_access_control_allow_origin"}}</dt>
<dd>
{{if .HTTP.AccessControlAllowOrigin}}
<code>{{.HTTP.AccessControlAllowOrigin}}</code>
{{else}}
<i>{{.i18n.Tr "admin.config.not_set"}}</i>
{{end}}
</dd>
</dl>
</div>
<!-- Database Configuration -->
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.i18n.Tr "admin.config.db_config"}} {{.i18n.Tr "admin.config.db_config"}}
</h4> </h4>

Loading…
Cancel
Save