nezha/resource/template/dashboard-default/setting.html

142 lines
6.1 KiB
HTML
Raw Normal View History

2022-06-02 21:45:11 -04:00
{{define "dashboard-default/setting"}}
2020-12-09 06:05:40 -05:00
{{template "common/header" .}}
{{template "common/menu" .}}
<div class="nb-container">
<div class="ui container">
<form id="settingForm" class="ui large form" onsubmit="return false;">
<div class="field">
<label>{{tr "SiteTitle"}}</label>
<input type="text" name="Title" placeholder="{{tr "NezhaMonitoring"}}" value="{{.Conf.Site.Brand}}">
2020-12-09 06:05:40 -05:00
</div>
<div class="field">
<label>{{tr "AdministratorList"}}</label>
<input type="text" name="Admin" placeholder="1010,2020" value="{{.Conf.Oauth2.Admin}}">
2020-12-09 06:05:40 -05:00
</div>
<div class="field">
<label>{{tr "Theme"}}</label>
2020-12-09 06:05:40 -05:00
<select name="Theme">
{{range $k,$v := .Themes}}
<option value="{{$k}}" {{if eq $.Conf.Site.Theme $k }} selected="selected" {{end}}>{{$v}}
{{end}}
2020-12-09 06:05:40 -05:00
</select>
</div>
2022-06-02 21:45:11 -04:00
<div class="field">
<label>{{tr "DashboardTheme"}}</label>
<select name="DashboardTheme">
{{range $k,$v := .DashboardThemes}}
<option value="{{$k}}" {{if eq $.Conf.Site.DashboardTheme $k }} selected="selected" {{end}}>{{$v}}
{{end}}
</select>
</div>
2022-04-29 12:48:39 -04:00
<div class="field">
<label>Language</label>
<select name="Language">
{{range $k,$v := .Languages}}
<option value="{{$k}}" {{if eq $.Conf.Language $k }} selected="selected" {{end}}>
{{$v}}</option>
{{end}}
2022-04-29 12:48:39 -04:00
</select>
</div>
2020-12-18 21:57:10 -05:00
<div class="field">
<label>{{tr "CustomCodes"}}</label>
2020-12-23 20:54:17 -05:00
<textarea name="CustomCode">{{.Conf.Site.CustomCode}}</textarea>
2020-12-18 21:57:10 -05:00
</div>
<div class="field">
2022-04-29 14:06:25 -04:00
<label>{{tr "AccessPassword"}}</label>
<input type="text" name="ViewPassword" placeholder="" value="{{.Conf.Site.ViewPassword}}">
</div>
2021-08-10 08:04:58 -04:00
<div class="field">
<label>{{tr "PanelServerDomainAndIP"}}</label>
2021-08-10 08:04:58 -04:00
<input type="text" name="GRPCHost" placeholder="" value="{{.Conf.GRPCHost}}">
</div>
<div class="field">
<label>{{tr "IPChangeAlert"}}</label>
</div>
2021-06-22 02:05:36 -04:00
<div class="ui segment">
<div class="field">
<label>{{tr "Coverage"}}</label>
2021-06-22 02:05:36 -04:00
<select name="Cover" class="ui fluid dropdown">
<option value=0>{{tr "AllIncludedOnlySpecificServersAreNotAlerted"}}</option>
<option value=1>{{tr "IgnoreAllOnlyAlertSpecificServers"}}</option>
2021-06-22 02:05:36 -04:00
</select>
</div>
<div class="field">
<label>{{tr "SpecificServers"}}</label>
<input type="text" name="IgnoredIPNotification" placeholder="{{tr "ServerIDSeparatedByCommas"}} 1001,1002,1003"
2021-06-22 02:05:36 -04:00
value="{{.Conf.IgnoredIPNotification}}">
</div>
<div class="field">
<label>{{tr "IPChangeNotificationTag"}}</label>
<input type="text" name="IPChangeNotificationTag" placeholder="" value="{{.Conf.IPChangeNotificationTag}}">
</div>
2021-06-22 02:05:36 -04:00
<div class="field">
2024-02-27 08:05:39 -05:00
<div class="ui checkbox ip-change">
2021-06-22 02:05:36 -04:00
<input name="EnableIPChangeNotification" type="checkbox" tabindex="0" class="hidden">
<label>{{tr "Enable"}}</label>
2021-06-22 02:05:36 -04:00
</div>
</div>
</div>
2022-02-19 01:29:06 -05:00
<div class="field">
2024-02-27 08:05:39 -05:00
<div class="ui checkbox plain-ip">
2022-02-19 01:29:06 -05:00
<input name="EnablePlainIPInNotification" type="checkbox" tabindex="0" class="hidden">
<label>{{tr "NotificationMessagesDoNotHideIP"}}</label>
2022-02-19 01:29:06 -05:00
</div>
</div>
2024-02-27 08:05:39 -05:00
<div class="field">
<div class="ui checkbox disable-switch-template">
<input name="DisableSwitchTemplateInFrontend" type="checkbox" tabindex="0" class="hidden">
<label>{{tr "DisableSwitchTemplateInFrontend"}}</label>
</div>
</div>
<button class="ui button" type="submit">{{tr "Save"}}</button>
2020-12-09 06:05:40 -05:00
</form>
</div>
</div>
{{template "common/footer" .}}
<script>
$('#settingForm').submit(function () {
2021-08-10 08:04:58 -04:00
$.post('/api/setting', $('#settingForm').serialize())
.then((resp) => {
if (resp.code == 200) {
$.suiAlert({
title: '',
description: '{{tr "ModifiedSuccessfully"}}',
2021-08-10 08:04:58 -04:00
type: 'success',
time: '3',
position: 'top-center',
});
2022-04-29 12:48:39 -04:00
window.location.reload()
2021-08-10 08:04:58 -04:00
} else {
$.suiAlert({
title: '',
description: resp.message,
type: 'error',
time: '3',
position: 'top-center',
});
}
}).catch(err => {
2021-03-02 01:46:02 -05:00
$.suiAlert({
title: '',
2021-08-10 08:04:58 -04:00
description: err,
2021-03-02 01:46:02 -05:00
type: 'error',
time: '3',
position: 'top-center',
});
2021-08-10 08:04:58 -04:00
})
2020-12-09 06:05:40 -05:00
return false;
})
$('.checkbox').checkbox()
2022-02-19 01:29:06 -05:00
$('#settingForm').find("select[name=Cover]").val({{.Conf.Cover }});
2021-08-10 08:04:58 -04:00
{{if .Conf.EnableIPChangeNotification}}
2022-02-19 01:29:06 -05:00
$('.checkbox.ip-change').checkbox('set checked')
{{ end }}
{{if .Conf.EnablePlainIPInNotification}}
$('.checkbox.plain-ip').checkbox('set checked')
2021-06-22 02:05:36 -04:00
{{ end }}
2024-02-27 08:05:39 -05:00
{{if .Conf.DisableSwitchTemplateInFrontend }}
$('.checkbox.disable-switch-template').checkbox('set checked')
{{ end }}
2020-12-09 06:05:40 -05:00
</script>
2022-01-08 10:54:24 -05:00
{{end}}