-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathindex.html
282 lines (258 loc) · 10.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<style>
.bt-w-con, .plugin_body {
height: 100%;
}
.show {
display: block;
}
.output {
white-space: pre;
background-color: #333;
color: #fff;
height: 100%;
width: 100%;
padding: 1rem;
overflow: auto;
}
.plugin_body {
overflow: auto;
}
.plugin_body > div {
display: none;
height: 99%;
width: 100%;
}
#p-config-content {
height: 85%;
}
#p-log-content {
height: 90%;
}
.head {
display: flex;
justify-content: flex-start;
margin-top: 0;
}
.head .place-input {
background-color: #f3f3f3;
border: 1px solid #ccc;
}
.head .place-input {
display: flex;
align-items: center;
justify-content: flex-start;
padding-right: 18px;
cursor: pointer;
width: 60%;
overflow: auto;
}
.head .place-input li {
background: url(/static/img/ico/ico-ltr.png) no-repeat right center;
flex-shrink: 0;
padding: 1rem;
padding-right: 2rem;
}
.list-list td span {
line-height: 30px;
}
#p-index .status {
padding: 2rem 1rem;
font-size: 1.5rem;
}
.actions {
margin-bottom: 2rem;
}
.status-info {
display: flex;
}
</style>
<div class="bt-form">
<div class="bt-w-main">
<!--菜单部分-->
<div class="bt-w-menu">
<p class="bgw" onclick="alidrive.get_index()">概览</p>
<p onclick="alidrive.get_config()">配置</p>
<p onclick="alidrive.get_tasks()">任务列表</p>
<p onclick="alidrive_view_files.index()">查看文件</p>
<p onclick="alidrive.get_logs()">实时日志</p>
</div>
<!--内容部分-->
<div class="bt-w-con pd15">
<div class="plugin_body">
<div id="p-index" class="divtable">
<div class="status-info">
<div class="plugin-status">
<p class="status ok">
任务池状态:<span>运行</span>
<span style="color: #20a53a; margin-left: 3px;"
class="glyphicon glyphicon glyphicon-play"></span>
</p>
<p class="status no">
任务池状态:<span>停止</span>
<span style="color: red; margin-left: 3px;"
class="glyphicon glyphicon-pause"></span></p>
</div>
<div class="core-status">
<p class="status ok">
Core 状态:<span>运行</span>
<span style="color: #20a53a; margin-left: 3px;"
class="glyphicon glyphicon glyphicon-play"></span>
</p>
<p class="status no">
Core 状态:<span>停止</span>
<span style="color: red; margin-left: 3px;"
class="glyphicon glyphicon-pause"></span></p>
</div>
</div>
<div class="actions">
<button style="display: none" onclick="alidrive_server.start()"
class="status-change btn btn-default btn-sm">
启动
</button>
<button onclick="alidrive_server.stop()" class="status-change btn btn-default btn-sm">
停止
</button>
<button onclick="alidrive_server.restart()" class="btn btn-default btn-sm">
重启
</button>
<button onclick="alidrive.check_update()" class="btn btn-default btn-sm">
检查更新
</button>
<button onclick="alidrive.update()" class="btn btn-default btn-sm">
立即更新
</button>
</div>
<table class="table table-hover table-bordered"
style="background-color:#fafafa">
<tbody id="p-index-content">
</tbody>
</table>
<ul class="help-info-text c7">
<li>任务池为监控上传任务的后台应用</li>
<li>Core 状态在未上传时为停止状态,正在上传时才为运行状态</li>
</ul>
</div>
<div id="p-config">
<div contentEditable="true" class="output" id="p-config-content"></div>
<button onclick="alidrive.save_config()" class="btn btn-success btn-sm" style="margin-top:10px;">保存
</button>
<ul class="help-info-text c7">
<li>此处为yaml类型配置文件,请严格按照语法修改。</li>
</ul>
</div>
<div id="p-log">
<div contentEditable="true" class="output" id="p-log-content"></div>
<button onclick="alidrive.clear_logs()" class="btn btn-success btn-sm" style="margin-top:10px;">
清空日志
</button>
<button onclick="alidrive.exec_clean()" class="btn btn-success btn-sm" style="margin-top:10px;">
清空缓存
</button>
</div>
<div id="p-task">
<div class="divtable">
<table class="table table-hover">
<thead>
<tr>
<th width="20"><input id="p-task-checkAll" type="checkbox">
</th>
<th>ID</th>
<th>文件路径</th>
<th>网盘根目录</th>
</tr>
</thead>
<tbody id="p-task-content">
</tbody>
</table>
</div>
<div class="mtb15" style="height:32px">
<div class="pull-left buttongroup">
<button id="p-task-delete" class="btn btn-default btn-sm rs-del">删除</button>
</div>
<div class="page">
<div>
<span id="p-task-count" class="Pcount">共0条</span>
</div>
</div>
</div>
</div>
<div id="p-files">
<div class="head pd15">
<button
class="btn btn-default btn-sm glyphicon glyphicon-arrow-left"
title="后退" onclick="alidrive_view_files.back()"></button>
<ul class="place-input" id="p-files-path">
<li><a title="/" onclick="">根目录</a></li>
</ul>
<button class="btn btn-default btn-sm glyphicon glyphicon-refresh"
title="刷新" onclick="alidrive_view_files.get_dir(alidrive_view_files.page)"></button>
</div>
<div class="main pd15">
<div class="divtable" style="margin-bottom:15px">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>大小</th>
<th>更新时间</th>
<th class="text-right">操作</th>
</tr>
</thead>
<tbody id="p-files-list" class="list-list">
</tbody>
</table>
</div>
</div>
<div class="pd15 text-right">
<div id="p-file-page" class="pagination page">
<div><span class="Pcurrent">1</span><span class="Pnumber">1/1</span><span
class="Pline">从1-1条</span><span class="Pcount">共0条</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="/alidrive/static/js/app.js"></script>
<script type="text/javascript">
//定义窗口尺寸
$('.layui-layer-page').css({'width': '900px'});
//左测菜单切换效果
$(".bt-w-menu p").click(function () {
$(this).addClass('bgw').siblings().removeClass('bgw')
});
$('#p-task-checkAll').click(function () {
$('#p-task-content input[type=checkbox]').prop("checked", $(this).prop("checked"));
})
$('#p-task-delete').click(function () {
let els = $('#p-task-content input[type=checkbox]:checked')
if (els.length <= 0) {
alidrive_message.error("请至少选择一个任务")
return
}
const loading = alidrive_message.loading('提交中');
let tasks = []
for (const el of els) {
tasks.push(alidrive.delete_task($(el).data('id')))
}
Promise.all(tasks)
.finally(() => {
alidrive_message.close(loading)
alidrive_message.success("删除成功")
$('#p-task-checkAll').prop('checked', false)
alidrive.get_tasks()
})
})
function show(child) {
$('.plugin_body div').removeClass("show")
$('#' + child).addClass("show")
alidrive.task = null
}
alidrive.get_index()
setInterval(() => {
if (alidrive.task) {
alidrive.task()
}
}, 1000);
</script>