-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebugger.html
More file actions
323 lines (304 loc) · 14.6 KB
/
debugger.html
File metadata and controls
323 lines (304 loc) · 14.6 KB
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="/img/favicon.ico" />
<link href="css/bootstrap.min.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />
<link href="css/animate.min.css" rel="stylesheet" />
<link rel="stylesheet" href="js/layui/css/layui.css" media="all">
<script src="js/jquery-1.11.3.min.js" type="text/javascript"></script>
<script src="js/jstree/jstree.min.js" type="text/javascript"></script>
<script src="js/ace/ace.js" charset="utf-8" type="text/javascript"></script>
<script src="js/ace/ext-language_tools.js" type="text/javascript"></script>
<!--<script src="js/transport.js" type="text/javascript"></script>-->
<script src="js/jQuery.cookie.js" type="text/javascript"></script>
<script src="js/layui/layui.js" charset="utf-8"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src="js/arrayFun.js" type="text/javascript"></script>
<script src="js/common.js" type="text/javascript"></script>
<script src="js/crontab.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="js/jstree/themes/default/style.min.css">
<style>
.vakata-context,.vakata-context ul {
z-index:999;
}
</style>
<script>
$(function(){
var token = $.cookie('DS_auth_token');
$.ajaxSetup({
headers: { // 默认添加请求头
"X-Frappe-CSRF-Token": token
}
});
// 禁止点击
//$(".debug_top .off").unbind();
// 底部拖拽
var src_posi_Y = 0, dest_posi_Y = 0, move_Y = 0, is_mouse_down = false, destHeight = 300, bottomHeight = 200;
$("#expander").mousedown(function(e){
src_posi_Y = e.pageY;
is_mouse_down = true;
});
$(document).bind("click mouseup",function(e){
if(is_mouse_down){
is_mouse_down = false;
}
}).mousemove(function(e){
dest_posi_Y = e.pageY;
move_Y = src_posi_Y - dest_posi_Y;
src_posi_Y = dest_posi_Y;
destHeight = $(".debug_bottom").height() + move_Y;
bottomHeight = $(".debug_bottom tbody").height() + move_Y;
if(is_mouse_down){
$(".debug_bottom").css("height", destHeight > 300 ? destHeight : 300);
$(".debug_bottom tbody").css("height", bottomHeight> 200 ? bottomHeight : 200);
var h = $(".debug_main").height() - $(".debug_bottom").height();
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}
});
$(".right-full").css("min-width",1000)
//调试工具
$(".debug").click(function(){
if($(".debug_bottom").hasClass("hd")){
$(".debug_bottom").removeClass("hd");
$(this).css("color","#1E8AE0");
var h = $(".debug_main").height() - $(".debug_bottom").height();
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}else{
$(".debug_bottom").addClass("hd");
$(this).css("color","");
var h = $(".debug_main").height();
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}
});
$(window).resize(function () {
var h = Math.max($(window).height() - 160, 420);
$(".debug_main").height($(".right-full").height() - 100);
if($(".debug_bottom").hasClass("hd")){
h = $(".debug_main").height();
} else {
h = $(".debug_main").height() - $(".debug_bottom").height();
}
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}).resize();
$(".debug_main").height($(".right-full").height() - 100);
});
</script>
<title>应用调试</title>
</head>
<body>
<nav class="nav_herder">
<div class="nav_left gate_hand" onClick="location='index.html'"><img src="img/cloud_thingslink_logo.png" class="logo"/>冬笋物联网</div>
<div class="pull-right nav_right">
<p class="J_appCenter hd" onClick="location='shop.html'"><img src="img/top_appstore.png"/><span>应用商店</span><em>|</em></p>
<p class="J_getMembers hd"><img src="img/top_management.png"/><span><!--成员管理--></span><em>|</em></p>
<p onClick="location='message.html'"><img src="img/top_news.png"/><em>|</em></p>
<p onClick="location='personal_info.html'"><img src="img/top_avatar.png"/><span class="J_nickname">昵称</span><em>|</em></p>
<p><img src="img/top_quit.png" id="J_logout"/></p>
</div>
</nav>
<div class="down-main">
<div class="left-main left-full">
<div class="sidebar-fold"><img src="img/nav_shrink.png"/></div>
<div class="subNav" onClick="location='index.html'">
<img src="img/nav_home.png" class="hd_img"/>
<img src="img/nav_home_hover.png" class="hover_img"/>
<p class="sublist-title">首页</p>
</div>
<div class="subNav" onClick="location='mine.html'">
<img src="img/nav_equipment.png" class="hd_img"/>
<img src="img/nav_equipment_hover.png" class="hover_img"/>
<p class="sublist-title">我的网关</p>
</div>
<div class="subNav bg-color" onClick="location='application_list.html'">
<img src="img/my_app.png" class="hd_img"/>
<img src="img/myAPPs.png" class="hover_img"/>
<p class="sublist-title">我的应用</p>
</div>
</div>
<div class="right-product my-index right-full">
<ol class="breadcrumb">
<li class="active"><a href="mine.html">我的应用</a></li>
<li class="active J_gate_name"><a href="#"></a></li>
<li class="active">应用调试</li>
</ol>
<div class="debug_top">
<div>
<span class="apply"><img src="img/icon_d_01.png" areaname="apply" title="打包并安装到应用"/></span><!--class off关闭-->
<span class="tag"><img src="img/icon_d_02.png" areaname="tag" title="发布新版本"/></span>
<span class="revert"><img src="img/icon_d_03.png" areaname="revert" title="重置工作区到指定版本"/></span>
<span class="folder"><img src="img/icon_d_04.png" areaname="folder" title="新目录"/></span>
<span class="file"><img src="img/icon_d_05.png" areaname="file" title="新文件"/></span>
<span class="rename"><img src="img/icon_d_06.png" areaname="rename" title="重命名"/></span>
<span class="delete"><img src="img/icon_d_07.png" areaname="delete" title="删除"/></span>
<span class="save off"><img src="img/icon_d_08.png" areaname="save" title="保存文件"/></span>
<span class="download"><img src="img/icon_d_09.png" areaname="download" title="获取文件"/></span>
<span class="undo"><img src="img/icon_d_10.png" areaname="undo" title="撤销"/></span>
<span class="redo"><img src="img/icon_d_11.png" areaname="redo" title="重置"/></span>
<span class="zoom"><img src="img/icon_d_12.png" areaname="zoom" title="放大字体"/></span>
<span class="zoom_out"><img src="img/icon_d_13.png" areaname="zoom_out" title="缩小字体"/></span>
<span class="debug"><img src="img/icon_d_14.png"title="调试工具"/></span>
</div>
<p class="fr"></p>
</div>
<div class="debug_main">
<div class="debug_content">
<div class="debug_left fl" id="jstree_tree">
<!--编辑器目录区-->
</div>
<div class="debug_right fl" id="editor_data">
<div id="editor_code"><!--编辑器代码区--></div>
<!--<div class="content folder" style="display:none;"></div>
<div class="content image" style="display:none; position:relative;">
<img src="" alt="" style="display:block; position:absolute; left:50%; top:50%; padding:0; max-height:90%; max-width:90%;" />
</div>-->
<div class="content default" style="text-align:center;display:none;">请从文件树中选择要编辑的文件。</div>
</div>
</div>
</div>
</div>
</div>
<div class="shade J_apply">
<div class="debug_shade">
<div class="add_content">
<!--<div class="tit">打包修改内容并安装到</div>-->
<p>设备序列号</p>
<input type="text" class="J_apply_device" readonly="true" value="value_device_sn" />
<p>应用实例</p>
<input type="text" class="J_apply_inst" readonly="true" value="value_inst" />
<div class="checkbox"><label><input class="J_protocol" type="checkbox">我同意使用条款<em></em></label></div>
<div class="bottom">
<button id="J_apply_do">应用</button>
<button class="off J_content_close">取消</button>
</div>
</div>
</div>
</div>
<div class="shade J_tag">
<div class="debug_shade">
<div class="add_content">
<!--<div class="tit">发布新版本</div>-->
<p>填写版本</p>
<input type="text" id="J_tag_version" value="0" />
<p>评论</p>
<textarea rows="5" id="J_tag_comment"></textarea>
<div class="checkbox"><label><input class="J_protocol" type="checkbox">我同意使用条款<em></em></label></div>
<div class="bottom">
<button id="J_tag_do">创建</button>
<button class="off J_content_close">取消</button>
</div>
</div>
</div>
</div>
<div class="shade J_revert">
<div class="debug_shade">
<div class="add_content">
<p>选择版本</p>
<select name="version" id="J_revert_version">
version_list
</select>
<div class="bottom">
<button id="J_revert_do">重置</button>
<button class="off J_content_close">取消</button>
</div>
</div>
</div>
</div>
<script src="js/debugger.js"></script>
<!--<script src="js/gatedebug.js?v=20180710" type="text/javascript"></script>-->
<!--<script src="js/index.js?v=20180611" type="text/javascript"></script>-->
<!---->
<!-- 上传报文和上传日志 -->
<!--<script src="js/paho-mqtt.js"></script>-->
<!--<script src="js/mqtt_utility.js"></script>-->
<!--<script src="js/collection_sys_enable.js?v=20180709"></script>-->
<input type="hidden" value="" id="J_current_inst"><!--当前应用的inst-->
<script>
$(function(){
var token = $.cookie('DS_auth_token');
$.ajaxSetup({
headers: { // 默认添加请求头
"X-Frappe-CSRF-Token": token
}
});
// 禁止点击
//$(".debug_top .off").unbind();
// 底部拖拽
var src_posi_Y = 0, dest_posi_Y = 0, move_Y = 0, is_mouse_down = false, destHeight = 300, bottomHeight = 200;
$("#expander").mousedown(function(e){
src_posi_Y = e.pageY;
is_mouse_down = true;
});
$(document).bind("click mouseup",function(e){
if(is_mouse_down){
is_mouse_down = false;
}
}).mousemove(function(e){
dest_posi_Y = e.pageY;
move_Y = src_posi_Y - dest_posi_Y;
src_posi_Y = dest_posi_Y;
destHeight = $(".debug_bottom").height() + move_Y;
bottomHeight = $(".debug_bottom tbody").height() + move_Y;
if(is_mouse_down){
$(".debug_bottom").css("height", destHeight > 300 ? destHeight : 300);
$(".debug_bottom tbody").css("height", bottomHeight> 200 ? bottomHeight : 200);
var h = $(".debug_main").height() - $(".debug_bottom").height();
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}
});
$(".right-full").css("min-width",1000)
//调试工具
$(".debug").click(function(){
if($(".debug_bottom").hasClass("hd")){
$(".debug_bottom").removeClass("hd");
$(this).css("color","#1E8AE0");
var h = $(".debug_main").height() - $(".debug_bottom").height();
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}else{
$(".debug_bottom").addClass("hd");
$(this).css("color","");
var h = $(".debug_main").height();
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}
});
$(window).resize(function () {
var h = Math.max($(window).height() - 160, 420);
$(".debug_main").height($(".right-full").height() - 100);
if($(".debug_bottom").hasClass("hd")){
h = $(".debug_main").height();
} else {
h = $(".debug_main").height() - $(".debug_bottom").height();
}
$('#jstree_tree').height(h);
var code_editor = ace.edit("editor_code");
code_editor.container.style.height = h + "px";
code_editor.resize();
}).resize();
$(".debug_main").height($(".right-full").height() - 100);
});
</script>
</body>
</html>