mil-rack_apm 0.2.0 → 0.2.1
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.
- checksums.yaml +4 -4
- data/lib/mil/rack_apm/public/js/js.js +65 -5
- data/lib/mil/rack_apm/version.rb +1 -1
- data/lib/mil/rack_apm/views/index.erb +14 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f1661e428f897244efeb08c0cdc1831c169952e
|
4
|
+
data.tar.gz: bc2a12f7472598ebaa7a9d9431de1d6d47d5f3d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8fea03a77dafd024719af1ac5e11c6dcc31de69ea9d62fc782cffa9cf6263f1c5fd38687605cd2b9b50b7999f2ba74df9d581288817b1a6ef15c9192c136c2b
|
7
|
+
data.tar.gz: fc3c409e1bdf16aafdbb19b589a31cae924a97e9d7c1ca36089e9babd80085995714714fba04b2fa09c5d002ec00e446c825712c8bbdc5f10708eda2db79a264
|
@@ -1,6 +1,7 @@
|
|
1
1
|
var method = '';
|
2
2
|
var path = '';
|
3
|
-
var
|
3
|
+
var min_count = 0;
|
4
|
+
var max_count = 0;
|
4
5
|
|
5
6
|
$(document).ready(function(){
|
6
7
|
|
@@ -18,8 +19,16 @@ $(document).ready(function(){
|
|
18
19
|
|
19
20
|
$('#min_count').keyup(function() {
|
20
21
|
var num = parseInt($(this).val());
|
21
|
-
if(
|
22
|
-
|
22
|
+
if(min_count != num){
|
23
|
+
min_count = num;
|
24
|
+
update_data();
|
25
|
+
}
|
26
|
+
});
|
27
|
+
|
28
|
+
$('#max_count').keyup(function() {
|
29
|
+
var num = parseInt($(this).val());
|
30
|
+
if(max_count != num){
|
31
|
+
max_count = num;
|
23
32
|
update_data();
|
24
33
|
}
|
25
34
|
});
|
@@ -50,8 +59,52 @@ $(document).ready(function(){
|
|
50
59
|
}
|
51
60
|
})
|
52
61
|
|
62
|
+
$('.delete_show').click(function(){
|
63
|
+
if(confirm("Are you delete all show key?")){
|
64
|
+
delete_all_show();
|
65
|
+
// var url = window.location.href.split('?')[0];
|
66
|
+
// var obj = $(this);
|
67
|
+
// $.ajax({
|
68
|
+
// method: "DELETE",
|
69
|
+
// url: url +"/delete_key",
|
70
|
+
// data: { key: obj.attr('key') },
|
71
|
+
// success: function(message){
|
72
|
+
// if('ok' == message){
|
73
|
+
// obj.parents('tr').remove();
|
74
|
+
// }else{
|
75
|
+
// alert('delete error!');
|
76
|
+
// }
|
77
|
+
// }
|
78
|
+
// })
|
79
|
+
}
|
80
|
+
})
|
81
|
+
|
53
82
|
})
|
54
83
|
|
84
|
+
var delete_all_show = function(){
|
85
|
+
$("#table_data tr").each(function(){
|
86
|
+
if ($(this).attr("class").indexOf("no_data") < 0){
|
87
|
+
if ($(this).attr("style").indexOf("display: none;") < 0){
|
88
|
+
var url = window.location.href.split('?')[0];
|
89
|
+
var obj = $(this).find(".delete_key");
|
90
|
+
$.ajax({
|
91
|
+
method: "DELETE",
|
92
|
+
url: url +"/delete_key",
|
93
|
+
data: { key: obj.attr('key') },
|
94
|
+
success: function(message){
|
95
|
+
if('ok' == message){
|
96
|
+
obj.parents('tr').remove();
|
97
|
+
}else{
|
98
|
+
alert('delete error!');
|
99
|
+
}
|
100
|
+
}
|
101
|
+
})
|
102
|
+
}
|
103
|
+
};
|
104
|
+
});
|
105
|
+
|
106
|
+
}
|
107
|
+
|
55
108
|
var update_data = function(){
|
56
109
|
$("#table_data tr").each(function(){
|
57
110
|
if ($(this).attr("class").indexOf("no_data") < 0){
|
@@ -72,9 +125,16 @@ var update_data = function(){
|
|
72
125
|
}
|
73
126
|
}
|
74
127
|
|
75
|
-
if(
|
128
|
+
if(min_count > 0){
|
129
|
+
var pathInt =parseInt($(this).find(".count").text());
|
130
|
+
if (pathInt < min_count) {
|
131
|
+
is_show = false;
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
if(max_count > 0){
|
76
136
|
var pathInt =parseInt($(this).find(".count").text());
|
77
|
-
if (pathInt
|
137
|
+
if (pathInt > max_count) {
|
78
138
|
is_show = false;
|
79
139
|
}
|
80
140
|
}
|
data/lib/mil/rack_apm/version.rb
CHANGED
@@ -12,12 +12,14 @@
|
|
12
12
|
</head>
|
13
13
|
<body>
|
14
14
|
<header>
|
15
|
-
<br />
|
16
15
|
<div class="row">
|
17
16
|
<div class="col-xs-offset-1 col-xs-2">
|
18
17
|
<h5>MIL RACK APM v0.1.0</h5>
|
19
18
|
</div>
|
20
|
-
|
19
|
+
</div>
|
20
|
+
<br />
|
21
|
+
<div class="row">
|
22
|
+
<div class="col-xs-offset-1 col-xs-10">
|
21
23
|
<form class="form-inline">
|
22
24
|
<div class="form-group">
|
23
25
|
<label>METHOD</label>
|
@@ -31,11 +33,18 @@
|
|
31
33
|
</div>
|
32
34
|
<div class="form-group">
|
33
35
|
<label>PATH</label>
|
34
|
-
<input type="text" class="form-control" id="path"
|
36
|
+
<input type="text" class="form-control" id="path" placeholder="/url">
|
35
37
|
</div>
|
36
38
|
<div class="form-group">
|
37
39
|
<label>MIN COUNT</label>
|
38
|
-
<input type="number" class="form-control" id="min_count"
|
40
|
+
<input type="number" class="form-control" id="min_count" placeholder="0">
|
41
|
+
</div>
|
42
|
+
<div class="form-group">
|
43
|
+
<label>MAX COUNT</label>
|
44
|
+
<input type="number" class="form-control" id="max_count" placeholder="0">
|
45
|
+
</div>
|
46
|
+
<div class="form-group">
|
47
|
+
<a href="javascript:void(0)" class="btn btn-danger delete_show" role="button">Delete Show</a>
|
39
48
|
</div>
|
40
49
|
</form>
|
41
50
|
</div>
|
@@ -55,7 +64,7 @@
|
|
55
64
|
<td class="count"><%= data[:count] %></td>
|
56
65
|
<td class="times"><%= '%0.3f' % (data[:times].to_f / data[:count].to_f) %>ms</td>
|
57
66
|
<td>
|
58
|
-
<a href="javascript:void(0)" class="btn btn-danger btn-xs delete_key" key="<%= "#{data[:request_method]}-#{data[:path]}"%>" role="button"
|
67
|
+
<a href="javascript:void(0)" class="btn btn-danger btn-xs delete_key" key="<%= "#{data[:request_method]}-#{data[:path]}"%>" role="button">Delete</a>
|
59
68
|
</td>
|
60
69
|
</tr>
|
61
70
|
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mil-rack_apm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- millim
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|