fix:服务器备份、数据库恢复验证概况、指标预测分析功能迁移
Showing
10 changed files
with
700 additions
and
6 deletions
1 | +//备份失败列表 | ||
2 | +layui.define(['table', 'form', 'admin', 'layer', 'common', 'sessions', 'soulTable'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var table = layui.table; | ||
6 | + var common = layui.common; | ||
7 | + var admin = layui.admin; | ||
8 | + var session = layui.sessions | ||
9 | + //对外暴露的接口 | ||
10 | + exports("backDingjiaList", function (d) { | ||
11 | + var accessToken = localStorage.getItem("accessToken"); | ||
12 | + var busId = d.busId === null ? '' : d.busId; | ||
13 | + var flag = d.flag === null ? '' : d.flag; | ||
14 | + createFailTable(); | ||
15 | + $("#dingjia-detail-export-excel").on('click', function () { | ||
16 | + var href = common.domainName + "/api-web/backupview/exportDingjiaBackDetails?accessToken=" + accessToken + "&busId=" + busId + "&flag=" + flag; | ||
17 | + window.open(href) | ||
18 | + }) | ||
19 | + | ||
20 | + //渲染附件表格 | ||
21 | + function createFailTable() { | ||
22 | + var loading = layer.load(2) | ||
23 | + var url = common.domainName + '/api-web/backupview/dingjiaBackDetails' | ||
24 | + $.ajax({ | ||
25 | + url: url, | ||
26 | + type: 'get', | ||
27 | + data: {accessToken: accessToken, busId: busId, flag: flag}, | ||
28 | + success: function (res) { | ||
29 | + layer.close(loading); | ||
30 | + var data = res.data; | ||
31 | + $("#backDingjiaListTable").find("tbody").empty(); | ||
32 | + $.each(data, function (i, e) { | ||
33 | + var tr = ''; | ||
34 | + var rowspan = e.jobs != null && e.jobs.length > 1 ? e.jobs.length : 1; | ||
35 | + var str = '<td rowspan="' + rowspan + '">' + (i + 1) + '</td><td rowspan="' + rowspan + '">' + e.resName + '</td><td rowspan="' + rowspan + '">' + e.ip + '</td>' | ||
36 | + tr += '<tr data-id="' + e.resId + '">' + str | ||
37 | + if (e.jobs != null && e.jobs.length > 0) { | ||
38 | + $.each(e.jobs, function (j, f) { | ||
39 | + var lastRunResult = f.lastRunResult === "" ? "未知" : f.lastRunResult; | ||
40 | + var totalSize = (Number(f.totalSize) / 1024 / 1024 / 1024).toFixed(2); | ||
41 | + var speed = (Number(f.speed) / 1024 / 1024).toFixed(2); | ||
42 | + tr += '<td class="jobid" data-jobid ="' + f.id + '">' + f.subtype + '</td>' + | ||
43 | + '<td>' + f.status + '</td>' + | ||
44 | + '<td>' + f.resName + '</td>' + | ||
45 | + '<td>' + totalSize + '</td>' + | ||
46 | + '<td>' + speed + '</td>' + | ||
47 | + '<td>' + f.lastRunTime + '</td>' + | ||
48 | + '<td>' + f.lastCompletedTime + '</td>' + | ||
49 | + '<td>' + lastRunResult + '</td>' + | ||
50 | + '<td>' + f.nextRunTime + '</td>' + | ||
51 | + '<td><input type="button" value="编辑" class="edit" style="background-color: #1E9FFF;"/></td>' + | ||
52 | + '</tr>' | ||
53 | + }); | ||
54 | + } else { | ||
55 | + tr += '<td></td>' + | ||
56 | + '<td></td>' + | ||
57 | + '<td></td>' + | ||
58 | + '<td></td>' + | ||
59 | + '<td></td>' + | ||
60 | + '<td></td>' + | ||
61 | + '<td></td>' + | ||
62 | + '<td></td>' + | ||
63 | + '<td></td>' + | ||
64 | + '<td><input type="button" value="移除资源" class="remove" style="background-color: #1E9FFF;"/></td>' + | ||
65 | + '</tr>' | ||
66 | + } | ||
67 | + | ||
68 | + $("#backDingjiaListTable").find("tbody").append(tr); | ||
69 | + }); | ||
70 | + $('#backDingjiaListTable :button.edit').click(function () { | ||
71 | + var toEdit = this.value == '编辑'; | ||
72 | + this.value = toEdit ? '确定' : '编辑'; | ||
73 | + var tdArr = [] | ||
74 | + var jobId = $(this).closest('tr').find('td.jobid').attr("data-jobid"); | ||
75 | + $(this).closest('tr').find('td').not('[rowspan]').not(':last').each(function (t, index) { | ||
76 | + if (toEdit) { | ||
77 | + this.innerHTML = '<input type="text" value="' + this.innerHTML.replace(/"/g, '"').replace(/<\/?.+?>/g, '').replace(/ /g, '') + '"/>'; | ||
78 | + } else { | ||
79 | + if (this.firstChild != null) { | ||
80 | + if (this.firstChild.value != undefined) { | ||
81 | + this.innerHTML = this.firstChild.value.replace(/</g, '<').replace(/>/g, '>'); | ||
82 | + } else { | ||
83 | + this.innerHTML = this.firstChild.data.replace(/</g, '<').replace(/>/g, '>'); | ||
84 | + } | ||
85 | + }else { | ||
86 | + this.innerHTML = this.value.replace(/</g, '<').replace(/>/g, '>'); | ||
87 | + } | ||
88 | + tdArr.push(this.innerHTML) | ||
89 | + } | ||
90 | + }); | ||
91 | + if (!toEdit) { | ||
92 | + var param = { | ||
93 | + 'id': jobId, | ||
94 | + 'subtype': tdArr[0], | ||
95 | + 'status': tdArr[1], | ||
96 | + 'resName': tdArr[2], | ||
97 | + 'totalSize': (Number(tdArr[3]) * 1024 * 1024 * 1024), | ||
98 | + 'speed': (Number(tdArr[4]) * 1024 * 1024), | ||
99 | + 'lastRunTime': tdArr[5], | ||
100 | + 'lastCompletedTime': tdArr[6], | ||
101 | + 'lastRunResult': tdArr[7], | ||
102 | + 'nextRunTime': tdArr[8] | ||
103 | + }; | ||
104 | + if (param.resName == '') { | ||
105 | + layer.msg('备份类型不能为空!', {icon: 1}); | ||
106 | + return; | ||
107 | + } else if (param.status == '') { | ||
108 | + layer.msg('状态不能为空!', {icon: 1}); | ||
109 | + return; | ||
110 | + } else if (param.lastRunTime == '') { | ||
111 | + layer.msg('上次备份时间不能为空!', {icon: 1}); | ||
112 | + return; | ||
113 | + } else { | ||
114 | + var url = common.domainName + '/api-web/backupview/dingjiaJobEdit?accessToken=' + accessToken | ||
115 | + layer.load(2); | ||
116 | + admin.req({ | ||
117 | + url: url, | ||
118 | + type: 'POST', | ||
119 | + contentType: 'application/json', | ||
120 | + data: JSON.stringify(param), | ||
121 | + success: function (response) { | ||
122 | + layer.closeAll('loading'); | ||
123 | + if (response.success) { | ||
124 | + layer.msg('修改成功!', {icon: 1}); | ||
125 | + createFailTable() | ||
126 | + return true; | ||
127 | + } else { | ||
128 | + layer.msg('修改失败!', {icon: 2}); | ||
129 | + } | ||
130 | + }, | ||
131 | + error: function () { | ||
132 | + layer.closeAll('loading'); | ||
133 | + } | ||
134 | + }); | ||
135 | + } | ||
136 | + | ||
137 | + } | ||
138 | + }); | ||
139 | + | ||
140 | + $('#backDingjiaListTable :button.remove').click(function () { | ||
141 | + var resId = $(this).closest('tr').attr("data-id"); | ||
142 | + layer.confirm('确定要将此资源移除备份嘛?', { | ||
143 | + btn: ['确定', '取消'] //按钮 | ||
144 | + }, function () { | ||
145 | + $.ajax({ | ||
146 | + url: common.domainName + `/api-web/backupview/removeDingjiaRes?accessToken=` + accessToken + `&busId=` + busId + `&resId=` + resId, | ||
147 | + type: "get", | ||
148 | + }).done(function (res) { | ||
149 | + layer.msg('移除成功', { | ||
150 | + offset: '15px' | ||
151 | + , icon: 1 | ||
152 | + , time: 1000 | ||
153 | + }); | ||
154 | + }).error(function (error) { | ||
155 | + console.log(error); | ||
156 | + }); | ||
157 | + }); | ||
158 | + }); | ||
159 | + } | ||
160 | + }) | ||
161 | + } | ||
162 | + | ||
163 | + }) | ||
164 | +}) |
@@ -138,6 +138,8 @@ layui.define(['common', 'admin', 'echarts', 'common', 'table', 'sessions', 'layd | @@ -138,6 +138,8 @@ layui.define(['common', 'admin', 'echarts', 'common', 'table', 'sessions', 'layd | ||
138 | tr += '<td><span style="color:#ffe40e">' + n + '</span></td>' | 138 | tr += '<td><span style="color:#ffe40e">' + n + '</span></td>' |
139 | } else if (/未备份/.test(n)) { | 139 | } else if (/未备份/.test(n)) { |
140 | tr += '<td><span style="color:magenta">' + n + '</span></td>' | 140 | tr += '<td><span style="color:magenta">' + n + '</span></td>' |
141 | + } else if (/已失效/.test(n)) { | ||
142 | + tr += '<td><span style="color:rgba(72,72,72,0.77)">' + n + '</span></td>' | ||
141 | } else { | 143 | } else { |
142 | tr += '<td>' + n + '</td>' | 144 | tr += '<td>' + n + '</td>' |
143 | } | 145 | } |
1 | +layui.define(['table', 'admin', 'form', 'laydate', 'common', 'sessions', 'view', 'element'], function (exports) { | ||
2 | + var $ = layui.$; | ||
3 | + var form = layui.form; | ||
4 | + var table = layui.table; | ||
5 | + var common = layui.common; | ||
6 | + //对外暴露的接口 | ||
7 | + exports('backupDingjia', function () { | ||
8 | + var sessions = layui.sessions; | ||
9 | + var accessToken = localStorage.getItem("accessToken"); | ||
10 | + loadConditionSelect(); | ||
11 | + reloadAllChange(); | ||
12 | + //发送状态 | ||
13 | + // 下拉框改变搜索 | ||
14 | + form.on('select(slt-dingjia-biz)', reloadAllChange); | ||
15 | + | ||
16 | + // 加载查询条件下拉框 | ||
17 | + function loadConditionSelect() { | ||
18 | + //绑定业务下拉选择数据 | ||
19 | + common.bizTypeSelect("slt-dingjia-biz", function () { | ||
20 | + form.render("select"); | ||
21 | + }); | ||
22 | + } | ||
23 | + $("#btn-dingjia-export-excel").on('click', function () { | ||
24 | + var href = common.domainName + "/api-web/backupview/exportDingjiaBacks?accessToken=" + accessToken + "&busId=" + $("#slt-dingjia-biz").val(); | ||
25 | + window.open(href) | ||
26 | + }) | ||
27 | + //表格数据 | ||
28 | + function renderBackupDingjiaListTable() { | ||
29 | + var loading = layer.load(2); | ||
30 | + var url = common.domainName + '/api-web/backupview/dingjiaBacks'; | ||
31 | + $.ajax({ | ||
32 | + url: url, | ||
33 | + type: 'get', | ||
34 | + data: {accessToken: accessToken, busId: $("#slt-dingjia-biz").val()}, | ||
35 | + success: function (res) { | ||
36 | + layer.close(loading); | ||
37 | + var data = res.data; | ||
38 | + $("#dingjia_table_id").find("tbody").empty(); | ||
39 | + $.each(data, function (i, e) { | ||
40 | + var tr = ''; | ||
41 | + var rowspan = e.children!=null && e.children.length > 1 ? e.children.length : 1; | ||
42 | + var str = '<td rowspan="' + rowspan + '">' + (i + 1) + '</td><td rowspan="' + rowspan + '">' + e.busTypeName + '</td>' | ||
43 | + tr += '<tr data-id="' + e.busId + '">' + str | ||
44 | + if (e.children!=null && e.children.length > 1){ | ||
45 | + $.each(e.children, function (j, f) { | ||
46 | + var resNumhtml = '0'; | ||
47 | + if (f.resNum>0) { | ||
48 | + var resNum = f.resNum | ||
49 | + resNumhtml = '<div><span data-busid="' + f.busId + '" data-flag="" class="layui-table-link view-backed-collectValue" style="color: #1E9FFF;font-size: 14px">'+resNum+'</span></div>'; | ||
50 | + } | ||
51 | + var backedhtml = '0'; | ||
52 | + if (f.backed>0) { | ||
53 | + var backed = f.backed | ||
54 | + backedhtml = '<div><span data-busid="' + f.busId + '" data-flag="backed" class="layui-table-link view-backed-collectValue" style="color: green;font-size: 14px">'+backed+'</span></div>'; | ||
55 | + } | ||
56 | + var nobackhtml = '0'; | ||
57 | + if (f.noback>0) { | ||
58 | + var noback = f.noback | ||
59 | + nobackhtml = '<div><span data-busid="' + f.busId + '" data-flag="noback" class="layui-table-link view-backed-collectValue" style="color: red;font-size: 14px">'+noback+'</span></div>'; | ||
60 | + } | ||
61 | + var totalSize = (Number(f.totalSize)/1024/1024/1024).toFixed(2); | ||
62 | + | ||
63 | + var phone = f.phone===null?"":f.phone | ||
64 | + tr += '<td >' + f.busTypeName + '</td>' + | ||
65 | + '<td>' + resNumhtml + '</td>' + | ||
66 | + '<td>' + backedhtml+ '</td>' + | ||
67 | + '<td>' + nobackhtml + '</td>' + | ||
68 | + '<td>' + totalSize + '</td>' + | ||
69 | + '<td>' + f.leader + '</td>' + | ||
70 | + '<td>' + phone + '</td>' + | ||
71 | + '<td>' + e.opUser + '</td>' + | ||
72 | + '<td>' + f.lastBackupTime + '</td>' + | ||
73 | + '</tr>' | ||
74 | + }); | ||
75 | + }else{ | ||
76 | + var resNumhtml = '0'; | ||
77 | + if (e.resNum>0) { | ||
78 | + var resNum = e.resNum | ||
79 | + resNumhtml = '<div><span data-busid="' + e.busId + '" data-flag="" class="layui-table-link view-backed-collectValue" style="color: #1E9FFF;font-size: 14px">'+resNum+'</span></div>'; | ||
80 | + } | ||
81 | + var backedhtml = '0'; | ||
82 | + if (e.backed>0) { | ||
83 | + var backed = e.backed | ||
84 | + backedhtml = '<div><span data-busid="' + e.busId + '" data-flag="backed" class="layui-table-link view-backed-collectValue" style="color: green;font-size: 14px">'+backed+'</span></div>'; | ||
85 | + } | ||
86 | + var nobackhtml = '0'; | ||
87 | + if (e.noback>0) { | ||
88 | + var noback = e.noback | ||
89 | + nobackhtml = '<div><span data-busid="' + e.busId + '" data-flag="noback" class="layui-table-link view-backed-collectValue" style="color: red;font-size: 14px">'+noback+'</span></div>'; | ||
90 | + } | ||
91 | + var totalSize = (Number(e.totalSize)/1024/1024/1024).toFixed(2); | ||
92 | + | ||
93 | + var phone = e.phone===null?"":e.phone | ||
94 | + tr += '<td>' + e.busTypeName + '</td>' + | ||
95 | + '<td>' + resNumhtml + '</td>' + | ||
96 | + '<td>' + backedhtml+ '</td>' + | ||
97 | + '<td>' + nobackhtml + '</td>' + | ||
98 | + '<td>' + totalSize + '</td>' + | ||
99 | + '<td>' + e.leader + '</td>' + | ||
100 | + '<td>' + phone + '</td>' + | ||
101 | + '<td>' + e.opUser + '</td>' + | ||
102 | + '<td>' + e.lastBackupTime + '</td>' + | ||
103 | + '</tr>' | ||
104 | + } | ||
105 | + $("#dingjia_table_id").find("tbody").append(tr); | ||
106 | + }) | ||
107 | + $('.view-backed-collectValue').on('click', function () { | ||
108 | + var busId = $(this).data("busid"); | ||
109 | + var flag = $(this).data("flag"); | ||
110 | + var title = '备份服务器列表' | ||
111 | + common.openWin('backup/backDingjiaList', title, { | ||
112 | + busId: busId, | ||
113 | + flag: flag | ||
114 | + }, ['确定', '取消']) | ||
115 | + }); | ||
116 | + | ||
117 | + } | ||
118 | + }) | ||
119 | + } | ||
120 | + | ||
121 | + // 图表,表格重新加载 | ||
122 | + function reloadAllChange() { | ||
123 | + renderBackupDingjiaListTable(); | ||
124 | + loadConditionSelect(); | ||
125 | + } | ||
126 | + }); | ||
127 | + | ||
128 | +}); |
1 | +/** 应急演练 */ | ||
2 | +layui.define(['table', 'form', 'sessions', 'admin', 'common', 'echarts', 'laydate', 'element'], function (exports) { | ||
3 | + var $ = layui.$; | ||
4 | + var form = layui.form; | ||
5 | + var common = layui.common; | ||
6 | + exports('recoverycount', function () { | ||
7 | + var sessions = layui.sessions; | ||
8 | + var accessToken = localStorage.getItem("accessToken"); | ||
9 | + var createTime ="year"; | ||
10 | + var period = new Date().getFullYear().toString(); | ||
11 | + form.render(); | ||
12 | + renderrecoverycountListTable(); | ||
13 | + loadConditionSelect(); | ||
14 | + | ||
15 | + $('button[data-period="year"]').click(); | ||
16 | + | ||
17 | + // 日期方式选择 | ||
18 | + $('#btns-recoverycount-time button').on("click",function () { | ||
19 | + $.each($("button.date"), function (i, e) { | ||
20 | + var $dom = $(e); | ||
21 | + if ($dom.hasClass("active")) { | ||
22 | + $dom.removeClass("active") | ||
23 | + } | ||
24 | + }) | ||
25 | + $("#btns-recoverycount-time button").removeClass("active"); | ||
26 | + $(this).addClass("active"); | ||
27 | + createTime = ($(this).data("period")) | ||
28 | + if(createTime=='lastYear'){ | ||
29 | + period = (new Date().getFullYear()-1).toString(); | ||
30 | + }else { | ||
31 | + period = new Date().getFullYear().toString(); | ||
32 | + } | ||
33 | + reloadAllChange(); | ||
34 | + }); | ||
35 | + | ||
36 | + // 回车搜索 | ||
37 | + $('[lay-filter="form-recoverycount-condition"] input').keydown(function (e) { | ||
38 | + if (e.keyCode === 13) { | ||
39 | + reloadAllChange(); | ||
40 | + } | ||
41 | + }); | ||
42 | + | ||
43 | + // 下拉框改变搜索 | ||
44 | + form.on('select(slt-recoverycount-biz)', reloadAllChange); | ||
45 | + | ||
46 | + function renderStyle(number){ | ||
47 | + if(number>0){ | ||
48 | + return '<div><span style="color: #0BAC33" >'+number+'</span></div>'; | ||
49 | + }else { | ||
50 | + return '<div><span style="color: #aa2222">'+number+'</span></div>'; | ||
51 | + } | ||
52 | + } | ||
53 | + | ||
54 | + function renderIsDiscovery(isRecovery) { | ||
55 | + if(isRecovery=="1"){ | ||
56 | + return '<i class="layui-icon layui-icon-ok" style="font-size: 30px; color: #1dff1c;"></i>'; | ||
57 | + }else { | ||
58 | + return '<i class="layui-icon layui-icon-close" style="font-size: 30px; color: #ff252c;"></i>'; | ||
59 | + } | ||
60 | + } | ||
61 | + | ||
62 | + // 加载设备出入表格 | ||
63 | + function renderrecoverycountListTable() { | ||
64 | + var conditions = form.val('form-recoverycount-condition'); | ||
65 | + Object.assign(conditions, { | ||
66 | + access_token: accessToken, | ||
67 | + period: period, | ||
68 | + busId: $("#slt-recoverycount-biz").val() | ||
69 | + }); | ||
70 | + var loading = layer.load(2) | ||
71 | + var url = common.domainName + '/api-web/recoveryverify/recoveryCount' | ||
72 | + $.ajax({ | ||
73 | + url: url, | ||
74 | + type: 'get', | ||
75 | + data: conditions, | ||
76 | + success: function (res) { | ||
77 | + layer.close(loading); | ||
78 | + var data = res.data; | ||
79 | + $("#recoverycount-table").find("tbody").empty(); | ||
80 | + $.each(data, function (i, e) { | ||
81 | + var tr = ''; | ||
82 | + var rowspan =e.children!=null && e.children.length > 1 ? e.children.length : 1; | ||
83 | + var str = '<td rowspan="' + rowspan + '">' + (i + 1) + '</td><td rowspan="' + rowspan + '">' + e.busTypeName + '</td><td rowspan="' + rowspan + '">'+ e.evaluationLevel + '</td>' | ||
84 | + tr += '<tr data-id="' + e.busId + '">' + str | ||
85 | + if (e.children!=null && e.children.length > 0){ | ||
86 | + $.each(e.children, function (j, f) { | ||
87 | + tr += '<td >' + f.resName + '</td>' + | ||
88 | + '<td>' + f.ip + '</td>' + | ||
89 | + '<td>' + renderIsDiscovery(f.isRecovery)+ '</td>' + | ||
90 | + '<td>' + renderStyle(f.dece)+ '</td>' + | ||
91 | + '<td>' + renderStyle(f.nov) + '</td>' + | ||
92 | + '<td>' + renderStyle(f.oct) + '</td>' + | ||
93 | + '<td>' + renderStyle(f.sep) + '</td>' + | ||
94 | + '<td>' + renderStyle(f.aug) + '</td>' + | ||
95 | + '<td>' + renderStyle(f.jul) + '</td>' + | ||
96 | + '<td>' + renderStyle(f.jun) + '</td>' + | ||
97 | + '<td>' + renderStyle(f.may) + '</td>' + | ||
98 | + '<td>' + renderStyle(f.apr) + '</td>' + | ||
99 | + '<td>' + renderStyle(f.mar) + '</td>' + | ||
100 | + '<td>' + renderStyle(f.feb) + '</td>' + | ||
101 | + '<td>' + renderStyle(f.jan) + '</td>' + | ||
102 | + '</tr>' | ||
103 | + }); | ||
104 | + }else{ | ||
105 | + tr += '<td ></td>' + | ||
106 | + '<td></td>' + | ||
107 | + '<td></td>' + | ||
108 | + '<td></td>' + | ||
109 | + '<td></td>' + | ||
110 | + '<td></td>' + | ||
111 | + '<td></td>' + | ||
112 | + '<td></td>' + | ||
113 | + '<td></td>' + | ||
114 | + '<td></td>' + | ||
115 | + '<td></td>' + | ||
116 | + '<td></td>' + | ||
117 | + '<td></td>' + | ||
118 | + '<td></td>' + | ||
119 | + '</tr>' | ||
120 | + } | ||
121 | + $("#recoverycount-table").find("tbody").append(tr); | ||
122 | + }) | ||
123 | + | ||
124 | + | ||
125 | + } | ||
126 | + }) | ||
127 | + } | ||
128 | + | ||
129 | + | ||
130 | + // 加载查询条件下拉框 | ||
131 | + function loadConditionSelect() { | ||
132 | + | ||
133 | + //绑定业务下拉选择数据 | ||
134 | + common.bizTypeSelect("slt-recoverycount-biz", function () { | ||
135 | + form.render("select"); | ||
136 | + }); | ||
137 | + | ||
138 | + } | ||
139 | + | ||
140 | + $("#recoverycount-export-excel").on('click', function () { | ||
141 | + | ||
142 | + let href = common.domainName + '/api-web/recoverycount/export?access_token=' + accessToken + "&createtime=" + createTime + '&dateLimit=' + dateLimit + '&limit=1000'; | ||
143 | + | ||
144 | + window.open(href) | ||
145 | + }) | ||
146 | + | ||
147 | + | ||
148 | + // 图表,表格重新加载 | ||
149 | + function reloadAllChange() { | ||
150 | + renderrecoverycountListTable(); | ||
151 | + } | ||
152 | + }); | ||
153 | +}); |
@@ -23,7 +23,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi | @@ -23,7 +23,7 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi | ||
23 | var attachmentIds = [] | 23 | var attachmentIds = [] |
24 | var id = data.id | 24 | var id = data.id |
25 | var viewType = data && data.viewType ? data.viewType : ''; | 25 | var viewType = data && data.viewType ? data.viewType : ''; |
26 | - | 26 | + var busId=''; |
27 | //渲染表单 | 27 | //渲染表单 |
28 | form.render(null, 'add-recoveryverify-form') | 28 | form.render(null, 'add-recoveryverify-form') |
29 | init() | 29 | init() |
@@ -189,7 +189,24 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi | @@ -189,7 +189,24 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi | ||
189 | initViewMode(); | 189 | initViewMode(); |
190 | } | 190 | } |
191 | } | 191 | } |
192 | - | 192 | + form.on('select(slt-biz-add)', function (data) { |
193 | + busId = data.value; | ||
194 | + //初始化业务下数据库资源 | ||
195 | + admin.req({ | ||
196 | + url: domainName + '/api-web/recoveryverify/loadresListforBiz?busId='+busId +'&resType=DATABASE_ORACLE' | ||
197 | + }).done(function (response) { | ||
198 | + var options = "<option value=''>=选择数据库=</option>"; | ||
199 | + $.each(response.data, function (i, v) { | ||
200 | + options += "<option value='" + v.resId + "'>" + v.resName + "</option>" | ||
201 | + }); | ||
202 | + $('#slt-resId').html(options); | ||
203 | + form.render(); | ||
204 | + }); | ||
205 | + }); | ||
206 | + form.on('select(slt-resId)', function (data) { | ||
207 | + var databaseName =$("select#slt-resId").find("option:selected").text(); | ||
208 | + $("input#databaseName").val(databaseName); | ||
209 | + }) | ||
193 | // 初始化下拉框 | 210 | // 初始化下拉框 |
194 | function loadSelect() { | 211 | function loadSelect() { |
195 | admin.req({ | 212 | admin.req({ |
@@ -541,7 +558,20 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi | @@ -541,7 +558,20 @@ layui.define(['table', 'form', 'admin', 'layer', 'common', 'commonDetail','sessi | ||
541 | } | 558 | } |
542 | }); | 559 | }); |
543 | } | 560 | } |
544 | - form.val('add-recoveryverify-form', res.object); | 561 | + busId = res.object.bizId; |
562 | + //初始化业务下数据库资源 | ||
563 | + admin.req({ | ||
564 | + url: domainName + '/api-web/recoveryverify/loadresListforBiz?busId='+busId +'&resType=DATABASE_ORACLE' | ||
565 | + }).done(function (response) { | ||
566 | + var options = "<option value=''>=选择数据库=</option>"; | ||
567 | + $.each(response.data, function (i, v) { | ||
568 | + options += "<option value='" + v.resId + "'>" + v.resName + "</option>" | ||
569 | + }); | ||
570 | + $('#slt-resId').html(options); | ||
571 | + form.render(); | ||
572 | + form.val('add-recoveryverify-form', res.object); | ||
573 | + }); | ||
574 | + | ||
545 | if (res.object.attachmentList) { | 575 | if (res.object.attachmentList) { |
546 | $.each(res.object.attachmentList, function (i, v) { | 576 | $.each(res.object.attachmentList, function (i, v) { |
547 | writeTagsInfo(v.id, v.originalName) | 577 | writeTagsInfo(v.id, v.originalName) |
1 | +<article class="page-container"> | ||
2 | + <div class="page-panel"> | ||
3 | + <div class="main"> | ||
4 | + <div class="layui-card"> | ||
5 | + <div class="layui-card-header"> | ||
6 | + </div> | ||
7 | + <div class="layui-card-body" > | ||
8 | + <div style="display: block;height: 35px"> | ||
9 | + <button class="layui-btn layui-btn-sm layui-btn-normal active" | ||
10 | + id="dingjia-detail-export-excel" style="float: right"> | ||
11 | + <i class="layui-icon"></i>导出到Excel | ||
12 | + </button> | ||
13 | + </div> | ||
14 | + <table id="backDingjiaListTable" class="layui-table" lay-filter="backDingjiaListTable"> | ||
15 | + <thead> | ||
16 | + <tr> | ||
17 | + <th>序号</th> | ||
18 | + <th>资源名称</th> | ||
19 | + <th>IP地址</th> | ||
20 | + <th>备份等级</th> | ||
21 | + <th>备份状态</th> | ||
22 | + <th>备份类型</th> | ||
23 | + <th>数据量(GB)</th> | ||
24 | + <th>速率(MB/s)</th> | ||
25 | + <th>上次备份时间</th> | ||
26 | + <th>上次完成时间</th> | ||
27 | + <th>上次执行结果</th> | ||
28 | + <th>下次执行时间</th> | ||
29 | + <th>操作</th> | ||
30 | + </tr> | ||
31 | + </thead> | ||
32 | + <tbody> | ||
33 | + </tbody> | ||
34 | + </table> | ||
35 | + </div> | ||
36 | + </div> | ||
37 | + </div> | ||
38 | + </div> | ||
39 | +</article> | ||
40 | + | ||
41 | +<script> | ||
42 | + layui.use('backDingjiaList', function (fn) { | ||
43 | + fn({{d}}) | ||
44 | + }); | ||
45 | +</script> |
1 | +<style type="text/css"> | ||
2 | + td input{ | ||
3 | + width: 70px; | ||
4 | + border: 1px; | ||
5 | + } | ||
6 | + | ||
7 | + element.style { | ||
8 | + } | ||
9 | + .layui-table td, .layui-table th { | ||
10 | + position: relative; | ||
11 | + padding: 9px 15px; | ||
12 | + min-height: 20px; | ||
13 | + line-height: 20px; | ||
14 | + font-size: 14px; | ||
15 | + } | ||
16 | + .layui-table td, .layui-table th, .layui-table-col-set, .layui-table-fixed-r, .layui-table-grid-down, .layui-table-header, .layui-table-page, .layui-table-tips-main, .layui-table-tool, .layui-table-total, .layui-table-view, .layui-table[lay-skin=line], .layui-table[lay-skin=row] { | ||
17 | + border-width: 1px; | ||
18 | + border-style: solid; | ||
19 | + border-color: #e6e6e6; | ||
20 | + } | ||
21 | + .layui-table th{ | ||
22 | + min-width: 35px; | ||
23 | + text-align: center; | ||
24 | + background-color: cornflowerblue; | ||
25 | + } | ||
26 | +</style> | ||
27 | +<title>服务器备份概况</title> | ||
28 | +<article class="page-container template"> | ||
29 | + <div class="page-panel"> | ||
30 | + <div class="main" style="background-color: #fff"> | ||
31 | + <div class="layui-card-header"> | ||
32 | + <div class="layui-status"> | ||
33 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
34 | + lay-filter="dingjia-index-form"> | ||
35 | + <div class="layui-form-item"> | ||
36 | + <div class="layui-inline"> | ||
37 | + <div class="layui-input-inline"> | ||
38 | + <select name="busId" id="slt-dingjia-biz" | ||
39 | + lay-filter="slt-dingjia-biz" lay-search> | ||
40 | + <option value="">=业务系统=</option> | ||
41 | + </select> | ||
42 | + </div> | ||
43 | + </div> | ||
44 | + </div> | ||
45 | + </form> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + <div class="layui-card" style="height: 100%"> | ||
49 | + <div class="layui-card-body"> | ||
50 | + <div class="layui-tab layui-tab-card" lay-filter="insp-tab"> | ||
51 | + <ul class="layui-tab-title"> | ||
52 | + <button class="layui-btn layui-btn-sm layui-btn-normal tab-button" | ||
53 | + id="btn-dingjia-export-excel"> | ||
54 | + <i class="layui-icon"></i>导出到Excel | ||
55 | + </button> | ||
56 | + </ul> | ||
57 | + <div class="layui-tab-content"> | ||
58 | + <div class="layui-tab-item layui-show"> | ||
59 | + <div id="dingjia-head-info" class="statistics-top-head"></div> | ||
60 | + <table id="dingjia_table_id" class="layui-table"> | ||
61 | + <thead> | ||
62 | + <tr> | ||
63 | + <th>序号</th> | ||
64 | + <th>系统名称</th> | ||
65 | + <th>子系统名称</th> | ||
66 | + <th>资源数</th> | ||
67 | + <th>已备份</th> | ||
68 | + <th>未备份</th> | ||
69 | + <th>数据量(GB)</th> | ||
70 | + <th>甲方负责人</th> | ||
71 | + <th>联系方式</th> | ||
72 | + <th>乙方负责人</th> | ||
73 | + <th>上次备份时间</th> | ||
74 | + </tr> | ||
75 | + </thead> | ||
76 | + <tbody> | ||
77 | + </tbody> | ||
78 | + </table> | ||
79 | + </div> | ||
80 | + </div> | ||
81 | + </div> | ||
82 | + </div> | ||
83 | + </div> | ||
84 | + </div> | ||
85 | + </div> | ||
86 | +</article> | ||
87 | + | ||
88 | +<script> | ||
89 | + layui.use('backupDingjia', function (fn) { | ||
90 | + fn(); | ||
91 | + }); | ||
92 | +</script> |
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | background-color: cornflowerblue; | 24 | background-color: cornflowerblue; |
25 | } | 25 | } |
26 | </style> | 26 | </style> |
27 | -<title>资源备份概况</title> | 27 | +<title>数据库备份概况</title> |
28 | <article class="page-container template"> | 28 | <article class="page-container template"> |
29 | <div class="page-panel"> | 29 | <div class="page-panel"> |
30 | <div class="main" style="background-color: #fff"> | 30 | <div class="main" style="background-color: #fff"> |
@@ -52,8 +52,12 @@ | @@ -52,8 +52,12 @@ | ||
52 | <div class="layui-card-body"> | 52 | <div class="layui-card-body"> |
53 | <div class="layui-tab layui-tab-card" lay-filter="insp-tab"> | 53 | <div class="layui-tab layui-tab-card" lay-filter="insp-tab"> |
54 | <ul class="layui-tab-title"> | 54 | <ul class="layui-tab-title"> |
55 | +<!-- | ||
55 | <li class="layui-this">数据库备份</li> | 56 | <li class="layui-this">数据库备份</li> |
57 | +--> | ||
58 | +<!-- | ||
56 | <li>虚拟机备份</li> | 59 | <li>虚拟机备份</li> |
60 | +--> | ||
57 | <button class="layui-btn layui-btn-sm layui-btn-normal tab-button" | 61 | <button class="layui-btn layui-btn-sm layui-btn-normal tab-button" |
58 | id="btn-inspStatistics-export-excel"> | 62 | id="btn-inspStatistics-export-excel"> |
59 | <i class="layui-icon"></i>导出到Excel | 63 | <i class="layui-icon"></i>导出到Excel |
@@ -103,4 +107,4 @@ | @@ -103,4 +107,4 @@ | ||
103 | layui.use('backupmain', function (fn) { | 107 | layui.use('backupmain', function (fn) { |
104 | fn(); | 108 | fn(); |
105 | }); | 109 | }); |
106 | -</script> | 110 | +</script> |
@@ -20,7 +20,10 @@ | @@ -20,7 +20,10 @@ | ||
20 | <label class="layui-form-label"><span | 20 | <label class="layui-form-label"><span |
21 | style="color: red;font-size: 16px">*</span>数据库名称</label> | 21 | style="color: red;font-size: 16px">*</span>数据库名称</label> |
22 | <div class="layui-input-inline"> | 22 | <div class="layui-input-inline"> |
23 | - <input type="text" class="layui-input" name="databaseName" id="databaseName" lay-verify="required"> | 23 | + <input type="text" class="layui-input" name="databaseName" id="databaseName" style="display: none"> |
24 | + <select name="resId" id="slt-resId" lay-verify="required" lay-filter ="slt-resId"> | ||
25 | + <option value="">=选择数据库=</option> | ||
26 | + </select> | ||
24 | </div> | 27 | </div> |
25 | </div> | 28 | </div> |
26 | <div class="layui-inline inline-onethird"> | 29 | <div class="layui-inline inline-onethird"> |
1 | +<title>数据库恢复验证概况</title> | ||
2 | +<article class="page-container"> | ||
3 | + <div class="page-panel "> | ||
4 | + <div class="main"> | ||
5 | + <div class="layui-card"> | ||
6 | + | ||
7 | + <div class="layui-card-body" style="margin-top: 10px;"> | ||
8 | + <div class="layui-btn-group time-group" id="btns-recoverycount-time" style="float: right;"> | ||
9 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs date" | ||
10 | + data-period="lastYear">去年 | ||
11 | + </button> | ||
12 | + <button type="button" class="layui-btn layui-btn-primary layui-btn-xs active date" | ||
13 | + data-period="year">今年 | ||
14 | + </button> | ||
15 | + </div> | ||
16 | + <div style="display: flex"> | ||
17 | + <form class="layui-form layui-card-header" onsubmit="return false" | ||
18 | + lay-filter="form-recoverycount-condition"> | ||
19 | + <div class="layui-form-item"> | ||
20 | + <div class="layui-inline"> | ||
21 | + <div class="layui-input-inline"> | ||
22 | + <select name="busId" id="slt-recoverycount-biz" | ||
23 | + lay-filter="slt-recoverycount-biz" lay-search> | ||
24 | + <option value="">=业务系统=</option> | ||
25 | + </select> | ||
26 | + </div> | ||
27 | + <!-- <button class="layui-btn layui-btn-sm layui-btn-normal active" | ||
28 | + id="recoverycount-export-excel" style="float: right;"> | ||
29 | + <i class="layui-icon"></i>导出到Excel | ||
30 | + </button>--> | ||
31 | + </div> | ||
32 | + | ||
33 | + </div> | ||
34 | + | ||
35 | + </form> | ||
36 | + | ||
37 | + </div> | ||
38 | + <table id="recoverycount-table" class="layui-table" lay-filter="recoverycount-table"> | ||
39 | + <thead> | ||
40 | + <tr> | ||
41 | + <th>序号</th> | ||
42 | + <th>业务名称</th> | ||
43 | + <th>等保等级</th> | ||
44 | + <th>数据库名称</th> | ||
45 | + <th>IP地址</th> | ||
46 | + <th>是否恢复过</th> | ||
47 | + <th>12月</th> | ||
48 | + <th>11月</th> | ||
49 | + <th>10月</th> | ||
50 | + <th>9月</th> | ||
51 | + <th>8月</th> | ||
52 | + <th>7月</th> | ||
53 | + <th>6月</th> | ||
54 | + <th>5月</th> | ||
55 | + <th>4月</th> | ||
56 | + <th>3月</th> | ||
57 | + <th>2月</th> | ||
58 | + <th>1月</th> | ||
59 | + </tr> | ||
60 | + </thead> | ||
61 | + <tbody> | ||
62 | + </tbody> | ||
63 | + </table> | ||
64 | + </div> | ||
65 | + </div> | ||
66 | + </div> | ||
67 | + </div> | ||
68 | +</article> | ||
69 | +<script> | ||
70 | + layui.use('recoverycount', function (fn) { | ||
71 | + fn(); | ||
72 | + }); | ||
73 | +</script> |
-
Please register or login to post a comment