Commit 38e56924 authored by Alain Takoudjou's avatar Alain Takoudjou

[erp5_web_monitoring] replace jquery notify plugin with erp5_notify gadget

parent 2932fbc3
...@@ -148,11 +148,14 @@ ...@@ -148,11 +148,14 @@
} }
if (msg_list.length > 0) { if (msg_list.length > 0) {
return RSVP.all([ return RSVP.all([
gadget.notifySubmitted('Error while ' + msg_list.join('; ')) gadget.notifySubmitted({
message: 'Error while ' + msg_list.join('; '),
status: 'error'
})
]); ]);
} }
return RSVP.all([ return RSVP.all([
gadget.notifySubmitted('Parameters Updated') gadget.notifySubmitted({message: 'Parameters Updated', status: 'success'})
]); ]);
}); });
}) })
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.1690.33865.32955</string> </value> <value> <string>963.20929.61143.52155</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509095405.67</float> <float>1510216762.18</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -548,7 +548,8 @@ ...@@ -548,7 +548,8 @@
.push(function (select_limit) { .push(function (select_limit) {
return getInstanceOPMLListFromMaster(gadget, select_limit); return getInstanceOPMLListFromMaster(gadget, select_limit);
}) })
.push(undefined, function () { .push(undefined, function (error) {
console.log(error);
gadget.state.message gadget.state.message
.innerHTML = notify_msg_template({ .innerHTML = notify_msg_template({
status: 'error', status: 'error',
...@@ -587,10 +588,16 @@ ...@@ -587,10 +588,16 @@
has_failed = true; has_failed = true;
}) })
.push(function () { .push(function () {
if (!has_failed) { if (has_failed) {
return gadget.notifySubmitted("Failed to import Configurations"); return gadget.notifySubmitted({
message: "Failed to import Configurations",
status: "error"
});
} else { } else {
return gadget.notifySubmitted("Configuration Saved!"); return gadget.notifySubmitted({
message: "Configuration Saved!",
status: "success"
});
} }
}) })
.push(function () { .push(function () {
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.17936.4203.52804</string> </value> <value> <string>963.21850.42337.9796</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509983206.06</float> <float>1510219191.94</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -85,9 +85,9 @@ ...@@ -85,9 +85,9 @@
return opml_global.saveOPML(doc, true); return opml_global.saveOPML(doc, true);
}) })
.push(function (status) { .push(function (status) {
var msg = 'Document Updated'; var msg = {message: 'OPML document added', status: 'success'};
if (!status) { if (!status) {
msg = 'Document update failed'; msg = {message: 'Failed to add OPML document', status: "error"};
} }
return RSVP.all([ return RSVP.all([
gadget.notifySubmitted(msg), gadget.notifySubmitted(msg),
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.1933.16122.39953</string> </value> <value> <string>963.21318.32760.12475</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509023050.17</float> <float>1510217057.28</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
return gadget.jio_remove(options.jio_key); return gadget.jio_remove(options.jio_key);
}) })
.push(function () { .push(function () {
return gadget.notifySubmitted("Document Deleted"); return gadget.notifySubmitted({message: "Document Deleted", status: "success"});
}) })
.push(function () { .push(function () {
return gadget.redirect({command: 'change', options: { return gadget.redirect({command: 'change', options: {
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.642.61316.20292</string> </value> <value> <string>963.20929.61143.52155</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1508945461.31</float> <float>1510231849.59</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/> <link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="notify.min.js"></script>
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.46066.30387.47069</string> </value> <value> <string>963.22427.36654.49664</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1507902085.76</float> <float>1510327379.3</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, RSVP, URI, location, $, /*global window, rJS, RSVP, Handlebars */
loopEventListener, btoa */
/*jslint nomen: true, indent: 2, maxerr: 3*/ /*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, $, RSVP) { (function (window, rJS, RSVP, Handlebars) {
"use strict"; "use strict";
var gadget_klass = rJS(window), var gadget_klass = rJS(window),
...@@ -71,16 +70,13 @@ ...@@ -71,16 +70,13 @@
.get(gadget.property_dict.monitor_process_state); .get(gadget.property_dict.monitor_process_state);
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
console.error(error); return gadget.notifySubmitted({
$.notify( message: "Error: Failed to download data files!",
"Error: Failed to download data files!", status: "error"
{ })
position: "top right", .push(function () {
autoHideDelay: 7000, return undefined;
className: "error" });
}
);
return undefined;
}) })
.push(function (average_result) { .push(function (average_result) {
if (average_result !== undefined) { if (average_result !== undefined) {
...@@ -93,6 +89,7 @@ ...@@ -93,6 +89,7 @@
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod('jio_get', 'jio_get') .declareAcquiredMethod('jio_get', 'jio_get')
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.allowPublicAcquisition("jio_allDocs", function (param_list) { .allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this, var gadget = this,
...@@ -225,8 +222,7 @@ ...@@ -225,8 +222,7 @@
return gadget.property_dict.jio_gadget return gadget.property_dict.jio_gadget
.get(gadget.property_dict.monitor_process_state) .get(gadget.property_dict.monitor_process_state)
.push(undefined, function (error) { .push(undefined, function () {
console.error(error);
return undefined; return undefined;
}) })
.push(function (average_result) { .push(function (average_result) {
...@@ -238,4 +234,4 @@ ...@@ -238,4 +234,4 @@
}); });
}, 65000); }, 65000);
}(window, rJS, $, RSVP)); }(window, rJS, RSVP, Handlebars));
\ No newline at end of file \ No newline at end of file
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.16563.15280.46899</string> </value> <value> <string>963.22187.48632.58282</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1510052139.85</float> <float>1510239168.21</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/> <link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="notify.min.js"></script>
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<!--<script src="handlebars.js"></script>--> <!--<script src="handlebars.js"></script>-->
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.36002.50044.8055</string> </value> <value> <string>963.22427.36654.49664</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1507902037.02</float> <float>1510327355.11</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, RSVP, Handlebars, $, console */ /*global window, rJS, RSVP, console */
/*jslint nomen: true, indent: 2, maxerr: 3*/ /*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP, $, console) { (function (window, rJS, RSVP, console) {
"use strict"; "use strict";
var gadget_klass = rJS(window); var gadget_klass = rJS(window);
...@@ -9,20 +9,15 @@ ...@@ -9,20 +9,15 @@
function loadGraphData(gadget, key) { function loadGraphData(gadget, key) {
var resource_key = gadget.property_dict.ressource_dict[key]; var resource_key = gadget.property_dict.ressource_dict[key];
return gadget.property_dict.jio_gadget.get(resource_key) return gadget.property_dict.jio_gadget.get(resource_key)
.push(undefined, function (error) { .push(undefined, function () {
console.log(error); return gadget.notifySubmitted({
$.notify( message: "Error: Failed to download resource file '" + resource_key +
"Error: Failed to download resource file '" + resource_key + "' from URL: " + gadget.state.opml_outline.url,
"' from URL: " + gadget.state.opml_outline.url, status: "error"
{ })
position: "top right", .push(function () {
autoHideDelay: 7000, return {data: []};
className: "error" });
}
);
return {
data: []
};
}) })
.push(function (jio_element) { .push(function (jio_element) {
gadget.property_dict.date_window = getDateWindow(gadget.property_dict.mem_data.data); gadget.property_dict.date_window = getDateWindow(gadget.property_dict.mem_data.data);
...@@ -98,7 +93,7 @@ ...@@ -98,7 +93,7 @@
} }
} }
return { return {
value:{ value: {
data: data_list, data: data_list,
layout: { layout: {
axis_dict : axis_dict, axis_dict : axis_dict,
...@@ -117,13 +112,13 @@ ...@@ -117,13 +112,13 @@
max_date = data[data.length - 1].split(',')[0]; max_date = data[data.length - 1].split(',')[0];
begin_date = new Date(max_date); begin_date = new Date(max_date);
end_date = new Date(max_date); end_date = new Date(max_date);
begin_date.setHours(begin_date.getHours() -2); begin_date.setHours(begin_date.getHours() - 2);
date_window = [Date.parse(begin_date), Date.parse(end_date)]; date_window = [Date.parse(begin_date), Date.parse(end_date)];
} }
return date_window; return date_window;
} }
function updateGraph (gadget) { function updateGraph(gadget) {
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
var key, var key,
...@@ -178,7 +173,7 @@ ...@@ -178,7 +173,7 @@
data_list[0].value_dict["1"].push(line_list[2]); data_list[0].value_dict["1"].push(line_list[2]);
} }
return gadget.property_dict.graph_mem_used.render({ return gadget.property_dict.graph_mem_used.render({
value:{ value: {
data: data_list, data: data_list,
layout: { layout: {
axis_dict : axis_dict, axis_dict : axis_dict,
...@@ -246,7 +241,7 @@ ...@@ -246,7 +241,7 @@
} }
} }
return gadget.property_dict.graph_cpu.render({ return gadget.property_dict.graph_cpu.render({
value:{ value: {
data: data_list, data: data_list,
layout: { layout: {
axis_dict : axis_dict, axis_dict : axis_dict,
...@@ -345,6 +340,7 @@ ...@@ -345,6 +340,7 @@
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod('jio_get', 'jio_get') .declareAcquiredMethod('jio_get', 'jio_get')
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.onLoop(function () { .onLoop(function () {
return updateGraph(this); return updateGraph(this);
...@@ -443,4 +439,4 @@ ...@@ -443,4 +439,4 @@
}); });
}); });
}(window, rJS, RSVP, $, console)); }(window, rJS, RSVP, console));
\ No newline at end of file \ No newline at end of file
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.64762.24229.58760</string> </value> <value> <string>963.22199.29933.17390</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1508860480.94</float> <float>1510239154.52</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.notifySubmitted('All OPML removed') gadget.notifySubmitted({message: 'All OPML removed', status: 'success'})
]); ]);
}) })
.push(function () { .push(function () {
...@@ -115,8 +115,7 @@ ...@@ -115,8 +115,7 @@
return gadget.redirect({"command": "reload"}); return gadget.redirect({"command": "reload"});
}); });
} }
event.returnValue = true; }, false, false)
})
.onEvent('submit', function () { .onEvent('submit', function () {
var gadget = this, var gadget = this,
doc; doc;
...@@ -146,7 +145,7 @@ ...@@ -146,7 +145,7 @@
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.notifySubmitted('Parameters Updated') gadget.notifySubmitted({message: 'Parameters Updated', status: 'success'})
]); ]);
}); });
}) })
......
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.17877.3072.30788</string> </value> <value> <string>963.21245.1149.59784</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509981253.88</float> <float>1510216637.34</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -83,9 +83,9 @@ ...@@ -83,9 +83,9 @@
doc.title === "" || doc.title === undefined || doc.verify_password === 1); doc.title === "" || doc.title === undefined || doc.verify_password === 1);
}) })
.push(function (status) { .push(function (status) {
var msg = 'Document Updated'; var msg = {message: 'Document Updated', status: 'success'};
if (!status) { if (!status) {
msg = 'Document update failed'; msg = {message: 'Document update failed', status: "error"};
} }
return RSVP.all([ return RSVP.all([
gadget.notifySubmitted(msg), gadget.notifySubmitted(msg),
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
"opml_title": doc.title || "", "opml_title": doc.title || "",
"opml_key": options.jio_key, "opml_key": options.jio_key,
"password": doc.password "password": doc.password
}); });
}) })
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.1932.7812.44987</string> </value> <value> <string>963.21293.17700.853</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509022866.95</float> <float>1510185606.72</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -137,11 +137,9 @@ monitoring_jio_http_storage.js\n ...@@ -137,11 +137,9 @@ monitoring_jio_http_storage.js\n
monitoring_jio_parser_storage.js\n monitoring_jio_parser_storage.js\n
monitoring_jio_storage.js\n monitoring_jio_storage.js\n
monitoring_jio_web_storage.js\n monitoring_jio_web_storage.js\n
jquery.js\n
jsen.min.js\n jsen.min.js\n
renderjs.js\n renderjs.js\n
rsvp.js\n rsvp.js\n
notify.min.js\n
\n \n
# shared\n # shared\n
gadget_erp5_notification.html\n gadget_erp5_notification.html\n
...@@ -197,6 +195,8 @@ gadget_erp5_field_integer.html\n ...@@ -197,6 +195,8 @@ gadget_erp5_field_integer.html\n
gadget_erp5_field_integer.js\n gadget_erp5_field_integer.js\n
gadget_erp5_jio.html\n gadget_erp5_jio.html\n
gadget_erp5_jio.js\n gadget_erp5_jio.js\n
gadget_erp5_search_editor.html\n
gadget_erp5_search_editor.js\n
\n \n
# monitoring\n # monitoring\n
gadget_officejs_monitoring.appcache\n gadget_officejs_monitoring.appcache\n
...@@ -383,7 +383,7 @@ NETWORK:\n ...@@ -383,7 +383,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.17891.16389.10547</string> </value> <value> <string>963.22437.57747.1757</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -401,7 +401,7 @@ NETWORK:\n ...@@ -401,7 +401,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1509980460.49</float> <float>1510327329.0</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,8 +8,6 @@ ...@@ -8,8 +8,6 @@
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="jquery.js" type="text/javascript"></script>
<script src="notify.min.js"></script>
<script src="gadget_officejs_monitoring_sync.js"></script> <script src="gadget_officejs_monitoring_sync.js"></script>
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.48761.27674.29661</string> </value> <value> <string>963.20929.61143.52155</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1507900413.18</float> <float>1510233336.64</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
.declareAcquiredMethod("getSetting", "getSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("jio_repair", "jio_repair") .declareAcquiredMethod("jio_repair", "jio_repair")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.declareMethod("registerSync", function (options) { .declareMethod("registerSync", function (options) {
var gadget = this; var gadget = this;
...@@ -74,15 +76,6 @@ ...@@ -74,15 +76,6 @@
return syncAllStorage(); return syncAllStorage();
} }
gadget.props.offline = true; gadget.props.offline = true;
return $.notify(
"Sync aborted, no internet access...",
{
position: "bottom right",
autoHide: true,
className: "error",
autoHideDelay: 10000
}
);
}); });
} }
return syncAllStorage(); return syncAllStorage();
...@@ -98,15 +91,13 @@ ...@@ -98,15 +91,13 @@
return gadget.setSetting('sync_start_time', new Date().getTime()); return gadget.setSetting('sync_start_time', new Date().getTime());
}) })
.push(function () { .push(function () {
$(".notifyjs-wrapper").remove(); return gadget.notifySubmitting();
return $.notify( })
"Synchronizing Data...", .push(function () {
{ return gadget.notifySubmitted({
position: "bottom right", message: "Synchronizing Data...",
autoHide: false, status: "success"
className: "info" });
}
);
}) })
.push(function () { .push(function () {
// call repair on storage // call repair on storage
...@@ -119,36 +110,33 @@ ...@@ -119,36 +110,33 @@
}) })
.push(function () { .push(function () {
last_sync_time = new Date().getTime(); last_sync_time = new Date().getTime();
return gadget.setSetting('latest_sync_time', last_sync_time); return RSVP.all([
gadget.setSetting('latest_sync_time', last_sync_time),
gadget.notifySubmitting()
]);
}) })
.push(function () { .push(function () {
var time = 3000, var time = 3000,
classname = "info", classname = "success",
message = "Synchronisation finished.", message = "Synchronisation finished.",
//log_message = '', //log_message = '',
log_title = "OK: " + message; log_title = "OK: " + message;
if (has_error) { if (has_error) {
classname = "warning"; classname = "error";
time = 5000; time = 5000;
//log_message = getErrorLog(gadget.props.error_list); //log_message = getErrorLog(gadget.props.error_list);
log_title = "Synchronisation finished with error(s)."; log_title = "Synchronisation finished with error(s).";
message = log_title + "\nYou can retry with manual sync."; message = log_title + "\nYou can retry with manual sync.";
} }
$(".notifyjs-wrapper").remove(); return gadget.notifySubmitted({
return RSVP.all([$.notify( message: message,
message, status: classname
{ });
position: "bottom right",
autoHide: true,
className: classname,
autoHideDelay: time
}
)]);
}) })
.push(function () { .push(function () {
gadget.props.started = false; gadget.props.started = false;
return $.notify( /*return $.notify(
"Last Sync: " + formatDate(new Date(last_sync_time)), "Last Sync: " + formatDate(new Date(last_sync_time)),
{ {
position: "bottom right", position: "bottom right",
...@@ -156,7 +144,7 @@ ...@@ -156,7 +144,7 @@
className: "success", className: "success",
autoHideDelay: 30000 autoHideDelay: 30000
} }
); );*/
}); });
} }
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.53134.26022.64665</string> </value> <value> <string>963.21916.52285.31846</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1508860939.04</float> <float>1510233154.98</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
web_page_module/gadget_erp5_page_settings_configurator_*
web_page_module/ojsm_gadget_erp5_statusfield_*
web_page_module/Notify_min_js
web_page_module/gadget_erp5_field_status_* web_page_module/gadget_erp5_field_status_*
web_page_module/gadget_erp5_page_ojsm_* web_page_module/gadget_erp5_page_ojsm_*
web_page_module/gadget_erp5_page_settings_configurator_*
web_page_module/gadget_officejs_jio_global_view_html web_page_module/gadget_officejs_jio_global_view_html
web_page_module/gadget_officejs_jio_global_view_js web_page_module/gadget_officejs_jio_global_view_js
web_page_module/gadget_officejs_jio_opml_view_html web_page_module/gadget_officejs_jio_opml_view_html
...@@ -15,6 +13,6 @@ web_page_module/monitoring_jio_http_storage_js ...@@ -15,6 +13,6 @@ web_page_module/monitoring_jio_http_storage_js
web_page_module/monitoring_jio_parser_storage_js web_page_module/monitoring_jio_parser_storage_js
web_page_module/monitoring_jio_storage_js web_page_module/monitoring_jio_storage_js
web_page_module/monitoring_jio_web_storage_js web_page_module/monitoring_jio_web_storage_js
web_page_module/rjs_jquery_js web_page_module/ojsm_gadget_erp5_statusfield_*
web_site_module/officejs_monitoring web_site_module/officejs_monitoring
web_site_module/officejs_monitoring/** web_site_module/officejs_monitoring/**
\ No newline at end of file
web_page_module/gadget_erp5_page_settings_configurator_*
web_page_module/ojsm_gadget_erp5_statusfield_*
web_page_module/Notify_min_js
web_page_module/gadget_erp5_field_status_* web_page_module/gadget_erp5_field_status_*
web_page_module/gadget_erp5_page_ojsm_* web_page_module/gadget_erp5_page_ojsm_*
web_page_module/gadget_erp5_page_settings_configurator_*
web_page_module/gadget_officejs_jio_global_view_html web_page_module/gadget_officejs_jio_global_view_html
web_page_module/gadget_officejs_jio_global_view_js web_page_module/gadget_officejs_jio_global_view_js
web_page_module/gadget_officejs_jio_opml_view_html web_page_module/gadget_officejs_jio_opml_view_html
...@@ -15,6 +13,6 @@ web_page_module/monitoring_jio_http_storage_js ...@@ -15,6 +13,6 @@ web_page_module/monitoring_jio_http_storage_js
web_page_module/monitoring_jio_parser_storage_js web_page_module/monitoring_jio_parser_storage_js
web_page_module/monitoring_jio_storage_js web_page_module/monitoring_jio_storage_js
web_page_module/monitoring_jio_web_storage_js web_page_module/monitoring_jio_web_storage_js
web_page_module/rjs_jquery_js web_page_module/ojsm_gadget_erp5_statusfield_*
web_site_module/officejs_monitoring web_site_module/officejs_monitoring
web_site_module/officejs_monitoring/** web_site_module/officejs_monitoring/**
\ No newline at end of file
web_page_module/Notify_min_js
web_page_module/gadget_erp5_field_status_* web_page_module/gadget_erp5_field_status_*
web_page_module/gadget_erp5_page_ojsm_* web_page_module/gadget_erp5_page_ojsm_*
web_page_module/gadget_erp5_page_settings_configurator_* web_page_module/gadget_erp5_page_settings_configurator_*
...@@ -15,6 +14,5 @@ web_page_module/monitoring_jio_parser_storage_js ...@@ -15,6 +14,5 @@ web_page_module/monitoring_jio_parser_storage_js
web_page_module/monitoring_jio_storage_js web_page_module/monitoring_jio_storage_js
web_page_module/monitoring_jio_web_storage_js web_page_module/monitoring_jio_web_storage_js
web_page_module/ojsm_gadget_erp5_statusfield_* web_page_module/ojsm_gadget_erp5_statusfield_*
web_page_module/rjs_jquery_js
web_site_module/officejs_monitoring web_site_module/officejs_monitoring
web_site_module/officejs_monitoring/** web_site_module/officejs_monitoring/**
\ No newline at end of file
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