forked from TruthHun/BookStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetting.html
More file actions
306 lines (274 loc) · 19.1 KB
/
setting.html
File metadata and controls
306 lines (274 loc) · 19.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!DOCTYPE html>
<html lang="zh-CN">
<head>
{{template "widgets/head.html" .}}
<style>
.checkbox, .radio{margin-top: 0px;}
</style>
</head>
<body>
<div class="manual-reader">
{{template "widgets/header.html" .}}
<div class="container manual-body">
<div class="row">
<div class="page-left">
{{template "manager/menu.html" .}}
</div>
<div class="page-right">
<div class="m-box">
<div class="box-head">
<strong class="box-title"> 配置管理</strong>
<a href="{{urlfor "ManagerController.RebuildAllIndex"}}" class="ajax-get pull-right btn btn-success">更新全量索引</a>
</div>
</div>
<div class="box-body" style="padding-bottom: 200px;">
<form method="post" id="gloablEditForm" action="{{urlfor "ManagerController.Setting"}}">
<div class="form-group">
<label>网站名称</label>
<input type="text" class="form-control" name="SITE_NAME" id="siteName" placeholder="网站标题" value="{{.SITE_NAME.OptionValue}}">
</div>
<div class="form-group">
<label>网站备案</label>
<input type="text" class="form-control" name="ICP" id="ICP" placeholder="网站备案" value="{{.ICP.OptionValue}}">
</div>
<div class="form-group">
<label>版本控制</label>
<input type="number" name="ENABLE_DOCUMENT_HISTORY" class="form-control" value="{{.ENABLE_DOCUMENT_HISTORY.OptionValue}}">
<div class="help-block">如果启用版本控制,请填写大于0的数字,表示每个文档的最大版本数。</div>
</div>
{{/*肯定要允许游客进行访问*/}}
<div class="form-group hide">
<label>启用匿名访问</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" checked name="ENABLE_ANONYMOUS" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" name="ENABLE_ANONYMOUS" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
{{/*肯定要允许用户注册行为*/}}
<div class="form-group hide">
<label>启用注册</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" checked name="ENABLED_REGISTER" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" name="ENABLED_REGISTER" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>启用验证码</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .ENABLED_CAPTCHA.OptionValue "true"}}checked{{end}} name="ENABLED_CAPTCHA" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .ENABLED_CAPTCHA.OptionValue "false"}}checked{{end}} name="ENABLED_CAPTCHA" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>是否隐藏导航栏收录入口</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .CLOSE_SUBMIT_ENTER.OptionValue "true"}}checked{{end}} name="CLOSE_SUBMIT_ENTER" value="true">隐藏<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .CLOSE_SUBMIT_ENTER.OptionValue "false"}}checked{{end}} name="CLOSE_SUBMIT_ENTER" value="false">显示<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>是否隐藏导航栏开源入口</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .CLOSE_OPEN_SOURCE_LINK.OptionValue "true"}}checked{{end}} name="CLOSE_OPEN_SOURCE_LINK" value="true">隐藏<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .CLOSE_OPEN_SOURCE_LINK.OptionValue "false"}}checked{{end}} name="CLOSE_OPEN_SOURCE_LINK" value="false">显示<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>开启QQ登录</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .LOGIN_QQ.OptionValue "true"}}checked{{end}} name="LOGIN_QQ" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .LOGIN_QQ.OptionValue "false"}}checked{{end}} name="LOGIN_QQ" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>开启GitHub登录</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .LOGIN_GITHUB.OptionValue "true"}}checked{{end}} name="LOGIN_GITHUB" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .LOGIN_GITHUB.OptionValue "false"}}checked{{end}} name="LOGIN_GITHUB" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>开启码云登录</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .LOGIN_GITEE.OptionValue "true"}}checked{{end}} name="LOGIN_GITEE" value="true">开启<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .LOGIN_GITEE.OptionValue "false"}}checked{{end}} name="LOGIN_GITEE" value="false">关闭<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>一键采集器,是否仅对管理员开放</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .SPIDER.OptionValue "true"}}checked{{end}} name="SPIDER" value="true">是<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .SPIDER.OptionValue "false"}}checked{{end}} name="SPIDER" value="false">否<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>是否都可以创建项目( <span class="text-muted"> 选择是,<span class="text-danger">所有人</span>都可以创建书籍项目;选择否,只有 <span class="text-danger">作者</span> 和 <span class="text-danger">管理员</span> 才能创建项目</span> )</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .ALL_CAN_WRITE_BOOK.OptionValue "true"}}checked{{end}} name="ALL_CAN_WRITE_BOOK" value="true">是<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .ALL_CAN_WRITE_BOOK.OptionValue "false"}}checked{{end}} name="ALL_CAN_WRITE_BOOK" value="false">否<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>获取访客真实IP的request header字段</label>
<input type="text" name="REAL_IP_FIELD" class="form-control" value="{{.REAL_IP_FIELD.OptionValue}}">
<small class="help-block">
常见的字段有:X-Real-Ip、X-Forwarded-For、Remote-Host,如果您的网站使用了CDN,则您的request header字段可能不一样。
您可以通过GET的方式访问: <span class="text-danger">http://您的域名/bookchat/api/v1/register</span> 的方式来查看获取真实IP的字段。
</small>
</div>
<div class="form-group">
<label>同一IP每小时允许注册人数( <span class="text-muted">针对APP和小程序接口请求注册的用户。0 表示不限制</span> )</label>
<input type="number" name="HOUR_REG_NUM" class="form-control" value="{{.HOUR_REG_NUM.OptionValue}}">
</div>
<div class="form-group">
<label>同一IP每天允许注册人数( <span class="text-muted">针对APP和小程序接口请求注册的用户。0 表示不限制</span> )</label>
<input type="number" name="DAILY_REG_NUM" class="form-control" value="{{.DAILY_REG_NUM.OptionValue}}">
</div>
<div class="form-group">
<label>移动端横幅宽高比( <span class="text-muted">填写横幅宽高比例数字,如长300,宽100,则填3或3.0。【针对 <a href="/manager/banners" target="_blank">横幅管理</a> 中的移动端横幅比例】</span> )</label>
<input type="number" name="MOBILE_BANNER_SIZE" class="form-control" value="{{.MOBILE_BANNER_SIZE.OptionValue}}">
</div>
<div class="form-group">
<label>手机APP下载单页( <span class="text-muted">如果单页链接不为空,则会在导航栏显示APP下载页面</span> )</label>
<input type="text" name="APP_PAGE" class="form-control" value="{{.M_APP_PAGE.OptionValue}}">
</div>
<div class="form-group">
<label>是否需要登录才能下载电子书( <span class="text-muted">如果需要登录才能下载电子书,请输入相关登录下载提示;置空则表示允许免登录下载</span> )</label>
<input type="text" name="DOWNLOAD_LIMIT" class="form-control" value="{{.DOWNLOAD_LIMIT.OptionValue}}">
</div>
<div class="form-group">
<label>{{.AUTO_HTTPS.OptionTitle}} ( <span class="text-muted">将图片链接由 http:// 自动替换为 https:// </span>)</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .AUTO_HTTPS.OptionValue "true"}}checked{{end}} name="AUTO_HTTPS" value="true">是<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .AUTO_HTTPS.OptionValue "false"}}checked{{end}} name="AUTO_HTTPS" value="false">否<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>是否隐藏导航栏"标签"</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .HIDE_TAG.OptionValue "true"}}checked{{end}} name="HIDE_TAG" value="true">是<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .HIDE_TAG.OptionValue "false"}}checked{{end}} name="HIDE_TAG" value="false">否<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>是否开启全文搜索( <span class="text-muted">每次重新启用全文搜索,请务必点击右上角的 <strong>更新全量索引</strong> 按钮,以免用户搜索不到结果 </span> )</label>
<div class="radio">
<label class="radio-inline">
<input type="radio" {{if eq .ELASTICSEARCH_ON.OptionValue "true"}}checked{{end}} name="ELASTICSEARCH_ON" value="true">是<span class="text"></span>
</label>
<label class="radio-inline">
<input type="radio" {{if eq .ELASTICSEARCH_ON.OptionValue "false"}}checked{{end}} name="ELASTICSEARCH_ON" value="false">否<span class="text"></span>
</label>
</div>
</div>
<div class="form-group">
<label>ElasticSearch全文搜索地址</label>
<input type="text" name="ELASTICSEARCH_HOST" class="form-control" value="{{.ELASTICSEARCH_HOST.OptionValue}}">
</div>
<div class="form-group">
<label>默认搜索</label>
<select name="DEFAULT_SEARCH" class="form-control">
<option {{if eq .DEFAULT_SEARCH.OptionValue "book"}}selected{{end}} value="book">搜索书籍</option>
<option {{if eq .DEFAULT_SEARCH.OptionValue "doc"}}selected{{end}} value="doc">搜索文档</option>
</select>
</div>
<div class="form-group">
<label>搜索结果精度( <span class="text-muted">可选值:0 ~ 100,值越大,精度越大</span> )</label>
<input type="number" min="0" class="form-control" max="100" name="SEARCH_ACCURACY" value="{{.SEARCH_ACCURACY.OptionValue}}">
</div>
<div class="form-group">
<label>是否开启关联书籍功能( <span class="text-muted">数值,大于0表示开启并把关联结果缓存xx天,其他值表示不开启。<strong class="text-danger">需开启全文搜索!!!</strong></span> )</label>
<input type="number" min="0" max="365" class="form-control" name="RELATE_BOOK" value="{{.RELATE_BOOK.OptionValue}}">
</div>
<div class="form-group">
<label>站点统计</label>
<textarea name="TONGJI" PLACEHOLDER="站点统计代码" class="form-control" rows="3">{{.TONGJI.OptionValue}}</textarea>
</div>
<div class="form-group">
<button type="submit" id="btnSaveBookInfo" class="btn btn-success" data-loading-text="保存中...">保存修改</button>
<span id="form-error-message" class="error-message"></span>
</div>
</form>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</div>
{{/*<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>*/}}
<script src="/static/jquery/1.12.4/jquery.min.js" type="text/javascript"></script>
{{/*<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>*/}}
<script src="/static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="{{$.StaticDomain}}/static/js/toast.script.js" type="text/javascript"></script>
<script src="{{$.StaticDomain}}/static/js/jquery.form.js" type="text/javascript"></script>
<script src="/static/js/main.js?version={{$.Version}}" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("#gloablEditForm").ajaxForm({
beforeSubmit : function () {
var title = $.trim($("#siteName").val());
if (title === ""){
return showError("网站标题不能为空");
}
$("#btnSaveBookInfo").button("loading");
},success : function (res) {
if(res.errcode === 0) {
showSuccess("保存成功")
}else{
showError(res.message);
}
$("#btnSaveBookInfo").button("reset");
}
});
});
</script>
</body>
</html>