Commit dd87a961 authored by Alain Takoudjou's avatar Alain Takoudjou

[erp5_web_monitoring] Drop jquerymobile and use erp5_web_renderjs_ui style

parent 3b3591f7
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.21883.33309.38348</string> </value>
<value> <string>961.21937.16299.41642</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1502445194.86</float>
<float>1507899148.22</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 Monitor Page ERP5 Jio Config</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_erp5_page_ojsm_erp5_configurator.js"></script>
</head>
<body>
<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-database">&nbsp;</span>
Your ERP5 Connection parameters
</h3>
</section>
<p>You have to be logged in this ERP5 prior to synchronising</p>
</article>
<br>
<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>
<br>
</body>
</html>
/*global window, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS) {
"use strict";
rJS(window)
.setState({
erp5_url: "https://vifib.erp5.net/web_site_module/renderjs_runner"
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("setSetting", "setSetting")
/////////////////////////////////////////
// Form submit
/////////////////////////////////////////
.onEvent('submit', function () {
var gadget = this,
master_url;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (content) {
master_url = content.erp5_url + "/hateoas/";
return gadget.setSetting("hateoas_url", master_url);
})
.push(function () {
return gadget.redirect({command: "display", options: {
page: "ojsm_import_export",
auto_sync: "erp5",
url: master_url
}});
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareMethod("render", function () {
var gadget = this;
return gadget.getDeclaredGadget('form_view')
.push(function (form_gadget) {
return form_gadget.render({
erp5_document: {
"_embedded": {"_view": {
"my_erp5_url": {
"description": "",
"title": "Connection Url",
"default": gadget.state.erp5_url,
"css_class": "",
"required": 1,
"editable": 1,
"key": "erp5_url",
"hidden": 0,
"type": "StringField"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"top",
[["my_erp5_url"]]
]]
}
});
})
.push(function () {
return gadget.getUrlFor({command: 'display', options: {page: 'ojsm_import_export'}});
})
.push(function (url) {
return gadget.updateHeader({
page_title: "Connect To ERP5 Storage",
back_url: url,
submit_action: true,
panel_action: false
});
});
});
}(window, rJS));
......@@ -4,18 +4,17 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monitoring Logs Widget</title>
<title>Monitoring Hosting Subscription List</title>
<link href="gadget_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<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_monitoring_log_widget.js"></script>
<script src="gadget_erp5_page_ojsm_hosting_subscription_list.js"></script>
</head>
<body>
<div data-gadget-url="gadget_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list"></div>
</body>
</html>
......@@ -80,7 +80,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_hosting_subscription_list.html</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_list.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -90,7 +90,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_hosting_subscription_list_html</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_list_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -243,7 +243,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.6384.703.48554</string> </value>
<value> <string>962.48791.22929.44424</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -261,7 +261,7 @@
</tuple>
<state>
<tuple>
<float>1501862298.92</float>
<float>1507902208.04</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP) {
"use strict";
var gadget_klass = rJS(window);
function getHostingData(gadget, filter) {
// optimized way to fetch hosting subscription list
var hosting_dict = {},
instance_dict = {},
total_rows = 0;
return gadget.jio_allDocs(filter)
.push(function (result) {
var i;
total_rows = result.data.total_rows;
for (i = 0; i < result.data.total_rows; i += 1) {
hosting_dict[result.data.rows[i].id] = {
id: result.data.rows[i].id,
value: {
url: result.data.rows[i].value.url,
status: "WARNING",
date: 'Not Synchronized',
title: result.data.rows[i].value.title,
amount: 0
}
};
}
return gadget.jio_allDocs({
query: '(portal_type:"opml-outline") OR (portal_type:"global")',
select_list: [
"parent_url",
"status",
"parent_id",
"date",
"portal_type"
]
});
})
.push(function (result) {
var i,
key,
item,
row_list = [];
for (i = 0; i < result.data.total_rows; i += 1) {
if (result.data.rows[i].value.portal_type === 'opml-outline') {
if (hosting_dict.hasOwnProperty(result.data.rows[i].value.parent_url)) {
instance_dict[result.data.rows[i].id] = {
parent_id: result.data.rows[i].value.parent_url
};
}
}
}
for (i = 0; i < result.data.total_rows; i += 1) {
if (result.data.rows[i].value.portal_type === 'global') {
if (instance_dict.hasOwnProperty(result.data.rows[i].value.parent_id)) {
instance_dict[result.data.rows[i].value.parent_id].date =
result.data.rows[i].value.date;
instance_dict[result.data.rows[i].value.parent_id].status =
result.data.rows[i].value.status;
}
}
}
//calculate hosting subscription status
for (key in instance_dict) {
if (instance_dict.hasOwnProperty(key)) {
item = hosting_dict[instance_dict[key].parent_id].value;
item.amount += 1;
if (item.status !== "ERROR") {
item.status = instance_dict[key].status || "WARNING";
}
item.date = instance_dict[key].date || 'Not Synchronized';
item.synced = item.status !== "WARNING" ? "YES" : "NO";
}
}
for (key in hosting_dict) {
if (hosting_dict.hasOwnProperty(key)) {
row_list.push(hosting_dict[key]);
}
}
return {data: {total_rows: total_rows, rows: row_list}};
});
}
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("getUrlFor", function (param_list) {
if (param_list[0].options.jio_key !== undefined &&
param_list[0].options.query.indexOf('portal_type:"opml"') !== -1) {
param_list[0].options.page = "ojsm_hosting_subscription_view";
param_list[0].options.opml_key = param_list[0].options.jio_key;
}
return this.getUrlFor(param_list[0]);
})
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
return getHostingData(gadget, 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 = {
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": new Date(result.data.rows[i].value.date).toUTCString(),
key: "date",
required: 0,
timezone_style: 0,
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 = {
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", 100);
})
.push(function (listbox_lines_limit) {
lines_limit = listbox_lines_limit;
return gadget.getDeclaredGadget('form_list');
})
.push(function (form_list) {
var column_list = [
['title', 'Hosting Subscription'],
['amount', 'Instance Amount'],
['date', 'Status Date'],
['synced', 'Synced?'],
['status', 'Status']
];
return form_list.render({
erp5_document: {
"_embedded": {"_view": {
"listbox": {
"column_list": column_list,
"show_anchor": 0,
"default_params": {},
"editable": 0,
"editable_column_list": [],
"key": "hosting_subscription_listbox",
"lines": lines_limit,
"list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=%28portal_type%3A%22" +
"opml" + "%22%29AND%28active%3A%22" +
"true" + "%22%29",
"portal_type": [],
"search_column_list": [['title', 'Hosting Subscription']],
"sort_column_list": [['title', 'Hosting Subscription']],
"sort": [["title", "ascending"]],
"title": "Hosting Subscriptions",
"command": "index",
"type": "ListBox"
}
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"bottom",
[["listbox"]]
]]
}
});
})
.push(function (result) {
return gadget.updateHeader({
page_title: "Hosting Subscriptions 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
......@@ -80,7 +80,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_hosting_subscription_list.js</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_list.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -90,7 +90,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_hosting_subscription_list_js</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_list_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -108,7 +108,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Monitoring Hosting Subscription list Js</string> </value>
<value> <string>Monitoring Hosting Subscription list JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -239,7 +239,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.36732.50199.26692</string> </value>
<value> <string>963.19077.52757.17169</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>1503333754.52</float>
<float>1510052055.87</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 Hosting Subscription 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="gadget_erp5_page_ojsm_hosting_subscription_view.js"></script>
</head>
<body>
<br/>
<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"
data-gadget-scope="form_list"
data-gadget-sandbox="public">
</div>
</div>
</body>
</html>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_hosting_subscription_view.html</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_view.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -93,7 +93,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_hosting_subscription_view_html</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_view_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.40879.58115.22357</string> </value>
<value> <string>962.46060.41528.54152</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1503583096.3</float>
<float>1507901514.08</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_hosting_subscription_view.js</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_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_monitoring_hosting_subscription_view_js</string> </value>
<value> <string>gadget_erp5_page_ojsm_hosting_subscription_view_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.40930.22839.30634</string> </value>
<value> <string>963.1690.33865.32955</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1503585188.82</float>
<float>1509095405.67</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 Monitor Import Export</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 src="jsen.min.js" type="text/javascript"></script>
<script src="gadget_erp5_page_ojsm_import_export.js"></script>
<script id="template-message-error" type="text/x-handlebars-template">
<p><span class='ui-text-{{status}}'>{{message}}</span></p>
</script>
<script id="template-section-title" type="text/x-handlebars-template">
<span class="ui-icon ui-icon-custom ui-icon-{{icon}}">&nbsp;</span>
{{title}}
</script>
<script id="storage-selection" type="text/x-handlebars-template">
<br>
<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-database">&nbsp;</span>
Load Settings from remote Storage
</h3>
</section>
<section class="ui-body-c ui-content-section">
<div class="storage-selection">
<ul data-role="listview" data-theme="c" class="document-listview ui-listview-inset ui-corner-all">
{{#each documentlist}}
<li><a class="ui-body-inherit" href="{{link}}">{{title}}</a></li>
{{/each}}
</ul>
</div>
</section>
</article>
</script>
</head>
<body>
<article class="ui-content ui-body-c document-access">
<section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c">
</h3>
</section>
<section class="ui-body-c ui-content-section">
<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="ui-message-alert"></div>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</section>
</article>
<br/>
<div class="storage-list">
</div>
<div data-gadget-url="gadget_erp5_jio.html" data-gadget-scope="erp5_gadget" data-gadget-sandbox="public"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>ERP5 Page Monitoring Jump</title>
<!-- 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_jump.js" type="text/javascript"></script>
<script id="table-template" type="text/x-handlebars-template">
<section class="ui-content-header-plain">
<h3 class="ui-content-title ui-body-c" data-i18n="[last]{{definition_i18n}}">
<span class="ui-icon ui-icon-custom ui-icon-plane">&nbsp;</span>
{{definition_title}}
</h3>
</section>
<ul data-role="listview" data-theme="c" data-inset="true" class="document-listview">
{{#each documentlist}}
<li><a data-i18n="{{i18n}}" class="ui-body-inherit" href="{{link}}">{{title}}</a></li>
{{/each}}
</ul>
</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
"use strict";
var gadget_klass = rJS(window),
source = gadget_klass.__template_element
.getElementById("table-template")
.innerHTML,
table_template = Handlebars.compile(source);
gadget_klass
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("updateHeader", "updateHeader")
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) {
var gadget = this,
promise_list = [];
options.page = options.jump_page;
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: {
page: options.search_page,
extended_search: options.title
}}));
}
return new RSVP.Queue()
.push(function () {
return RSVP.all(promise_list);
})
.push(function (result_list) {
var i,
tab_list = [];
tab_list.push({
title: options.view_title || options.jio_key,
link: result_list[0],
i18n: options.view_title || options.jio_key
});
if (result_list.length > 1) {
tab_list.push({
title: options.title + " Promises",
link: result_list[1],
i18n: options.title + " Promises"
});
}
return RSVP.all([
gadget.translateHtml(table_template({
definition_title: "Jumps",
documentlist: tab_list,
definition_i18n: "Jumps"
})),
gadget.getUrlFor({command: 'history_previous'})
]);
})
.push(function (last_result_list) {
gadget.element.innerHTML = last_result_list[0];
return gadget.updateHeader({
back_url: last_result_list[1],
page_title: options.title + ": Jump to URL"
});
});
});
}(window, rJS, RSVP, Handlebars));
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OfficeJS Monitor Add OPML</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 src="gadget_officejs_monitoring_global.js"></script>
<script src="gadget_erp5_page_ojsm_opml_add.js"></script>
<script id="template-message-error" type="text/x-handlebars-template">
<p><span class='ui-text-{{status}}'>{{message}}</span></p>
</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 class="ui-message-alert"></div>
<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
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_software_instance_view.html</string> </value>
<value> <string>gadget_erp5_page_ojsm_opml_add.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -93,7 +93,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_software_instance_view_html</string> </value>
<value> <string>gadget_erp5_page_ojsm_opml_add_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -113,14 +113,18 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Monitoring Software Instance View</string> </value>
<value> <string>OfficeJS Add New OPML</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
......@@ -201,7 +205,7 @@
</tuple>
<state>
<tuple>
<float>1464251887.79</float>
<float>1506071769.76</float>
<string>UTC</string>
</tuple>
</state>
......@@ -246,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.59699.24642.30873</string> </value>
<value> <string>963.1898.2167.63078</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1504711023.3</float>
<float>1509020790.01</float>
<string>UTC</string>
</tuple>
</state>
......@@ -321,7 +325,7 @@
</tuple>
<state>
<tuple>
<float>1464250270.25</float>
<float>1506071722.5</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, rJS, RSVP, Handlebars, OPMLManage */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars, OPMLManage) {
"use strict";
var gadget_klass = rJS(window),
templater = gadget_klass.__template_element,
notify_msg_template = Handlebars.compile(
templater.getElementById("template-message-error").innerHTML
),
opml_global = OPMLManage;
gadget_klass
/////////////////////////////
// state
/////////////////////////////
.setState({
message: "",
redirect: true
})
/////////////////////////////
// ready
/////////////////////////////
.ready(function (gadget) {
return opml_global.init(gadget, notify_msg_template);
})
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_put", "jio_put")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.onEvent('submit', function () {
var gadget = this,
doc;
return new RSVP.Queue()
.push(function () {
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (form_doc) {
doc = form_doc;
if (!opml_global.validateHttpUrl(form_doc.url)) {
gadget.state.message
.innerHTML = notify_msg_template({
status: 'error',
message: "'" + form_doc.url + "' is not a valid OPML URL"
});
return false;
}
if (!form_doc.username || !form_doc.password) {
gadget.state.message
.innerHTML = notify_msg_template({
status: 'error',
message: 'Username and password fields are required!'
});
return false;
}
if (form_doc.new_password &&
form_doc.new_password !== form_doc.confirm_new_password) {
gadget.state.message
.innerHTML = notify_msg_template({
status: 'error',
message: 'The new password and it confirmation are differents!'
});
return false;
}
return true;
})
.push(function (state) {
if (state) {
return gadget.notifySubmitting()
.push(function () {
doc.title = "";
return opml_global.saveOPML(doc, true);
})
.push(function (status) {
var msg = 'Document Updated';
if (!status) {
msg = 'Document update failed';
}
return RSVP.all([
gadget.notifySubmitted(msg),
status
]);
})
.push(function (result_list) {
if (result_list[1] && gadget.state.redirect) {
return gadget.redirect({
"command": "change",
"options": {"page": "ojsm_status_list"}
});
}
});
}
});
})
.declareMethod("triggerSubmit", function () {
return this.element.querySelector('button[type="submit"]').click();
})
.declareMethod("render", function (options) {
var gadget = this;
return RSVP.Queue()
.push(function () {
return RSVP.all([
gadget.getDeclaredGadget('form_view'),
gadget.getSetting('portal_type')
]);
})
.push(function (result) {
return result[0].render({
erp5_document: {
"_embedded": {"_view": {
"my_url": {
"description": "",
"title": "OPML URL",
"default": options.url || "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "url",
"hidden": 0,
"type": "StringField"
},
"my_username": {
"description": "Username for access private URLs",
"title": "Username",
"default": options.username || "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "username",
"hidden": 0,
"type": "StringField"
},
"my_password": {
"description": "Password for access private URLs",
"title": "Password",
"default": options.password || "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "password",
"hidden": 0,
"type": "PasswordField"
},
"my_portal_type": {
"description": "The name of a document in ERP5",
"title": "Portal Type",
"default": result[1],
"css_class": "",
"required": 1,
"editable": 1,
"key": "portal_type",
"hidden": 1,
"type": "StringField"
},
"my_active": {
"description": "Sync this opml or not",
"title": "Active (Auto Sync)",
"default": 1,
"css_class": "",
"required": 1,
"editable": 1,
"key": "active",
"hidden": 1,
"type": "CheckBoxField"
},
"my_new_password": {
"description": "Change current OPML password",
"title": "New Password",
"default": "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "new_password",
"hidden": (options.chg_passwd || '' === true) ? 0 : 1,
"type": "PasswordField"
},
"my_confirm_new_password": {
"description": "Confirm new OPML password",
"title": "Confirm New Password",
"default": "",
"css_class": "",
"required": 1,
"editable": 1,
"key": "confirm_new_password",
"hidden": (options.chg_passwd || '' === true) ? 0 : 1,
"type": "PasswordField"
},
}},
"_links": {
"type": {
// form_list display portal_type in header
name: ""
}
}
},
form_definition: {
group_list: [[
"left",
[["my_url"], ["my_username"], ["my_password"],
["my_portal_type"], ["my_active"],
["my_new_password"], ["my_confirm_new_password"]]
]]
}
});
})
.push(function () {
var new_options;
if (options.chg_passwd === 'true') {
return undefined;
}
new_options = JSON.parse(JSON.stringify(options));
new_options.chg_passwd = 'true';
return gadget.getUrlFor({command: "change", options: new_options});
})
.push(function (chg_pwd_url) {
return gadget.updateHeader({
page_title: "Add OPML",
save_action: true,
change_password: chg_pwd_url
});
});
});
}(window, rJS, RSVP, Handlebars, OPMLManage));
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_breadcrumb.js</string> </value>
<value> <string>gadget_erp5_page_ojsm_opml_add.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -93,7 +93,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_breadcrumb_js</string> </value>
<value> <string>gadget_erp5_page_ojsm_opml_add_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -113,14 +113,18 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Monitoring Breadcrumb JS</string> </value>
<value> <string>OfficeJS Monitoring Add OPML JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
......@@ -201,7 +205,7 @@
</tuple>
<state>
<tuple>
<float>1502444254.8</float>
<float>1506075175.77</float>
<string>UTC</string>
</tuple>
</state>
......@@ -246,7 +250,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.21922.6098.18551</string> </value>
<value> <string>963.1933.16122.39953</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +268,7 @@
</tuple>
<state>
<tuple>
<float>1502445069.05</float>
<float>1509023050.17</float>
<string>UTC</string>
</tuple>
</state>
......@@ -287,9 +291,7 @@
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
......@@ -305,7 +307,7 @@
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
......@@ -323,7 +325,7 @@
</tuple>
<state>
<tuple>
<float>1502444184.21</float>
<float>1506072210.95</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,15 +4,11 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monitoring Main Page</title>
<link href="gadget_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<title>OfficeJS Monitor Delete OPML</title>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>
<script src="gadget_monitoring_main.js"></script>
<script src="gadget_erp5_page_ojsm_opml_delete.js"></script>
</head>
<body>
......
/*global window, rJS, RSVP, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) {
"use strict";
rJS(window)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("jio_remove", "jio_remove")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", 'notifySubmitted')
.declareMethod("render", function (options) {
var gadget = this;
return gadget.notifySubmitting()
.push(function () {
return gadget.jio_remove(options.jio_key);
})
.push(function () {
return gadget.notifySubmitted("Document Deleted");
})
.push(function () {
return gadget.redirect({command: 'change', options: {
page: options.return_url || 'settings_configurator'
}});
});
});
}(window, rJS, RSVP, Handlebars));
......@@ -6,7 +6,7 @@
<title>Monitoring Process View Page</title>
<link href="gadget_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="notify.min.js"></script>
<script src="rsvp.js"></script>
......@@ -16,7 +16,7 @@
{{#each resource_list}}
<div class="infobox">
<div class="infobox-icon">
<i class="fa fa-{{icon_name}} fa-2x"></i>
<span class="ui-icon ui-icon-custom ui-icon-{{icon_name}}"></span>
</div>
<div class="infobox-data">
<span class="infobox-data-number">{{value}}</span>
......@@ -26,48 +26,22 @@
{{/each}}
</script>
<script id="monitor-process-widget-template" type="text/x-handlebars-template">
<table class="ui-responsive ui-body-c ui-table-inset custom-force-list">
<thead class="ui-bar-inherit">
<tr>
{{#each column_list}}
<th>{{title}}</th>
{{/each}}
</tr>
</thead>
<tbody>
{{#each row_list}}
<tr title='{{message}}'>
{{#each cell_list}}
{{#if href}}
<td class='{{class}}'><a class="ui-link" href="{{href}}">{{value}}</a></td>
{{else}}
<td class='{{class}}'><a class="ui-link">{{value}}</a></td>
{{/if}}
{{/each}}
</tr>
{{/each}}
</tbody>
<tfoot class="ui-bar-inherit"></tfoot>
</table>
</script>
<script src="gadget_monitoring_process_view.js"></script>
<script src="gadget_erp5_page_ojsm_processes_view.js"></script>
</head>
<body>
<div data-gadget-url="gadget_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<div class="ui-promise-title">
<h2>
<div data-gadget-url="gadget_monitoring_breadcrumb.html" data-gadget-scope="breadcrumb_gadget" data-gadget-sandbox="public"></div>
</h2>
</div>
<div data-gadget-url="gadget_officejs_monitoring_jio.html" data-gadget-scope="jio_gadget" data-gadget-sandbox="public"></div>
<div class="center">
<div class="padding-lr-10 infobox-container">
</div>
<h2 class="header-notice"><i class="fa fa-info" aria-hidden="true"></i> Processes information will be reloaded automatically every minutes.</h2>
<div class="ui-panel-overview ui-grid-container process-all">
<h2 class="header-notice"><i class="ui-icon ui-icon-custom ui-icon-info"></i> Processes information will be reloaded automatically every minutes.</h2>
</div>
<form>
<div data-gadget-url="gadget_erp5_form.html"
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
</form>
</body>
</html>
......@@ -80,7 +80,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_process_view.html</string> </value>
<value> <string>gadget_erp5_page_ojsm_processes_view.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -90,7 +90,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_process_view_html</string> </value>
<value> <string>gadget_erp5_page_ojsm_processes_view_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -110,7 +110,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Monitoring Process View</string> </value>
<value> <string>Gadget Monitoring Processes View</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -243,7 +243,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.17754.56595.43520</string> </value>
<value> <string>962.46066.30387.47069</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -261,7 +261,7 @@
</tuple>
<state>
<tuple>
<float>1502194340.06</float>
<float>1507902085.76</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -80,7 +80,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_process_view.js</string> </value>
<value> <string>gadget_erp5_page_ojsm_processes_view.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -90,7 +90,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_process_view_js</string> </value>
<value> <string>gadget_erp5_page_ojsm_processes_view_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -108,7 +108,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Monitoring Process JS</string> </value>
<value> <string>Gadget Monitoring Processes JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -239,7 +239,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>961.21883.33309.38348</string> </value>
<value> <string>963.16563.15280.46899</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -257,7 +257,7 @@
</tuple>
<state>
<tuple>
<float>1502445069.11</float>
<float>1510052139.85</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 Resource View Page</title>
<link href="gadget_officejs_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<script src="notify.min.js"></script>
<script src="rsvp.js"></script>
<script src="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>
<h2 class="header-notice"><i class="ui-icon ui-icon-custom ui-icon-info"></i> Graph content will be reloaded automatically every minutes.</h2>
<!--<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">
<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>
<div class="ui-grid-b ui-responsive">
<div data-gadget-url="gadget_field_graph_dygraph.html" data-gadget-scope="graph_io" class="graph graph-h-medium" data-gadget-sandbox="public"></div>
</div>
<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>
</body>
</html>
......@@ -83,7 +83,7 @@
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_monitoring_message_log.html</string> </value>
<value> <string>gadget_erp5_page_ojsm_resources_view.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -93,7 +93,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_monitoring_message_log_html</string> </value>
<value> <string>gadget_erp5_page_ojsm_resources_view_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
......@@ -113,7 +113,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Monitoring Log List</string> </value>
<value> <string>Gadget OJS Monitoring Resources View</string> </value>
</item>
<item>
<key> <string>version</string> </key>
......@@ -201,7 +201,7 @@
</tuple>
<state>
<tuple>
<float>1467736090.49</float>
<float>1507116490.54</float>
<string>UTC</string>
</tuple>
</state>
......@@ -246,7 +246,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>952.24422.29891.16622</string> </value>
<value> <string>962.36002.50044.8055</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -264,7 +264,7 @@
</tuple>
<state>
<tuple>
<float>1467963489.81</float>
<float>1507902037.02</float>
<string>UTC</string>
</tuple>
</state>
......@@ -321,7 +321,7 @@
</tuple>
<state>
<tuple>
<float>1467735613.0</float>
<float>1507111456.51</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -4,18 +4,17 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monitoring Software Instance List</title>
<title>Monitoring Software Instances</title>
<link href="gadget_monitoring_custom.css" rel="stylesheet" type="text/css"/>
<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_monitoring_software_instance_list.js"></script>
<script src="gadget_erp5_page_ojsm_software_instance_list.js"></script>
</head>
<body>
<div data-gadget-url="gadget_monitoring_widget_listbox.html" data-gadget-scope="listview"></div>
<div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list"></div>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Monitoring Promises Status</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_status_list.js"></script>
</head>
<body>
<div data-gadget-url="gadget_erp5_pt_form_list.html" data-gadget-scope="form_list" data-gadget-sandbox="public"></div>
</body>
</html>
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