2020-12-09 06:05:40 -05:00
|
|
|
{{define "dashboard/setting"}}
|
|
|
|
{{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">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "SiteTitle"}}</label>
|
2022-04-27 22:17:38 -04:00
|
|
|
<input type="text" name="Title" placeholder="{{tr "nezhaMonitor"}}" value="{{.Conf.Site.Brand}}">
|
2020-12-09 06:05:40 -05:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "AdministratorList"}}</label>
|
2021-03-02 10:08:40 -05:00
|
|
|
<input type="text" name="Admin" placeholder="1010,2020" value="{{.Conf.Oauth2.Admin}}">
|
2020-12-09 06:05:40 -05:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "Theme"}}</label>
|
2020-12-09 06:05:40 -05:00
|
|
|
<select name="Theme">
|
2022-04-28 22:52:26 -04:00
|
|
|
<option value="default" {{if eq .Conf.Site.Theme "default" }} selected="selected" {{end}}>{{tr "DefaultTheme"}}
|
2021-06-22 02:05:36 -04:00
|
|
|
</option>
|
|
|
|
<option value="daynight" {{if eq .Conf.Site.Theme "daynight" }} selected="selected" {{end}}>
|
|
|
|
JackieSung DayNight</option>
|
|
|
|
<option value="hotaru" {{if eq .Conf.Site.Theme "hotaru" }} selected="selected" {{end}}>CokeMine
|
|
|
|
Hotaru</option>
|
2022-01-08 10:54:24 -05:00
|
|
|
<option value="mdui" {{if eq .Conf.Site.Theme "mdui" }} selected="selected" {{end}}>Neko Mdui</option>
|
2020-12-09 06:05:40 -05:00
|
|
|
</select>
|
|
|
|
</div>
|
2020-12-18 21:57:10 -05:00
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<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>
|
2021-01-31 00:37:43 -05:00
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "AccessPassword"}}}</label>
|
2021-01-31 00:37:43 -05:00
|
|
|
<input type="text" name="ViewPassword" placeholder="" value="{{.Conf.Site.ViewPassword}}">
|
|
|
|
</div>
|
2021-08-10 08:04:58 -04:00
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "PanelServerDomainAndIP"}}</label>
|
2021-08-10 08:04:58 -04:00
|
|
|
<input type="text" name="GRPCHost" placeholder="" value="{{.Conf.GRPCHost}}">
|
|
|
|
</div>
|
2021-04-07 09:11:59 -04:00
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "IPChangeAlert"}}</label>
|
2021-04-07 09:11:59 -04:00
|
|
|
</div>
|
2021-06-22 02:05:36 -04:00
|
|
|
<div class="ui segment">
|
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "Coverage"}}</label>
|
2021-06-22 02:05:36 -04:00
|
|
|
<select name="Cover" class="ui fluid dropdown">
|
2022-04-28 22:52:26 -04:00
|
|
|
<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">
|
2022-04-28 22:52:26 -04:00
|
|
|
<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>
|
2022-04-14 15:13:53 -04:00
|
|
|
<div class="field">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "IPChangeNotificationTag"}}</label>
|
2022-04-14 15:13:53 -04:00
|
|
|
<input type="text" name="IPChangeNotificationTag" placeholder="" value="{{.Conf.IPChangeNotificationTag}}">
|
|
|
|
</div>
|
2021-06-22 02:05:36 -04:00
|
|
|
<div class="field">
|
2022-02-19 01:29:06 -05:00
|
|
|
<div class="ui nf-ssl checkbox ip-change">
|
2021-06-22 02:05:36 -04:00
|
|
|
<input name="EnableIPChangeNotification" type="checkbox" tabindex="0" class="hidden">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "Enable"}}</label>
|
2021-06-22 02:05:36 -04:00
|
|
|
</div>
|
2021-01-13 09:30:28 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-19 01:29:06 -05:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui nf-ssl checkbox plain-ip">
|
|
|
|
<input name="EnablePlainIPInNotification" type="checkbox" tabindex="0" class="hidden">
|
2022-04-28 22:52:26 -04:00
|
|
|
<label>{{tr "NotificationMessagesDoNotHideIP"}}</label>
|
2022-02-19 01:29:06 -05:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-04-28 22:52:26 -04:00
|
|
|
<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: '',
|
2022-04-28 22:52:26 -04:00
|
|
|
description: '{{tr "ModifiedSuccessfully"}}',
|
2021-08-10 08:04:58 -04:00
|
|
|
type: 'success',
|
|
|
|
time: '3',
|
|
|
|
position: 'top-center',
|
|
|
|
});
|
|
|
|
} 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;
|
|
|
|
})
|
2021-01-13 09:30:28 -05:00
|
|
|
$('.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 }}
|
2020-12-09 06:05:40 -05:00
|
|
|
</script>
|
2022-01-08 10:54:24 -05:00
|
|
|
{{end}}
|