OSS备份管理功能上线

This commit is contained in:
yutou 2021-06-18 15:44:40 +08:00
parent c65c7e1619
commit d6734600fe
3 changed files with 23 additions and 13 deletions

View File

@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication @SpringBootApplication
public class ToolsApplication { public class ToolsApplication {
public static final String version="1.1.2"; public static final String version="1.1.3";
public static void main(String[] args) { public static void main(String[] args) {
System.out.println("当前版本号:" + version); System.out.println("当前版本号:" + version);

View File

@ -14,9 +14,12 @@ public class NasDepotManager {
@ResponseBody @ResponseBody
@RequestMapping("/add.do") @RequestMapping("/add.do")
public JSONObject addNasPath(String path) { public JSONObject addNasPath(String path,String type) {
JSONObject json=new JSONObject(); JSONObject json=new JSONObject();
long size=RedisTools.list_add(DEPOT_NAME, path); JSONObject item=new JSONObject();
item.put("path",path);
item.put("type",type);
long size=RedisTools.list_add(DEPOT_NAME,item.toJSONString());
if(size==0){ if(size==0){
json.put("code",0); json.put("code",0);
json.put("msg","添加失败"); json.put("msg","添加失败");

View File

@ -38,16 +38,14 @@
console.log(2) console.log(2)
let ta=table.render({ let ta=table.render({
elem: "#oss", elem: "#oss",
height: 312,
url: "/nas/depot/list.do", url: "/nas/depot/list.do",
page: false, page: false,
toolbar: '#topTools', toolbar: '#topTools',
parseData: function (json) { parseData: function (json) {
let item = []; let item = [];
for (let i in json.data) { for (let i in json.data) {
item[i] = {'item': json.data[i]} item[i] =JSON.parse(json.data[i])
} }
console.log(item)
return { return {
"code": 0, "code": 0,
"msg": json.msg, "msg": json.msg,
@ -55,15 +53,16 @@
} }
}, },
cols: [[ cols: [[
{field: 'item', title: '地址', sort: true}, {field: 'path', title: '地址', width: 400,sort: true},
{field: 'type', title: '类型',width: 150, sort: true},
{ field: "right", width: 200, toolbar: '#listTools' } { field: "right", width: 200, toolbar: '#listTools' }
]], ]],
done:function (){ done:function (){
table.on('tool(myOssFilter)', function (obj) { table.on('tool(myOssFilter)', function (obj) {
console.log('del') console.log(obj.data)
if (obj.event === 'del') { if (obj.event === 'del') {
layer.msg(obj.data.item) layer.msg(obj.data.item)
$.post('/nas/depot/remove.do',{'path':obj.data.item},function (json) { $.post('/nas/depot/remove.do',{'path':JSON.stringify(obj.data)},function (json) {
layer.msg(json.msg) layer.msg(json.msg)
}); });
} }
@ -75,10 +74,18 @@
formType: 2, formType: 2,
value: '/media/yutou/4t/public/', value: '/media/yutou/4t/public/',
title: '请输入地址', title: '请输入地址',
}, function(value, index, elem){ }, function(path, index, elem){
$.post('/nas/depot/add.do',{'path':value},function (json) { layer.prompt({
formType: 2,
value: 'depot/photo/music',
title: '请选择类型',
},function (type,index,elem) {
$.post('/nas/depot/add.do',{'path':path,'type':type},function (json) {
layer.msg(json.msg) layer.msg(json.msg)
}); });
layer.close(index);
})
layer.close(index); layer.close(index);
}); });
} }