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">
|
|
|
|
<label>站点标题</label>
|
2021-02-06 20:51:55 -05:00
|
|
|
<input type="text" name="Title" placeholder="哪吒监控" value="{{.Conf.Site.Brand}}">
|
2020-12-09 06:05:40 -05:00
|
|
|
</div>
|
|
|
|
<div class="field">
|
|
|
|
<label>管理员列表</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">
|
|
|
|
<select name="Theme">
|
2021-01-15 11:45:49 -05:00
|
|
|
<option value="default"{{if eq .Conf.Site.Theme "default"}} selected="selected"{{end}}>默认主题</option>
|
2021-01-20 09:15:47 -05:00
|
|
|
<option value="daynight"{{if eq .Conf.Site.Theme "daynight"}} selected="selected"{{end}}>JackieSung DayNight</option>
|
2021-01-15 11:45:49 -05:00
|
|
|
<option value="hotaru"{{if eq .Conf.Site.Theme "hotaru"}} selected="selected"{{end}}>CokeMine Hotaru</option>
|
2020-12-09 06:05:40 -05:00
|
|
|
</select>
|
|
|
|
</div>
|
2020-12-18 21:57:10 -05:00
|
|
|
<div class="field">
|
2020-12-23 20:54:17 -05:00
|
|
|
<label>自定义代码(style、script 都可以)</label>
|
|
|
|
<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">
|
|
|
|
<label>前台查看密码</label>
|
|
|
|
<input type="text" name="ViewPassword" placeholder="" value="{{.Conf.Site.ViewPassword}}">
|
|
|
|
</div>
|
2021-01-13 09:30:28 -05:00
|
|
|
<div class="field">
|
|
|
|
<div class="ui nf-ssl checkbox">
|
|
|
|
<input name="EnableIPChangeNotification" type="checkbox" tabindex="0" class="hidden">
|
|
|
|
<label>开启 IP 变更提醒</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-12-09 06:05:40 -05:00
|
|
|
<button class="ui button" type="submit">保存</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{template "common/footer" .}}
|
|
|
|
<script>
|
|
|
|
$('#settingForm').submit(function () {
|
|
|
|
$.post('/api/setting', $('#settingForm').serialize()).then((resp) => {
|
|
|
|
if (resp.code == 200) {
|
2021-03-02 01:46:02 -05:00
|
|
|
$.suiAlert({
|
|
|
|
title: '',
|
|
|
|
description: '修改成功',
|
|
|
|
type: 'success',
|
|
|
|
time: '3',
|
|
|
|
position: 'top-center',
|
|
|
|
});
|
2020-12-09 06:05:40 -05:00
|
|
|
} else {
|
2021-03-02 01:46:02 -05:00
|
|
|
$.suiAlert({
|
|
|
|
title: '',
|
|
|
|
description:resp.message,
|
|
|
|
type: 'error',
|
|
|
|
time: '3',
|
|
|
|
position: 'top-center',
|
|
|
|
});
|
2020-12-09 06:05:40 -05:00
|
|
|
}
|
|
|
|
}).error(err => {
|
2021-03-02 01:46:02 -05:00
|
|
|
$.suiAlert({
|
|
|
|
title: '',
|
|
|
|
description:err,
|
|
|
|
type: 'error',
|
|
|
|
time: '3',
|
|
|
|
position: 'top-center',
|
|
|
|
});
|
2020-12-09 06:05:40 -05:00
|
|
|
})
|
|
|
|
return false;
|
|
|
|
})
|
2021-01-13 09:30:28 -05:00
|
|
|
$('.checkbox').checkbox()
|
2021-01-20 09:57:38 -05:00
|
|
|
{{if .Conf.EnableIPChangeNotification}}
|
|
|
|
$('.checkbox').checkbox('set checked')
|
|
|
|
{{end}}
|
2020-12-09 06:05:40 -05:00
|
|
|
</script>
|
2021-03-02 10:08:40 -05:00
|
|
|
{{end}}
|