Commit 89a58c60 authored by Roque's avatar Roque

[WIP] erp5_web_monitoring: Romain changes in monitoring app

parent 4463bfb4
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Monitor Custom gadget display</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojsm_gadget_display.js"></script>
</head>
<body>
<form class="save_form ui-body-c" novalidate>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div class='container'></div>
</form>
</body>
</html>
\ No newline at end of file
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, RSVP, rJS, jIO, document) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("jio_get", "jio_get")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.allowPublicAcquisition("getPromiseDocument", function (param_list) {
var gadget = this,
source = param_list[0],
url_suffix = param_list[1];
return gadget.jio_allDocs({
// select_list: [],
query: 'portal_type:promise AND source:"' + source + '" AND channel:' +
gadget.state.instance.specialise_title
})
.push(function (result) {
if (result.data.rows.length !== 1) {
throw new Error('Unexpected number of promise ' +
result.data.rows.length);
}
return gadget.jio_get(result.data.rows[0].id);
})
.push(function (result) {
return jIO.util.ajax({
type: "GET",
url: result.link + url_suffix,
dataType: "text",
headers: {
authorization: "Basic " + gadget.state.basic_login
},
xhrFields: {
withCredentials: false
}
});
})
.push(function (evt) {
return evt.target.responseText;
});
})
.onEvent('submit', function () {
// ON submit, refresh page
return this.redirect({command: 'reload'});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareJob("loadCustomGadget", function () {
var gadget = this,
container;
container = gadget.element.querySelector('.container');
return gadget.notifySubmitting()
.push(function () {
return gadget.declareGadget(
//gadget.state.gadget_url,
"https://softinst141426.host.vifib.net/share/public/html/software.cfg.html",
{
element: container,
scope: "custom_gadget",
sandbox: "iframe"
});
})
.push(function (custom_gadget) {
return new RSVP.Queue()
.push(function () {
return custom_gadget.render({
//channel: gadget.state.instance_tree.title,
//url: gadget.state.opml.url,
//username: gadget.state.opml.username,
//password: gadget.state.opml.password,
//basic_login: gadget.state.opml.basic_login
})
.push(function () {
return gadget.notifySubmitted({
message: "Gadget loaded.",
status: "success"
});
});
})
.push(undefined, function (error) {
// render does not exist or failed
console.error(error);
return gadget.notifySubmitted({
message: "Failed to render the gadget!",
status: "error"
});
});
}, function (error) {
// Failed to load the gadget. Probably not found!
console.error(error);
return gadget.notifySubmitted({
message: "Could not load gadget!",
status: "error"
});
});
})
.declareMethod("render", function (options) {
var gadget = this;
return gadget.jio_get(options.key)
.push(function (instance_doc) {
return gadget.changeState({instance: instance_doc});
})
.push(function () {
return gadget.jio_get(options.opml_url);
}).push(function (opml) {
return gadget.changeState({
basic_login: opml.basic_login,
gadget_url: gadget.state.instance.software_release + ".html"
});
})
.push(function () {
return gadget.getUrlFor({command: 'history_previous'});
})
.push(function (previous_url) {
var options = {
page_title: "Software Instance: " + gadget.state.instance.title,
selection_url: previous_url,
refresh_action: true
};
return gadget.updateHeader(options);
});
})
.onStateChange(function (modification_dict) {
var gadget = this;
if (!modification_dict.hasOwnProperty('gadget_url')) {
return;
}
return gadget.loadCustomGadget();
});
}(window, RSVP, rJS, jIO, document));
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Monitoring Delete OPML JS</string> </value> <value> <string>OfficeJS Monitoring OPML Delete JS</string> </value>
</item> </item>
<item> <item>
<key> <string>url_string</string> </key> <key> <string>url_string</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>963.27666.8050.30907</string> </value> <value> <string>1004.55433.58483.4608</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1510581396.39</float> <float>1670427603.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -41,16 +41,16 @@ ...@@ -41,16 +41,16 @@
data-gadget-sandbox="public"> data-gadget-sandbox="public">
</div> </div>
</form> </form>
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_cpu" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_cpu" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
<div class="ui-grid-a ui-responsive"> <div class="ui-grid-a ui-responsive">
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_memory_used" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_memory_used" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
<div class="ui-grid-a ui-responsive"> <div class="ui-grid-a ui-responsive">
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_io_read" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_io_read" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
<div class="ui-grid-a ui-responsive"> <div class="ui-grid-a ui-responsive">
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_io_write" class="graph graph-h-medium" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_io_write" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div> </div>
</body> </body>
</html> </html>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.40737.38602.8192</string> </value> <value> <string>1004.34236.10343.40209</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1542206472.63</float> <float>1669244284.09</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.43798.57526.26624</string> </value> <value> <string>1004.34930.23605.8738</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1542387970.17</float> <float>1669283952.25</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<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 class="render-link-template" type="text/x-handlebars-template">
<a href="{{url}}" target="{{target}}">{{title}}</a>
</script>
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="gadget_officejs_jio_instance_tree_view.js"></script> <script src="gadget_officejs_jio_instance_tree_view.js"></script>
...@@ -15,25 +18,13 @@ ...@@ -15,25 +18,13 @@
</head> </head>
<body> <body>
<br/> <div class="center">
<article class="ui-content ui-body-c">
<section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c">
<span class="ui-icon ui-icon-custom ui-icon-cubes">&nbsp;</span>
<span class="hosting-title"></span>
</h3>
</section>
<section class="ui-body-c ui-content-section">
<p class="text-info">To change monitor password, go to <i>Monitoring Configuration</i>.</p>
<div class="parameters-box">
</div>
</section>
</article>
<div class="bottom">
<div data-gadget-url="gadget_erp5_form.html" <div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_list" data-gadget-scope="form_list"
data-gadget-sandbox="public"> data-gadget-sandbox="public">
</div> </div>
</div> </div>
<div class="bottom custom-gadget">
</div>
</body> </body>
</html> </html>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>971.13402.51340.4454</string> </value> <value> <string>1004.26520.12594.3771</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1540563538.46</float> <float>1670343169.06</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, document, RSVP, escape */ /*global window, rJS, document, RSVP, escape */
/*jslint nomen: true, indent: 2, maxerr: 3*/ /*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, document, RSVP, escape) { (function (window, rJS, document, Handlebars, RSVP, jIO, escape) {
"use strict"; "use strict";
var gadget_klass = rJS(window); var gadget_klass = rJS(window),
source = gadget_klass.__template_element
.querySelector(".render-link-template")
.innerHTML,
link_template = Handlebars.compile(source);
gadget_klass gadget_klass
.setState({ .setState({
...@@ -31,11 +35,7 @@ ...@@ -31,11 +35,7 @@
param_list[0].select_list.push('parameters'); param_list[0].select_list.push('parameters');
return gadget.jio_allDocs(param_list[0]) return gadget.jio_allDocs(param_list[0])
.push(function (result) { .push(function (result) {
return gadget.changeState({instance_dict: result}); var i,
})
.push(function () {
var result = gadget.state.instance_dict,
i,
value, value,
len = result.data.total_rows; len = result.data.total_rows;
for (i = 0; i < len; i += 1) { for (i = 0; i < len; i += 1) {
...@@ -171,63 +171,9 @@ ...@@ -171,63 +171,9 @@
.onStateChange(function (modification_dict) { .onStateChange(function (modification_dict) {
var gadget = this; var gadget = this;
if (!modification_dict.hasOwnProperty('ouline_list') && if (!modification_dict.hasOwnProperty('ouline_list')) {
!modification_dict.hasOwnProperty('instance_dict')) {
return; return;
} }
if (modification_dict.hasOwnProperty('instance_dict')) {
// render parameter form
return new RSVP.Queue()
.push(function () {
var promise_list = [],
i,
element = gadget.element.querySelector('.parameters-box'),
gadget_element;
//cleanup
while (element.hasChildNodes()) {
element.removeChild(element.lastChild);
}
for (i = 0; i < gadget.state.instance_dict.data.total_rows; i += 1) {
if (gadget.state.instance_dict.data.rows[i]
.value.aggregate_reference === undefined) {
// Instance is not Synchronized!
promise_list.push(false);
continue;
}
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);
})
.push(function (parameter_gadget_list) {
var i,
promise_list = [];
gadget.props.parameter_form_list = parameter_gadget_list;
for (i = 0; i < parameter_gadget_list.length; i += 1) {
if (parameter_gadget_list[i]) {
promise_list.push(
parameter_gadget_list[i].render({
url: gadget.state.instance_dict.data.rows[i].value._links.private_url.href
.replace('jio_private', 'private') + '/config',
basic_login: gadget.state.opml.basic_login,
title: "Parameters " + gadget.state.instance_dict.data.rows[i].value.title,
parameters: gadget.state.instance_dict.data.rows[i].value.parameters
})
);
}
}
return RSVP.all(promise_list);
});
}
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.getDeclaredGadget('form_list'); return gadget.getDeclaredGadget('form_list');
...@@ -253,6 +199,92 @@ ...@@ -253,6 +199,92 @@
return form_list.render({ return form_list.render({
erp5_document: { erp5_document: {
"_embedded": {"_view": { "_embedded": {"_view": {
"your_title": {
"description": "",
"title": "Instance Tree",
"default": gadget.state.instance_tree.title,
"css_class": "",
"required": 0,
"editable": 0,
"key": "instance_tree_title",
"hidden": 0,
"type": "EditorField"
},
"your_status": {
"description": "",
"title": "Status",
"default": gadget.state.instance_tree.status,
"css_class": "",
"required": 1,
"editable": 0,
"key": "status",
"hidden": 0,
"url": "gadget_erp5_field_status.html",
"type": "GadgetField"
},
"your_status_date": {
"description": "",
"title": "Status Date",
"default": gadget.state.instance_tree.status_date,
"css_class": "",
"required": 0,
"editable": 0,
"key": "status_date",
"hidden": 0,
"timezone_style": 1,
"date_only": 0,
"type": "DateTimeField"
},
"your_instance_amount": {
"description": "",
"title": "Instance Amount",
"default": gadget.state.instance_tree.instance_amount,
"css_class": "",
"required": 0,
"editable": 0,
"key": "instance_amount",
"hidden": 0,
"type": "StringField"
},
"your_portal_type": {
"description": "",
"title": "Portal Type",
"default": gadget.state.instance_tree.portal_type,
"css_class": "",
"required": 0,
"editable": 0,
"key": "portal_type",
"hidden": 0,
"type": "StringField"
},
"your_opml_url": {
"description": "",
"title": "OMPL Url",
"default": link_template({
url: gadget.state.instance_tree.opml_url || "",
title: gadget.state.instance_tree.opml_url || "",
target: "_blank"
}),
"css_class": "",
"required": 0,
"editable": 0,
"key": "opml_url",
"type": "EditorField"
},
"your_software_release_url": {
"description": "",
"title": "Software Release",
"default": link_template({
url: gadget.state.instance_tree.software_release || "",
title: gadget.state.instance_tree.software_release || "",
target: "_blank"
}),
"css_class": "",
"required": 0,
"editable": 0,
"key": "software_release_url",
"type": "EditorField"
},
"listbox": { "listbox": {
"column_list": column_list, "column_list": column_list,
"show_anchor": 0, "show_anchor": 0,
...@@ -280,10 +312,29 @@ ...@@ -280,10 +312,29 @@
} }
}, },
form_definition: { form_definition: {
group_list: [[ group_list: [
"bottom", [
[["listbox"]] "left",
]] [
["your_title"], ["your_status"], ["your_status_date"]
]
],
[
"right",
[
["your_instance_amount"], ["your_portal_type"],
["your_opml_url"]
]
],
[
"center",
[["your_software_release_url"]]
],
[
"bottom",
[["listbox"]]
]
]
} }
}); });
}) })
...@@ -301,23 +352,19 @@ ...@@ -301,23 +352,19 @@
}) })
.push(function (url_list) { .push(function (url_list) {
if (gadget.state.instance_tree.instance_amount === 0) { if (gadget.state.instance_tree.instance_amount === 0) {
gadget.element.querySelector('.hosting-title').textContent = gadget.state.instance_tree.title += " - Not synchronized!";
gadget.state.instance_tree.title + " - Not synchronized!";
return gadget.updateHeader({ return gadget.updateHeader({
page_title: "Instance Tree: " + gadget.state.instance_tree.title, page_title: "Instance Tree: " + gadget.state.instance_tree.title,
selection_url: url_list[0], selection_url: url_list[0],
jump_url: url_list[1] jump_url: url_list[1]
}); });
} }
gadget.element.querySelector('.hosting-title').textContent =
gadget.state.instance_tree.title;
return gadget.updateHeader({ return gadget.updateHeader({
page_title: "Instance Tree: " + gadget.state.instance_tree.title, page_title: "Instance Tree: " + gadget.state.instance_tree.title,
selection_url: url_list[0], selection_url: url_list[0],
jump_url: url_list[1], jump_url: url_list[1]
save_action: true
}); });
}); });
}); });
}(window, rJS, document, RSVP, escape)); }(window, rJS, document, Handlebars, RSVP, jIO, escape));
\ No newline at end of file \ No newline at end of file
...@@ -79,7 +79,9 @@ ...@@ -79,7 +79,9 @@
</item> </item>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
...@@ -250,7 +252,7 @@ ...@@ -250,7 +252,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.4007.38246.25361</string> </value> <value> <string>1004.56923.1101.33536</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +272,7 @@ ...@@ -270,7 +272,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543845609.21</float> <float>1670517705.78</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -3,6 +3,25 @@ ...@@ -3,6 +3,25 @@
(function (window, rJS, RSVP, Handlebars, atob) { (function (window, rJS, RSVP, Handlebars, atob) {
"use strict"; "use strict";
function padTo2Digits(num) {
return num.toString().padStart(2, '0');
}
function formatDate(date) {
return (
[
date.getFullYear(),
padTo2Digits(date.getMonth() + 1),
padTo2Digits(date.getDate())
].join('-') +
' ' +
[
padTo2Digits(date.getHours()),
padTo2Digits(date.getMinutes())
].join(':')
);
}
var gadget_klass = rJS(window), var gadget_klass = rJS(window),
source = gadget_klass.__template_element source = gadget_klass.__template_element
.querySelector(".render-link-template") .querySelector(".render-link-template")
...@@ -219,58 +238,49 @@ ...@@ -219,58 +238,49 @@
], ],
data = element_dict.data || promise_data, data = element_dict.data || promise_data,
data_list = [], data_list = [],
data_dict = {date_list: [], success_list: [], error_list: []},
line_list, line_list,
i; i;
for (i = 1; i < data.length; i += 1) {
line_list = data[i].split(',');
data_dict.date_list.push(formatDate(new Date(line_list[0])));
data_dict.success_list.push(line_list[1]);
data_dict.error_list.push(line_list[2]);
}
data_list.push({ data_list.push({
value_dict: {"0": [], "1": []}, value_dict: {
type: "scatter", 0: data_dict.date_list,
axis_mapping_id_dict: {"1": "1_1"}, 1: data_dict.success_list
},
colors: ['#61a0a8'],
type: "line",
title: "promises success" title: "promises success"
}); }, {
data_list.push({ value_dict: {
value_dict: {"0": [], "1": []}, 0: data_dict.date_list,
type: "scatter", 1: data_dict.error_list
axis_mapping_id_dict: {"1": "1_2"}, },
colors: ['#c23531'],
type: "line",
title: "promises error" title: "promises error"
}); });
for (i = 1; i < data.length; i += 1) {
line_list = data[i].split(',');
data_list[0].value_dict["0"].push(line_list[0]);
data_list[0].value_dict["1"].push(line_list[1]);
// XXX repeating date entry
data_list[1].value_dict["0"].push(line_list[0]);
data_list[1].value_dict["1"].push(line_list[2]);
}
return data_list; return data_list;
}; };
graph_options.data_dict = { graph_options.data_dict = {
data: {}, data: [],
layout: { layout: {
axis_dict : { axis_dict : {
"0": { 0: {"title": "date"},
"title": "Promises Failure Progression", 1: {"title": "value", "value_type": "number"}
"scale_type": "linear",
"value_type": "date"
},
"1_1": {
"title": "Promises success",
"position": "right"
},
"1_2": {
"title": "Promises error",
"position": "right"
}
}, },
title: "Promises Failure Progression" title: "Promises Success/Failure Progression"
} }
}; };
return graph_options; return graph_options;
}) })
.push(function (g) { .push(function (g) {
graph_data = g; graph_data = g;
//gadget.element.querySelector('.template-view').innerHTML = html;
return gadget.getDeclaredGadget('form_view'); return gadget.getDeclaredGadget('form_view');
}) })
.push(function (form_gadget) { .push(function (form_gadget) {
...@@ -542,6 +552,11 @@ ...@@ -542,6 +552,11 @@
gadget.getUrlFor({command: 'push_history', options: { gadget.getUrlFor({command: 'push_history', options: {
page: 'ojsm_processes_view', page: 'ojsm_processes_view',
key: gadget.state.opml_outline.reference key: gadget.state.opml_outline.reference
}}),
gadget.getUrlFor({command: 'push_history', options: {
page: 'ojsm_gadget_display',
key: gadget.state.instance.reference,
opml_url: gadget.state.opml_outline.parent_url
}}) }})
]); ]);
}) })
...@@ -556,6 +571,7 @@ ...@@ -556,6 +571,7 @@
if (gadget.state.instance._links !== undefined) { if (gadget.state.instance._links !== undefined) {
options.resources_url = url_list[3]; options.resources_url = url_list[3];
options.processes_url = url_list[4]; options.processes_url = url_list[4];
options.gadget_url = url_list[5];
} }
return gadget.updateHeader(options); return gadget.updateHeader(options);
}); });
......
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.4061.47106.61696</string> </value> <value> <string>1004.56556.50306.8192</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543848850.64</float> <float>1670494974.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -63,7 +63,8 @@ ...@@ -63,7 +63,8 @@
['edit_properties', 'Properties', 'info'], ['edit_properties', 'Properties', 'info'],
['change_password', 'Change Password', 'pencil-square-o'], ['change_password', 'Change Password', 'pencil-square-o'],
['resources_url', 'Resources', 'picture-o'], ['resources_url', 'Resources', 'picture-o'],
['processes_url', 'Processes', 'list-alt'] ['processes_url', 'Processes', 'list-alt'],
['gadget_url', 'Script', 'puzzle-piece']
]; ];
gadget_klass gadget_klass
......
...@@ -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.27666.8050.30907</string> </value> <value> <string>1004.15047.64260.56968</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1542277962.83</float> <float>1670494589.86</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -108,6 +108,27 @@ ...@@ -108,6 +108,27 @@
<key> <string>language</string> </key> <key> <string>language</string> </key>
<value> <string>en</string> </value> <value> <string>en</string> </value>
</item> </item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1455284352.46</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value> <value> <string>Web Page</string> </value>
......
...@@ -108,6 +108,27 @@ ...@@ -108,6 +108,27 @@
<key> <string>language</string> </key> <key> <string>language</string> </key>
<value> <string>en</string> </value> <value> <string>en</string> </value>
</item> </item>
<item>
<key> <string>modification_date</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1455284352.21</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value> <value> <string>Web Page</string> </value>
......
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
</head> </head>
<body> <body>
<div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_gadget" data-gadget-sandbox="public"></div> <div data-gadget-url="gadget_field_graph_echarts.html" data-gadget-scope="graph_gadget" data-gadget-sandbox="public" class="graph graph-medium"></div>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.25931.6156.58743</string> </value> <value> <string>1005.8558.21408.14438</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1514370606.61</float> <float>1671547158.99</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -601,7 +601,8 @@ ...@@ -601,7 +601,8 @@
var i, var i,
j, j,
start, start,
extra_dict; extra_dict,
software_release_url;
function applyItemToTree(item, item_result, extra_dict) { function applyItemToTree(item, item_result, extra_dict) {
var id_hash, var id_hash,
...@@ -657,6 +658,13 @@ ...@@ -657,6 +658,13 @@
reference: id_hash, reference: id_hash,
active: true active: true
}); });
if (!software_release_url &&
element.portal_type == "Software Instance" &&
element.software_release) {
// OPML has no software release URL, we get it from the first
// which has it.
software_release_url = element.software_release;
}
opml_document_list.push({ opml_document_list.push({
id: id_hash, id: id_hash,
doc: element doc: element
...@@ -726,6 +734,7 @@ ...@@ -726,6 +734,7 @@
} }
} }
} }
instance_tree.software_release = software_release_url || '';
opml_document_list.push({ opml_document_list.push({
id: id, id: id,
doc: instance_tree doc: instance_tree
......
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>972.3978.30023.34679</string> </value> <value> <string>1011.60237.8337.45209</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1543851108.12</float> <float>1697754171.94</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -311,7 +311,7 @@ ...@@ -311,7 +311,7 @@
</item> </item>
<item> <item>
<key> <string>configuration_content_security_policy</string> </key> <key> <string>configuration_content_security_policy</string> </key>
<value> <string>default-src \'self\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://content.dropboxapi.com https://api.dropboxapi.com data: * localhost:5378 *.vifib.erp5.net *.host.vifib.net *.node.vifib.com *.erp5.net; script-src \'self\' \'unsafe-eval\' \'unsafe-inline\'; font-src \'self\'; style-src \'self\' \'unsafe-inline\' data:; frame-src \'self\' data:</string> </value> <value> <string>default-src \'self\'; img-src \'self\' data:; media-src \'self\' blob:; connect-src \'self\' https://content.dropboxapi.com https://api.dropboxapi.com data: * localhost:5378 *.vifib.erp5.net *.host.vifib.net *.node.vifib.com *.erp5.net; script-src \'self\' \'unsafe-eval\' \'unsafe-inline\'; font-src \'self\'; style-src \'self\' \'unsafe-inline\' data:; frame-src \'self\' * data:</string> </value>
</item> </item>
<item> <item>
<key> <string>configuration_default_jio_document_page_gadget_url</string> </key> <key> <string>configuration_default_jio_document_page_gadget_url</string> </key>
...@@ -576,7 +576,7 @@ ...@@ -576,7 +576,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>992.64257.46798.35242</string> </value> <value> <string>1011.60641.7001.46387</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -596,7 +596,7 @@ ...@@ -596,7 +596,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1625247788.8</float> <float>1697748086.87</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,6 +5,8 @@ url_list = [ ...@@ -5,6 +5,8 @@ url_list = [
"gadget_global.js", "gadget_global.js",
"gadget_field_graph_dygraph.html", "gadget_field_graph_dygraph.html",
"gadget_field_graph_dygraph.js", "gadget_field_graph_dygraph.js",
"gadget_field_graph_echarts.html",
"gadget_field_graph_echarts.js",
"gadget_jio.html", "gadget_jio.html",
"gadget_jio.js", "gadget_jio.js",
"gadget_translate.html", "gadget_translate.html",
...@@ -79,6 +81,8 @@ url_list = [ ...@@ -79,6 +81,8 @@ url_list = [
"gadget_erp5_sort_editor.html", "gadget_erp5_sort_editor.html",
"gadget_erp5_sort_editor.js", "gadget_erp5_sort_editor.js",
"gadget_officejs_monitoring_jio.html", "gadget_officejs_monitoring_jio.html",
"gadget_erp5_page_ojsm_gadget_display.html",
"gadget_erp5_page_ojsm_gadget_display.js",
"gadget_erp5_page_ojsm_instance_tree_list.html", "gadget_erp5_page_ojsm_instance_tree_list.html",
"gadget_officejs_monitoring_parameter_view.html", "gadget_officejs_monitoring_parameter_view.html",
"gadget_erp5_page_settings_configurator.html", "gadget_erp5_page_settings_configurator.html",
......
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