Commit d233dc6b authored by Roque's avatar Roque

Upgrade ojs monitoring app

See merge request nexedi/erp5!1848
parents bab42871 f1a5c5e1
......@@ -31,7 +31,15 @@
})
.push(function (result) {
if (result === undefined || result.data.total_rows === 0) {
// no result from the query
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) {
......@@ -123,6 +131,9 @@
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
});
......
......@@ -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.38066.29413.61576</string> </value>
<value> <string>1012.62724.50149.41113</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -266,7 +266,7 @@
</tuple>
<state>
<tuple>
<float>1540892674.51</float>
<float>1701717676.56</float>
<string>UTC</string>
</tuple>
</state>
......
<!DOCTYPE html>
<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>
<!-- 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>
</head>
<body>
</body>
</html>
\ No newline at end of file
/*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
......@@ -654,7 +654,7 @@
portal_type: element.portal_type || element.type ||
item_result.type,
status: status,
reference: id_hash,
reference: element.reference || id_hash,
active: true
});
opml_document_list.push({
......
......@@ -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>972.3978.30023.34679</string> </value>
<value> <string>1012.51177.40041.21742</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -267,7 +269,7 @@
</tuple>
<state>
<tuple>
<float>1543851108.12</float>
<float>1701111013.97</float>
<string>UTC</string>
</tuple>
</state>
......
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