config.ftl 55.8 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 30 31
                            <li role="presentation">
                                <a href="#tab_auth" id="auth-tab" role="tab" data-toggle="tab" aria-expanded="true">第三方登录</a>
                            </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 157 158 159 160 161 162 163 164 165 166 167 168 169 170
                                    <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">
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="localFileUrl" id="localFileUrl" required="required" placeholder="请输入文件服务器域名"/>
                                            </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">
                                                <input type="text" class="form-control col-md-7 col-xs-12" name="localFilePath" id="localFilePath" required="required" placeholder="请输入文件存储路径,如:/var/www/oneblog/upload"/>
                                            </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 242 243 244
                            <div role="tabpanel" class="tab-pane fade" id="tab_auth" aria-labelledby="auth-tab">
                                <form class="form-horizontal form-label-left" novalidate>
                                    <div class="col-md-6">
                                        <div class="x_panel">
                                            <div class="x_title">
245 246 247
                                                <h2><i class="fa fa-github"></i> GitHub
                                                    <small><a href="https://github.com/settings/developers" target="_blank">OAuth Apps</a></small>
                                                </h2>
248 249 250 251
                                                <div class="clearfix"></div>
                                            </div>
                                            <div class="x_content locking" data-mask="暂不支持,敬请期待!">
                                                <div class="item form-group">
252
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="githubClientId">Client ID <i class="fa fa-question-circle" title="GitHub OAuth Apps的Client ID"></i>
253
                                                    </label>
254
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
255 256 257 258 259 260 261
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="githubClientId" id="githubClientId" placeholder="请输入 client id"/>
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="githubClientSecret">Client Secret
                                                        <i class="fa fa-question-circle" title="GitHub OAuth Apps的Client Secret"></i>
                                                    </label>
262
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
263 264 265 266 267 268 269 270 271
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="githubClientSecret" id="githubClientSecret" placeholder="请输入 client secret"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="x_panel">
                                            <div class="x_title">
272 273 274
                                                <h2><i class="fa fa-git"></i> Gitee
                                                    <small><a href="https://gitee.com/api/v5/oauth_doc#list_1" target="_blank">第三方应用</a></small>
                                                </h2>
275 276 277 278 279 280 281
                                                <div class="clearfix"></div>
                                            </div>
                                            <div class="x_content locking" data-mask="暂不支持,敬请期待!">
                                                <div class="item form-group">
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="giteeClientId">Client ID
                                                        <i class="fa fa-question-circle" title="Gitee 应用的Client Id"></i>
                                                    </label>
282
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
283 284 285 286 287 288 289
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="giteeClientId" id="giteeClientId" placeholder="请输入 client id"/>
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="giteeClientSecret">Client Secret
                                                        <i class="fa fa-question-circle" title="Gitee 应用的Client Secret"></i>
                                                    </label>
290
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="giteeClientSecret" id="giteeClientSecret" placeholder="请输入 client secret"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="x_panel">
                                            <div class="x_title">
                                                <h2><i class="fa fa-weibo"></i> Weibo <small><a href="https://open.weibo.com/apps" target="_blank">微博·开放平台</a></small></h2>
                                                <div class="clearfix"></div>
                                            </div>
                                            <div class="x_content locking" data-mask="暂不支持,敬请期待!">
                                                <div class="item form-group">
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="weiboClientId">App Key
                                                        <i class="fa fa-question-circle" title="weibo应用的App Key,可在“应用信息”-“基本信息”页面查看"></i>
                                                    </label>
308
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
309 310 311 312 313 314 315
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="weiboClientId" id="weiboClientId" placeholder="请输入 App Key"/>
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="weiboClientSecret">App Secret
                                                        <i class="fa fa-question-circle" title="weibo应用的App Secret,可在“应用信息”-“基本信息”页面查看"></i>
                                                    </label>
316
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
317 318 319 320 321 322 323 324 325
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="weiboClientSecret" id="weiboClientSecret" placeholder="请输入 App Secret"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="x_panel">
                                            <div class="x_title">
326 327 328
                                                <h2><i class="fa fa-qq"></i> QQ
                                                    <small><a href="https://connect.qq.com/" target="_blank">QQ互联</a> </small>
                                                </h2>
329 330 331 332 333 334 335
                                                <div class="clearfix"></div>
                                            </div>
                                            <div class="x_content locking" data-mask="暂不支持,敬请期待!">
                                                <div class="item form-group">
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qqClientId">App Id
                                                        <i class="fa fa-question-circle" title="qq 开发者账号的App ID"></i>
                                                    </label>
336
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
337 338 339 340 341 342 343
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="qqClientId" id="qqClientId" placeholder="请输入 App Id"/>
                                                    </div>
                                                </div>
                                                <div class="item form-group">
                                                    <label class="control-label col-md-3 col-sm-3 col-xs-12" for="qqClientSecret">App Secret
                                                        <i class="fa fa-question-circle" title="qq 开发者账号的App Secret"></i>
                                                    </label>
344
                                                    <div class="col-md-6 col-sm-6 col-xs-12">
345 346 347 348 349 350 351 352 353 354 355 356 357 358
                                                        <input type="text" class="form-control col-md-7 col-xs-12" name="qqClientSecret" id="qqClientSecret" placeholder="请输入 App Secret"/>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="item form-group">
                                        <div class="col-md-11 col-sm-11 col-xs-11">
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
                                        </div>
                                    </div>
                                </form>
                            </div>
359 360 361 362
                            <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">允许匿名评论?
363
                                            <i class="fa fa-question-circle" title="【暂不可用】是否允许匿名评论,如果为否则必须需要登录。"></i>
364 365 366
                                        </label>
                                        <div class="col-md-6 col-sm-6 col-xs-12 fixed-radio-checkbox">
                                            <ul class="list-unstyled list-inline">
367 368
                                                <li><label for="storageType" class="pointer"> <input type="radio" class="square" checked name="anonymous" value="1"> 开启 </label></li>
                                                <li><label for="storageType" class="pointer"> <input type="radio" class="square" name="anonymous" value="0"> 关闭 </label></li>
369 370 371 372 373 374 375
                                            </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">
376 377
                                                <li><label for="storageType" class="pointer"> <input type="radio" class="square" checked name="comment" value="1"> 开启 </label></li>
                                                <li><label for="storageType" class="pointer"> <input type="radio" class="square" name="comment" value="0"> 关闭 </label></li>
378 379 380 381
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="item form-group">
382 383
                                        <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>
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
                                        <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 已提交
403
                            <div role="tabpanel" class="tab-pane fade" id="tab_contact" aria-labelledby="contact-tab">
Y
yadong.zhang 已提交
404 405 406 407
                                <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">
408
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="authorName" id="authorName" placeholder="请输入站长名称"/>
Y
yadong.zhang 已提交
409 410 411 412 413
                                        </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">
414
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="authorEmail" id="authorEmail" placeholder="请输入站长邮箱"/>
Y
yadong.zhang 已提交
415 416 417
                                        </div>
                                    </div>
                                    <div class="item form-group">
418
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="wxCode">微信二维码</label>
Y
yadong.zhang 已提交
419
                                        <div class="col-md-6 col-sm-6 col-xs-12">
420
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="wxCode" id="wxCode" placeholder="请输入微信二维码"/>
Y
yadong.zhang 已提交
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
                                        </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">
438
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="github" id="github" placeholder="请输入GitHub"/>
Y
yadong.zhang 已提交
439 440 441 442 443
                                        </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 已提交
444
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
445 446 447 448
                                        </div>
                                    </div>
                                </form>
                            </div>
449 450 451 452 453
                            <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">
454
                                            <input type="file" class="form-control col-md-7 col-xs-12 uploadPreview" data-preview-container="#wxPraiseCodePreview" name="wxPraiseCode" id="wxPraiseCode"/>
455 456
                                        </div>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
457
                                            <div id="wxPraiseCodePreview" style="width: 200px;height: auto"></div>
458 459 460 461 462
                                        </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">
463
                                            <input type="file" class="form-control col-md-7 col-xs-12 uploadPreview" data-preview-container="#zfbPraiseCodePreview" id="zfbPraiseCode" name="zfbPraiseCode"/>
464 465
                                        </div>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
466
                                            <div id="zfbPraiseCodePreview" style="width: 200px;height: auto"></div>
467 468 469 470 471 472 473 474 475 476
                                        </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 已提交
477
                            <div role="tabpanel" class="tab-pane fade" id="tab_setting" aria-labelledby="setting-tab">
Y
yadong.zhang 已提交
478
                                <form class="form-horizontal form-label-left" novalidate>
Y
yadong.zhang 已提交
479 480 481
                                    <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">
482
                                            <input type="text" class="form-control col-md-7 col-xs-12" name="baiduApiAk" id="baiduApiAk" placeholder="请输入百度Api的AK"/>
Y
yadong.zhang 已提交
483 484 485 486
                                        </div>
                                    </div>
                                    <div class="item">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12"></label>
487 488 489
                                        <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 已提交
490 491
                                    </div>
                                    <div class="clear"></div>
Y
yadong.zhang 已提交
492
                                    <div class="item form-group">
智布道's avatar
智布道 已提交
493
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenance">维护通知</label>
494
                                        <div class="col-md-6 col-sm-6 col-xs-12 fixed-radio-checkbox">
Y
yadong.zhang 已提交
495
                                            <ul class="list-unstyled list-inline">
496 497
                                                <li><label for="storageType" class="pointer"> <input type="radio" class="square" checked name="maintenance" value="1"> 显示 </label> </li>
                                                <li><label for="storageType" class="pointer"> <input type="radio" class="square" name="maintenance" value="0"> 关闭 </label></li>
Y
yadong.zhang 已提交
498 499 500 501
                                            </ul>
                                        </div>
                                    </div>
                                    <div class="item form-group">
502
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenanceDate">维护日期</label>
Y
yadong.zhang 已提交
503 504
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <div class='input-group date myDatepicker'>
505
                                                <input type='text' class="form-control" readonly="readonly" id="maintenanceDate" name="maintenanceDate"  placeholder="请输入维护日期"/>
Y
yadong.zhang 已提交
506
                                                <span class="input-group-addon">
507
                                                   <span class="fa fa-calendar"></span>
Y
yadong.zhang 已提交
508 509 510 511
                                                </span>
                                            </div>
                                        </div>
                                    </div>
512 513 514 515 516 517 518 519 520 521 522
                                    <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 已提交
523 524 525
                                    <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 已提交
526
                                            <button type="button" class="btn btn-primary saveBtn"><i class="fa fa-save"> 保存</i></button>
Y
yadong.zhang 已提交
527 528 529 530 531 532 533 534 535 536 537 538
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560
<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>
561 562 563 564 565 566 567 568 569 570 571 572 573
                        <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>
574 575 576 577 578 579 580 581 582
                    </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 已提交
583 584 585
<@footer>
    <script type="text/javascript">
        $(function () {
586
            var oldStorageType, firstLoad = true;
Y
yadong.zhang 已提交
587 588 589 590 591
            $.ajax({
                url: '/config/get',
                type: 'POST',
                success: function (json) {
                    var data = json.data;
592
                    oldStorageType = data.storageType;
Y
yadong.zhang 已提交
593 594 595
                    $("#myTabContent").find("input, select, textarea").each(function () {
                        clearText($(this), this.type, data);
                    });
596
                    changeMaintenance(data.maintenance && data.maintenance == 1, data.maintenance);
597 598
                    data.zfbPraiseCode && $("#zfbPraiseCodePreview").html('<img src="' + data.fileStoragePath + data.zfbPraiseCode + '" alt="支付宝赞赏码" class="img-responsive img-rounded auto-shake">');
                    data.wxPraiseCode && $("#wxPraiseCodePreview").html('<img src="' + data.fileStoragePath + data.wxPraiseCode + '" alt="微信赞赏码" class="img-responsive img-rounded auto-shake">');
Y
yadong.zhang 已提交
599 600
                }
            });
Y
yadong.zhang 已提交
601

Y
yadong.zhang 已提交
602 603 604
            $(".saveBtn").click(function () {
                var $this = $(this);
                var $form = $this.parents("form");
605
                if (validator.checkAll($form)) {
Y
yadong.zhang 已提交
606 607
                    $form.ajaxSubmit({
                        type: "POST",
608
                        url: '/config/save',
609 610 611
                        success: function (json) {
                            $.alert.ajaxSuccess(json);
                        },
Y
yadong.zhang 已提交
612 613 614 615
                        error: $.alert.ajaxError
                    });
                }
            });
616 617

            $("#tab_storage input[name=storageType]").on('ifChecked', function (event) {
618 619
                var $this = $(this);
                var thisValue = $this.val();
620 621 622
                if (!$("#" + thisValue).hasClass("hide")) {
                    return;
                }
623 624 625 626 627 628 629 630
                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");
                        }
631 632
                    });
                }
633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
                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');
                            });
                        });
                    }
                }
649
            });
650

651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667
            $("#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();
668 669
                    })
                }
670
            }
671 672 673 674 675 676

            $("#aliyunBucketName, #aliyunEndpoint").change(function () {
                var $fileUrl = $("#aliyunFileUrl");
                var aliyunBucketName = $("#aliyunBucketName").val();
                var aliyunEndpoint = $("#aliyunEndpoint").val();
                if(aliyunBucketName && aliyunEndpoint) {
677
                    $fileUrl.val("https://" + aliyunBucketName + "." + aliyunEndpoint + "/");
678 679
                }
            });
Y
yadong.zhang 已提交
680

Y
yadong.zhang 已提交
681 682 683
        });
    </script>
</@footer>