Commit f269e093 authored by Łukasz Nowak's avatar Łukasz Nowak

erp5_web_monitoring: Apply JSLint

parent e1b5e7e1
...@@ -74,21 +74,21 @@ ...@@ -74,21 +74,21 @@
//"date, io rw counter, io cycles counter, disk used" //"date, io rw counter, io cycles counter, disk used"
line_list = ["io rw count (Kb/s)", "io cycles count (/1000)"]; //, "disk used"]; line_list = ["io rw count (Kb/s)", "io cycles count (/1000)"]; //, "disk used"];
axis_list.push({ axis_list.push({
"0": { "0": {
"title": "IO read/write counter", "title": "IO read/write counter",
"scale_type": "linear", "scale_type": "linear",
"value_type": "date", "value_type": "date",
"zoom_range": date_window "zoom_range": date_window
} }
}); });
axis_list.push({ axis_list.push({
"0": { "0": {
"title": "IO cycles counter", "title": "IO cycles counter",
"scale_type": "linear", "scale_type": "linear",
"value_type": "date", "value_type": "date",
"zoom_range": date_window "zoom_range": date_window
} }
}); });
for (i = 0; i < line_list.length; i += 1) { for (i = 0; i < line_list.length; i += 1) {
line_list[i] = line_list[i].trim(); line_list[i] = line_list[i].trim();
data_list.push({ data_list.push({
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
}) })
.push(function () { .push(function () {
//return gadget.element.querySelector('form button[type="submit"]').click(); //return gadget.element.querySelector('form button[type="submit"]').click();
return gadget.getDeclaredGadget('form_cpu_graph') return gadget.getDeclaredGadget('form_cpu_graph')
.push(function (form_gadget) { .push(function (form_gadget) {
return form_gadget.getContent(); return form_gadget.getContent();
}) })
...@@ -433,14 +433,14 @@ ...@@ -433,14 +433,14 @@
"left", "left",
[["my_graph_auto_update"], ["my_cpu_graph_select"]] [["my_graph_auto_update"], ["my_cpu_graph_select"]]
], ],
[ [
"right", "right",
[] []
], ],
[ [
"bottom", "bottom",
[] []
]] ]]
} }
}); });
}) })
...@@ -479,7 +479,7 @@ ...@@ -479,7 +479,7 @@
updateGraph(gadget, true); updateGraph(gadget, true);
} }
if (evt.target.getAttribute("name") === "graph_auto_update_key") { if (evt.target.getAttribute("name") === "graph_auto_update_key") {
if (evt.target.value == "on") { if (evt.target.value === "on") {
gadget.property_dict.disable_update = false; gadget.property_dict.disable_update = false;
} else { } else {
gadget.property_dict.disable_update = true; gadget.property_dict.disable_update = true;
......
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
doc; doc;
return gadget.notifySubmitting() return gadget.notifySubmitting()
.push(function () { .push(function () {
return gadget.getDeclaredGadget('form_view'); return gadget.getDeclaredGadget('form_view');
}) })
.push(function (form_gadget) { .push(function (form_gadget) {
return form_gadget.getContent(); return form_gadget.getContent();
......
...@@ -194,17 +194,17 @@ ...@@ -194,17 +194,17 @@
.value.aggregate_reference === undefined) { .value.aggregate_reference === undefined) {
// Instance is not Synchronized! // Instance is not Synchronized!
promise_list.push(false); promise_list.push(false);
continue; } else {
gadget_element = document.createElement("div");
element.appendChild(gadget_element);
promise_list.push(
gadget.declareGadget("gadget_officejs_monitoring_parameter_view.html",
{element: gadget_element,
scope: 'p_' + gadget.state.instance_dict.data.rows[i].id,
sandbox: "public"}
)
);
} }
gadget_element = document.createElement("div");
element.appendChild(gadget_element);
promise_list.push(
gadget.declareGadget("gadget_officejs_monitoring_parameter_view.html",
{element: gadget_element,
scope: 'p_' + gadget.state.instance_dict.data.rows[i].id,
sandbox: "public"}
)
);
} }
return RSVP.all(promise_list); return RSVP.all(promise_list);
}) })
......
/*global window, rJS, RSVP, Handlebars */ /*global window, rJS, RSVP, Rusha, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Rusha) { (function (window, rJS, RSVP, Rusha) {
"use strict"; "use strict";
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
start; start;
function addUTCTimezone(date_string) { function addUTCTimezone(date_string) {
if (new RegExp(/[+-][\d]{2}\:?[\d]{2}$/).test(date_string)) { if (new RegExp(/[+\-][\d]{2}\:?[\d]{2}$/).test(date_string)) {
return date_string; return date_string;
} }
return date_string + "+0000"; return date_string + "+0000";
......
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
var message_text, var message_text,
code = 0; code = 0;
if (error instanceof jIO.util.jIOError) { if (error instanceof jIO.util.jIOError) {
message_text = error.message; message_text = error.message;
code = error.status_code; code = error.status_code;
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
} }
return context.getUrlParameter('editable') return context.getUrlParameter('editable')
.push(function () { .push(function () {
return context.registerSync(); return context.registerSynchronisation();
}) })
.push(function (editable) { .push(function (editable) {
return context.changeState({ return context.changeState({
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
window.dispatchEvent(event); window.dispatchEvent(event);
return result; return result;
}) })
.declareJob('registerSync', function () { .declareJob('registerSynchronisation', function () {
return this.getDeclaredGadget("sync_gadget") return this.getDeclaredGadget("sync_gadget")
.push(function (sync_gadget) { .push(function (sync_gadget) {
return sync_gadget.register(); return sync_gadget.register();
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
*/ */
/*jslint nomen: true */ /*jslint nomen: true, indent: 2, maxerr: 3*/
/*global jIO, RSVP, Rusha, console, Blob */ /*global jIO, RSVP, Rusha, console, Blob */
(function (jIO, RSVP, Rusha, Blob, console) { (function (jIO, RSVP, Rusha, Blob, console) {
...@@ -402,6 +402,15 @@ ...@@ -402,6 +402,15 @@
}); });
} }
function fixDateTimezone(date_string) {
// set default timezone offset to UTC
// XXX should be removed later
if (ZONE_LIST.indexOf(date_string.slice(-5)) === -1) {
return date_string + "+0000";
}
return date_string;
}
function updateHostingSubscriptionState(hosting, element) { function updateHostingSubscriptionState(hosting, element) {
var status = element.status.toUpperCase(); var status = element.status.toUpperCase();
...@@ -410,22 +419,15 @@ ...@@ -410,22 +419,15 @@
} }
if (hosting.status === "ERROR") { if (hosting.status === "ERROR") {
return; return;
} else if (status === "ERROR") { }
if (status === "ERROR") {
hosting.status = status; hosting.status = status;
} else if (status === "WARNING") { } else if (status === "WARNING") {
hosting.status = status; hosting.status = status;
} if (status === "OK" && hosting.status !== status) {
hosting.status = status;
} }
} if (status === "OK" && hosting.status !== status) {
hosting.status = status;
function fixDateTimezone(date_string) {
// set default timezone offset to UTC
// XXX should be removed later
if (ZONE_LIST.indexOf(date_string.slice(-5)) === -1) {
return date_string + "+0000";
} }
return date_string;
} }
function getOpmlTree(context, opml_url, opml_spec, basic_login, opml_title) { function getOpmlTree(context, opml_url, opml_spec, basic_login, opml_title) {
...@@ -702,8 +704,7 @@ ...@@ -702,8 +704,7 @@
name: result_list[i].url, name: result_list[i].url,
doc: result_list[i].current_signature doc: result_list[i].current_signature
}); });
} } else if (context._remote_storage_unreachable_status !== undefined) {
else if (context._remote_storage_unreachable_status !== undefined) {
if (result_list[i].type === "webhttp") { if (result_list[i].type === "webhttp") {
// In case it was impossible to get software Instance // In case it was impossible to get software Instance
// Add an empty Software Instance with unreachable status // Add an empty Software Instance with unreachable status
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
*/ */
/*jslint nomen: true*/ /*jslint nomen: true, indent: 2, maxerr: 3*/
/*global jIO, RSVP */ /*global jIO, RSVP */
(function (jIO, RSVP) { (function (jIO, RSVP) {
......
/*global window, rJS, Handlebars */ /*global window, rJS, Handlebars */
/*jslint indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, Handlebars) { (function (window, rJS, Handlebars) {
"use strict"; "use strict";
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
templater = gadget_klass.__template_element, templater = gadget_klass.__template_element,
status_field_template = Handlebars.compile( status_field_template = Handlebars.compile(
templater.getElementById("template-status-field").innerHTML templater.getElementById("template-status-field").innerHTML
); );
gadget_klass gadget_klass
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
return this.changeState(state_dict); return this.changeState(state_dict);
}) })
.onStateChange(function (modification_dict) { .onStateChange(function () {
if (this.state.hidded) { if (this.state.hidded) {
this.element.innerHTML = ""; this.element.innerHTML = "";
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment