funboost 47.9__py3-none-any.whl → 48.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of funboost might be problematic. Click here for more details.
- funboost/__init__.py +3 -3
- funboost/assist/celery_helper.py +1 -1
- funboost/constant.py +7 -0
- funboost/consumers/base_consumer.py +132 -75
- funboost/consumers/redis_consumer_ack_able.py +1 -1
- funboost/core/active_cousumer_info_getter.py +60 -0
- funboost/core/current_task.py +37 -0
- funboost/core/func_params_model.py +2 -2
- funboost/core/function_result_status_saver.py +1 -1
- funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
- funboost/function_result_web/__pycache__/functions.cpython-39.pyc +0 -0
- funboost/function_result_web/app.py +104 -7
- funboost/function_result_web/functions.py +17 -4
- funboost/function_result_web/static/css/content_page_style.css +39 -0
- funboost/function_result_web/static/images/favicon.ico +0 -0
- funboost/function_result_web/static/js/bootstrap-datetimepicker.min.js +2 -0
- funboost/function_result_web/static/js/echarts.min.js +32478 -0
- funboost/function_result_web/static/js/moment-with-locales.min.js +1 -0
- funboost/function_result_web/static/js/select2.min.js +2 -0
- funboost/function_result_web/templates/about.html +67 -0
- funboost/function_result_web/templates/conusme_speed.html +217 -0
- funboost/function_result_web/templates/fun_result_table.html +433 -0
- funboost/function_result_web/templates/index.html +194 -423
- funboost/function_result_web/templates/index_backup.html +475 -0
- funboost/function_result_web/templates/index_/321/204/342/225/225/320/235/321/205/320/237/320/277/321/206/320/232/320/250/321/205/320/237/320/260.html +153 -0
- funboost/function_result_web/templates/queue_op.html +490 -0
- funboost/function_result_web/templates/running_consumer_by_ip.html +220 -0
- funboost/function_result_web/templates/running_consumer_by_queue_name.html +216 -0
- funboost/timing_job/__init__.py +3 -218
- funboost/timing_job/apscheduler_use_redis_store.py +6 -1
- funboost/timing_job/timing_job_base.py +213 -0
- funboost/timing_job/timing_push.py +136 -0
- funboost/utils/ctrl_c_end.py +1 -1
- {funboost-47.9.dist-info → funboost-48.1.dist-info}/METADATA +78 -76
- {funboost-47.9.dist-info → funboost-48.1.dist-info}/RECORD +39 -22
- {funboost-47.9.dist-info → funboost-48.1.dist-info}/WHEEL +1 -1
- {funboost-47.9.dist-info → funboost-48.1.dist-info}/LICENSE +0 -0
- {funboost-47.9.dist-info → funboost-48.1.dist-info}/entry_points.txt +0 -0
- {funboost-47.9.dist-info → funboost-48.1.dist-info}/top_level.txt +0 -0
|
@@ -1,462 +1,233 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
|
-
<html lang="
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
3
4
|
<head>
|
|
4
5
|
<meta charset="UTF-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
|
|
8
|
-
<link href="
|
|
9
|
-
|
|
10
|
-
<link
|
|
11
|
-
|
|
12
|
-
<
|
|
7
|
+
|
|
8
|
+
<link rel="icon" href="{{ url_for('static',filename='images/favicon.ico') }}">
|
|
9
|
+
<!-- 引入 Bootstrap CSS -->
|
|
10
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
11
|
+
<!-- 引入 jQuery -->
|
|
12
|
+
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
|
13
|
+
<!-- 引入 Bootstrap JS -->
|
|
14
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
15
|
+
<link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
|
16
|
+
<title>funboost web</title>
|
|
13
17
|
<style>
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
body {
|
|
19
|
+
overflow-x: hidden;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
.
|
|
19
|
-
|
|
22
|
+
.sidebar {
|
|
23
|
+
position: fixed;
|
|
24
|
+
top: 0;
|
|
25
|
+
left: 0;
|
|
26
|
+
bottom: 0;
|
|
27
|
+
width: 180px;
|
|
28
|
+
background-color: #296074;
|
|
29
|
+
padding-top: 20px;
|
|
30
|
+
overflow-y: auto;
|
|
31
|
+
transition: all 0.3s ease; /* 添加过渡效果 */
|
|
20
32
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</head>
|
|
24
|
-
<body>
|
|
25
|
-
<div class="page-wrapper">
|
|
26
|
-
<nav class="navbar navbar-inverse navbar-fixed-top">
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<div class="navbar-header">
|
|
30
|
-
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
|
31
|
-
<span class="sr-only">Toggle navigation</span>
|
|
32
|
-
<span class="icon-bar"></span>
|
|
33
|
-
<span class="icon-bar"></span>
|
|
34
|
-
<span class="icon-bar"></span>
|
|
35
|
-
</button>
|
|
36
|
-
<a href="javascript: void(0)" id="toggle-sidebar" style="color: red"><i class="fa fa-bars"></i></a>
|
|
37
|
-
<a class="navbar-brand" style="padding-left: 60px"><b>python分布式函数调度框架之函数运行结果状态</b></a>
|
|
38
|
-
<a class="navbar-brand" style="padding-left: 160px;color: cyan"><b id="top_text"></b></a>
|
|
39
|
-
</div>
|
|
40
|
-
<div id="navbar" class="navbar-collapse collapse">
|
|
41
|
-
<ul class="nav navbar-nav navbar-right" style="margin-right: 15px;">
|
|
42
|
-
<li><a href="#">rabbitmqAdmin</a></li>
|
|
43
|
-
<li><a href="{{url_for('logout')}}">退出</a></li>
|
|
44
|
-
</ul>
|
|
45
|
-
<!-- <form class="navbar-form navbar-right">-->
|
|
46
|
-
<!-- <input type="text" class="form-control" placeholder="Search...">-->
|
|
47
|
-
<!-- </form>-->
|
|
48
|
-
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</nav>
|
|
53
|
-
<nav id="sidebar" class="sidebar-wrapper" style="top:50px">
|
|
54
|
-
<div class="sidebar-content">
|
|
55
|
-
|
|
56
|
-
<div class="sidebar-search">
|
|
57
|
-
<div>
|
|
58
|
-
<div class="input-group"><input id="col_name_search" type="text" class="form-control search-menu" placeholder="搜索队列名字。。..." onkeydown="if
|
|
59
|
-
(event.keyCode===13){searchCols()}"><span class="input-group-addon" id="col_name_search_button" onclick="searchCols()"><i class="fa fa-search"></i></span></div>
|
|
60
|
-
</div>
|
|
61
|
-
</div><!-- sidebar-search -->
|
|
62
|
-
<div class="sidebar-menu">
|
|
63
|
-
<ul id="ul_cols"></ul>
|
|
64
|
-
|
|
65
|
-
<!-- <ul>-->
|
|
66
|
-
<!-- <div id="div_cols"></div>-->
|
|
67
|
-
|
|
68
|
-
<!-- <li class="header-menu"><span>函数结果集合</span></li>-->
|
|
69
|
-
<!-- <li><a href="#"><i class="fa fa-tv"></i><span>Menu 1</span></a></li>-->
|
|
70
|
-
<!-- <li><a href="#"><i class="fa fa-photo"></i><span>Menu 2</span></a></li>-->
|
|
71
|
-
<!-- <li><a href="#"><i class="fa fa-bar-chart-o"></i><span>Menu 3</span></a></li>-->
|
|
72
|
-
<!-- <li><a href="#"><i class="fa fa-diamond"></i><span>Menu 4</span></a></li>-->
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<!-- </ul>-->
|
|
76
|
-
</div><!-- sidebar-menu --></div><!-- sidebar-content -->
|
|
77
|
-
</nav><!-- sidebar-wrapper -->
|
|
78
|
-
<main class="page-content">
|
|
79
|
-
<div class="container-fluid" style="margin-top: 40px;">
|
|
80
|
-
{# <h1 style="text-align:center;">Pro sidebar template</h1>#}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
<form class="form-inline" role="form" style="float: left">
|
|
84
|
-
<div class="form-group ">
|
|
85
|
-
<label for="start_time">起始时间:</label>
|
|
86
|
-
<input type="text" class="form-control" id="start_time">
|
|
87
|
-
</div>
|
|
88
|
-
<div class="form-group marginLeft20">
|
|
89
|
-
<label for="end_time">截止时间:</label>
|
|
90
|
-
<input type="text" class="form-control" id="end_time">
|
|
91
|
-
</div>
|
|
92
|
-
<label for="sucess_status" class="marginLeft20">函数运行状态:</label>
|
|
93
|
-
<select class="form-control" id="sucess_status">
|
|
94
|
-
<option value="1">全部</option>
|
|
95
|
-
<option value="2">成功</option>
|
|
96
|
-
<option value="3">失败</option>
|
|
97
|
-
|
|
98
|
-
</select>
|
|
99
|
-
<div class="form-group marginLeft20">
|
|
100
|
-
<label for="params">函数参数:</label>
|
|
101
|
-
<input type="text" class="form-control" id="params" placeholder="请输入参数。。">
|
|
102
|
-
</div>
|
|
103
|
-
<button type="button" class="btn btn-default marginLeft20" onclick="document.getElementById('table').style.display = 'block';$('#echartsArea').css('display','none');startRun();queryResult(currentColName,0,true)">查询</button>
|
|
104
|
-
</form>
|
|
105
|
-
|
|
106
|
-
<button id="statistic" type="button" class="btn btn-info btn-sm marginLeft20" onclick="statistic()">生成统计表</button>
|
|
107
|
-
|
|
108
|
-
<button id="autoFresh" type="button" class="btn btn-success btn-sm marginLeft20" style="float2: right" onclick="startOrStop()">自动刷新中</button>
|
|
109
|
-
<p id="echartsInfoTex" style="clear: both;margin-top: 30px;background-color:yellowgreen ;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;display: none"></p>
|
|
110
|
-
<p id="resultInfoTex" style="clear: both;margin-top: 30px;background-color:green;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;"></p>
|
|
111
|
-
<div id = echartsArea style="display: None">
|
|
112
|
-
<div id="st4" style="width: 100%;height:600px;margin-top:60px;"></div>
|
|
113
|
-
<div id="st3" style="width: 100%;height:600px;margin-top:60px;"></div>
|
|
114
|
-
<div id="st2" style="width: 100%;height:600px;margin-top:60px;"></div>
|
|
115
|
-
<div id="st1" style="width: 100%;height:600px;margin-top:60px;"></div>
|
|
116
|
-
</div>
|
|
117
|
-
<div class="table-responsive">
|
|
118
|
-
<table id="table" class="table table-striped">
|
|
119
|
-
|
|
120
|
-
</table>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</main><!-- page-content" --></div><!-- page-wrapper -->
|
|
126
|
-
<!--<script src="{{ url_for('static',filename='js/jquery-1.11.0.min.js') }}" type="text/javascript"></script>-->
|
|
127
|
-
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
|
|
128
|
-
<script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<script src="https://cdn.bootcss.com/moment.js/2.24.0/moment-with-locales.js"></script>
|
|
132
|
-
<script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script>
|
|
133
|
-
<script type="text/javascript" src="https://cdn.bootcss.com/echarts/3.3.0/echarts.js"></script>
|
|
134
|
-
|
|
135
|
-
<script src="{{ url_for('static',filename='assets/js//jquery.mCustomScrollbar.concat.min.js') }}"></script>
|
|
136
|
-
<script src="{{ url_for('static',filename='assets/js/custom.js') }}"></script>
|
|
137
|
-
|
|
138
|
-
<script>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
String.prototype.format = function () {
|
|
142
|
-
var values = arguments;
|
|
143
|
-
return this.replace(/\{(\d+)\}/g, function (match, index) {
|
|
144
|
-
if (values.length > index) {
|
|
145
|
-
return values[index];
|
|
146
|
-
} else {
|
|
147
|
-
return "";
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
function dateToString(date) {
|
|
153
|
-
const year = date.getFullYear();
|
|
154
|
-
let month = date.getMonth() + 1;
|
|
155
|
-
let day = date.getDate();
|
|
156
|
-
let hour = date.getHours();
|
|
157
|
-
let minute = date.getMinutes();
|
|
158
|
-
let second = date.getSeconds();
|
|
159
|
-
month = month > 9 ? month : ('0' + month);
|
|
160
|
-
day = day > 9 ? day : ('0' + day);
|
|
161
|
-
hour = hour > 9 ? hour : ('0' + hour);
|
|
162
|
-
minute = minute > 9 ? minute : ('0' + minute);
|
|
163
|
-
second = second > 9 ? second : ('0' + second);
|
|
164
|
-
return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
//昨天的时间
|
|
169
|
-
var day1 = new Date();
|
|
170
|
-
day1.setDate(day1.getDate() - 2);
|
|
171
|
-
|
|
172
|
-
//明天的时间
|
|
173
|
-
var day2 = new Date();
|
|
174
|
-
day2.setDate(day2.getDate() + 1);
|
|
175
|
-
|
|
176
|
-
$("#start_time").val(dateToString(day1));
|
|
177
|
-
$("#end_time").val(dateToString(day2));
|
|
178
|
-
useAsync = false;
|
|
179
|
-
|
|
180
|
-
function searchCols() {
|
|
181
|
-
// console.info($("#col_name_search").val());
|
|
182
|
-
|
|
183
|
-
$.ajax({
|
|
184
|
-
url: "{{ url_for('query_cols_view')}}", data: {col_name_search: $("#col_name_search").val()}, async: useAsync, success: function (result, status) {
|
|
185
|
-
console.info(result);
|
|
186
|
-
if (useAsync === false) {
|
|
187
|
-
currentColName = result[0].collection_name;
|
|
188
|
-
}
|
|
189
|
-
var html = "";
|
|
190
|
-
for (var item of result) {
|
|
191
|
-
// console.info(item);
|
|
192
|
-
html += '<li onclick="queryResult(\'{0}\' ,0,true)"><a href="#"><span > {1}</span><span class="badge" style="margin-top: 0;"> {2}</span></a></li>'.format(item.collection_name, item.collection_name, item.count);
|
|
193
|
-
}
|
|
194
|
-
$("#ul_cols").html(html);
|
|
195
|
-
|
|
196
|
-
$("#ul_cols").find("li").on("click", function () {
|
|
197
|
-
var $index = $(this).index();//获取点击当前的索引
|
|
198
|
-
$(this).addClass("liActive").siblings("li").removeClass("liActive");//为当前点击元素添加class,移除相邻兄弟元素li的active
|
|
199
|
-
console.log($index);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
});
|
|
33
|
+
.sidebar.collapsed {
|
|
34
|
+
width: 50px;
|
|
203
35
|
}
|
|
204
36
|
|
|
205
|
-
searchCols();
|
|
206
|
-
useAsync = true;
|
|
207
37
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
38
|
+
.sidebar .nav-link {
|
|
39
|
+
color: white;
|
|
40
|
+
background-color: #296074; /* 导航栏链接默认灰色背景 */
|
|
41
|
+
margin-bottom: 5px;
|
|
42
|
+
border-radius: 5px;
|
|
213
43
|
}
|
|
214
44
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}, async: useAsync, success: function (result, status) {
|
|
220
|
-
// console.info(result);
|
|
221
|
-
|
|
222
|
-
var html = ' <thead>\n' +
|
|
223
|
-
' <tr>\n' +
|
|
224
|
-
' <th>执行机器-进程-脚本</th>\n' +
|
|
225
|
-
|
|
226
|
-
' <th>函数名称</th>\n' +
|
|
227
|
-
' <th>函数入参</th>\n' +
|
|
228
|
-
' <th>函数结果</th>\n' +
|
|
229
|
-
' <th>消息发布时间</th>\n' +
|
|
230
|
-
' <th>开始执行时间</th>\n' +
|
|
231
|
-
' <th>消耗时间(秒)</th>\n' +
|
|
232
|
-
' <th>执行次数(重试)</th>\n' +
|
|
233
|
-
' <th>运行状态</th>\n' +
|
|
234
|
-
' <th>是否成功</th>\n' +
|
|
235
|
-
' <th>错误原因</th>\n' +
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
' <th>线程(协程)数</th>\n' +
|
|
239
|
-
' </tr>\n' +
|
|
240
|
-
' </thead>' +
|
|
241
|
-
'<tbody>';
|
|
242
|
-
for (var item of result) {
|
|
243
|
-
// console.info(item);
|
|
244
|
-
var displayLevel = "success";
|
|
245
|
-
if (item.run_times > 1) {
|
|
246
|
-
displayLevel = "warning";
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
if (item.success === false) {
|
|
250
|
-
displayLevel = "danger";
|
|
251
|
-
}
|
|
252
|
-
var tr = ' <tr class="{0}">\n' +
|
|
253
|
-
|
|
254
|
-
' <td>{1}</td>\n' +
|
|
255
|
-
' <td>{2}</td>\n' +
|
|
256
|
-
' <td>{3}</td>\n' +
|
|
257
|
-
' <td>{4}</td>\n' +
|
|
258
|
-
' <td>{5}</td>\n' +
|
|
259
|
-
' <td>{6}</td>\n' +
|
|
260
|
-
' <td>{7}</td>\n' +
|
|
261
|
-
' <td>{8}</td>\n' +
|
|
262
|
-
' <td>{9}</td>\n' +
|
|
263
|
-
' <td>{10}</td>\n' +
|
|
264
|
-
' <td>{11}</td>\n' +
|
|
265
|
-
' <td>{12}</td>\n' +
|
|
266
|
-
|
|
267
|
-
' </tr>';
|
|
268
|
-
var successText = item.success === true ? "成功" : "失败";
|
|
269
|
-
<!-- console.info(item.run_status);-->
|
|
270
|
-
var run_status_text = item.run_status;
|
|
271
|
-
if (item.run_status==="running"){
|
|
272
|
-
successText = "未完成";
|
|
273
|
-
displayLevel = "info";
|
|
274
|
-
if ( Date.now() /1000 - item.time_start > 600) {
|
|
275
|
-
run_status_text = "running?";
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
var time_start_obj = new Date(item.time_start * 1000);
|
|
280
|
-
var time_start_str = dateToString(time_start_obj);
|
|
281
|
-
|
|
282
|
-
tr = tr.format(displayLevel, item.host_process + ' - ' + item.script_name, item.function, item.params_str, item.result,item.publish_time_str,
|
|
283
|
-
time_start_str,item.time_cost, item.run_times, run_status_text,successText, item.exception, item.total_thread);
|
|
284
|
-
html += tr;
|
|
285
|
-
}
|
|
286
|
-
html += '</tbody>';
|
|
287
|
-
$("#table").html(html);
|
|
288
|
-
|
|
289
|
-
// document.getElementById('echartsArea').style.display = 'none';
|
|
290
|
-
|
|
45
|
+
.sidebar .nav-link.active {
|
|
46
|
+
background-color: #0BBAF8; /* 激活状态蓝色背景 */
|
|
47
|
+
color: white;
|
|
48
|
+
}
|
|
291
49
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
updateQueryText()
|
|
50
|
+
.main-content {
|
|
51
|
+
margin-left: 180px;
|
|
52
|
+
transition: all 0.3s ease; /* 添加过渡效果 */
|
|
296
53
|
}
|
|
54
|
+
|
|
55
|
+
.main-content.expanded {
|
|
56
|
+
margin-left: 50px;
|
|
297
57
|
}
|
|
298
58
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
59
|
+
.toggle-btn {
|
|
60
|
+
position: fixed;
|
|
61
|
+
left: 180px;
|
|
62
|
+
top: 10px;
|
|
63
|
+
z-index: 1000;
|
|
64
|
+
background: #296074;
|
|
65
|
+
color: white;
|
|
66
|
+
border: none;
|
|
67
|
+
padding: 5px 10px;
|
|
68
|
+
border-radius: 0 5px 5px 0;
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
transition: all 0.3s ease;
|
|
311
71
|
}
|
|
312
72
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
function updateTopText() {
|
|
317
|
-
var t1 = new Date(new Date().getTime() - 60000);
|
|
318
|
-
var t2 = new Date();
|
|
319
|
-
$.ajax({
|
|
320
|
-
url: "{{ url_for('speed_stats')}}", data: {
|
|
321
|
-
col_name: currentColName, start_time: dateToString(t1), end_time: dateToString(t2)
|
|
322
|
-
}, async: useAsync, success: function (result, status) {
|
|
323
|
-
var msg = '{0}队列,最近一分钟内运行成功了{1}次,失败了{2}次'.format(currentColName, result.success_num, result.fail_num);
|
|
324
|
-
console.info(msg);
|
|
325
|
-
$('#top_text').text(msg);
|
|
326
|
-
}
|
|
327
|
-
})
|
|
73
|
+
.toggle-btn.collapsed {
|
|
74
|
+
left: 50px;
|
|
328
75
|
}
|
|
329
76
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
setInterval(updateTopText, 30000);
|
|
333
|
-
|
|
334
|
-
function autoFreshResult() {
|
|
335
|
-
queryResult(currentColName, 0, false);
|
|
77
|
+
.sidebar.collapsed .nav-link span {
|
|
78
|
+
display: none;
|
|
336
79
|
}
|
|
337
80
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
function startRun() {
|
|
344
|
-
$("#autoFresh").text("自动刷新中");
|
|
345
|
-
$("#autoFresh").removeClass("btn-danger");
|
|
346
|
-
$("#autoFresh").addClass("btn-success");
|
|
347
|
-
iid = setInterval(autoFreshResult, 5000);
|
|
348
|
-
runStatus = 1;
|
|
81
|
+
.nav-link i {
|
|
82
|
+
margin-right: 10px;
|
|
83
|
+
width: 20px;
|
|
84
|
+
text-align: center;
|
|
349
85
|
}
|
|
350
86
|
|
|
351
|
-
function stopRun() {
|
|
352
|
-
$("#autoFresh").text("暂停刷新了");
|
|
353
|
-
$("#autoFresh").removeClass("btn-success");
|
|
354
|
-
$("#autoFresh").addClass("btn-danger");
|
|
355
|
-
clearInterval(iid);
|
|
356
|
-
runStatus = 0;
|
|
357
|
-
}
|
|
358
87
|
|
|
359
|
-
function startOrStop() {
|
|
360
|
-
if (runStatus === 1) {
|
|
361
|
-
stopRun();
|
|
362
|
-
} else {
|
|
363
|
-
startRun();
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
88
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
89
|
+
.main-content iframe {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: calc(100vh - 40px); /* 视窗高度减去padding */
|
|
92
|
+
padding: 20px;
|
|
93
|
+
border: none;
|
|
94
|
+
overflow: auto;
|
|
371
95
|
}
|
|
372
96
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
97
|
+
.sidebar .nav-item {
|
|
98
|
+
padding: 5px 10px;
|
|
99
|
+
position: relative;
|
|
376
100
|
}
|
|
377
101
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
document.getElementById('table').style.display = "none";
|
|
387
|
-
$.ajax({
|
|
388
|
-
url: "{{ url_for('speed_statistic_for_echarts')}}", data: {
|
|
389
|
-
col_name: currentColName
|
|
390
|
-
}, async: useAsync, success: function (result, status) {
|
|
391
|
-
// var msg = '{0}队列,最近一分钟内运行成功了{1}次,失败了{2}次'.format(currentColName, result.success_num, result.fail_num);
|
|
392
|
-
console.info(result);
|
|
393
|
-
_buildOneChart('st1', '最近10天的消费情况', '运行次数', result['recent_10_days']['time_arr'], result['recent_10_days']['count_arr']);
|
|
394
|
-
_buildOneChart('st2', '最近24小时的消费情况', '运行次数', result['recent_24_hours']['time_arr'], result['recent_24_hours']['count_arr']);
|
|
395
|
-
_buildOneChart('st3', '最近60分钟的消费情况', '运行次数', result['recent_60_minutes']['time_arr'], result['recent_60_minutes']['count_arr']);
|
|
396
|
-
_buildOneChart('st4', '最近60秒的消费情况', '运行次数', result['recent_60_seconds']['time_arr'], result['recent_60_seconds']['count_arr']);
|
|
397
|
-
$("#echartsInfoTex").css('display','none');
|
|
398
|
-
|
|
399
|
-
// $('#top_text').text(msg);
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
|
|
403
|
-
|
|
102
|
+
.sidebar .nav-item:not(:last-child)::after {
|
|
103
|
+
content: '';
|
|
104
|
+
position: absolute;
|
|
105
|
+
bottom: -2px;
|
|
106
|
+
left: 10%;
|
|
107
|
+
width: 80%;
|
|
108
|
+
height: 2px;
|
|
109
|
+
background: linear-gradient(to right, transparent, #ffffff80, transparent);
|
|
404
110
|
}
|
|
405
111
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
// 指定图表的配置项和数据
|
|
413
|
-
var option = {
|
|
414
|
-
title: {
|
|
415
|
-
text: titelText
|
|
416
|
-
},
|
|
417
|
-
tooltip: {},
|
|
418
|
-
legend: {
|
|
419
|
-
data: [legendData]
|
|
420
|
-
},
|
|
421
|
-
|
|
422
|
-
xAxis: {
|
|
423
|
-
type: 'category',
|
|
424
|
-
data: xData,
|
|
425
|
-
axisLabel: {
|
|
426
|
-
rotate: 90,
|
|
427
|
-
|
|
428
|
-
interval: 0,
|
|
429
|
-
|
|
430
|
-
// formatter: function (value) {
|
|
431
|
-
//
|
|
432
|
-
// console.info(value);
|
|
433
|
-
// var v = value.split("").join("\n");
|
|
434
|
-
// console.info(v);
|
|
435
|
-
// return v;
|
|
436
|
-
// },
|
|
437
|
-
|
|
438
|
-
// show: true, interval: 'auto', inside: false, rotate: 90, margin: 8, formatter: null, showMinLabel: null, showMaxLabel: null,
|
|
439
|
-
|
|
440
|
-
},
|
|
441
|
-
|
|
442
|
-
},
|
|
443
|
-
|
|
444
|
-
yAxis: {},
|
|
445
|
-
series: [{
|
|
446
|
-
name: legendData,
|
|
447
|
-
type: 'bar',
|
|
448
|
-
data: yData
|
|
449
|
-
}]
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
// 使用刚指定的配置项和数据显示图表。
|
|
453
|
-
myChart.setOption(option);
|
|
454
|
-
console.info(elementId);
|
|
455
|
-
|
|
112
|
+
.sidebar .nav-link {
|
|
113
|
+
padding: 8px 15px;
|
|
114
|
+
transition: all 0.3s ease;
|
|
115
|
+
font-weight: 500;
|
|
116
|
+
}
|
|
456
117
|
|
|
118
|
+
.sidebar .nav-link:hover {
|
|
119
|
+
transform: translateX(5px);
|
|
120
|
+
background-color: #1e4d61;
|
|
457
121
|
}
|
|
458
122
|
|
|
123
|
+
</style>
|
|
124
|
+
</head>
|
|
459
125
|
|
|
460
|
-
|
|
126
|
+
<body>
|
|
127
|
+
<!-- 添加折叠按钮 -->
|
|
128
|
+
<button class="toggle-btn">
|
|
129
|
+
<i class="fa fa-angle-left"></i>
|
|
130
|
+
</button>
|
|
131
|
+
|
|
132
|
+
<!-- 左侧导航栏 -->
|
|
133
|
+
<div class="sidebar">
|
|
134
|
+
<ul class="nav flex-column">
|
|
135
|
+
<li class="nav-item">
|
|
136
|
+
<a class="nav-link " href="#" data-target="/tpl/fun_result_table.html">
|
|
137
|
+
<i class="fa fa-table"></i><span>函数结果表</span>
|
|
138
|
+
</a>
|
|
139
|
+
</li>
|
|
140
|
+
<li class="nav-item">
|
|
141
|
+
<a class="nav-link" href="#" data-target="/tpl/conusme_speed.html">
|
|
142
|
+
<i class="fa fa-tachometer"></i><span>消费速率图</span>
|
|
143
|
+
</a>
|
|
144
|
+
</li>
|
|
145
|
+
<li class="nav-item">
|
|
146
|
+
<a class="nav-link" href="#" data-target="/tpl/running_consumer_by_ip.html">
|
|
147
|
+
<i class="fa fa-server"></i><span>运行中消费者(by ip)</span>
|
|
148
|
+
</a>
|
|
149
|
+
</li>
|
|
150
|
+
<li class="nav-item">
|
|
151
|
+
<a class="nav-link" href="#" data-target="/tpl/running_consumer_by_queue_name.html">
|
|
152
|
+
<i class="fa fa-list"></i><span>运行中消费者(by queue)</span>
|
|
153
|
+
</a>
|
|
154
|
+
</li>
|
|
155
|
+
<li class="nav-item ">
|
|
156
|
+
<a class="nav-link active" href="#" data-target="/tpl/queue_op.html">
|
|
157
|
+
<i class="fa fa-cogs"></i><span>队列操作</span>
|
|
158
|
+
</a>
|
|
159
|
+
</li>
|
|
160
|
+
<li class="nav-item">
|
|
161
|
+
<a class="nav-link" href="#" data-target="/tpl/about.html">
|
|
162
|
+
<i class="fa fa-info-circle"></i><span>说明</span>
|
|
163
|
+
</a>
|
|
164
|
+
</li>
|
|
165
|
+
</ul>
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
<!-- 右侧内容区域 -->
|
|
169
|
+
<div class="main-content" id="content000">
|
|
170
|
+
<!-- 初始加载 Home 页面内容 -->
|
|
171
|
+
<!-- 右侧内容区域 -->
|
|
172
|
+
<iframe id="content" frameborder="0">
|
|
173
|
+
<!-- 初始加载 Home 页面内容 -->
|
|
174
|
+
</iframe >
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<script>
|
|
180
|
+
$(document).ready(function () {
|
|
181
|
+
// ... 现有代码 ...
|
|
182
|
+
|
|
183
|
+
// 添加折叠功能
|
|
184
|
+
$('.toggle-btn').click(function() {
|
|
185
|
+
$('.sidebar').toggleClass('collapsed');
|
|
186
|
+
$('.main-content').toggleClass('expanded');
|
|
187
|
+
$('.toggle-btn').toggleClass('collapsed');
|
|
188
|
+
|
|
189
|
+
// 切换箭头方向
|
|
190
|
+
var icon = $(this).find('i');
|
|
191
|
+
if (icon.hasClass('fa-angle-left')) {
|
|
192
|
+
icon.removeClass('fa-angle-left').addClass('fa-angle-right');
|
|
193
|
+
} else {
|
|
194
|
+
icon.removeClass('fa-angle-right').addClass('fa-angle-left');
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
$(document).ready(function () {
|
|
200
|
+
// 初始加载 Home 页面
|
|
201
|
+
loadPage('/tpl/queue_op.html');
|
|
202
|
+
|
|
203
|
+
// 导航栏点击事件
|
|
204
|
+
$('.sidebar .nav-link').click(function (e) {
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
// 移除所有导航项的 active 类
|
|
207
|
+
$('.sidebar .nav-link').removeClass('active');
|
|
208
|
+
// 为当前点击的导航项添加 active 类
|
|
209
|
+
$(this).addClass('active');
|
|
210
|
+
// 获取要加载的页面文件名
|
|
211
|
+
const targetPage = $(this).data('target');
|
|
212
|
+
// 加载页面内容
|
|
213
|
+
loadPage(targetPage);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
// 加载页面内容的函数
|
|
217
|
+
function loadPage(page) {
|
|
218
|
+
$.ajax({
|
|
219
|
+
url: page,
|
|
220
|
+
method: 'GET',
|
|
221
|
+
success: function (data) {
|
|
222
|
+
$('#content').attr('src', page);
|
|
223
|
+
},
|
|
224
|
+
error: function () {
|
|
225
|
+
$('#content').html('<p>Error loading page.</p>');
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
</script>
|
|
461
231
|
</body>
|
|
232
|
+
|
|
462
233
|
</html>
|