Commit b64c26a9 authored by Roque's avatar Roque

erp5_web_monitoring: refactor monitoring app to use new ojs framework

- site web section changes
- update app router
- update app panel
- adapt monitoring jio gadget and jio storage
- add form views configuration
- add new portal types, views and actions
- migration_version check
- update precache manifest
- sync checks and redirection
- refactor dispatch page according to new monitor urls
- add opml redirects to front page
- slapos portal types
- drop obsolete files
- drop auto-sync on add OPML page
- parameters gadget field for instance tree view
- custom views for software instance resources and processes
- options header gadget (custom header options)
- custom submit gadgets
- graph gadget field
parent 82ad02d6
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_search</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>10.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/InstanceTreeModule_viewForMonitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>30.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/InstanceTree_viewForMonitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_search</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>10.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/PromiseModule_viewForMonitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>30.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Promise_viewForMonitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_search</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>10.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstanceModule_viewForMonitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>30.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_processes_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_processes_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Processes</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstance_viewForMonitoringProcesses</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>30.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_resources_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_resources_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Resources</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstance_viewForMonitoringResources</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>30.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/SoftwareInstance_viewForMonitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Action Information" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>action_permission</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>action_type/object_jio_view</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>float_index</string> </key>
<value> <float>30.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Action Information</string> </value>
</item>
<item>
<key> <string>reference</string> </key>
<value> <string>monitoring_view</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Expression" module="Products.CMFCore.Expression"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Opml_viewForMonitoring</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -5,37 +5,12 @@
<meta name="viewport" content="width=device-width" />
<title>ERP5 Page Monitoring Dispatch</title>
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="handlebars.js" type="text/javascript"></script>
<script src="gadget_erp5_page_ojsm_dispatch.js" type="text/javascript"></script>
<script id="dispatch-template" type="text/x-handlebars-template">
<h3 class="ui-content-title ui-body-c" data-i18n="No results from your search">
<span class="ui-icon ui-icon-custom ui-icon-frown-o">&nbsp;</span>
No results from your search!
</h3>
</script>
</head>
<body>
<section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c" data-i18n="Monitoring Search">
<span class="ui-icon ui-icon-custom ui-icon-search">&nbsp;</span>
Monitoring Search
</h3>
</section>
<p class="text-info">Type a text or query. ie: <i>portal_type: "Software Instance" AND title: "foo"</i></p>
<form class="dialog_form">
<button type="submit"
class="ui-btn ui-btn-b ui-btn-inline
ui-icon-action ui-btn-icon-right ui-screen-hidden">Submit</button>
<div data-gadget-url="gadget_erp5_searchfield.html"
data-gadget-scope="erp5_searchfield"
data-gadget-sandbox="public"></div>
</form>
<div class="search-result"></div>
</body>
</html>
\ No newline at end of file
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -250,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.33813.35232.64187</string> </value>
<value> <string>1014.27842.65173.60296</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -270,7 +270,7 @@
</tuple>
<state>
<tuple>
<float>1510936342.8</float>
<float>1707263598.02</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, Handlebars */
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
(function (window, rJS, RSVP) {
"use strict";
var gadget_klass = rJS(window),
source = gadget_klass.__template_element
.getElementById("dispatch-template")
.innerHTML,
dispatch_template = Handlebars.compile(source);
function searchItem(gadget, search_query) {
var redirect_options = {},
select_list = ["portal_type"];
if (search_query === undefined || search_query === "") {
return new RSVP.Queue()
.push(function () {
return;
});
}
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("listbox_lines_limit", 20);
})
.push(function (lines_limit) {
return gadget.jio_allDocs({
query: search_query,
select_list: select_list,
limit: [0, lines_limit]
});
})
.push(function (result) {
if (result === undefined || result.data.total_rows === 0) {
if (gadget.state.url && gadget.state.username && gadget.state.password) {
return gadget.redirect({"command": "display",
"options": {"page": "ojsm_opml_add",
"url": gadget.state.url,
"username": gadget.state.username,
"password": gadget.state.password,
"query": gadget.state.original_query}
});
}
return;
}
if (result.data.total_rows === 1) {
// one item found, redirect to it
redirect_options = {
jio_key: result.data.rows[0].id
};
return gadget.redirect({"command": "index", options: redirect_options});
}
redirect_options = {
extended_search: gadget.state.query
};
if (gadget.state.portal_type === undefined) {
// take the first one
gadget.state.portal_type = result.data.rows[0].value.portal_type;
}
if (gadget.state.portal_type === "Instance Tree") {
redirect_options.page = "ojsm_instance_tree_list";
} else if (gadget.state.portal_type === "Software Instance") {
redirect_options.page = "ojsm_software_instance_list";
} else if (gadget.state.portal_type === "promise") {
redirect_options.page = "ojsm_status_list";
}
return gadget.redirect({"command": "display", options: redirect_options});
});
}
gadget_klass
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_view')
.push(function (gadget) {
return gadget.triggerSubmit.apply(gadget, argument_list);
.declareMethod("render", function (options) {
var gadget = this, portal_type, extended_search, query_parts_list;
if (options.query && options.url && options.username && options.password) {
return new RSVP.Queue()
.push(function () {
return gadget.jio_allDocs({
query: options.query
});
})
.declareMethod("render", function (options) {
var gadget = this,
regex = /portal_type\s*\:\s*[\'\"]([\w+\s+]+)[\'\"]/i,
regex_list = /\(?([\w\d\_]+)\s*\:\s*\(([\"\w\_\d\-\.\s*\,]+)\)\)?/g,
query_list = [],
i,
tmp,
page_title = "Monitoring Search",
original_query,
portal_type,
pt_result,
result;
result = regex_list.exec(options.query);
if (result !== null) {
tmp = result[2].split(',');
for (i = 0; i < tmp.length; i += 1) {
query_list.push(result[1] + ': ' + tmp[i].trim());
}
options.query = options.query
.replace(regex_list, '(' + query_list.join(' OR ') + ')');
}
original_query = JSON.parse(JSON.stringify(options.query || ""));
pt_result = regex.exec(options.query);
if (pt_result !== null) {
page_title = "Searching " + pt_result[1] + "(s)";
portal_type = pt_result[1];
.push(function (result) {
if (result === undefined || result.data.total_rows === 0) {
return gadget.redirect(
{"command": "display",
"options": {
"url": options.url,
"username": options.username,
"password": options.password,
"page": "ojsm_opml_add"
}
return gadget.getUrlFor({command: 'display', options: {page: 'ojsm_status_list'}})
.push(function (back_url) {
return gadget.updateHeader({
page_title: page_title,
back_url: back_url
});
})
.push(function () {
return gadget.changeState({
original_query: original_query,
query: options.query,
url: options.url,
username: options.username,
password: options.password,
portal_type: portal_type || "promise",
import_opml: portal_type === undefined ? false : options.import_opml || true
} else {
// URL queries from slapos master / panel rapid space:
// 'portal_type: "Instance Tree" AND title:"my-title"'
// or
// 'portal_type: "Software Instance" AND title:"my-title"
// AND specialise_title:"my-parent-title"'
query_parts_list = options.query.split('AND');
portal_type = query_parts_list[0].replace('portal_type:', '').replaceAll('"', '').trim();
extended_search = options.query.replace(query_parts_list[0] + 'AND ', '').trim();
return gadget.redirect(
{"command": "display",
"options": {
"page": "ojs_local_controller",
"portal_type": portal_type + " Module",
"extended_search": extended_search
}
});
}
});
})
.onStateChange(function () {
var gadget = this;
}
return new RSVP.Queue()
.push(function () {
if (gadget.state.import_opml) {
return gadget.getSetting('latest_import_date')
.push(function (import_date) {
// If import was never done, or was done more than 2 weeks ago
// 1209600000 = 1000*60*60*24*14
var current_date = new Date().getTime();
if (import_date === undefined ||
(import_date + 1209600000) < current_date) {
return gadget.setSetting('sync_redirect_options', {
query: gadget.state.original_query,
page: 'ojsm_dispatch'
})
.push(function () {
(import_date + 1209600000) < new Date().getTime()) {
return gadget.redirect({command: 'change', options: {
page: "ojsm_erp5_configurator",
type: "erp5"
}});
});
}
});
}
})
.push(function () {
return gadget.getDeclaredGadget('erp5_searchfield');
})
.push(function (searchfield) {
return searchfield.render({
extended_search: gadget.state.original_query,
focus: true
// default front page (list of promises)
return gadget.redirect({command: 'display',
options: {page: "ojs_local_controller",
portal_type: "Promise Module"}
});
})
.push(function () {
return searchItem(gadget, gadget.state.query);
})
.push(function (search_result) {
if (search_result === undefined && gadget.state.query) {
gadget.element.querySelector('.search-result')
.innerHTML = dispatch_template({});
}
});
})
.onEvent('submit', function () {
var gadget = this;
return gadget.getDeclaredGadget("erp5_searchfield")
.push(function (search_gadget) {
return search_gadget.getContent();
})
.push(function (data) {
var options = {
page: "ojsm_dispatch"
};
if (data.search) {
options.query = data.search;
return gadget.redirect({command: 'change', options: options});
}
});
}, false, true);
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1012.62724.50149.41113</string> </value>
<value> <string>1014.43824.52459.5376</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1701717676.56</float>
<float>1708449003.36</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -379,6 +379,7 @@
if (tmp_parameter === undefined) {
tmp_parameter = {username: "", password: "", opml_url: undefined};
}
if (instance_tree_list[uid_dict[tmp_uid]]) {
opml_list.push({
portal_type: "opml",
title: instance_tree_list[uid_dict[tmp_uid]]
......@@ -397,6 +398,7 @@
});
}
}
}
return opml_list;
});
}
......@@ -441,6 +443,7 @@
return form_gadget.getContent();
})
.push(function (form_doc) {
//TODO if this feature is restored, update latest_import_date
return importMonitorConfiguration(gadget, form_doc.config);
});
})
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -260,7 +260,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>994.35349.51657.9164</string> </value>
<value> <string>1014.43844.29599.43673</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -280,7 +280,7 @@
</tuple>
<state>
<tuple>
<float>1630678740.59</float>
<float>1708448979.03</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monitoring Instance Tree List</title>
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojsm_instance_tree_list.js"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list"></div>
</body>
</html>
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("reload", "reload")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("renderApplication", "renderApplication")
.declareAcquiredMethod('jio_allDocs', 'jio_allDocs')
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i,
len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.hasOwnProperty("status_date")) {
result.data.rows[i].value.status_date = {
field_gadget_param: {
allow_empty_time: 0,
ampm_time_style: 0,
css_class: "date_field",
date_only: 0,
description: "The Date",
editable: 0,
hidden: 0,
hidden_day_is_last_day: 0,
"default": result.data.rows[i].value.status_date,
key: "date",
required: 0,
timezone_style: 1,
title: "Status Date",
type: "DateTimeField"
}
};
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
};
}
if (result.data.rows[i].value.hasOwnProperty("status")) {
result.data.rows[i].value.status = {
field_gadget_param: {
css_class: "",
description: "The Status",
hidden: 0,
"default": result.data.rows[i].value.status,
key: "status",
url: "gadget_erp5_field_status.html",
title: "Status",
type: "GadgetField"
}
};
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
};
}
}
return result;
});
})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_list')
.push(function (gadget) {
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function (options) {
return this.changeState({
options: options,
latest_reload_time: new Date().getTime()
});
})
.onStateChange(function () {
var gadget = this,
lines_limit;
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("listbox_lines_limit", 20);
})
.push(function (listbox_lines_limit) {
lines_limit = listbox_lines_limit;
return gadget.getDeclaredGadget('form_list');
})
.push(function (form_list) {
var column_list = [
['status', 'Status'],
['title', 'Instance Tree'],
['instance_amount', 'Instance Amount'],
['status_date', 'Status Date']
];
return form_list.render({
erp5_document: {
"_embedded": {"_view": {
"listbox": {
"column_list": column_list,
"show_anchor": 0,
"default_params": {},
"editable": 0,
"editable_column_list": [],
"key": "instance_tree_listbox",
"lines": lines_limit,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=%28portal_type%3A%22" +
"Instance Tree" + "%22%29",
"portal_type": [],
"search_column_list": [['status', 'Status'], ['title', 'Instance Tree']],
"sort_column_list": [['status', 'Status'], ['title', 'Instance Tree'],
['instance_amount', 'Instance Amount'], ['status_date', 'Status Date']],
"sort": [['status', 'ascending'], ['title', 'ascending']],
"title": "Instance Trees",
"command": "index",
"type": "ListBox"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"bottom",
[["listbox"]]
]]
}
});
})
.push(function () {
return gadget.updateHeader({
page_title: "Instance Trees Status",
filter_action: true
});
});
})
.onLoop(function () {
var gadget = this;
return gadget.getSetting('latest_sync_time')
.push(function (latest_sync_time) {
if (latest_sync_time > gadget.state.latest_reload_time) {
return gadget.changeState({latest_reload_time: new Date().getTime()});
}
});
}, 30000);
}(window, rJS, RSVP));
\ No newline at end of file
......@@ -30,8 +30,9 @@
promise_list.push(gadget.getUrlFor({command: "display", options: options}));
if (options.title !== undefined &&
options.search_page !== undefined) {
promise_list.push(gadget.getUrlFor({command: "change", options: {
promise_list.push(gadget.getUrlFor({command: "display", options: {
page: options.search_page,
portal_type: options.portal_type,
extended_search: options.title
}}));
}
......
......@@ -232,7 +232,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.27666.8050.30907</string> </value>
<value> <string>1016.618.22640.54749</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1510581537.14</float>
<float>1713546953.85</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
var gadget = this,
redirect_options = {
"page": "ojsm_dispatch",
"url": options.url,
"username": options.username,
"password": options.password,
"query": options.query
};
if (options.query) {
return gadget.redirect({"command": "display",
"options": redirect_options
});
}
if (options.url && options.username && options.password) {
redirect_options.page = "ojsm_opml_add";
return gadget.redirect({"command": "display",
"options": redirect_options
});
}
return gadget.redirect({"command": "display",
"options": {"page": "ojsm_status_list"}
});
});
}(window, rJS));
\ No newline at end of file
......@@ -67,6 +67,11 @@
})
.push(function (result_list) {
if (result_list[1].status) {
var redirect_options = {
"command": "display",
"options": {page: "ojs_local_controller",
portal_type: "Promise Module"}
};
if (gadget.state.auto_sync) {
return gadget.getDeclaredGadget('sync_gadget')
.push(function (sync_gadget) {
......@@ -74,16 +79,10 @@
return sync_gadget.register({now: true});
})
.push(function () {
return gadget.redirect({
"command": "display",
"options": {"page": "ojsm_status_list"}
});
return gadget.redirect(redirect_options);
});
}
return gadget.redirect({
"command": "display",
"options": {"page": "settings_configurator"}
});
return gadget.redirect(redirect_options);
}
if (result_list[1].can_force) {
gadget.element.getElementsByClassName("btn-nopasswd")[0]
......@@ -231,14 +230,6 @@
save_action: true,
change_password: chg_pwd_url
});
})
.push(function () {
return gadget.checkSynchronize();
});
})
.declareJob("checkSynchronize", function () {
if (this.state.auto_sync) {
return this.element.querySelector('button[type="submit"]').click();
}
});
}(window, rJS, RSVP));
......@@ -79,7 +79,9 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
......@@ -244,7 +246,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -258,7 +260,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.63895.24146.65194</string> </value>
<value> <string>1015.15648.56156.28518</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,7 +280,7 @@
</tuple>
<state>
<tuple>
<float>1543593135.84</float>
<float>1710516573.13</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Monitoring Instance Parameters View Page</title>
<title>Monitoring Instance Tree View</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_erp5_page_ojsm_parameters_view.js" type="text/javascript"></script>
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_officejs_jio_instance_tree_view.js"></script>
</head>
<body>
<br/>
<div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<article class="ui-content ui-body-c">
<section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c">
......@@ -24,16 +24,9 @@
</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"
data-gadget-scope="form_list"
data-gadget-sandbox="public">
</div>
</div>
</body>
</html>
\ No newline at end of file
/*global window, rJS, document, RSVP, escape */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, document, RSVP, escape) {
"use strict";
var gadget_klass = rJS(window);
gadget_klass
.setState({
ouline_list: "",
instance_tree: ""
})
.ready(function (g) {
g.props = {};
g.props.parameter_form_list = [];
})
.declareAcquiredMethod('jio_allDocs', 'jio_allDocs')
.declareAcquiredMethod('jio_get', 'jio_get')
.declareMethod("render", function (options) {
var gadget = this;
return new RSVP.Queue()
.push(function () {
return gadget.jio_get(options.opml_url);
})
.push(function (opml_doc) {
return gadget.changeState({opml: opml_doc, options: options});
})
.push(function () {
return gadget.jio_allDocs({
query: '(portal_type:"Software Instance") AND (specialise_title:"' +
options.title + '")',
sort_on: [["title", "ascending"]],
select_list: ["_links", "title", "parameters", "aggregate_reference"]
});
})
.push(function (result) {
return gadget.changeState({instance_dict: result});
});
})
.onStateChange(function (modification_dict) {
var gadget = this;
if (gadget.state.options.instance_amount === 0) {
gadget.element.querySelector('.hosting-title').textContent =
gadget.state.options.title + " - Not synchronized!";
}
gadget.element.querySelector('.hosting-title').textContent =
gadget.state.options.title;
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);
});
}
});
}(window, rJS, document, RSVP, escape));
\ No newline at end of file
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -79,11 +77,13 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_jio_instance_tree_view.js</string> </value>
<value> <string>gadget_erp5_page_ojsm_parameters_view.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -93,7 +93,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_instance_tree_view_js</string> </value>
<value> <string>gadget_erp5_page_ojsm_parameters_view_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -111,7 +111,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Monitoring Instance Tree View Js</string> </value>
<value> <string>Monitoring Parameters Js</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -177,7 +177,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -201,7 +201,7 @@
</tuple>
<state>
<tuple>
<float>1464275223.91</float>
<float>1712768158.73</float>
<string>UTC</string>
</tuple>
</state>
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -250,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>972.4007.38246.25361</string> </value>
<value> <string>1016.10516.11551.16861</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -270,7 +270,7 @@
</tuple>
<state>
<tuple>
<float>1543845609.21</float>
<float>1714140736.42</float>
<string>UTC</string>
</tuple>
</state>
......@@ -301,7 +301,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -333,7 +333,7 @@
</tuple>
<state>
<tuple>
<float>1464275183.55</float>
<float>1712767849.87</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -29,7 +29,7 @@
.declareMethod('render', function (options) {
var gadget = this;
return gadget.jio_get(options.key)
return gadget.jio_get(options.parent_id)
.push(function (outline) {
return gadget.changeState({opml_outline: outline});
})
......@@ -114,6 +114,13 @@
});
}
return result;
}, function (error) {
if ((error instanceof jIO.util.jIOError) &&
(error.status_code === 404)) {
return result;
} else {
throw error;
}
});
})
......@@ -149,12 +156,7 @@
title: "Memory Used",
icon_name: "pie-chart",
value: change_dict.average_state.memory_percent + " %"
}/*,
{
title: "Disk Used",
icon_name: "hdd-o",
value: change_dict.average_state.disk_used + " Mo"
}*/
}
];
resource_state_content = infobox_widget_template({
resource_list: monitor_resource_list
......
......@@ -76,7 +76,9 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
......@@ -233,7 +235,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -247,7 +249,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>963.29300.23681.7082</string> </value>
<value> <string>1016.32493.13517.11946</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -267,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>1510669789.68</float>
<float>1715373485.61</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -10,30 +10,12 @@
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<!--<script src="handlebars.js"></script>-->
<!--<script id="graph-label-widget-template" type="text/x-handlebars-template">
<fieldset class="graph-state-labels" data-role="controlgroup">
{{#each label_list}}
<input type="checkbox" name="{{id}}" id="{{id}}" checked="">
<label for="{{id}}" style="color: {{color}};" class="{{graph}}" rel="{{index}}">{{name}}</label>
{{/each}}
</fieldset>
</script>-->
<script src="gadget_erp5_page_ojsm_resources_view.js"></script>
</head>
<body>
<div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<!--<ul class="ui-grid-column ui-grid-column-5 graph_cpu">
<li class="ui-grid-span-5 custom-grid-wrap graph-cell">
<div data-gadget-url="gadget_erp5_graph.html" data-gadget-scope="graph_cpu" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</li>
<li class="ui-grid-span-1 custom-grid-wrap graph-cell">
</li>
</ul>-->
<div class="ui-grid-a ui-responsive">
<form class="save_form ui-body-c" novalidate style="padding-left: 30px">
<div data-gadget-url="gadget_erp5_form.html"
......
......@@ -240,7 +240,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -254,7 +254,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.40737.38602.8192</string> </value>
<value> <string>1014.2117.47678.65518</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -274,7 +274,7 @@
</tuple>
<state>
<tuple>
<float>1542206472.63</float>
<float>1713212331.1</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -185,12 +185,6 @@
"position": "right"
}
};
/*data_list.push({
value_dict: {"0": [], "1": []},
type: "surface",
axis_mapping_id_dict: {"1": "1_1"},
title: "Memory used percent"
});*/
data_list.push({
value_dict: {"0": [], "1": []},
type: "surface",
......@@ -352,8 +346,8 @@
.declareMethod("render", function (options) {
var gadget = this;
gadget.property_dict.document_key = options.key;
return gadget.jio_get(options.key)
gadget.property_dict.document_key = options.parent_id;
return gadget.jio_get(options.parent_id)
.push(function (outline) {
return gadget.changeState({opml_outline: outline});
})
......@@ -449,8 +443,7 @@
type: "webhttp",
// XXX Fix URL
url: (gadget.state.opml_outline.url
.replace("jio_private", "private") +
'documents/'),
.replace("jio_private", "private") + 'documents/'),
basic_login: gadget.state.opml.basic_login
});
gadget.property_dict.mem_data = {data: []};
......@@ -465,7 +458,6 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareAcquiredMethod("redirect", "redirect")
//.declareAcquiredMethod("notifySubmitting", 'notifySubmitting')
.onLoop(function () {
if (!this.property_dict.disable_update) {
......
......@@ -79,7 +79,9 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
......@@ -236,7 +238,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -250,7 +252,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.43798.57526.26624</string> </value>
<value> <string>1015.60575.57531.48776</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -270,7 +272,7 @@
</tuple>
<state>
<tuple>
<float>1542387970.17</float>
<float>1713212157.56</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monitoring Software Instances</title>
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojsm_software_instance_list.js"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list"></div>
</body>
</html>
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
"use strict";
rJS(window)
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, value, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.hasOwnProperty("date")) {
result.data.rows[i].value.date = {
field_gadget_param: {
allow_empty_time: 0,
ampm_time_style: 0,
css_class: "date_field",
date_only: 0,
description: "The Date",
editable: 0,
hidden: 0,
hidden_day_is_last_day: 0,
"default": result.data.rows[i].value.date,
key: "date",
required: 0,
timezone_style: 1,
title: "Status Date",
type: "DateTimeField"
}
};
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
};
}
if (result.data.rows[i].value.hasOwnProperty("status")) {
value = result.data.rows[i].value.status;
result.data.rows[i].value.status = {
field_gadget_param: {
css_class: "",
description: "The Status",
hidden: 0,
"default": value,
key: "status",
url: "gadget_erp5_field_status.html",
title: "Status",
type: "GadgetField"
}
};
result.data.rows[i].value["listbox_uid:list"] = {
key: "listbox_uid:list",
value: 2713
};
}
}
return result;
});
})
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_list')
.push(function (gadget) {
return gadget.triggerSubmit.apply(gadget, argument_list);
});
})
.declareMethod("render", function (options) {
return this.changeState({
options: options,
latest_reload_time: new Date().getTime()
});
})
.onStateChange(function () {
var gadget = this,
lines_limit;
return new RSVP.Queue()
.push(function () {
return gadget.getSetting("listbox_lines_limit", 20);
})
.push(function (listbox_lines_limit) {
lines_limit = listbox_lines_limit;
return gadget.getDeclaredGadget('form_list');
})
.push(function (form_list) {
var column_list = [
['status', 'Status'],
['title', 'Instance Title'],
['specialise_title', 'Instance Tree'],
['aggregate_reference', 'Computer'],
['date', 'Status Date']
];
return form_list.render({
erp5_document: {
"_embedded": {"_view": {
"listbox": {
"column_list": column_list,
"show_anchor": 0,
"default_params": {},
"editable": 0,
"editable_column_list": [],
"key": "software_instance_listbox",
"lines": lines_limit,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=portal_type%3A%22" +
"Software%20Instance" + "%22",
"portal_type": [],
"search_column_list": column_list,
"sort_column_list": column_list,
"sort": [["status", "ascending"]],
"title": "Software Instances",
"type": "ListBox"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"bottom",
[["listbox"]]
]]
}
});
})
.push(function () {
return gadget.updateHeader({
page_title: "Software Instances Status",
filter_action: true
});
});
})
.onLoop(function () {
var gadget = this;
return gadget.getSetting('latest_sync_time')
.push(function (latest_sync_time) {
if (latest_sync_time > gadget.state.latest_reload_time) {
return gadget.changeState({latest_reload_time: new Date().getTime()});
}
});
}, 30000);
}(window, rJS, RSVP));
......@@ -25,7 +25,7 @@
});
})
.push(function () {
var redirect_options = {"page": "ojsm_status_list"};
var redirect_options = {"page": "ojsm_dispatch"};
if (options.reset === "1") {
// reset redirections
return gadget.setSetting("sync_redirect_options", undefined)
......
......@@ -79,7 +79,9 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
......@@ -244,7 +246,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -258,7 +260,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.18960.44200.52138</string> </value>
<value> <string>1014.27855.54097.10478</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,7 +280,7 @@
</tuple>
<state>
<tuple>
<float>1540897197.53</float>
<float>1707263598.02</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -250,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.40832.39714.27067</string> </value>
<value> <string>1014.25166.15810.62685</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -270,7 +270,7 @@
</tuple>
<state>
<tuple>
<float>1542210787.16</float>
<float>1712760670.53</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -173,7 +173,19 @@
.declareMethod("triggerSubmit", function (event) {
return this.element.querySelector('form button[type="submit"]').click();
})
.declareMethod("render", function (options) {
if (options.url && options.username && options.password) {
var redirect_options = {
"url": options.url,
"username": options.username,
"password": options.password,
"page": "ojsm_opml_add"
};
return this.redirect({"command": "display",
"options": redirect_options
});
}
var gadget = this,
last_sync_time,
sync_data_interval,
......@@ -182,12 +194,6 @@
opml_import_limit,
opml_add_auto_sync;
if (options.url) {
// backward compatibility redirect to add opml
options.page = "ojsm_opml_add";
return gadget.redirect({"command": "change", "options": options});
}
return new RSVP.Queue()
.push(function () {
return gadget.getSetting('opml_import_limit', 300);
......@@ -311,8 +317,7 @@
"key": "monitoring_setting_listbox",
"lines": 20,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=portal_type%3A%22" +
result[1] + "%22",
"query": "urn:jio:allDocs?query=portal_type%3A%22opml%22",
"portal_type": [],
"search_column_list": column_list,
"sort_column_list": column_list,
......
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1012.23628.37695.12441</string> </value>
<value> <string>1016.681.49439.24951</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1699538392.28</float>
<float>1713893527.2</float>
<string>UTC</string>
</tuple>
</state>
......
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Jio Web Page View</title>
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script class="render-link-template" type="text/x-handlebars-template">
<a href="{{url}}" target="{{target}}">{{title}}</a>
</script>
<script src="gadget_officejs_jio_promise_view.js"></script>
</head>
<body>
<div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<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 data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<title>OfficeJS Jio Web Page View</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="handlebars.js"></script>
<script class="render-link-template" type="text/x-handlebars-template">
<a href="{{url}}" target="{{target}}">{{title}}</a>
</script>
<script src="gadget_officejs_jio_software_instance_view.js"></script>
</head>
<body>
<form>
<button type="submit" class="ui-btn ui-btn-b ui-btn-inline
ui-icon-edit ui-btn-icon-right ui-screen-hidden"></button>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
<global name="Web Manifest" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -56,15 +55,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/public</string>
</tuple>
</value>
</item>
......@@ -74,13 +64,9 @@
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/javascript</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_page_ojsm_instance_tree_list.js</string> </value>
<value> <string>gadget_officejs_monitoring.configuration</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -90,29 +76,48 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_erp5_page_ojsm_instance_tree_list_js</string> </value>
<value> <string>gadget_officejs_monitoring.configuration</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Monitoring Instance Tree list JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
<key> <string>text_content</string> </key>
<value> <string>CONFIGURATION MANIFEST\n
# generated on Fri Apr 19 17:49:01 2024\n
CACHE:\n
\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNl\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNlL21vbml0b3Jpbmdfdmlldw==\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvU29mdHdhcmVJbnN0YW5jZV92aWV3Rm9yTW9uaXRvcmluZw==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNlL21vbml0b3JpbmdfcmVzb3VyY2VzX3ZpZXc=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvU29mdHdhcmVJbnN0YW5jZV92aWV3Rm9yTW9uaXRvcmluZ1Jlc291cmNlcw==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNlL21vbml0b3JpbmdfcHJvY2Vzc2VzX3ZpZXc=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvU29mdHdhcmVJbnN0YW5jZV92aWV3Rm9yTW9uaXRvcmluZ1Byb2Nlc3Nlcw==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL29wbWw=\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL29wbWwvbW9uaXRvcmluZ192aWV3\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvT3BtbF92aWV3Rm9yTW9uaXRvcmluZw==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL0luc3RhbmNlIFRyZWU=\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL0luc3RhbmNlIFRyZWUvbW9uaXRvcmluZ192aWV3\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvSW5zdGFuY2VUcmVlX3ZpZXdGb3JNb25pdG9yaW5n\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1Byb21pc2UgTW9kdWxl\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1Byb21pc2UgTW9kdWxlL21vbml0b3Jpbmdfdmlldw==\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvUHJvbWlzZU1vZHVsZV92aWV3Rm9yTW9uaXRvcmluZw==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1Byb21pc2U=\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1Byb21pc2UvbW9uaXRvcmluZ192aWV3\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvUHJvbWlzZV92aWV3Rm9yTW9uaXRvcmluZw==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL0luc3RhbmNlIFRyZWUgTW9kdWxl\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL0luc3RhbmNlIFRyZWUgTW9kdWxlL21vbml0b3Jpbmdfdmlldw==\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvSW5zdGFuY2VUcmVlTW9kdWxlX3ZpZXdGb3JNb25pdG9yaW5n\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNlIE1vZHVsZQ==\n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNlIE1vZHVsZS9tb25pdG9yaW5nX3ZpZXc=\n
hateoas_appcache/definition_view/cG9ydGFsX3NraW5zL2VycDVfd2ViX21vbml0b3JpbmcvU29mdHdhcmVJbnN0YW5jZU1vZHVsZV92aWV3Rm9yTW9uaXRvcmluZw==\n
\n
NETWORK:\n
*</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
......@@ -174,7 +179,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -198,7 +203,7 @@
</tuple>
<state>
<tuple>
<float>1457347208.26</float>
<float>1706027216.26</float>
<string>UTC</string>
</tuple>
</state>
......@@ -233,7 +238,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -247,7 +252,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.33408.64727.5632</string> </value>
<value> <string>1014.12296.22288.38843</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -267,7 +272,7 @@
</tuple>
<state>
<tuple>
<float>1542965869.33</float>
<float>1709576768.94</float>
<string>UTC</string>
</tuple>
</state>
......@@ -294,11 +299,13 @@
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -310,7 +317,7 @@
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
......@@ -330,7 +337,7 @@
</tuple>
<state>
<tuple>
<float>1457347073.74</float>
<float>1706027216.24</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -247,7 +247,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>971.43784.34275.28586</string> </value>
<value> <string>1015.24509.15236.10769</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -267,7 +267,7 @@
</tuple>
<state>
<tuple>
<float>1542388521.4</float>
<float>1711048261.14</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -2,13 +2,16 @@
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<title>ERP5 Page Monitoring Landing</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Jio All Docs</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="gadget_erp5_page_ojsm_landing.js" type="text/javascript"></script>
<script src="jiodev.js" type="text/javascript"></script>
<!-- custom script -->
<script src="gadget_officejs_monitoring_jio_alldocs.js" type="text/javascript"></script>
</head>
<body>
......
......@@ -16,7 +16,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -59,7 +58,6 @@
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
......@@ -83,7 +81,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_jio_promise_view.html</string> </value>
<value> <string>gadget_officejs_monitoring_jio_alldocs.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -93,13 +91,11 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_jio_promise_view_html</string> </value>
<value> <string>gadget_officejs_monitoring_jio_alldocs_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -113,13 +109,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>OfficeJS Jio Promise View</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
<value> <string>Officejs Monitoring All Docs</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -185,7 +175,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -209,7 +199,7 @@
</tuple>
<state>
<tuple>
<float>1506672679.59</float>
<float>1712168087.71</float>
<string>UTC</string>
</tuple>
</state>
......@@ -244,7 +234,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -258,7 +248,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.48890.59022.44748</string> </value>
<value> <string>1015.43169.7471.64085</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1508252274.8</float>
<float>1712168022.61</float>
<string>UTC</string>
</tuple>
</state>
......@@ -309,7 +299,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -341,7 +331,7 @@
</tuple>
<state>
<tuple>
<float>1506672050.57</float>
<float>1712167647.48</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, jIO, FormData, AbortController, RSVP, navigator */
/*jslint indent: 2, maxerr: 3 */
(function (window, rJS, jIO) {
"use strict";
rJS(window)
.declareAcquiredMethod("getSettingList", "getSettingList")
.declareAcquiredMethod("setSetting", "setSetting")
.declareMethod('jio_allDocs', function (param_list, gadget) {
var jio_gadget;
if (param_list[0].query.indexOf('portal_type:"Promise"') !== -1 &&
gadget.state.doc && gadget.state.doc.source) {
return new RSVP.Queue()
.push(function () {
return gadget.declareGadget('gadget_officejs_monitoring_jio.html');
})
.push(function (result) {
jio_gadget = result;
return jio_gadget.createJio({
type: "webhttp",
// XXX fix of url
url: gadget.state.doc.source_url.replace("jio_public", "public")
});
})
.push(function () {
// get history file on live
return jio_gadget.get(
gadget.state.doc.source + ".history"
)
.push(undefined, function (error) {
if (error.name === "cancel") {
return undefined;
}
return gadget.notifySubmitted({
status: "error",
message: "Failed to get promise history content! \n" +
error.message || ''
})
.push(function () {
return undefined;
});
})
.push(function (status_history) {
var i, len, start, result = {};
result.data = {rows: [], total_rows: 0};
function addUTCTimezone(date_string) {
if (new RegExp(/[+-][\d]{2}\:?[\d]{2}$/).test(date_string)) {
return date_string;
}
return date_string + "+0000";
}
if (status_history && status_history.hasOwnProperty('data')) {
// the status history list is reversed ([old, ...., newest])
len = status_history.data.length;
start = len - param_list[0].limit[0] - 1;
if (start < 0) {
start = len - 1;
}
for (i = start; i >= 0; i -= 1) {
result.data.total_rows += 1;
result.data.rows.push({
value: {
status: {
url_value: {
onclick: "return false;"
},
field_gadget_param: {
css_class: "",
description: "The Status",
hidden: 0,
"default": status_history.data[i].status,
key: "status",
url: "gadget_erp5_field_status.html",
title: "Status",
type: "GadgetField"
}
},
start_date: {
url_value: {
onclick: "return false;"
},
field_gadget_param: {
allow_empty_time: 0,
ampm_time_style: 0,
css_class: "date_field",
date_only: 0,
description: "The Date",
editable: 0,
hidden: 0,
hidden_day_is_last_day: 0,
"default": addUTCTimezone(status_history.data[i].date ||
status_history.data[i]['start-date']),
key: "start_date",
required: 0,
timezone_style: 1,
title: "Date",
type: "DateTimeField"
}
},
change_date: {
url_value: {
onclick: "return false;"
},
field_gadget_param: {
allow_empty_time: 0,
ampm_time_style: 0,
css_class: "date_field",
date_only: 0,
description: "The Date",
editable: 0,
hidden: 0,
hidden_day_is_last_day: 0,
"default": addUTCTimezone(status_history.data[i]['change-date'] ||
new Date(status_history.data[i]['change-time'] * 1000)
.toUTCString()),
key: "change_date",
required: 0,
timezone_style: 1,
title: "Status Date",
type: "DateTimeField"
}
},
message: {
url_value: {
onclick: "return false;"
},
field_gadget_param: {
css_class: "",
description: "The promise output message",
editable: 0,
hidden: 0,
"default": status_history.data[i].message,
key: "message",
required: 0,
title: "Promise Output",
type: "StringField"
}
},
"listbox_uid:list": {
key: "listbox_uid:list",
value: 2713
}
}
});
}
}
return result;
});
});
}
});
}(window, rJS, jIO));
\ No newline at end of file
......@@ -12,6 +12,9 @@
<script src="jiodev.js" type="text/javascript"></script>
<script src="monitoring_jio_storage.js" type="text/javascript"></script>
<script src="monitoring_jio_web_storage.js" type="text/javascript"></script>
<script src="jio_ojs_storage.js" type="text/javascript"></script>
<script src="jio_appcachestorage.js"></script>
<script src="jio_configuration_storage.js"></script>
<!-- custom script -->
<script src="gadget_officejs_monitoring_jio.js" type="text/javascript"></script>
......
......@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Monitoring Instance Parameters View Page</title>
<title>Monitoring Instance Parameter View Gadget</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
......
This diff is collapsed.
This diff is collapsed.
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