diff --git a/cmd/dashboard/controller/member_api.go b/cmd/dashboard/controller/member_api.go index cf20e78f7d..69f97124b5 100644 --- a/cmd/dashboard/controller/member_api.go +++ b/cmd/dashboard/controller/member_api.go @@ -858,8 +858,9 @@ type settingForm struct { GRPCHost string Cover uint8 - EnableIPChangeNotification string - EnablePlainIPInNotification string + EnableIPChangeNotification string + EnablePlainIPInNotification string + DisableSwitchTemplateInFrontend string } func (ma *memberAPI) updateSetting(c *gin.Context) { @@ -907,6 +908,7 @@ func (ma *memberAPI) updateSetting(c *gin.Context) { singleton.Conf.Language = sf.Language singleton.Conf.EnableIPChangeNotification = sf.EnableIPChangeNotification == "on" singleton.Conf.EnablePlainIPInNotification = sf.EnablePlainIPInNotification == "on" + singleton.Conf.DisableSwitchTemplateInFrontend = sf.DisableSwitchTemplateInFrontend == "on" singleton.Conf.Cover = sf.Cover singleton.Conf.GRPCHost = sf.GRPCHost singleton.Conf.IgnoredIPNotification = sf.IgnoredIPNotification diff --git a/model/config.go b/model/config.go index 341597bdfe..12953f5be1 100644 --- a/model/config.go +++ b/model/config.go @@ -98,7 +98,8 @@ type Config struct { ProxyGRPCPort uint TLS bool - EnablePlainIPInNotification bool // 通知信息IP不打码 + EnablePlainIPInNotification bool // 通知信息IP不打码 + DisableSwitchTemplateInFrontend bool // 前台禁用切换模板功能 // IP变更提醒 EnableIPChangeNotification bool diff --git a/resource/l10n/en-US.toml b/resource/l10n/en-US.toml index cac84ad00b..c9ecf7303b 100644 --- a/resource/l10n/en-US.toml +++ b/resource/l10n/en-US.toml @@ -630,3 +630,6 @@ other = "Template" [Stat] other = "Stat" + +[DisableSwitchTemplateInFrontend] +other = "Disable Switch Template in Frontend" \ No newline at end of file diff --git a/resource/l10n/es-ES.toml b/resource/l10n/es-ES.toml index f09853167c..0a2d8a0611 100644 --- a/resource/l10n/es-ES.toml +++ b/resource/l10n/es-ES.toml @@ -203,7 +203,7 @@ other = "Agregar Servidor" other = "Editar Grupo de Servidores en Lote" [BatchDeleteServer] -other = "Eliminar Servidores en Lote"" +other = "Eliminar Servidores en Lote" [InputServerGroupName] other = "Ingrese Nombre del Grupo de Servidores" @@ -630,3 +630,6 @@ other = "Plantilla" [Stat] other = "Stat" + +[DisableSwitchTemplateInFrontend] +other = "Deshabilitar Cambio de Plantilla en Frontend" \ No newline at end of file diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index 82d7553547..b818bd8433 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -630,3 +630,6 @@ other = "主题" [Stat] other = "信息" + +[DisableSwitchTemplateInFrontend] +other = "禁止前台切换模板" diff --git a/resource/l10n/zh-TW.toml b/resource/l10n/zh-TW.toml index 05327cfe12..717988abac 100644 --- a/resource/l10n/zh-TW.toml +++ b/resource/l10n/zh-TW.toml @@ -630,3 +630,6 @@ other = "主題" [Stat] other = "信息" + +[DisableSwitchTemplateInFrontend] +other = "禁止前台切換主題" diff --git a/resource/template/dashboard-default/setting.html b/resource/template/dashboard-default/setting.html index 7f46704d11..2ed9ae37ff 100644 --- a/resource/template/dashboard-default/setting.html +++ b/resource/template/dashboard-default/setting.html @@ -70,18 +70,24 @@
-
+
-
+
+
+
+ + +
+
@@ -128,5 +134,8 @@ {{if .Conf.EnablePlainIPInNotification}} $('.checkbox.plain-ip').checkbox('set checked') {{ end }} + {{if .Conf.DisableSwitchTemplateInFrontend }} + $('.checkbox.disable-switch-template').checkbox('set checked') + {{ end }} {{end}} diff --git a/resource/template/theme-default/footer.html b/resource/template/theme-default/footer.html index 2211155ec7..ed1afa98e4 100644 --- a/resource/template/theme-default/footer.html +++ b/resource/template/theme-default/footer.html @@ -7,6 +7,16 @@ {{.Version}} +{{ if not .Conf.DisableSwitchTemplateInFrontend }} + +{{ end }} + {{end}}