suricate 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/suricate.rb +1 -0
- data/lib/suricate/configuration/widget_configurations_builder.rb +4 -0
- data/lib/suricate/generator/assets/javascript/widget-view.js +3 -2
- data/lib/suricate/generator/assets/javascript/widgets/status-widget.js +14 -0
- data/lib/suricate/generator/assets/stylesheets/suricate.css +36 -2
- data/lib/suricate/version.rb +1 -1
- data/lib/suricate/widgets/status_widget.rb +9 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b8794a9a174151433cd55ca1141d728c2c5b6c2
|
4
|
+
data.tar.gz: da4ee9ddd4b8e28ec9faa0727c6f6607807f6016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 995489c410f4900e5afdcb13eb62768038375f7983c1303d8db4364137d5522e48172f152a27d3a23cb0bc8a09143694a245b7314d5f4686720c4017f0cb0dc7
|
7
|
+
data.tar.gz: 03e86a61c6d84cbe30b530f18b7f758abd4a8f6190a53ae3349eb917c952db00accd2930d2a102683491d0c175954f7c75f89b0830b5fb3c40160bebfd79d2b4
|
data/lib/suricate.rb
CHANGED
@@ -21,6 +21,7 @@ module Suricate
|
|
21
21
|
autoload :Widget, 'suricate/widgets/widget'
|
22
22
|
autoload :CounterWidget, 'suricate/widgets/counter_widget'
|
23
23
|
autoload :LineChartWidget, 'suricate/widgets/line_chart_widget'
|
24
|
+
autoload :StatusWidget, 'suricate/widgets/status_widget'
|
24
25
|
|
25
26
|
# Responses
|
26
27
|
autoload :WidgetResponse, 'suricate/widgets/responses/widget_response'
|
@@ -17,6 +17,10 @@ module Suricate
|
|
17
17
|
register(id, LineChartWidget, collector, options)
|
18
18
|
end
|
19
19
|
|
20
|
+
def status(id, collector, options = {})
|
21
|
+
register(id, StatusWidget, collector, options)
|
22
|
+
end
|
23
|
+
|
20
24
|
def register(id, klass, collector, options = {})
|
21
25
|
id = id.to_sym
|
22
26
|
if find_with_id(id)
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
Suricate.WidgetView = function(content) {
|
12
12
|
this.content = $(content);
|
13
|
-
this.currentStatus =
|
13
|
+
this.currentStatus = undefined;
|
14
14
|
};
|
15
15
|
|
16
16
|
/*
|
@@ -68,7 +68,8 @@
|
|
68
68
|
if(this.currentStatus !== status) {
|
69
69
|
var statuses = ["ok", "danger", "warning"];
|
70
70
|
var statusIndex = statuses.indexOf(status);
|
71
|
-
|
71
|
+
statuses.splice(statusIndex, 1);
|
72
|
+
var classesToRemove = statuses.join(" ");
|
72
73
|
this.content.removeClass(classesToRemove);
|
73
74
|
this.content.addClass(status);
|
74
75
|
this.currentStatus = status;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
(function() {
|
2
|
+
"use strict";
|
3
|
+
window.Suricate = window.Suricate || {};
|
4
|
+
|
5
|
+
Suricate.StatusWidget = function(id, container, configuration, application) {
|
6
|
+
Suricate.Widget.call(this, id, container, configuration, application);
|
7
|
+
};
|
8
|
+
|
9
|
+
Suricate.StatusWidget.prototype = new Suricate.Widget();
|
10
|
+
|
11
|
+
Suricate.StatusWidget.prototype.setData = function(data) {
|
12
|
+
};
|
13
|
+
}());
|
14
|
+
|
@@ -19,7 +19,7 @@
|
|
19
19
|
text-transform: uppercase;
|
20
20
|
text-align: center;
|
21
21
|
color: #5C5C5C;
|
22
|
-
padding-bottom:
|
22
|
+
padding-bottom: 5px;
|
23
23
|
}
|
24
24
|
|
25
25
|
.widget .bottom-bar {
|
@@ -67,7 +67,7 @@
|
|
67
67
|
}
|
68
68
|
|
69
69
|
.line-chart-widget .name {
|
70
|
-
padding-top:
|
70
|
+
padding-top: 10px;
|
71
71
|
}
|
72
72
|
|
73
73
|
.line-chart-widget .legend {
|
@@ -95,3 +95,37 @@
|
|
95
95
|
position: relative;
|
96
96
|
margin-right: 5px;
|
97
97
|
}
|
98
|
+
|
99
|
+
/*
|
100
|
+
* StatusWidget
|
101
|
+
*/
|
102
|
+
|
103
|
+
.status-widget .status {
|
104
|
+
margin-top: 10px;
|
105
|
+
margin-left: auto;
|
106
|
+
margin-right: auto;
|
107
|
+
width: 60px;
|
108
|
+
border-radius: 50%;
|
109
|
+
height: 60px;
|
110
|
+
margin-bottom: 10px;
|
111
|
+
}
|
112
|
+
|
113
|
+
.status-widget.danger .body {
|
114
|
+
background-color: white;
|
115
|
+
}
|
116
|
+
|
117
|
+
.status-widget.warning .body {
|
118
|
+
background-color: white;
|
119
|
+
}
|
120
|
+
|
121
|
+
.status-widget.ok .status {
|
122
|
+
background-color: #32986C;
|
123
|
+
}
|
124
|
+
|
125
|
+
.status-widget.danger .status {
|
126
|
+
background-color: #F59F97;
|
127
|
+
}
|
128
|
+
|
129
|
+
.status-widget.warning .status {
|
130
|
+
background-color: #f5ce97;
|
131
|
+
}
|
data/lib/suricate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suricate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aurélien AMILIN
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/suricate/generator/assets/javascript/widgets-container.js
|
154
154
|
- lib/suricate/generator/assets/javascript/widgets/counter-widget.js
|
155
155
|
- lib/suricate/generator/assets/javascript/widgets/line-chart-widget.js
|
156
|
+
- lib/suricate/generator/assets/javascript/widgets/status-widget.js
|
156
157
|
- lib/suricate/generator/assets/javascript/widgets/widget.js
|
157
158
|
- lib/suricate/generator/assets/stylesheets/suricate.css
|
158
159
|
- lib/suricate/generator/assets/stylesheets/vendor/bootstrap-theme.css.map
|
@@ -172,6 +173,7 @@ files:
|
|
172
173
|
- lib/suricate/widgets/responses/chart_widget_response.rb
|
173
174
|
- lib/suricate/widgets/responses/counter_widget_response.rb
|
174
175
|
- lib/suricate/widgets/responses/widget_response.rb
|
176
|
+
- lib/suricate/widgets/status_widget.rb
|
175
177
|
- lib/suricate/widgets/widget.rb
|
176
178
|
homepage: https://github.com/holinnn/suricate
|
177
179
|
licenses:
|