Skip to content

Commit

Permalink
增加系统配置项
Browse files Browse the repository at this point in the history
  • Loading branch information
TruthHun88 committed Mar 24, 2019
1 parent c915dbc commit 85174bf
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
11 changes: 6 additions & 5 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@
- [x] 封面、横幅裁剪,不再依赖云存储做图片处理
- [x] `DefPic`处理
- [x] `sudo`支持
- [ ] 优化文档上传的处理,正在转码的文档直接在前端展示的时候提示文档正在转码
- [x] 下载文档出错,下载id为100的文档,可能下载到id位80的文档(MySQL查询语句错误造成的)
- [ ] 文档分类数据统计修正(管理后台处理)
- [ ] 频道图片上传和更换功能
- [x] 管理后台测试的时候,提示先保存
- [ ] 管理后台增加一个上传文档必须达到的最低积分要求,避免一些新用户上传垃圾文档
- [ ] 更换[KindEditor](https://www.oschina.net/news/104631/kindeditor-upload-vulnerability)
- [x] 把引入的外部js、css公共资源库替换成本地资源库,以方便内网部署
- [x] 增加虚拟根目录,路径为`./virtualroot`,并把`.well-known`加入到默认静态目录中,以便申请`let's encrypt`证书
- [x] 在管理后台增加注册邮箱验证开关,用户在注册的时候可以不验证邮箱
- [ ] 移除管理后台系统设置的频道管理,直接根据频道排序,在首页展示,避免造成困扰
- [ ] 文档分类数据统计修正(管理后台处理)
- [ ] 频道图片上传和更换功能
- [ ] 优化文档上传流程,正在转码的文档直接在前端展示的时候提示文档正在转码
- [ ] 管理后台增加一个上传文档必须达到的最低积分要求,避免一些新用户上传垃圾文档
- [ ] 更换[KindEditor](https://www.oschina.net/news/104631/kindeditor-upload-vulnerability)




Expand Down
2 changes: 1 addition & 1 deletion models/Install.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func installSys() {
5:人身攻击
6:骚扰他人`, //举报原因
Watermark: "DocHub", //文档水印
StoreWay: string(StoreOss),
StoreType: string(StoreOss),
CheckRegEmail: true,
}
orm.NewOrm().ReadOrCreate(&sys, "Id")
Expand Down
4 changes: 1 addition & 3 deletions models/SysModel.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ type Sys struct {
Watermark string `orm:"column(Watermark);default()"` //水印文案
ReportReasons string `orm:"column(ReportReasons);default();size(2048)"` //举报原因
IsCloseReg bool `orm:"default(false);column(IsCloseReg)"` //是否关闭注册
StoreWay string `orm:"default(oss);column(StoreWay);size(15)"` //文档存储方式
StoreType string `orm:"default(cs-oss);column(StoreType);size(15)"` //文档存储方式
CheckRegEmail bool `orm:"default(true);column(CheckRegEmail);"` //是否需要验证注册邮箱,如果需要验证注册邮箱,提要求发送注册验证码
//Price int `orm:"default(1);column(Price)"` //会员下载一篇文档需要的最大金币【会员在上传分享文档时允许设置的最大金币上限】
//HomeCates string `orm:"default();column(HomeCates);size(50)"` //首页分类,填写频道ids
}

func NewSys() *Sys {
Expand Down
4 changes: 4 additions & 0 deletions views/Admin/default/Index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ <h3>{{.Sys.CntUser}}</h3>
<a href="https://gitee.com/TruthHun/DocHub/" target="_blank">https://gitee.com/TruthHun/DocHub/</a>
</td>
</tr>
<tr>
<td>帮助文档</td>
<td><a href="https://www.bookstack.cn/books/dochub" target="_blank" title="书栈网">https://www.bookstack.cn/books/dochub</a></td>
</tr>
</tbody>
</table>
</div>
Expand Down
15 changes: 14 additions & 1 deletion views/Admin/default/Sys/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,27 @@ <h1 class="page-header">系统设置</h1>
<input type="text" class="form-control" name="Site" placeholder="请输入站点名称" value="{{.Site}}" />
</div>
<div class="form-group">
<label >绑定域名( <small class="text-muted">[必填]生成sitemap需要用到。示例:https://www.dochub.me</small> )</label>
<label >绑定域名( <small class="text-muted">[必填]生成sitemap需要用到。示例:https://www.bookstack.cn</small> )</label>
<input type="text" class="form-control" name="DomainPc" value="{{.DomainPc}}" />
</div>
<div class="form-group">
<label >网站备案号</label>
<input type="text" class="form-control" name="Icp" placeholder="请输入网站备案号,如 桂ICP备 xxxx" value="{{.Icp}}" />
</div>

<div class="form-group">
<label >请选择存储类型( <small class="text-muted">选择存储类型之前,请务必先 <a href="/admin/cloud-store">配置云存储</a></small> )</label>
<select name="StoreType" class="form-control">
<option {{if eq .StoreType "cs-oss"}}selected{{end}} value="cs-oss">OSS(阿里云存储)</option>
<option {{if eq .StoreType "cs-minio"}}selected{{end}} value="cs-minio">Minio(本地云存储)</option>
<option {{if eq .StoreType "cs-cos"}}selected{{end}} value="cs-cos">COS(腾讯云存储)</option>
<option {{if eq .StoreType "cs-bos"}}selected{{end}} value="cs-bos">BOS(百度云存储)</option>
<option {{if eq .StoreType "cs-obs"}}selected{{end}} value="cs-obs">OBS(华为云存储)</option>
<option {{if eq .StoreType "cs-qiniu"}}selected{{end}} value="cs-qiniu">QINIU(七牛云存储)</option>
<option {{if eq .StoreType "cs-upyun"}}selected{{end}} value="cs-upyun">UpYun(又拍云存储)</option>
</select>
</div>


<div class="col-xs-4" style="padding-left: 0px;">
<div class="form-group">
Expand Down
3 changes: 3 additions & 0 deletions views/Admin/default/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
<li class="hide">
<a {{if .IsCrawl}}class="active-menu"{{end}} href="/admin/crawl"><i class="fa fa-gg"></i> 采集管理</a>
</li>
<li>
<a {{if .IsCloudStore}}class="active-menu"{{end}} href="/admin/cloud-store"><i class="fa fa-cloud-upload"></i> 云存储配置</a>
</li>
<li>
<a {{if .IsSys}}class="active-menu"{{end}} href="/admin/sys"><i class="fa fa-cogs"></i> 系统设置</a>
</li>
Expand Down

0 comments on commit 85174bf

Please sign in to comment.