File tree Expand file tree Collapse file tree 7 files changed +17
-14
lines changed Expand file tree Collapse file tree 7 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ require (
2222 github.com/klauspost/cpuid v1.2.1 // indirect
2323 github.com/lib/pq v1.1.1
2424 github.com/ouqiang/goutil v1.1.1
25- github.com/rakyll/statik v0.1.6
25+ github.com/rakyll/statik v0.1.7
2626 github.com/sirupsen/logrus v1.4.2
2727 github.com/urfave/cli v1.20.0
2828 golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5 // indirect
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
8383github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
8484github.com/rakyll/statik v0.1.6 h1:uICcfUXpgqtw2VopbIncslhAmE5hwc4g20TEyEENBNs =
8585github.com/rakyll/statik v0.1.6 /go.mod h1:OEi9wJV/fMUAGx1eNjq75DKDsJVuEv1U0oYdX6GX8Zs =
86+ github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ =
87+ github.com/rakyll/statik v0.1.7 /go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc =
8688github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww =
8789github.com/satori/go.uuid v1.2.0 /go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0 =
8890github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24 h1:pntxY8Ary0t43dCZ5dqY4YTJCObLY1kIXl0uzMv+7DE =
Original file line number Diff line number Diff line change @@ -54,9 +54,7 @@ func Register(m *macaron.Macaron) {
5454 ctx .WriteHeader (http .StatusInternalServerError )
5555 return
5656 }
57-
5857 io .Copy (ctx .Resp , file )
59-
6058 })
6159 // 系统安装
6260 m .Group ("/install" , func () {
@@ -232,7 +230,6 @@ func userAuth(ctx *macaron.Context) {
232230 jsonResp := utils.JsonResponse {}
233231 data := jsonResp .Failure (utils .AuthError , "认证失败" )
234232 ctx .Write ([]byte (data ))
235-
236233}
237234
238235// URL权限验证
Original file line number Diff line number Diff line change @@ -32,13 +32,16 @@ func Index(ctx *macaron.Context) string {
3232
3333// 清空日志
3434func Clear (ctx * macaron.Context ) string {
35+ taskId := ctx .QueryInt ("task_id" )
3536 taskLogModel := new (models.TaskLog )
37+ if taskId > 0 {
38+ taskLogModel .TaskId = taskId
39+ }
3640 _ , err := taskLogModel .Clear ()
3741 json := utils.JsonResponse {}
3842 if err != nil {
3943 return json .CommonFailure (utils .FailureContent )
4044 }
41-
4245 return json .Success (utils .SuccessContent , nil )
4346}
4447
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ export default {
55 httpClient . get ( '/task/log' , query , callback )
66 } ,
77
8- clear ( callback ) {
9- httpClient . post ( '/task/log/clear' , { } , callback )
8+ clear ( taskId , callback ) {
9+ httpClient . post ( '/task/log/clear' , { task_id : taskId } , callback )
1010 } ,
1111
1212 stop ( id , taskId , callback ) {
Original file line number Diff line number Diff line change 3333 </el-form-item >
3434 </el-form >
3535 <el-row type =" flex" justify =" end" >
36- <el-col :span =" 3 " >
37- <el-button type =" danger" v-if =" this.$store.getters.user.isAdmin" @click =" clearLog" >清空日志 </el-button >
36+ <el-col :span =" 4 " >
37+ <el-button type =" danger" v-if =" this.$store.getters.user.isAdmin" @click =" clearLog" >清空{{ searchParams.task_id == '' ? "所有": "当前"}}任务日志 </el-button >
3838 </el-col >
3939 <el-col :span =" 2" >
4040 <el-button type =" info" @click =" refresh" >刷新</el-button >
@@ -237,7 +237,7 @@ export default {
237237 },
238238 clearLog () {
239239 this .$appConfirm (() => {
240- taskLogService .clear (() => {
240+ taskLogService .clear (this . searchParams . task_id , () => {
241241 this .searchParams .page = 1
242242 this .search ()
243243 })
You can’t perform that action at this time.
0 commit comments