config.ftl 48.3 KB
Newer Older
Y
yadong.zhang 已提交
1 2
<#include "include/macros.ftl">
<@header></@header>
Y
yadong.zhang 已提交
3 4
<div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12">
5 6 7 8 9 10
        <@breadcrumb>
            <ol class="breadcrumb">
                <li><a href="/">首页</a></li>
                <li class="active">系统配置</li>
            </ol>
        </@breadcrumb>
Y
yadong.zhang 已提交
11 12
        <div class="x_panel">
            <div class="x_title">
Y
yadong.zhang 已提交
13
                <h2>系统配置 </h2>
Y
yadong.zhang 已提交
14 15 16 17 18 19 20
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <div class="col-md-12 col-sm-12 col-xs-12 profile_left">
                    <div class="" role="tabpanel" data-example-id="togglable-tabs">
                        <ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
                            <li role="presentation" class="active">
Y
yadong.zhang 已提交
21 22 23
                                <a href="#tab_basic" id="basic-tab" role="tab" data-toggle="tab" aria-expanded="true">基本信息</a>
                            </li>
                            <li role="presentation">
24
                                <a href="#tab_seo" id="seo-tab" role="tab" data-toggle="tab" aria-expanded="true">SEO</a>
Y
yadong.zhang 已提交
25 26
                            </li>
                            <li role="presentation">
27
                                <a href="#tab_storage" id="storage-tab" role="tab" data-toggle="tab" aria-expanded="true">云存储</a>
28
                            </li>
29
                            <li role="presentation">
30
                                <a href="#tab_auth" id="auth-tab" role="tab" data-toggle="tab" aria-expanded="true">登录</a>
31
                            </li>
32 33
                            <li role="presentation">
                                <a href="#tab_comment" id="comment-tab" role="tab" data-toggle="tab" aria-expanded="true">评论</a>
Y
yadong.zhang 已提交
34 35
                            </li>
                            <li role="presentation" class="">
Y
yadong.zhang 已提交
36
                                <a href="#tab_contact" role="tab" id="contact-tab" data-toggle="tab" aria-expanded="false">联系方式</a>
Y
yadong.zhang 已提交
37
                            </li>
38
                            <li role="presentation">
39
                                <a href="#tab_praise" id="praise-tab" role="tab" data-toggle="tab" aria-expanded="true">赞赏码</a>
40
                            </li>
Y
yadong.zhang 已提交
41
                            <li role="presentation" class="">
42
                                <a href="#tab_setting" role="tab" id="setting-tab" data-toggle="tab" aria-expanded="false">其他</a>
Y
yadong.zhang 已提交
43 44 45
                            </li>
                        </ul>
                        <div id="myTabContent" class="tab-content">
46 47
                            <div role="tabpanel" class="tab-pane fade active in" id="tab_basic"
                                 aria-labelledby="basic-tab">
Y
yadong.zhang 已提交
48 49
                                <form class="form-horizontal form-label-left" novalidate>
                                    <div class="item form-group">
50
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteDesc">站点简介 <i class="fa fa-question-circle" title="一句话简介"></i> <span class="required">*</span></label>
Y
yadong.zhang 已提交
51
                                        <div class="col-md-6 col-sm-6 col-xs-12">
52
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteDesc" id="siteDesc" required="required" placeholder="请输入站点简介"/>
Y
yadong.zhang 已提交
53 54 55
                                        </div>
                                    </div>
                                    <div class="item form-group">
56
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="domain">主域名 <i class="fa fa-question-circle" title="例如:https://www.zhyd.me的主域名就是zhyd.me"></i> <span class="required">*</span></label>
Y
yadong.zhang 已提交
57
                                        <div class="col-md-6 col-sm-6 col-xs-12">
58
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="domain" id="domain" required="required" placeholder="请输入网站主域名: zhyd.me"/>
Y
yadong.zhang 已提交
59 60 61
                                        </div>
                                    </div>
                                    <div class="item form-group">
62
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteUrl">博客地址 <i class="fa fa-question-circle" title="博客前台地址,例如: http://localhost:8443"></i> <span class="required">*</span></label>
Y
yadong.zhang 已提交
63
                                        <div class="col-md-6 col-sm-6 col-xs-12">
64
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteUrl" id="siteUrl" required="required" placeholder="请输入博客地址"/>
Y
yadong.zhang 已提交
65 66 67
                                        </div>
                                    </div>
                                    <div class="item form-group">
68 69
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteFavicon">站点图标
                                            <i class="fa fa-question-circle" title="favicon,浏览器标签网站标题左侧的图标"></i> <span class="required">*</span></label>
Y
yadong.zhang 已提交
70
                                        <div class="col-md-6 col-sm-6 col-xs-12">
71
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteFavicon" id="siteFavicon" required="required" placeholder="请输入站点LOGO"/>
Y
yadong.zhang 已提交
72 73 74
                                        </div>
                                    </div>
                                    <div class="item form-group">
75 76
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="staticWebSite">资源文件域名
                                            <i class="fa fa-question-circle" title="js、css、img等文件的域名地址,如果是在本项目内,则与“博客地址”设置一样即可"></i> <span class="required">*</span></label>
Y
yadong.zhang 已提交
77
                                        <div class="col-md-6 col-sm-6 col-xs-12">
78
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="staticWebSite" id="staticWebSite" required="required" placeholder="请输入资源文件域名"/>
Y
yadong.zhang 已提交
79 80
                                        </div>
                                    </div>
81
                                    <div class="item form-group">
82 83
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="staticWebSite">CMS后管系统地址
                                            <i class="fa fa-question-circle" title="博客后台管理系统的地址,例如: http://localhost:8085"></i> <span class="required">*</span></label>
84
                                        <div class="col-md-6 col-sm-6 col-xs-12">
85
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="cmsUrl" id="cmsUrl" required="required" placeholder="请输入CMS后管系统地址"/>
86 87
                                        </div>
                                    </div>
Y
yadong.zhang 已提交
88
                                    <div class="item form-group">
Y
yadong.zhang 已提交
89
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
Y
yadong.zhang 已提交
90
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
91
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
92 93 94 95 96 97 98
                                        </div>
                                    </div>
                                </form>
                            </div>
                            <div role="tabpanel" class="tab-pane fade" id="tab_seo" aria-labelledby="seo-tab">
                                <form class="form-horizontal form-label-left" novalidate>
                                    <div class="item form-group">
99 100
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="siteName">Title <i class="fa fa-question-circle" title="百度白皮书推荐的格式:关键词1_关键词2_关键词3_关键词4-品牌词"></i> <span class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
101
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="siteName" id="siteName" required="required" placeholder="请输入站点名"/>
102 103 104 105
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeDesc">Description <i class="fa fa-question-circle" title="对keywords进行扩展描述,100~130字左右即可"></i> <span class="required">*</span></label>
106
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
107 108 109 110
                                            <textarea class="form-control col-md-7 col-xs-12" id="homeDesc" name="homeDesc" required="required" placeholder="请输入首页描述" rows="5"></textarea>
                                        </div>
                                    </div>
                                    <div class="item form-group">
111
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeKeywords">Keywords <i class="fa fa-question-circle" title="网站关键字,半角逗号分割,不建议多,贴合网站主题"></i> <span class="required">*</span></label>
112
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
113 114 115 116
                                            <textarea class="form-control col-md-7 col-xs-12" id="homeKeywords" name="homeKeywords" required="required" placeholder="请输入首页关键字(半角逗号分隔)" rows="5"></textarea>
                                        </div>
                                    </div>
                                    <div class="item form-group">
117
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeKeywords">百度推送Token <i class="fa fa-question-circle" title="方便百度引擎快速收录"></i> <span class="required">*</span></label>
118
                                        <div class="col-md-6 col-sm-6 col-xs-12">
119
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="baiduPushToken" id="baiduPushToken" required="required" placeholder="请输入百度推送Token"/>
Y
yadong.zhang 已提交
120 121
                                        </div>
                                    </div>
Y
yadong.zhang 已提交
122 123
                                    <div class="item">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
124 125 126
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <small>获取地址:<a href="https://ziyuan.baidu.com/linksubmit/index" target="_blank">点击获取百度推送Token</a></small>
                                        </div>
Y
yadong.zhang 已提交
127
                                    </div>
Y
yadong.zhang 已提交
128
                                    <div class="clearfix"></div>
Y
yadong.zhang 已提交
129 130
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
131
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
132
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
133 134 135 136
                                        </div>
                                    </div>
                                </form>
                            </div>
137
                            <div role="tabpanel" class="tab-pane fade" id="tab_storage" aria-labelledby="storage-tab">
Y
yadong.zhang 已提交
138
                                <form class="form-horizontal form-label-left" novalidate>
139 140 141 142
                                    <div class="alert alert-info" role="alert" style="color: white">
                                        <a href="#" class="close" data-dismiss="alert">&times;</a>
                                        <i class="fa fa-info-circle fa-fw"></i>注意:系统<strong>暂不自持自动同步</strong>各个云存储空间中的文件,所以当切换云存储类型时可能会造成<strong class="red">部分图片不可用</strong>的情况!请悉知!
                                    </div>
Y
yadong.zhang 已提交
143
                                    <div class="item form-group">
144
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">存储类型 <span class="required">*</span></label>
145 146 147 148 149 150
                                        <div class="col-md-8 col-sm-8 col-xs-8">
                                            <div class="checkbox">
                                                <label for="storageType" style="margin-right: 10px"> <input type="radio" class="square" name="storageType" value="local" checked="checked"/> 本地 </label>
                                                <label for="storageType" style="margin-right: 10px"><input type="radio" class="square" name="storageType" value="qiniu"/> 七牛云 </label>
                                                <label for="storageType" style="margin-right: 10px"><input type="radio" class="square" name="storageType" value="aliyun"/> 阿里云OSS</label>
                                            </div>
Y
yadong.zhang 已提交
151 152
                                        </div>
                                    </div>
153 154 155 156
                                    <div class="storage-box" id="local">
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="localFileUrl">文件服务器域名 <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
智布道's avatar
智布道 已提交
157
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="localFileUrl" id="localFileUrl" required="required" placeholder="请输入文件服务器域名,如:http://file.zhyd.me/"/>
158 159 160 161 162
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="localFilePath">文件存储路径 <i class="fa fa-question-circle" title="Nginx服务中root后面对应的目录地址"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
163
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="localFilePath" id="localFilePath" required="required" placeholder="请输入文件存储路径,如:/var/www/oneblog/upload/"/>
164 165 166 167 168 169 170
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <small><a class="pointer" data-toggle="modal" data-target="#storageNginxServerModal">获取nginx文件服务器配置</a> </small>
                                            </div>
Y
yadong.zhang 已提交
171 172
                                        </div>
                                    </div>
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
                                    <div class="storage-box hide" id="qiniu">
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="qiniuBucketName">Bucket 名称 <i class="fa fa-question-circle" title="存储空间名称"></i> <span  class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12"  name="qiniuBucketName" id="qiniuBucketName"  required="required" placeholder="请输入Bucket 名称"/>
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiniuAccessKey">Access Key <i class="fa fa-question-circle" title="密钥获取地址:https://portal.qiniu.com/user/key"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12"  name="qiniuAccessKey" id="qiniuAccessKey" required="required" placeholder="请输入Access Key"/>
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiniuSecretKey">Secret Key <i class="fa fa-question-circle" title="密钥获取地址:https://portal.qiniu.com/user/key"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="qiniuSecretKey" id="qiniuSecretKey" required="required" placeholder="请输入Secret Key"/>
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiniuBasePath">七牛云cdn域名 <i class="fa fa-question-circle" title="如果未自定义域名,则填写临时域名,格式:http://***.**.**/"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="qiniuBasePath" id="qiniuBasePath" required="required" placeholder="请输入七牛域名,格式:http://***.**.**/"/>
                                            </div>
Y
yadong.zhang 已提交
197 198
                                        </div>
                                    </div>
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
                                    <div class="storage-box hide" id="aliyun">
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="aliyunBucketName">Bucket 名称 <i class="fa fa-question-circle" title="存储空间名称"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="aliyunBucketName" id="aliyunBucketName" required="required" placeholder="请输入Bucket 名称"/>
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="aliyunEndpoint">地域节点(EndPoint) <i class="fa fa-question-circle" title="地域节点,注意必须填写外网地址,非内网"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12"  name="aliyunEndpoint" id="aliyunEndpoint" required="required" placeholder="请输入endpoint,如:http://oss-cn-hangzhou.aliyuncs.com"/>
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="aliyunFileUrl">Bucket 域名 <i class="fa fa-question-circle" title="默认为bucketName + endpoint,若使用自定义的域名,请修改"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12"  name="aliyunFileUrl" id="aliyunFileUrl" required="required" placeholder="默认为bucketName + endpoint,若使用自定义的域名,请修改"/>
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="aliyunAccessKey">Access Key <i class="fa fa-question-circle" title="阿里云API密钥,获取地址:https://ak-console.aliyun.com/#/"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="aliyunAccessKey" id="aliyunAccessKey" required="required" placeholder="请输入Access Key"/>
                                            </div>
                                        </div>
                                        <div class="item form-group">
                                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="aliyunAccessKeySecret">Access Key Secret <i class="fa fa-question-circle" title="阿里云API密钥,获取地址:https://ak-console.aliyun.com/#/"></i> <span class="required">*</span></label>
                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="aliyunAccessKeySecret" id="aliyunAccessKeySecret" required="required" placeholder="请输入Access Key Secret"/>
                                            </div>
Y
yadong.zhang 已提交
229 230
                                        </div>
                                    </div>
231

Y
yadong.zhang 已提交
232 233 234
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
235
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
236 237 238 239
                                        </div>
                                    </div>
                                </form>
                            </div>
240 241
                            <div role="tabpanel" class="tab-pane fade" id="tab_auth" aria-labelledby="auth-tab">
                                <form class="form-horizontal form-label-left" novalidate>
242 243 244 245
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="loginRetryNum">登录重试次数 <span class="required">*</span></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="loginRetryNum" id="loginRetryNum" required="required" placeholder="请输入登录重试次数,默认5"/>
246 247
                                        </div>
                                    </div>
248 249 250 251 252 253 254 255 256 257 258 259 260 261
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-3" for="sessionTimeOut">Session有效期 <span class="required">*</span></label>
                                        <div class="col-md-3 col-sm-3 col-xs-3">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="sessionTimeOut" id="sessionTimeOut" required="required" placeholder="请输入Session有效期,默认1小时"/>
                                        </div>
                                        <div class="col-md-1 col-sm-1 col-xs-1">
                                            <select name="sessionTimeOutUnit" id="sessionTimeOutUnit" class="form-control" required="required" >
                                                <@zhydTag method="sessionTimeOutUnit">
                                                    <option value="">请选择</option>
                                                    <#list sessionTimeOutUnit as item>
                                                        <option value="${item}">${item}</option>
                                                    </#list>
                                                </@zhydTag>
                                            </select>
262 263 264
                                        </div>
                                    </div>
                                    <div class="item form-group">
265 266
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
267 268 269 270 271
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
272 273 274 275
                            <div role="tabpanel" class="tab-pane fade" id="tab_comment" aria-labelledby="comment-tab">
                                <form class="form-horizontal form-label-left" novalidate>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12 aero" for="anonymous">允许匿名评论?
276
                                            <i class="fa fa-question-circle" title="【暂不可用】是否允许匿名评论,如果为否则必须需要登录。"></i>
277 278 279
                                        </label>
                                        <div class="col-md-6 col-sm-6 col-xs-12 fixed-radio-checkbox">
                                            <ul class="list-unstyled list-inline">
280 281
                                                <li><label for="anonymous" class="pointer"> <input type="radio" class="square" checked name="anonymous" value="1"> 开启 </label></li>
                                                <li><label for="anonymous" class="pointer"> <input type="radio" class="square" name="anonymous" value="0"> 关闭 </label></li>
282 283 284 285 286 287 288
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment">开启留言板评论 <i class="fa fa-question-circle" title="控制留言板页面的评论框显示情况"></i></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12 fixed-radio-checkbox">
                                            <ul class="list-unstyled list-inline">
289 290
                                                <li><label for="comment" class="pointer"> <input type="radio" class="square" checked name="comment" value="1"> 开启 </label></li>
                                                <li><label for="comment" class="pointer"> <input type="radio" class="square" name="comment" value="0"> 关闭 </label></li>
291 292 293 294
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="item form-group">
295 296
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="editorPlaceholder">Placeholder <i class="fa fa-question-circle" title="占位符,当没输入内容时显示该值"></i>
                                        </label>
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" id="editorPlaceholder" name="editorPlaceholder" placeholder="例如:说点什么吧">
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="editorAlert">警示语 <i class="fa fa-question-circle" title="评论框右下角显示的内容"></i> </label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" id="editorAlert" name="editorAlert" placeholder="例如:讲文明、要和谐">
                                        </div>
                                    </div>

                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
Y
yadong.zhang 已提交
316
                            <div role="tabpanel" class="tab-pane fade" id="tab_contact" aria-labelledby="contact-tab">
Y
yadong.zhang 已提交
317 318 319 320
                                <form class="form-horizontal form-label-left" novalidate>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="authorName">站长名称</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
321
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="authorName" id="authorName" placeholder="请输入站长名称"/>
Y
yadong.zhang 已提交
322 323 324 325 326
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="authorEmail">站长邮箱</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
327
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="authorEmail" id="authorEmail" placeholder="请输入站长邮箱"/>
Y
yadong.zhang 已提交
328 329 330
                                        </div>
                                    </div>
                                    <div class="item form-group">
331
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="wxCode">微信二维码</label>
Y
yadong.zhang 已提交
332
                                        <div class="col-md-6 col-sm-6 col-xs-12">
333
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="wxCode" id="wxCode" placeholder="请输入微信二维码"/>
Y
yadong.zhang 已提交
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qq">QQ</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="qq" id="qq" placeholder="请输入QQ"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="weibo">微博</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="weibo" id="weibo" placeholder="请输入微博"/>
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="github">GitHub</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
351
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="github" id="github" placeholder="请输入GitHub"/>
Y
yadong.zhang 已提交
352 353 354 355 356
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
357
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
358 359 360 361
                                        </div>
                                    </div>
                                </form>
                            </div>
362 363 364 365 366
                            <div role="tabpanel" class="tab-pane fade" id="tab_praise" aria-labelledby="praise-tab">
                                <form class="form-horizontal form-label-left" novalidate>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeDesc">微信赞赏码 </label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
367
                                            <input type="file" class="form-control col-md-7 col-xs-12 uploadPreview" data-preview-container="#wxPraiseCodePreview" name="wxPraiseCode" id="wxPraiseCode"/>
368 369
                                        </div>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
370
                                            <div id="wxPraiseCodePreview" style="width: 200px;height: auto"></div>
371 372 373 374 375
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="homeKeywords">支付宝赞赏码 </label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
376
                                            <input type="file" class="form-control col-md-7 col-xs-12 uploadPreview" data-preview-container="#zfbPraiseCodePreview" id="zfbPraiseCode" name="zfbPraiseCode"/>
377 378
                                        </div>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
379
                                            <div id="zfbPraiseCodePreview" style="width: 200px;height: auto"></div>
380 381 382 383 384 385 386 387 388 389
                                        </div>
                                    </div>
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
Y
yadong.zhang 已提交
390
                            <div role="tabpanel" class="tab-pane fade" id="tab_setting" aria-labelledby="setting-tab">
Y
yadong.zhang 已提交
391
                                <form class="form-horizontal form-label-left" novalidate>
Y
yadong.zhang 已提交
392 393 394
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="authorName">百度Api的AK</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
395
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="baiduApiAk" id="baiduApiAk" placeholder="请输入百度Api的AK"/>
Y
yadong.zhang 已提交
396 397 398 399
                                        </div>
                                    </div>
                                    <div class="item">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
400 401 402
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <small>获取地址:<a href="http://lbsyun.baidu.com/apiconsole/key" target="_blank">点击获取百度Api AK</a></small>
                                        </div>
Y
yadong.zhang 已提交
403 404
                                    </div>
                                    <div class="clear"></div>
Y
yadong.zhang 已提交
405
                                    <div class="item form-group">
智布道's avatar
智布道 已提交
406
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenance">维护通知</label>
407
                                        <div class="col-md-6 col-sm-6 col-xs-12 fixed-radio-checkbox">
Y
yadong.zhang 已提交
408
                                            <ul class="list-unstyled list-inline">
409 410
                                                <li><label for="maintenance" class="pointer"> <input type="radio" class="square" checked name="maintenance" value="1"> 显示 </label> </li>
                                                <li><label for="maintenance" class="pointer"> <input type="radio" class="square" name="maintenance" value="0"> 关闭 </label></li>
Y
yadong.zhang 已提交
411 412 413 414
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="item form-group">
415
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenanceDate">维护日期</label>
Y
yadong.zhang 已提交
416 417
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <div class='input-group date myDatepicker'>
418
                                                <input type='text' class="form-control" readonly="readonly" id="maintenanceDate" name="maintenanceDate"  placeholder="请输入维护日期"/>
Y
yadong.zhang 已提交
419
                                                <span class="input-group-addon">
420
                                                   <span class="fa fa-calendar"></span>
Y
yadong.zhang 已提交
421 422 423 424
                                                </span>
                                            </div>
                                        </div>
                                    </div>
425 426 427 428 429 430 431 432 433 434 435
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenanceTime">维护用时</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <div class='input-group'>
                                                <input type='text' class="form-control" id="maintenanceTime" name="maintenanceTime"  placeholder="请输入维护大约需要的时间"/>
                                                <span class="input-group-addon">

                                                </span>
                                            </div>
                                        </div>
                                    </div>
Y
yadong.zhang 已提交
436 437 438
                                    <div class="item form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="comment"></label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
Y
yadong.zhang 已提交
439
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
440 441 442 443 444 445 446 447 448 449 450 451
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473
<div class="modal fade" id="storageNginxServerModal" tabindex="-1" role="dialog"
     aria-labelledby="storageNginxServerModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="storageNginxServerModalLabel">Nginx文件服务器配置</h4>
            </div>
            <div class="modal-body">
                <@zhydTag method="template" key="TM_NGINX_FILE_SERVER">
                    <#if template?if_exists>
                        <textarea class="form-control" rows="15" cols="">${template.refValue}</textarea>
                    <#else>
                        <textarea class="form-control" placeholder="暂无可参考的配置" disabled readonly></textarea>
                    </#if>
                </@zhydTag>

                <div class="item form-group">
                    <fieldset>
                        <legend style="padding-bottom: 0;"><h4>使用帮助<i class="fa fa-question-circle fa-fw"></i></h4>
                        </legend>
474 475 476 477 478 479 480 481 482 483 484 485 486
                        <dl>
                            <dt><i class="fa fa-info-circle fa-fw"></i>1. 替换配置文件中的指定内容</dt>
                            <dd><code>serverName</code> 改为自己的域名</dd>
                            <dd><code>serverPath</code> Nginx文件服务映射的服务器路径,同云存储中填写的“文件存储路径”</dd>
                            <dd><code>serverReferers</code> 防盗链的Referers,多个用空格分隔,支持通配符,比如:<code>*.zhyd.me zhyd.me</code></dd>
                            <dd><code>serverLogoPath</code> 触发防盗链后显示的默认图片,即当别人引用你网站中的图片时,会触发防盗链,对方网站中看到的就是 <code>serverLogoPath</code>对应的文件内容</dd>
                        </dl>
                        <dl>
                            <dt><i class="fa fa-info-circle fa-fw"></i>2. 添加Nginx配置</dt>
                            <dd>i. 将上方文本域修改后的内容保存为<code>**.conf</code>,放入到Nginx配置文件目录中</dd>
                            <dd>ii. 重启Nginx</dd>
                            <dd>iii. 尝试访问<code>serverName</code>检查Nginx是否配置成功</dd>
                        </dl>
487 488 489 490 491 492 493 494 495
                    </fieldset>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
Y
yadong.zhang 已提交
496 497 498
<@footer>
    <script type="text/javascript">
        $(function () {
499
            var oldStorageType, firstLoad = true;
Y
yadong.zhang 已提交
500 501 502 503 504
            $.ajax({
                url: '/config/get',
                type: 'POST',
                success: function (json) {
                    var data = json.data;
505
                    oldStorageType = data.storageType;
Y
yadong.zhang 已提交
506 507 508
                    $("#myTabContent").find("input, select, textarea").each(function () {
                        clearText($(this), this.type, data);
                    });
509
                    changeMaintenance(data.maintenance && data.maintenance == 1, data.maintenance);
510 511
                    data.zfbPraiseCode && $("#zfbPraiseCodePreview").html('<img src="' + data.zfbPraiseCode + '" alt="支付宝赞赏码" class="img-responsive img-rounded auto-shake">');
                    data.wxPraiseCode && $("#wxPraiseCodePreview").html('<img src="' + data.wxPraiseCode + '" alt="微信赞赏码" class="img-responsive img-rounded auto-shake">');
Y
yadong.zhang 已提交
512 513
                }
            });
Y
yadong.zhang 已提交
514

Y
yadong.zhang 已提交
515 516 517
            $(".saveBtn").click(function () {
                var $this = $(this);
                var $form = $this.parents("form");
518
                if (validator.checkAll($form)) {
Y
yadong.zhang 已提交
519 520
                    $form.ajaxSubmit({
                        type: "POST",
521
                        url: '/config/save',
522 523 524
                        success: function (json) {
                            $.alert.ajaxSuccess(json);
                        },
Y
yadong.zhang 已提交
525 526 527 528
                        error: $.alert.ajaxError
                    });
                }
            });
529 530

            $("#tab_storage input[name=storageType]").on('ifChecked', function (event) {
531 532
                var $this = $(this);
                var thisValue = $this.val();
533 534 535
                if (!$("#" + thisValue).hasClass("hide")) {
                    return;
                }
536 537 538 539 540 541 542 543
                function changeStorageBox() {
                    $(".storage-box").each(function () {
                        var $box = $(this);
                        if ($box.attr("id") === thisValue) {
                            $box.removeClass("hide").find("input").removeAttr("disabled").removeAttr("readonly");
                        } else {
                            $box.addClass("hide").find("input").attr("disabled", "disabled").attr("readonly", "readonly");
                        }
544 545
                    });
                }
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561
                if(firstLoad) {
                    changeStorageBox();
                    firstLoad = false;
                } else {
                    if(oldStorageType !== thisValue) {
                        $.alert.confirm("您确定要切换云存储类型吗?切换后原文件将不可访问!", function () {
                            oldStorageType = thisValue;
                            changeStorageBox();
                        }, function () {
                            $("#tab_storage input[name=storageType]").each(function () {
                                var $this = $(this);
                                $this.iCheck((oldStorageType !== $this.val()) ? 'uncheck' : 'check');
                            });
                        });
                    }
                }
562
            });
563

564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580
            $("#tab_setting input[name=maintenance]").on('ifChanged', function (event) {
                changeMaintenance($(this).is(':checked'), $(this).val());
            });
            function changeMaintenance(checked, thisVal){
                if (checked && thisVal == 1) {
                    $("#maintenanceDate, #maintenanceTime").each(function () {
                        var $this = $(this);
                        var $label = $this.parents("div.form-group").find("label");
                        $this.attr("required", "required");
                        $label.append('<span class="required">*</span>');
                    })
                } else {
                    $("#maintenanceDate, #maintenanceTime").each(function () {
                        var $this = $(this);
                        var $span = $this.parents("div.form-group").find("label span");
                        $this.removeAttr("required");
                        $span.remove();
581 582
                    })
                }
583
            }
584 585 586 587 588 589

            $("#aliyunBucketName, #aliyunEndpoint").change(function () {
                var $fileUrl = $("#aliyunFileUrl");
                var aliyunBucketName = $("#aliyunBucketName").val();
                var aliyunEndpoint = $("#aliyunEndpoint").val();
                if(aliyunBucketName && aliyunEndpoint) {
590
                    $fileUrl.val("https://" + aliyunBucketName + "." + aliyunEndpoint + "/");
591 592
                }
            });
Y
yadong.zhang 已提交
593

Y
yadong.zhang 已提交
594 595 596
        });
    </script>
</@footer>