nutella_framework 0.4.23 → 0.4.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/framework_components/monitoring-bot/monitoring-bot.rb +11 -2
- data/framework_components/monitoring-interface/.gitignore +2 -0
- data/framework_components/monitoring-interface/README.md +1 -0
- data/framework_components/monitoring-interface/bower.json +29 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/.bower.json +23 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/bower.json +14 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/mqttws31.js +2081 -0
- data/framework_components/monitoring-interface/bower_components/bower-mqttws/readme.md +4 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/.bower.json +37 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/LICENSE +21 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/README.md +15 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/bower.json +28 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/mqtt_client_hello_world.html +23 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/browser/nutella_hello_world.html +52 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/mqtt_client_hello_world.js +14 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/examples/node/nutella_hello_world.js +38 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/nutella_lib.js +789 -0
- data/framework_components/monitoring-interface/bower_components/nutella_lib/package.json +30 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface.html +215 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/animations.js +27 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/application-view-controller.js +232 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/applications-model.js +61 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/bootstrap.min.js +7 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/cursor.css +7 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/d3.v3.min.js +5 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/graphics.js +156 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/grid-layout.js +103 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/highlight.min.js +2 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/instance-view-controller.js +104 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/jquery-1.10.0.min.js +6 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/notification-center.js +63 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/notifications.js +14 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/page.css +33 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/radial-layout.js +175 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/tab-table.js +8 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.css +0 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-application.js +320 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.css +10 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-connection-view.js +426 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-element.js +205 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-notification.js +94 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/ui-tab.js +229 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/underscore-min.js +5 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/view-controller.js +68 -0
- data/framework_components/monitoring-interface/css/Monitoring Interface_files/window-view-controller.js +169 -0
- data/framework_components/monitoring-interface/css/alerts.css +3 -0
- data/framework_components/monitoring-interface/css/bootstrap.min.css +5 -0
- data/framework_components/monitoring-interface/css/cursor.css +7 -0
- data/framework_components/monitoring-interface/css/highlight.default.min.css +1 -0
- data/framework_components/monitoring-interface/css/page.css +41 -0
- data/framework_components/monitoring-interface/css/ui-application.css +0 -0
- data/framework_components/monitoring-interface/css/ui-connection-view.css +10 -0
- data/framework_components/monitoring-interface/css/ui-legend-view.css +7 -0
- data/framework_components/monitoring-interface/data/alert.json +8 -0
- data/framework_components/monitoring-interface/data/data.json +2118 -0
- data/framework_components/monitoring-interface/data/data2.json +814 -0
- data/framework_components/monitoring-interface/data/data3.json +823 -0
- data/framework_components/monitoring-interface/data/data4.json +848 -0
- data/framework_components/monitoring-interface/data/message.json +999 -0
- data/framework_components/monitoring-interface/gulpfile.js +29 -0
- data/framework_components/monitoring-interface/img/arrow_white.svg +120 -0
- data/framework_components/monitoring-interface/img/arrow_white_right.svg +104 -0
- data/framework_components/monitoring-interface/img/back.svg +164 -0
- data/framework_components/monitoring-interface/img/cross_red_border_white.svg +143 -0
- data/framework_components/monitoring-interface/img/cross_red_border_white_mouseover.svg +143 -0
- data/framework_components/monitoring-interface/img/email.svg +89 -0
- data/framework_components/monitoring-interface/img/email_highlighted.svg +89 -0
- data/framework_components/monitoring-interface/index.html +144 -0
- data/framework_components/monitoring-interface/js/d3/layout/grid-layout.js +103 -0
- data/framework_components/monitoring-interface/js/d3/layout/radial-layout.js +184 -0
- data/framework_components/monitoring-interface/js/d3/plugin/graphics.js +156 -0
- data/framework_components/monitoring-interface/js/d3/plugin/tab-table.js +8 -0
- data/framework_components/monitoring-interface/js/d3/ui/animations.js +27 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-application.js +471 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-connection-view.js +847 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-element.js +245 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-legend.js +174 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-notification.js +90 -0
- data/framework_components/monitoring-interface/js/d3/ui/ui-tab.js +309 -0
- data/framework_components/monitoring-interface/js/lib/JSXTransformer-0.12.2.js +15199 -0
- data/framework_components/monitoring-interface/js/lib/bootstrap.min.js +7 -0
- data/framework_components/monitoring-interface/js/lib/d3.v3.min.js +5 -0
- data/framework_components/monitoring-interface/js/lib/highlight.min.js +2 -0
- data/framework_components/monitoring-interface/js/lib/jquery-1.10.0.min.js +6 -0
- data/framework_components/monitoring-interface/js/lib/nutella_lib.js +5121 -0
- data/framework_components/monitoring-interface/js/lib/react-with-addons-0.12.2.js +19822 -0
- data/framework_components/monitoring-interface/js/lib/underscore-min.js +5 -0
- data/framework_components/monitoring-interface/js/model/alerts-model.js +74 -0
- data/framework_components/monitoring-interface/js/model/applications-model.js +78 -0
- data/framework_components/monitoring-interface/js/model/messages-model.js +112 -0
- data/framework_components/monitoring-interface/js/notification/notification-center.js +63 -0
- data/framework_components/monitoring-interface/js/notification/notifications.js +21 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-alerts.js +178 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-message-send.js +389 -0
- data/framework_components/monitoring-interface/js/react/dist/ui-messages.js +103 -0
- data/framework_components/monitoring-interface/js/react/src/ui-alerts.js +178 -0
- data/framework_components/monitoring-interface/js/react/src/ui-message-send.js +389 -0
- data/framework_components/monitoring-interface/js/react/src/ui-messages.js +103 -0
- data/framework_components/monitoring-interface/js/view-controller/application-view-controller.js +256 -0
- data/framework_components/monitoring-interface/js/view-controller/instance-view-controller.js +112 -0
- data/framework_components/monitoring-interface/js/view-controller/view-controller.js +74 -0
- data/framework_components/monitoring-interface/js/view-controller/window-view-controller.js +169 -0
- data/framework_components/monitoring-interface/nutella.json +6 -0
- data/framework_components/order.json +1 -0
- data/framework_components/roomcast-bot/roomcast_bot.rb +139 -117
- data/framework_components/roomcast-channel-creator/dist/app.js +9 -7
- data/framework_components/roomcast-channel-creator/index.html +1 -1
- data/framework_components/roomcast-channel-creator/src/app/components/main.js +8 -6
- data/framework_components/roomcast-package-creator/dist/app.js +4 -4
- data/framework_components/roomcast-package-creator/index.html +1 -1
- data/framework_components/roomcast-package-creator/package.json +3 -3
- data/framework_components/roomcast-package-creator/src/app/components/ConfigurationsPanel.js +2 -2
- data/framework_components/roomcast-package-creator/src/app/components/PoolRow.js +1 -1
- data/framework_components/roomcast-teacher-controls/.gitignore +2 -0
- data/framework_components/roomcast-teacher-controls/README.md +9 -0
- data/framework_components/roomcast-teacher-controls/dist/app.js +38327 -0
- data/framework_components/roomcast-teacher-controls/dist/main.css +3052 -0
- data/framework_components/roomcast-teacher-controls/dist/nutella_lib.js +5121 -0
- data/framework_components/roomcast-teacher-controls/gulp/config.js +51 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/browserify.js +77 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/build.js +3 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/css.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/default.js +3 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/fonts.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/less.js +16 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/mui-fonts.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/nutella.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/setWatch.js +5 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/svgs.js +7 -0
- data/framework_components/roomcast-teacher-controls/gulp/tasks/watch.js +12 -0
- data/framework_components/roomcast-teacher-controls/gulp/util/bundleLogger.js +21 -0
- data/framework_components/roomcast-teacher-controls/gulp/util/handleErrors.js +15 -0
- data/framework_components/roomcast-teacher-controls/gulpfile.js +16 -0
- data/framework_components/roomcast-teacher-controls/index.html +51 -0
- data/framework_components/roomcast-teacher-controls/nutella.json +6 -0
- data/framework_components/roomcast-teacher-controls/package.json +38 -0
- data/framework_components/roomcast-teacher-controls/src/app/app.js +22 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/ActivitiesGrid.js +87 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/ActivityCard.js +141 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/Channel.js +70 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/Footer.js +34 -0
- data/framework_components/roomcast-teacher-controls/src/app/components/main.js +74 -0
- data/framework_components/roomcast-teacher-controls/src/less/main.less +186 -0
- data/framework_components/roomcast-teacher-controls/src/less/my_overrides.less +14 -0
- data/lib/commands/meta/run_command.rb +11 -9
- metadata +135 -2
@@ -0,0 +1,389 @@
|
|
1
|
+
var UIJSONAttribute = React.createClass ({displayName: "UIJSONAttribute",
|
2
|
+
getInitialState: function() {
|
3
|
+
return({
|
4
|
+
type: "string",
|
5
|
+
value: "",
|
6
|
+
key: "",
|
7
|
+
application: undefined,
|
8
|
+
instance: undefined,
|
9
|
+
component: undefined
|
10
|
+
})
|
11
|
+
},
|
12
|
+
handleTypeChange: function(type) {
|
13
|
+
this.setState({type: type});
|
14
|
+
this.updateJson = true;
|
15
|
+
},
|
16
|
+
handleKeyChange: function(event) {
|
17
|
+
/*
|
18
|
+
switch(this.state.type) {
|
19
|
+
case "string":
|
20
|
+
this.setState({key: event.target.value});
|
21
|
+
break;
|
22
|
+
}
|
23
|
+
*/
|
24
|
+
this.setState({key: event.target.value});
|
25
|
+
this.props.updateJSON();
|
26
|
+
},
|
27
|
+
handleValueChange: function() {
|
28
|
+
switch(this.state.type) {
|
29
|
+
case "string":
|
30
|
+
case "number":
|
31
|
+
this.setState({value: event.target.value});
|
32
|
+
break;
|
33
|
+
}
|
34
|
+
this.props.updateJSON();
|
35
|
+
},
|
36
|
+
getJson: function() {
|
37
|
+
if(this.props.keyEnabled) {
|
38
|
+
var json = {};
|
39
|
+
switch (this.state.type) {
|
40
|
+
case "string":
|
41
|
+
json[this.refs.key.getDOMNode().value] = this.refs.value.getDOMNode().value;
|
42
|
+
break;
|
43
|
+
case "number":
|
44
|
+
json[this.refs.key.getDOMNode().value] = parseFloat(this.refs.value.getDOMNode().value);
|
45
|
+
break;
|
46
|
+
case "array":
|
47
|
+
// TODO: check refs
|
48
|
+
json[this.refs.key.getDOMNode().value] = this.refs.array.getJson();
|
49
|
+
break;
|
50
|
+
case "object":
|
51
|
+
json[this.refs.key.getDOMNode().value] = this.refs.object.getJson();
|
52
|
+
break;
|
53
|
+
}
|
54
|
+
return json;
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
switch (this.state.type) {
|
58
|
+
case "string":
|
59
|
+
return this.refs.value.getDOMNode().value;
|
60
|
+
break;
|
61
|
+
case "number":
|
62
|
+
return parseFloat(this.refs.value.getDOMNode().value);
|
63
|
+
break;
|
64
|
+
case "array":
|
65
|
+
// TODO: check refs
|
66
|
+
return this.refs.array.getJson();
|
67
|
+
break;
|
68
|
+
case "object":
|
69
|
+
return this.refs.object.getJson();
|
70
|
+
break;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
},
|
74
|
+
render: function() {
|
75
|
+
|
76
|
+
var self = this;
|
77
|
+
|
78
|
+
var inputBox = "";
|
79
|
+
switch(this.state.type) {
|
80
|
+
case "string":
|
81
|
+
case "number":
|
82
|
+
inputBox = React.createElement("div", null,
|
83
|
+
React.createElement("button", {type: "button",
|
84
|
+
className: "close",
|
85
|
+
"aria-label": "Close",
|
86
|
+
onClick: _.partial(self.props.deleteAttribute, self.state.key)},
|
87
|
+
React.createElement("span", {"aria-hidden": "true"}, "×")
|
88
|
+
),
|
89
|
+
React.createElement("div", {className: "col-lg-4 col-md-4 col-sm-4", style: {padding: "10px"}},
|
90
|
+
React.createElement("input", {
|
91
|
+
onChange: this.handleValueChange,
|
92
|
+
type: "text", className: "form-control",
|
93
|
+
placeholder: "String",
|
94
|
+
"aria-describedby": "basic-addon2",
|
95
|
+
value: this.state.value,
|
96
|
+
ref: "value"})
|
97
|
+
)
|
98
|
+
);
|
99
|
+
break;
|
100
|
+
case "array":
|
101
|
+
inputBox = React.createElement("div", null,
|
102
|
+
React.createElement("button", {type: "button",
|
103
|
+
className: "close",
|
104
|
+
"aria-label": "Close",
|
105
|
+
onClick: _.partial(self.props.deleteAttribute, self.state.key)},
|
106
|
+
React.createElement("span", {"aria-hidden": "true"}, "×")
|
107
|
+
),
|
108
|
+
React.createElement("div", {className: "col-lg-12 col-md-12 col-sm-12", style: {padding: "10px"}},
|
109
|
+
React.createElement(UIJSONArray, {updateJSON: this.props.updateJSON, ref: "array"})
|
110
|
+
)
|
111
|
+
);
|
112
|
+
break;
|
113
|
+
case "object":
|
114
|
+
inputBox = React.createElement("div", null,
|
115
|
+
React.createElement("button", {type: "button",
|
116
|
+
className: "close",
|
117
|
+
"aria-label": "Close",
|
118
|
+
onClick: _.partial(self.props.deleteAttribute, self.state.key)},
|
119
|
+
React.createElement("span", {"aria-hidden": "true"}, "×")
|
120
|
+
),
|
121
|
+
React.createElement("div", {className: "col-lg-12 col-md-12 col-sm-12", style: {padding: "10px"}},
|
122
|
+
React.createElement(UIJSONObject, {updateJSON: this.props.updateJSON, ref: "object"})
|
123
|
+
)
|
124
|
+
);
|
125
|
+
break;
|
126
|
+
}
|
127
|
+
|
128
|
+
return (
|
129
|
+
React.createElement("div", null,
|
130
|
+
React.createElement("div", {className: "col-lg-6 col-md-6 col-sm-6 ", style: {padding: "10px"}},
|
131
|
+
React.createElement("div", {className: "input-group"},
|
132
|
+
this.props.keyEnabled ?
|
133
|
+
React.createElement("input", {
|
134
|
+
onChange: this.handleKeyChange,
|
135
|
+
type: "text", className: "form-control",
|
136
|
+
placeholder: "Key",
|
137
|
+
"aria-describedby": "basic-addon2",
|
138
|
+
value: this.state.key,
|
139
|
+
ref: "key"})
|
140
|
+
:
|
141
|
+
"",
|
142
|
+
|
143
|
+
React.createElement("div", {className: "input-group-btn"},
|
144
|
+
React.createElement("button", {className: "btn btn-default dropdown-toggle", type: "button", id: "menu1", "data-toggle": "dropdown"}, self.state.type,
|
145
|
+
React.createElement("span", {className: "caret"})),
|
146
|
+
React.createElement("ul", {className: "dropdown-menu", role: "menu", "aria-labelledby": "menu1"},
|
147
|
+
React.createElement("li", {role: "presentation"}, React.createElement("a", {role: "menuitem", tabindex: "-1", onClick: function() { self.handleTypeChange("string")}}, "String")),
|
148
|
+
React.createElement("li", {role: "presentation"}, React.createElement("a", {role: "menuitem", tabindex: "-1", onClick: function() { self.handleTypeChange("number")}}, "Number")),
|
149
|
+
React.createElement("li", {role: "presentation"}, React.createElement("a", {role: "menuitem", tabindex: "-1", onClick: function() { self.handleTypeChange("array")}}, "Array")),
|
150
|
+
React.createElement("li", {role: "presentation"}, React.createElement("a", {role: "menuitem", tabindex: "-1", onClick: function() { self.handleTypeChange("object")}}, "Object"))
|
151
|
+
)
|
152
|
+
)
|
153
|
+
)
|
154
|
+
),
|
155
|
+
inputBox
|
156
|
+
)
|
157
|
+
);
|
158
|
+
},
|
159
|
+
updateJson: false,
|
160
|
+
componentDidUpdate: function() {
|
161
|
+
if(this.updateJson) {
|
162
|
+
this.props.updateJSON();
|
163
|
+
this.updateJson = false;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
});
|
167
|
+
|
168
|
+
var UIJSONArray = React.createClass ({displayName: "UIJSONArray",
|
169
|
+
getInitialState: function () {
|
170
|
+
return ({
|
171
|
+
elements: 1
|
172
|
+
})
|
173
|
+
},
|
174
|
+
deleteElement: function(key) {
|
175
|
+
this.setState({
|
176
|
+
elements: this.state.elements - 1
|
177
|
+
});
|
178
|
+
this.updateJson = true;
|
179
|
+
},
|
180
|
+
addElement: function() {
|
181
|
+
this.setState({elements: this.state.elements + 1});
|
182
|
+
},
|
183
|
+
getJson: function() {
|
184
|
+
var array = [];
|
185
|
+
|
186
|
+
// Construct the json with the children
|
187
|
+
for(var i = 0; i < this.state.elements; i++) {
|
188
|
+
var element = this.refs['array-element-' + i].getJson();
|
189
|
+
array.push(element);
|
190
|
+
}
|
191
|
+
|
192
|
+
this.setState({oldJson: array});
|
193
|
+
return array;
|
194
|
+
|
195
|
+
},
|
196
|
+
render: function() {
|
197
|
+
var attributes = [];
|
198
|
+
|
199
|
+
for(var i = 0; i < this.state.elements; i++) {
|
200
|
+
attributes.push(
|
201
|
+
React.createElement(UIJSONAttribute, {
|
202
|
+
updateJSON: this.props.updateJSON,
|
203
|
+
ref: "array-element-" + i,
|
204
|
+
keyEnabled: false,
|
205
|
+
deleteAttribute: this.deleteElement})
|
206
|
+
);
|
207
|
+
}
|
208
|
+
|
209
|
+
return(
|
210
|
+
React.createElement("div", {className: "panel panel-default"},
|
211
|
+
React.createElement("div", {className: "panel-body"},
|
212
|
+
attributes,
|
213
|
+
React.createElement("div", {className: "col-lg-12 col-md-12 col-sm-12"},
|
214
|
+
React.createElement("button", {onClick: this.addElement, type: "button", className: "btn btn-default"},
|
215
|
+
React.createElement("span", {className: "glyphicon glyphicon-plus", "aria-hidden": "true"}), " Add"
|
216
|
+
)
|
217
|
+
)
|
218
|
+
)
|
219
|
+
)
|
220
|
+
);
|
221
|
+
},
|
222
|
+
updateJson: false,
|
223
|
+
componentDidUpdate: function() {
|
224
|
+
if(this.updateJson) {
|
225
|
+
this.props.updateJSON();
|
226
|
+
this.updateJson = false;
|
227
|
+
}
|
228
|
+
}
|
229
|
+
});
|
230
|
+
|
231
|
+
var UIJSONObject = React.createClass ({displayName: "UIJSONObject",
|
232
|
+
getInitialState: function() {
|
233
|
+
return({
|
234
|
+
attributes: 1
|
235
|
+
})
|
236
|
+
},
|
237
|
+
getJson: function() {
|
238
|
+
//alert("Get json UIJSONObject");
|
239
|
+
var json = {};
|
240
|
+
|
241
|
+
// Construct the json with the children
|
242
|
+
for(var i = 0; i < this.state.attributes; i++) {
|
243
|
+
var attribute = this.refs['object-attribute-' + i].getJson();
|
244
|
+
json = _.extend(json, attribute);
|
245
|
+
}
|
246
|
+
|
247
|
+
this.setState({oldJson: json});
|
248
|
+
return json;
|
249
|
+
|
250
|
+
},
|
251
|
+
deleteAttribute: function(key) {
|
252
|
+
this.setState({
|
253
|
+
attributes: this.state.attributes - 1
|
254
|
+
});
|
255
|
+
this.updateJson = true;
|
256
|
+
},
|
257
|
+
addAttribute: function() {
|
258
|
+
this.setState({attributes: this.state.attributes + 1});
|
259
|
+
},
|
260
|
+
render: function() {
|
261
|
+
var attributes = [];
|
262
|
+
|
263
|
+
for(var i = 0; i < this.state.attributes; i++) {
|
264
|
+
attributes.push(
|
265
|
+
React.createElement(UIJSONAttribute, {
|
266
|
+
updateJSON: this.props.updateJSON,
|
267
|
+
ref: "object-attribute-" + i,
|
268
|
+
keyEnabled: true,
|
269
|
+
deleteAttribute: this.deleteAttribute})
|
270
|
+
);
|
271
|
+
}
|
272
|
+
|
273
|
+
return(
|
274
|
+
React.createElement("div", {className: "panel panel-default"},
|
275
|
+
React.createElement("div", {className: "panel-body"},
|
276
|
+
attributes,
|
277
|
+
React.createElement("div", {className: "col-lg-12 col-md-12 col-sm-12"},
|
278
|
+
React.createElement("button", {onClick: this.addAttribute, type: "button", className: "btn btn-default"},
|
279
|
+
React.createElement("span", {className: "glyphicon glyphicon-plus", "aria-hidden": "true"}), " Add"
|
280
|
+
)
|
281
|
+
)
|
282
|
+
)
|
283
|
+
)
|
284
|
+
);
|
285
|
+
},
|
286
|
+
updateJson: false,
|
287
|
+
componentDidUpdate: function() {
|
288
|
+
if(this.updateJson) {
|
289
|
+
this.props.updateJSON();
|
290
|
+
this.updateJson = false;
|
291
|
+
}
|
292
|
+
}
|
293
|
+
});
|
294
|
+
|
295
|
+
var UIJSONRender = React.createClass ({displayName: "UIJSONRender",
|
296
|
+
render: function() {
|
297
|
+
return(
|
298
|
+
React.createElement("pre", null,
|
299
|
+
React.createElement("code", {className: "JSON"},
|
300
|
+
JSON.stringify(this.props.json, null, 4)
|
301
|
+
)
|
302
|
+
)
|
303
|
+
);
|
304
|
+
},
|
305
|
+
/*
|
306
|
+
componentDidUpdate: function() {
|
307
|
+
$('pre code').each(function(i, block) {
|
308
|
+
hljs.highlightBlock(block);
|
309
|
+
});
|
310
|
+
}
|
311
|
+
*/
|
312
|
+
});
|
313
|
+
|
314
|
+
var UIMessageSend = React.createClass ({displayName: "UIMessageSend",
|
315
|
+
getInitialState: function() {
|
316
|
+
return {
|
317
|
+
application: undefined,
|
318
|
+
instance: undefined,
|
319
|
+
component: undefined,
|
320
|
+
json: {}
|
321
|
+
}
|
322
|
+
},
|
323
|
+
|
324
|
+
componentDidMount: function() {
|
325
|
+
var self = this;
|
326
|
+
|
327
|
+
notificationCenter.subscribe(Notifications.alerts.ALERT_CHANGE, function() {
|
328
|
+
self.setState({
|
329
|
+
application: alertsModel.application,
|
330
|
+
instance: alertsModel.instance,
|
331
|
+
component: alertsModel.component
|
332
|
+
});
|
333
|
+
});
|
334
|
+
},
|
335
|
+
updateJSON: function() {
|
336
|
+
//alert("Update JSON");
|
337
|
+
this.setState({json: this.refs.jsonObject.getJson()})
|
338
|
+
},
|
339
|
+
sendMessage: function() {
|
340
|
+
alert("Send message");
|
341
|
+
var payload = this.refs.jsonObject.getJson();
|
342
|
+
console.log(payload);
|
343
|
+
var channel = messageModel.channel;
|
344
|
+
nutellaFramework.f.net.publish_to_run(this.state.application, this.state.instance, channel, payload)
|
345
|
+
},
|
346
|
+
render: function() {
|
347
|
+
var self = this;
|
348
|
+
|
349
|
+
subscription = [];
|
350
|
+
|
351
|
+
if(this.state.application != undefined) {
|
352
|
+
subscription.push(React.createElement("span", null, "application: ", React.createElement("span", {className: "label label-default"}, this.state.application)));
|
353
|
+
}
|
354
|
+
|
355
|
+
if(this.state.instance != undefined) {
|
356
|
+
subscription.push(React.createElement("span", null, " instance: ", React.createElement("span", {className: "label label-default"}, this.state.instance)));
|
357
|
+
}
|
358
|
+
|
359
|
+
if(this.state.component != undefined) {
|
360
|
+
subscription.push(React.createElement("span", null, " component: ", React.createElement("span", {className: "label label-default"}, this.state.component)));
|
361
|
+
}
|
362
|
+
|
363
|
+
subscription.push(React.createElement("span", null, " on channel: ", React.createElement("span", {className: "label label-default"}, messageModel.channel)));
|
364
|
+
|
365
|
+
return (
|
366
|
+
React.createElement("div", {className: "modal-dialog modal-messages"},
|
367
|
+
React.createElement("div", {className: "modal-content"},
|
368
|
+
React.createElement("div", {className: "modal-header"},
|
369
|
+
React.createElement("button", {type: "button", className: "close", "data-dismiss": "modal", "aria-label": "Close"}, React.createElement("span", {"aria-hidden": "true"}, "×")),
|
370
|
+
React.createElement("h4", {className: "modal-title text-center", id: "myMailLabel"}, "Send message to ", subscription)
|
371
|
+
),
|
372
|
+
React.createElement("div", {className: "modal-body"},
|
373
|
+
React.createElement("div", {className: "col-lg-4 col-md-4 col-sm-4"},
|
374
|
+
React.createElement(UIJSONRender, {json: this.state.json})
|
375
|
+
),
|
376
|
+
React.createElement("div", {className: "col-lg-8 col-md-8 col-sm-8"},
|
377
|
+
React.createElement(UIJSONObject, {updateJSON: this.updateJSON, ref: "jsonObject"})
|
378
|
+
)
|
379
|
+
),
|
380
|
+
React.createElement("div", {className: "modal-footer"},
|
381
|
+
React.createElement("button", {type: "button", className: "btn btn-default", onClick: this.sendMessage}, "Send"),
|
382
|
+
React.createElement("button", {type: "button", className: "btn btn-default", "data-dismiss": "modal"}, "Close")
|
383
|
+
)
|
384
|
+
)
|
385
|
+
)
|
386
|
+
);
|
387
|
+
}
|
388
|
+
});
|
389
|
+
|
@@ -0,0 +1,103 @@
|
|
1
|
+
var UIMessages = React.createClass({displayName: "UIMessages",
|
2
|
+
getInitialState: function () {
|
3
|
+
return {
|
4
|
+
messages: [],
|
5
|
+
from: undefined,
|
6
|
+
to: undefined,
|
7
|
+
type: undefined
|
8
|
+
};
|
9
|
+
},
|
10
|
+
componentDidMount: function () {
|
11
|
+
var self = this;
|
12
|
+
notificationCenter.subscribe(Notifications.data.MESSAGE_DATA_CHANGE, function() {
|
13
|
+
|
14
|
+
var messages = [];
|
15
|
+
|
16
|
+
if(messageModel.data != undefined)
|
17
|
+
messages = messageModel.data.messages;
|
18
|
+
|
19
|
+
self.setState({messages: messages,
|
20
|
+
from: messageModel.from,
|
21
|
+
to: messageModel.to,
|
22
|
+
type: messageModel.type
|
23
|
+
});
|
24
|
+
});
|
25
|
+
|
26
|
+
messageModel.downloadMessages();
|
27
|
+
|
28
|
+
/*
|
29
|
+
messageModel.fetchData("data/message.json");
|
30
|
+
|
31
|
+
setTimeout(function() {
|
32
|
+
messageModel.fetchData("data/message.json");
|
33
|
+
}, 10000)
|
34
|
+
*/
|
35
|
+
},
|
36
|
+
render: function () {
|
37
|
+
var self = this;
|
38
|
+
|
39
|
+
var messages = this.state.messages.map(function(message, index) {
|
40
|
+
|
41
|
+
var date = new Date(message.date);
|
42
|
+
|
43
|
+
return (
|
44
|
+
React.createElement("div", {className: "panel-group", id: "accordion", role: "tablist", "aria-multiselectable": "true"},
|
45
|
+
React.createElement("div", {className: "panel panel-default"},
|
46
|
+
React.createElement("a", {"data-toggle": "collapse", "data-parent": "#accordion", href: "#collapse"+index, "aria-expanded": "true", "aria-controls": "collapse"+index},
|
47
|
+
React.createElement("div", {className: "panel-heading", role: "tab", id: "headingOne"},
|
48
|
+
React.createElement("h4", {className: "panel-title"},
|
49
|
+
date.getUTCDate()+"/"+(date.getUTCMonth()+1)+"/"+date.getUTCFullYear()+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds()+"."+date.getUTCMilliseconds()+
|
50
|
+
" - "+message.type
|
51
|
+
)
|
52
|
+
)
|
53
|
+
),
|
54
|
+
React.createElement("div", {id: "collapse"+index, className: "panel-collapse collapse", role: "tabpanel", "aria-labelledby": "heading"+index},
|
55
|
+
React.createElement("div", {className: "panel-body"},
|
56
|
+
React.createElement("pre", null,
|
57
|
+
React.createElement("code", {className: "JSON"},
|
58
|
+
JSON.stringify(message.payload, null, 4)
|
59
|
+
)
|
60
|
+
)
|
61
|
+
)
|
62
|
+
)
|
63
|
+
)
|
64
|
+
)
|
65
|
+
);
|
66
|
+
});
|
67
|
+
|
68
|
+
return(
|
69
|
+
React.createElement("div", {className: "modal-dialog modal-messages"},
|
70
|
+
React.createElement("div", {className: "modal-content"},
|
71
|
+
React.createElement("div", {className: "modal-header"},
|
72
|
+
React.createElement("button", {type: "button", className: "close", "data-dismiss": "modal", "aria-label": "Close"},
|
73
|
+
React.createElement("span", {"aria-hidden": "true"}, "×")
|
74
|
+
),
|
75
|
+
React.createElement("h4", {className: "modal-title", id: "modalLabel"}, "Message display"),
|
76
|
+
React.createElement("svg", {style: {height: "40px", width: "100%"}, viewBox: "0 0 1000 40"},
|
77
|
+
React.createElement("text", {x: "50", y: "20", textAnchor: "middle", fill: "black"}, this.state.to),
|
78
|
+
React.createElement("text", {x: "950", y: "20", textAnchor: "middle", fill: "black"}, this.state.from),
|
79
|
+
React.createElement("line", {x1: "0", y1: "35", x2: "990", y2: "35", style: {stroke: "#425266", strokeWidth: "5"}}),
|
80
|
+
self.state.type == messageModel.constant.type.publish ?
|
81
|
+
React.createElement("polygon", {points: "990,40 990,30 1000,35", style: {fill:"#425266",stroke:"#425266",strokeWidth:1}})
|
82
|
+
:
|
83
|
+
React.createElement("polygon", {points: "990,40 990,30 1000,30 1000,40", style: {fill:"#425266",stroke:"#425266",strokeWidth:1}})
|
84
|
+
)
|
85
|
+
),
|
86
|
+
React.createElement("div", {className: "modal-body"},
|
87
|
+
messages
|
88
|
+
),
|
89
|
+
React.createElement("div", {className: "modal-footer"},
|
90
|
+
React.createElement("button", {type: "button", className: "btn btn-default", "data-dismiss": "modal"}, "Close")
|
91
|
+
)
|
92
|
+
)
|
93
|
+
)
|
94
|
+
);
|
95
|
+
|
96
|
+
},
|
97
|
+
componentDidUpdate: function() {
|
98
|
+
$('pre code').each(function(i, block) {
|
99
|
+
hljs.highlightBlock(block);
|
100
|
+
});
|
101
|
+
}
|
102
|
+
});
|
103
|
+
|
@@ -0,0 +1,178 @@
|
|
1
|
+
var UIMailInput = React.createClass ({
|
2
|
+
getInitialState: function() {
|
3
|
+
return {
|
4
|
+
email: "",
|
5
|
+
validMail: undefined
|
6
|
+
}
|
7
|
+
},
|
8
|
+
handleChange: function(event) {
|
9
|
+
this.setState({email: event.target.value,
|
10
|
+
validMail: validateEmail(event.target.value) ? true : undefined});
|
11
|
+
},
|
12
|
+
handleSubmit: function() {
|
13
|
+
|
14
|
+
if(validateEmail(this.state.email) == false) {
|
15
|
+
this.setState({validMail: false});
|
16
|
+
return;
|
17
|
+
}
|
18
|
+
|
19
|
+
var message = {
|
20
|
+
application: this.props.application,
|
21
|
+
mail: this.state.email
|
22
|
+
};
|
23
|
+
|
24
|
+
if(this.props.instance != undefined) {
|
25
|
+
message.instance = this.props.instance;
|
26
|
+
}
|
27
|
+
|
28
|
+
if(this.props.component != undefined) {
|
29
|
+
message.component = this.props.component;
|
30
|
+
}
|
31
|
+
|
32
|
+
nutella.net.publish("monitoring/alert/add", message);
|
33
|
+
alertsModel.fetchData();
|
34
|
+
console.log(message);
|
35
|
+
},
|
36
|
+
render: function() {
|
37
|
+
var error = "has-success";
|
38
|
+
var btn = "btn-success";
|
39
|
+
if(this.state.validMail == false) {
|
40
|
+
error = "has-error";
|
41
|
+
btn = "btn-danger";
|
42
|
+
}
|
43
|
+
if(this.state.validMail == undefined) {
|
44
|
+
error = "has-warning";
|
45
|
+
btn = "btn-warning";
|
46
|
+
}
|
47
|
+
|
48
|
+
return(
|
49
|
+
<div className={"input-group input-group-lg "+error}>
|
50
|
+
<span className="input-group-addon" id="sizing-addon1">@</span>
|
51
|
+
<input type="text" id="subscribeEmail" className="form-control" placeholder="e-mail" aria-describedby="sizing-addon1" value={this.state.email} onChange={this.handleChange}/>
|
52
|
+
<span className="input-group-btn">
|
53
|
+
<button className={"btn "+btn} type="button" id="subscribeButton" onClick={this.handleSubmit}>Subscribe</button>
|
54
|
+
</span>
|
55
|
+
</div>
|
56
|
+
)
|
57
|
+
}
|
58
|
+
});
|
59
|
+
|
60
|
+
var UIAlerts = React.createClass ({
|
61
|
+
getInitialState: function() {
|
62
|
+
return {
|
63
|
+
application: undefined,
|
64
|
+
instance: undefined,
|
65
|
+
component: undefined,
|
66
|
+
emails: []
|
67
|
+
|
68
|
+
}
|
69
|
+
},
|
70
|
+
|
71
|
+
componentDidMount: function() {
|
72
|
+
var self = this;
|
73
|
+
|
74
|
+
notificationCenter.subscribe(Notifications.alerts.ALERT_CHANGE, function() {
|
75
|
+
self.setState({
|
76
|
+
application: alertsModel.application,
|
77
|
+
instance: alertsModel.instance,
|
78
|
+
component: alertsModel.component
|
79
|
+
});
|
80
|
+
});
|
81
|
+
|
82
|
+
notificationCenter.subscribe(Notifications.alerts.EMAILS_CHANGE, function() {
|
83
|
+
self.setState({
|
84
|
+
emails: alertsModel.emails
|
85
|
+
});
|
86
|
+
});
|
87
|
+
},
|
88
|
+
handleDelete: function(mail) {
|
89
|
+
var message = {
|
90
|
+
application: this.state.application,
|
91
|
+
mail: mail
|
92
|
+
};
|
93
|
+
|
94
|
+
if(this.state.instance != undefined) {
|
95
|
+
message.instance = this.state.instance;
|
96
|
+
}
|
97
|
+
|
98
|
+
if(this.state.component != undefined) {
|
99
|
+
message.component = this.state.component;
|
100
|
+
}
|
101
|
+
|
102
|
+
nutella.net.publish("monitoring/alert/remove", message);
|
103
|
+
alertsModel.fetchData();
|
104
|
+
},
|
105
|
+
render: function() {
|
106
|
+
var self = this;
|
107
|
+
|
108
|
+
//<div className="floatLeft"><h4>{email}</h4></div>
|
109
|
+
//<div className="floatLeft"><h4><b>X</b></h4></div>
|
110
|
+
var emails = this.state.emails.map(function(email, index) {
|
111
|
+
return (
|
112
|
+
<tr key={index}>
|
113
|
+
<td>
|
114
|
+
Administrator
|
115
|
+
</td>
|
116
|
+
<td>
|
117
|
+
{email}
|
118
|
+
</td>
|
119
|
+
<td>
|
120
|
+
<button type="button" className="close" aria-label="Close" onClick={_.partial(self.handleDelete, email)}><span aria-hidden="true">×</span></button>
|
121
|
+
</td>
|
122
|
+
</tr>
|
123
|
+
|
124
|
+
)
|
125
|
+
});
|
126
|
+
|
127
|
+
subscription = [];
|
128
|
+
|
129
|
+
if(this.state.application != undefined) {
|
130
|
+
subscription.push(<span>application: <span className="label label-default">{this.state.application}</span></span>);
|
131
|
+
}
|
132
|
+
|
133
|
+
if(this.state.instance != undefined) {
|
134
|
+
subscription.push(<span> instance: <span className="label label-default">{this.state.instance}</span></span>);
|
135
|
+
}
|
136
|
+
|
137
|
+
if(this.state.component != undefined) {
|
138
|
+
subscription.push(<span> component: <span className="label label-default">{this.state.component}</span></span>);
|
139
|
+
}
|
140
|
+
|
141
|
+
return (
|
142
|
+
<div className="modal-dialog modal-messages">
|
143
|
+
<div className="modal-content">
|
144
|
+
<div className="modal-header">
|
145
|
+
<button type="button" className="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
146
|
+
<h4 className="modal-title text-center" id="myMailLabel">Subscription to {subscription}</h4>
|
147
|
+
</div>
|
148
|
+
<div className="modal-body">
|
149
|
+
<UIMailInput application={self.state.application} instance={self.state.instance} component={self.state.component}/>
|
150
|
+
<div className = "panel panel-default">
|
151
|
+
<table className="table table-striped">
|
152
|
+
<thead>
|
153
|
+
<tr>
|
154
|
+
<th>Role</th>
|
155
|
+
<th>Email</th>
|
156
|
+
<th></th>
|
157
|
+
</tr>
|
158
|
+
</thead>
|
159
|
+
<tbody>
|
160
|
+
{emails}
|
161
|
+
</tbody>
|
162
|
+
</table>
|
163
|
+
</div>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div className="modal-footer">
|
167
|
+
<button type="button" className="btn btn-default" data-dismiss="modal">Close</button>
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
</div>
|
171
|
+
);
|
172
|
+
}
|
173
|
+
});
|
174
|
+
|
175
|
+
function validateEmail(email) {
|
176
|
+
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
|
177
|
+
return re.test(email);
|
178
|
+
}
|