新增控制nas上传oss的入口

This commit is contained in:
yutou 2021-06-10 18:28:38 +08:00
parent 5cbe9af85e
commit c65c7e1619
8 changed files with 125 additions and 23 deletions

101
web/html/body/nas/oss.html Normal file
View File

@ -0,0 +1,101 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>NAS</title>
<link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
<div id="header"></div>
<div class="layui-body" style="left: 200px;">
<div id="side"></div>
<table id="oss" lay-filter="myOssFilter"></table>
<div id="footer"></div>
</div>
</div>
<script type="text/html" id="topTools">
<div>
<a class="layui-btn layui-btn-xs" lay-event="addAddress">新增路径</a>
</div>
</script>
<script type="text/html" id="listTools">
<div class="layui-btn-container">
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</div>
</script>
<script src="/js/jquery-3.2.1.js"></script>
<script src="/layui/layui.js"></script>
<script>
layui.use(['table'], function () {
let table = layui.table;
console.log(2)
let ta=table.render({
elem: "#oss",
height: 312,
url: "/nas/depot/list.do",
page: false,
toolbar: '#topTools',
parseData: function (json) {
let item = [];
for (let i in json.data) {
item[i] = {'item': json.data[i]}
}
console.log(item)
return {
"code": 0,
"msg": json.msg,
"data": item
}
},
cols: [[
{field: 'item', title: '地址', sort: true},
{ field: "right", width: 200, toolbar: '#listTools' }
]],
done:function (){
table.on('tool(myOssFilter)', function (obj) {
console.log('del')
if (obj.event === 'del') {
layer.msg(obj.data.item)
$.post('/nas/depot/remove.do',{'path':obj.data.item},function (json) {
layer.msg(json.msg)
});
}
})
table.on('toolbar(myOssFilter)', function (obj) {
console.log('add')
if (obj.event === 'addAddress') {
layer.prompt({
formType: 2,
value: '/media/yutou/4t/public/',
title: '请输入地址',
}, function(value, index, elem){
$.post('/nas/depot/add.do',{'path':value},function (json) {
layer.msg(json.msg)
});
layer.close(index);
});
}
});
}
})
});
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
</script>
</body>
</html>

View File

@ -25,6 +25,9 @@
<dl class="layui-nav-child">
<dd><a href="/html/body/nas/animrss.html">番剧订阅器</a></dd>
</dl>
<dl class="layui-nav-child">
<dd><a href="/html/body/nas/oss.html">OSS备份设置</a></dd>
</dl>
</li>
</ul>
</div>

View File

@ -12,7 +12,7 @@
<div class="layui-layout layui-layout-admin">
<div id="header"></div>
<div class="layui-body" style="top: 100px; ">
<div class="layui-body" style="top: 100px;overflow:auto; ">
<!-- <div id="side"></div> -->
<blockquote class="layui-elem-quote"><span id="ip">密码管理器</span></blockquote>
@ -44,12 +44,7 @@
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code != 0) {
window.location.href = "/"
}
})
let tabid = -1;
layui.use(['layer', 'form', 'element', 'table'], function () {
var layer = layui.layer
@ -58,7 +53,7 @@
, element = layui.element;
$.get("/tools/password/type/get/list.do", function (data) {
let json = JSON.parse(data);
if (json.code == 0) {
if (json.code === 0) {
for (let index = 0; index < json.data.length; index++) {
const ret = json.data[index];
element.tabAdd('type', {
@ -71,7 +66,9 @@
}
});
form.render()
console.log(1)
element.on('tab(type)', function (data) {
tabid = $(this).attr('lay-id')
table.render({
elem: "#passwordlist" + tabid
@ -224,7 +221,6 @@
})
})
});
$.ajax({ cache: false })
</script>

View File

@ -10,7 +10,7 @@
</div>
<div>
<a href="http://beian.miit.gov.cn/">湘ICP备16005656号</a>
<script type="text/javascript" src="https://s4.cnzz.com/z_stat.php?id=1279421741&web_id=1279421741"></script>
<!--<script type="text/javascript" src="https://s4.cnzz.com/z_stat.php?id=1279421741&web_id=1279421741"></script>-->
</div>
</div>

View File

@ -2,8 +2,10 @@
<html lang="en">
<head>
<meta name="referrer" content="no-referrer"/>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
@ -42,6 +44,8 @@
</div>
</body>
<script src="/js/qrcode.min.js"></script>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script>
let loginStatus = false;
$.get("/login/check.do", function (data) {

View File

@ -16,7 +16,6 @@
</div>
<div id="footer"></div>
</div>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script>
@ -27,16 +26,15 @@
});
$.ajax({cache: false})
console.log(layui.v)
$('#header').load("/html/header.html");
$('#footer').load("../html/footer.html");
$('#footer').load("/html/footer.html");
</script>
<style>
#icon {
float: right;
}
.body {
bottom: 0;
.layui-body {
position: relative;
z-index: 0;
background-color: #F2F2F2;
}
</style>
</body>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long