Commit 3982aa81 authored by Roque's avatar Roque

Update monitoring app storage

See merge request nexedi/erp5!1977
parents 18e9c69a db9466f8
...@@ -104,7 +104,9 @@ ...@@ -104,7 +104,9 @@
form_definition: form_definition, form_definition: form_definition,
form_type: form_definition.form_type, form_type: form_definition.form_type,
view: options.view || app_view, view: options.view || app_view,
view_action_dict: view_action_dict view_action_dict: view_action_dict,
notify_type: options.notify_type,
notify_msg: options.notify_msg
}); });
}, function (error) { }, function (error) {
// jio not found error // jio not found error
...@@ -144,6 +146,14 @@ ...@@ -144,6 +146,14 @@
return gadget.updatePanel({ return gadget.updatePanel({
view_action_dict: gadget.state.view_action_dict view_action_dict: gadget.state.view_action_dict
}); });
})
.push(function () {
if (gadget.state.notify_msg && gadget.state.notify_type) {
return gadget.notifySubmitted({
message: gadget.state.notify_msg,
status: gadget.state.notify_type
});
}
}); });
}) })
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1015.46091.52896.5922</string> </value> <value> <string>1018.11989.25920.31300</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1712343165.23</float> <float>1721922124.11</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -254,10 +254,18 @@ ...@@ -254,10 +254,18 @@
.declareMethod("triggerSubmit", function (argument_list) { .declareMethod("triggerSubmit", function (argument_list) {
var gadget = this, child_gadget, content_dict; var gadget = this, child_gadget, content_dict;
if (gadget.state.form_definition.portal_type_dict.custom_submit) { if (gadget.state.form_definition.portal_type_dict.custom_submit) {
return gadget.getDeclaredGadget('erp5_pt_gadget')
.push(function (result) {
child_gadget = result;
return child_gadget.getContent();
})
.push(function (result) {
content_dict = result;
return gadget.declareGadget(gadget.state.form_definition return gadget.declareGadget(gadget.state.form_definition
.portal_type_dict.custom_submit) .portal_type_dict.custom_submit)
})
.push(function (submit_gadget) { .push(function (submit_gadget) {
return submit_gadget.handle_submit(argument_list, gadget.state); return submit_gadget.handle_submit(argument_list, gadget.state, content_dict);
}); });
} }
return gadget.getDeclaredGadget('erp5_pt_gadget') return gadget.getDeclaredGadget('erp5_pt_gadget')
...@@ -434,16 +442,16 @@ ...@@ -434,16 +442,16 @@
} }
} }
} }
if (portal_type_dict.custom_header) {
return gadget.declareGadget(portal_type_dict.custom_header); return gadget.declareGadget(portal_type_dict.custom_header);
}
return;
}) })
.push(function (header_gadget) { .push(function (header_gadget) {
if (header_gadget) {
return header_gadget.getOptions(portal_type_dict, options, header_dict); return header_gadget.getOptions(portal_type_dict, options, header_dict);
}, function (error) {
if (!portal_type_dict.custom_header) {
return header_dict;
} else {
throw error;
} }
return header_dict;
}) })
.push(function (header_options) { .push(function (header_options) {
return gadget.updateHeader(header_options); return gadget.updateHeader(header_options);
......
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.46538.50454.1467</string> </value> <value> <string>1019.37331.10633.54664</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1716222503.85</float> <float>1727373462.24</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
"url": options.url, "url": options.url,
"username": options.username, "username": options.username,
"password": options.password, "password": options.password,
"slapos_master_url": options.slapos_master_url || "not-provided", "slapos_master_url": options.slapos_master_url || "",
"page": "ojsm_opml_add" "page": "ojsm_opml_add"
} }
}); });
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
"url": options.url, "url": options.url,
"username": options.username, "username": options.username,
"password": options.password, "password": options.password,
"slapos_master_url": options.slapos_master_url || "not-provided", "slapos_master_url": options.slapos_master_url || "",
"page": "ojsm_opml_add" "page": "ojsm_opml_add"
} }
}); });
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
// default front page (list of promises) // default front page (list of promises)
return gadget.redirect({command: 'display', return gadget.redirect({command: 'display',
options: {page: "ojs_local_controller", options: {page: "ojs_local_controller",
notify_msg: options.notify_msg,
notify_type: options.notify_type,
portal_type: "Promise Module"} portal_type: "Promise Module"}
}); });
}); });
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.31995.2932.55961</string> </value> <value> <string>1018.11987.13059.19063</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1719275229.13</float> <float>1721920651.07</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
rJS(window) rJS(window)
.setState({ .setState({
erp5_url_list: "https://panel.rapid.space/hateoas/" erp5_url_list: ["https://panel.rapid.space/hateoas/"]
}) })
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Acquired methods // Acquired methods
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSettingList", "setSettingList")
///////////////////////////////////////// /////////////////////////////////////////
// Form submit // Form submit
...@@ -30,6 +31,10 @@ ...@@ -30,6 +31,10 @@
for (i = 0; i < master_url_list.length; i += 1) { for (i = 0; i < master_url_list.length; i += 1) {
master_url_list[i] = master_url_list[i].trim(); master_url_list[i] = master_url_list[i].trim();
} }
return gadget.setSettingList({'master_url_list': master_url_list,
'master_url_list_updated': true});
})
.push(function () {
return gadget.redirect({command: "display", options: { return gadget.redirect({command: "display", options: {
page: "ojsm_import_export", page: "ojsm_import_export",
auto_sync: "erp5", auto_sync: "erp5",
...@@ -44,8 +49,13 @@ ...@@ -44,8 +49,13 @@
.declareMethod("render", function () { .declareMethod("render", function () {
var gadget = this; var gadget = this;
return gadget.getSetting('master_url_list')
return gadget.getDeclaredGadget('form_view') .push(function (master_url_list) {
if (master_url_list) {
gadget.state.erp5_url_list = master_url_list;
}
return gadget.getDeclaredGadget('form_view');
})
.push(function (form_gadget) { .push(function (form_gadget) {
//TODO replace textarea by N stringfield inputs //TODO replace textarea by N stringfield inputs
return form_gadget.render({ return form_gadget.render({
...@@ -54,7 +64,7 @@ ...@@ -54,7 +64,7 @@
"my_erp5_url_list": { "my_erp5_url_list": {
"description": "", "description": "",
"title": "Connection Url List", "title": "Connection Url List",
"default": gadget.state.erp5_url_list, "default": gadget.state.erp5_url_list.join('\r\n'),
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 1, "editable": 1,
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.60960.54632.28569</string> </value> <value> <string>1018.39277.14666.4573</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1718127515.73</float> <float>1723557962.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -600,91 +600,7 @@ ...@@ -600,91 +600,7 @@
.push(function () { .push(function () {
var has_failed = false, i; var has_failed = false, i;
if (gadget.state.sync === "erp5" && gadget.state.storage_url_list) { if (gadget.state.sync === "erp5" && gadget.state.storage_url_list) {
var storage_definition_list = []; return gadget.setSetting("latest_import_date", new Date().getTime())
// start import from erp5 now
return gadget.notifySubmitting()
.push(function () {
gadget.getSetting('default_view_reference');
})
.push(function (default_view_reference) {
for (i = 0; i < gadget.state.storage_url_list.length; i += 1) {
storage_definition_list.push({
type: "erp5",
url: gadget.state.storage_url_list[i],
default_view_reference: default_view_reference
});
}
//TODO fix. union doesn't bring all elements (limit issue?)
/*return gadget.state.jio_gadget.createJio(
{
"type": "union",
"storage_list": storage_definition_list
}
);*/
return gadget.state.jio_gadget.createJio({
type: "erp5",
url: gadget.state.storage_url_list[0],
default_view_reference: default_view_reference
});
})
.push(function () {
return gadget.getSetting('opml_import_limit', 300);
})
.push(function (select_limit) {
return getInstanceOPMLListFromMaster(gadget, select_limit);
})
.push(undefined, function () {
gadget.state.message
.innerHTML = notify_msg_template({
status: 'error',
message: 'Error: Failed to get Monitor Configuration from URL: ' +
gadget.state.storage_url_list[0]
});
has_failed = true;
return [];
})
.push(function (opml_list) {
var i, push_queue = new RSVP.Queue();
function pushOPML(opml_dict) {
push_queue
.push(function () {
return gadget.jio_put(opml_dict.url, opml_dict);
})
.push(undefined, function (error) {
throw error;
});
}
for (i = 0; i < opml_list.length; i += 1) {
pushOPML(opml_list[i]);
}
return push_queue;
})
.push(undefined, function () {
gadget.state.message
.innerHTML = notify_msg_template({
status: 'error',
message: 'An error occurred while saving Configuration from URL: ' +
gadget.state.storage_url_list[0]
});
has_failed = true;
})
.push(function () {
if (has_failed) {
return gadget.notifySubmitted({
message: "Failed to import Configurations",
status: "error"
});
}
return RSVP.all([
gadget.setSetting("latest_import_date", new Date().getTime()),
gadget.notifySubmitted({
message: "Configuration Saved!",
status: "success"
})
]);
})
.push(function () { .push(function () {
if (!has_failed) { if (!has_failed) {
return gadget.redirect({ return gadget.redirect({
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.35724.42699.60194</string> </value> <value> <string>1019.25789.13503.57429</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1719499012.07</float> <float>1726682048.38</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
"my_slapos_master_url": { "my_slapos_master_url": {
"description": "Slapos master URL", "description": "Slapos master URL",
"title": "Slapos master URL", "title": "Slapos master URL",
"default": options.slapos_master_url || "not-provided", "default": options.slapos_master_url || "",
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 1, "editable": 1,
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.7024.38172.32733</string> </value> <value> <string>1018.38079.38037.25019</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1717777119.89</float> <float>1723486191.89</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this; var gadget = this, notify = {}, redirect_options;
return this.updateHeader({ return this.updateHeader({
page_title: "Monitoring Synchronization" page_title: "Monitoring Synchronization"
}) })
...@@ -24,8 +24,10 @@ ...@@ -24,8 +24,10 @@
return sync_gadget.register({now: true}); return sync_gadget.register({now: true});
}); });
}) })
.push(function () { .push(function (result) {
var redirect_options = {"page": "ojsm_dispatch"}; redirect_options = {"page": "ojsm_dispatch", "notify_msg": result.msg, "notify_type": result.type};
notify.msg = result.msg;
notify.type = result.type;
if (options.reset === "1") { if (options.reset === "1") {
// reset redirections // reset redirections
return gadget.setSetting("sync_redirect_options", undefined) return gadget.setSetting("sync_redirect_options", undefined)
...@@ -38,7 +40,9 @@ ...@@ -38,7 +40,9 @@
} }
return gadget.getSetting('sync_redirect_options') return gadget.getSetting('sync_redirect_options')
.push(function (redirect_dict) { .push(function (redirect_dict) {
if (redirect_options) { if (redirect_dict) {
redirect_dict.msg = notify.msg;
redirect_dict.type = notify.type;
redirect_options = redirect_dict; redirect_options = redirect_dict;
return gadget.setSetting("sync_redirect_options", undefined); return gadget.setSetting("sync_redirect_options", undefined);
} }
......
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.6962.52907.14592</string> </value> <value> <string>1019.25789.13503.57429</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1717773952.0</float> <float>1726682152.0</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.1125.9926.47069</string> </value> <value> <string>1017.42953.62497.13994</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -266,7 +266,7 @@ ...@@ -266,7 +266,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1717423120.28</float> <float>1721847085.79</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<item> <item>
<key> <string>text_content</string> </key> <key> <string>text_content</string> </key>
<value> <string>CONFIGURATION MANIFEST\n <value> <string>CONFIGURATION MANIFEST\n
# generated on Mon Jun 3 13:55:24 2024\n # generated on Thu Sep 26 17:05:54 2024\n
CACHE:\n CACHE:\n
\n \n
hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNl\n hateoas_appcache/definition_view/cG9ydGFsX3R5cGVzL1NvZnR3YXJlIEluc3RhbmNl\n
......
...@@ -371,3 +371,8 @@ margin-top: 5px; ...@@ -371,3 +371,8 @@ margin-top: 5px;
margin: 30px 25px 10px 0; margin: 30px 25px 10px 0;
border-top: 1px solid #dedede; border-top: 1px solid #dedede;
} }
div[data-gadget-scope$="output_message"] p {
margin: 0;
}
\ No newline at end of file
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1015.24509.15236.10769</string> </value> <value> <string>1019.25707.33677.14080</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1711048261.14</float> <float>1727276878.74</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
div[data-gadget-scope$="output_message"] p {
margin: 0;
}
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/team</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_monitoring_jio_alldocs.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_officejs_monitoring_jio_alldocs_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Style</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Officejs Monitoring All Docs css</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1727283385.27</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1019.35832.27620.40430</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1727283398.43</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1727283335.24</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<meta name="viewport" content="width=device-width, user-scalable=no" /> <meta name="viewport" content="width=device-width, user-scalable=no" />
<title>Jio All Docs</title> <title>Jio All Docs</title>
<link rel="stylesheet" href="gadget_officejs_monitoring_jio_alldocs.css">
<!-- renderjs --> <!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script> <script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script> <script src="renderjs.js" type="text/javascript"></script>
......
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1015.43169.7471.64085</string> </value> <value> <string>1019.35831.119.51780</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1712168022.61</float> <float>1727283353.81</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
}) })
.push(function (result) { .push(function (result) {
jio_gadget = result; jio_gadget = result;
// TODO check url response before creating jio? sometimes public feeds url is broken
return jio_gadget.createJio({ return jio_gadget.createJio({
type: "webhttp", type: "webhttp",
// XXX fix of url // XXX fix of url
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
gadget.state.doc.source + ".history" gadget.state.doc.source + ".history"
) )
.push(undefined, function (error) { .push(undefined, function (error) {
//check if json error
if (error.name === "cancel") { if (error.name === "cancel") {
return undefined; return undefined;
} }
...@@ -133,7 +135,7 @@ ...@@ -133,7 +135,7 @@
description: "The promise output message", description: "The promise output message",
editable: 0, editable: 0,
hidden: 0, hidden: 0,
"default": status_history.data[i].message, "default": status_history.data[i].message.replaceAll("\n", "").replaceAll("\\n", ""),
key: "message", key: "message",
required: 0, required: 0,
title: "Promise Output", title: "Promise Output",
......
...@@ -250,7 +250,7 @@ ...@@ -250,7 +250,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.40876.2382.12151</string> </value> <value> <string>1019.35732.58009.30941</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1715958907.55</float> <float>1727278390.96</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<script src="jiodev.js" type="text/javascript"></script> <script src="jiodev.js" type="text/javascript"></script>
<script src="monitoring_jio_storage.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="monitoring_jio_web_storage.js" type="text/javascript"></script>
<script src="monitoring_jio_erp5monitor_storage.js" type="text/javascript"></script>
<script src="jio_ojs_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_appcachestorage.js"></script>
<script src="jio_configuration_storage.js"></script> <script src="jio_configuration_storage.js"></script>
......
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1014.2117.47678.65518</string> </value> <value> <string>1017.35894.43518.51251</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1706206800.08</float> <float>1723154487.39</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
(function (window, rJS, jIO) { (function (window, rJS, jIO) {
"use strict"; "use strict";
var LOCK_NAME = "sync_lock"; var LOCK_NAME = "sync_lock", LIMIT = 300;
function promiseLock(name, options, callback) { function promiseLock(name, options, callback) {
var callback_promise = null, var callback_promise = null,
...@@ -52,6 +52,63 @@ ...@@ -52,6 +52,63 @@
return new RSVP.Promise(resolver, canceller); return new RSVP.Promise(resolver, canceller);
} }
function getUpdatedMonitoringStorageSpec(gadget, checking_update_on_repair) {
var storage_definition_list = [], i, master_url_list,
update_settings, monitoring_jio;
return gadget.getSettingList(['master_url_list',
'master_url_list_updated',
'default_view_reference'])
.push(function (result_list) {
if (result_list[0]) {
master_url_list = result_list[0];
if (result_list[1]) {
update_settings = true;
} else {
if (checking_update_on_repair) {
return;
}
}
for (i = 0; i < master_url_list.length; i += 1) {
storage_definition_list.push({
type: "erp5monitor",
limit: LIMIT,
sub_storage: {
type: "erp5",
url: master_url_list[i],
default_view_reference: result_list[2]
}
});
}
}
monitoring_jio = {
type: "replicatedopml",
remote_storage_unreachable_status: "WARNING",
remote_opml_check_time_interval: 86400000,
request_timeout: 25000, // timeout is to 25 second
local_sub_storage: {
type: "query",
sub_storage: {
type: "uuid",
sub_storage: {
type: "indexeddb",
database: "monitoring_local.db"
}
}
},
remote_sub_storage: {
type: "union",
storage_list: storage_definition_list
}
};
if (update_settings) {
return gadget.setSetting('master_url_list_updated', false);
}
})
.push(function () {
return monitoring_jio;
});
}
rJS(window) rJS(window)
.ready(function (gadget) { .ready(function (gadget) {
...@@ -60,9 +117,10 @@ ...@@ -60,9 +117,10 @@
}) })
.declareAcquiredMethod("getSettingList", "getSettingList") .declareAcquiredMethod("getSettingList", "getSettingList")
.declareAcquiredMethod("setSettingList", "setSettingList")
.declareAcquiredMethod("setSetting", "setSetting") .declareAcquiredMethod("setSetting", "setSetting")
.declareMethod('updateConfiguration', function (appcache_storage, migration_version, current_version, jio_storage) { .declareMethod('updateConfiguration', function (appcache_storage, current_version, jio_storage) {
var gadget = this; var gadget = this;
if (!appcache_storage) { return; } if (!appcache_storage) { return; }
return RSVP.Queue() return RSVP.Queue()
...@@ -73,7 +131,9 @@ ...@@ -73,7 +131,9 @@
return jio_storage.repair(); return jio_storage.repair();
}) })
.push(function () { .push(function () {
return gadget.setSetting("migration_version", current_version); return gadget.setSettingList({'migration_version': current_version,
'master_url_list': undefined,
'master_url_list_updated': false});
}); });
}) })
...@@ -88,7 +148,7 @@ ...@@ -88,7 +148,7 @@
.declareMethod('createJio', function (options) { .declareMethod('createJio', function (options) {
var gadget = this, current_version, index, appcache_storage, var gadget = this, current_version, index, appcache_storage,
monitoring_jio, appcache_jio, migration_version, manifest, appcache_jio, migration_version, manifest, monitoring_jio,
origin_url = window.location.href; origin_url = window.location.href;
return gadget.getSettingList(['configuration_manifest', return gadget.getSettingList(['configuration_manifest',
'migration_version']) 'migration_version'])
...@@ -99,22 +159,16 @@ ...@@ -99,22 +159,16 @@
index = current_version.indexOf(window.location.host) + window.location.host.length; index = current_version.indexOf(window.location.host) + window.location.host.length;
current_version = current_version.substr(index); current_version = current_version.substr(index);
manifest = "gadget_officejs_monitoring.configuration"; manifest = "gadget_officejs_monitoring.configuration";
monitoring_jio = { if (migration_version !== current_version) {
type: "replicatedopml", return gadget.setSettingList({'master_url_list': undefined,
remote_storage_unreachable_status: "WARNING", 'master_url_list_updated': false});
remote_opml_check_time_interval: 86400000,
request_timeout: 25000, // timeout is to 25 second
local_sub_storage: {
type: "query",
sub_storage: {
type: "uuid",
sub_storage: {
type: "indexeddb",
database: "monitoring_local.db"
}
}
} }
}; })
.push(function () {
return getUpdatedMonitoringStorageSpec(gadget);
})
.push(function (spec) {
monitoring_jio = spec;
appcache_jio = { appcache_jio = {
type: "replicate", type: "replicate",
parallel_operation_attachment_amount: 10, parallel_operation_attachment_amount: 10,
...@@ -161,8 +215,6 @@ ...@@ -161,8 +215,6 @@
} }
}) })
.push(function (all_docs) { .push(function (all_docs) {
if (all_docs && all_docs.data.total_rows) {
//iterate all docs, jio_remove, and recreate
var remove_queue = new RSVP.Queue(), i; var remove_queue = new RSVP.Queue(), i;
function remove_doc(id) { function remove_doc(id) {
remove_queue remove_queue
...@@ -170,6 +222,8 @@ ...@@ -170,6 +222,8 @@
return gadget.props.jio_storage.remove(id); return gadget.props.jio_storage.remove(id);
}); });
} }
if (all_docs && all_docs.data.total_rows) {
//iterate all docs, jio_remove, and recreate
for (i = 0; i < all_docs.data.total_rows; i += 1) { for (i = 0; i < all_docs.data.total_rows; i += 1) {
remove_doc(all_docs.data.rows[i].id); remove_doc(all_docs.data.rows[i].id);
} }
...@@ -183,7 +237,7 @@ ...@@ -183,7 +237,7 @@
.push(function () { .push(function () {
if (migration_version !== current_version) { if (migration_version !== current_version) {
appcache_storage = jIO.createJIO(appcache_jio); appcache_storage = jIO.createJIO(appcache_jio);
return gadget.updateConfiguration(appcache_storage, migration_version, current_version, gadget.props.jio_storage); return gadget.updateConfiguration(appcache_storage, current_version, gadget.props.jio_storage);
} }
}) })
.push(function () { .push(function () {
...@@ -228,11 +282,17 @@ ...@@ -228,11 +282,17 @@
}); });
}) })
.declareMethod('repair', function () { .declareMethod('repair', function () {
var storage = this.props.jio_storage, var gadget = this, argument_list = arguments;
argument_list = arguments;
return promiseLock(LOCK_NAME, {}, function () { return promiseLock(LOCK_NAME, {}, function () {
return getUpdatedMonitoringStorageSpec(gadget, true)
.push(function (monitoring_jio) {
if (monitoring_jio) {
gadget.createStorage(undefined, monitoring_jio);
}
var storage = gadget.props.jio_storage;
return storage.repair.apply(storage, argument_list); return storage.repair.apply(storage, argument_list);
}); });
}); });
});
}(window, rJS, jIO)); }(window, rJS, jIO));
\ No newline at end of file
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.59484.28533.58572</string> </value> <value> <string>1019.25813.42370.5614</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1717176711.0</float> <float>1726682335.1</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -63,10 +63,14 @@ ...@@ -63,10 +63,14 @@
.push(function () { .push(function () {
return {status: 'OK'}; return {status: 'OK'};
}, function (error) { }, function (error) {
//console.error(error); console.log(error);
var code = error.status;
if (!code && error.target) {
code = error.target.status;
}
return { return {
status: 'ERROR', status: 'ERROR',
code: error.status || error.target.status, code: code,
url: base_url, url: base_url,
title: title title: title
}; };
...@@ -149,13 +153,14 @@ ...@@ -149,13 +153,14 @@
password: doc.password, password: doc.password,
active: (doc.active === "on") ? true : false, active: (doc.active === "on") ? true : false,
has_monitor: true, has_monitor: true,
state: doc.state || (doc.active === "on" ? "Started" : "Stopped") state: doc.state || (doc.active === "on" ? "Started" : "Stopped"),
slapos_master_url: doc.slapos_master_url,
manually_added: true
}, },
update_password_list = [], update_password_list = [],
allow_force = false, allow_force = false,
return_dict; return_dict;
if (doc.slapos_master_url && doc.slapos_master_url !== undefined && if (doc.slapos_master_url !== undefined) {
doc.slapos_master_url !== "") {
opml_dict.slapos_master_url = doc.slapos_master_url; opml_dict.slapos_master_url = doc.slapos_master_url;
} }
gadget.state.message.textContent = ""; gadget.state.message.textContent = "";
......
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.62588.18488.24661</string> </value> <value> <string>1019.37418.47754.9113</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1717178789.09</float> <float>1727388970.66</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -13,5 +13,10 @@ ...@@ -13,5 +13,10 @@
<script src="gadget_officejs_monitoring_submit.js"></script> <script src="gadget_officejs_monitoring_submit.js"></script>
</head> </head>
<body></body> <body>
<form>
<div data-gadget-url="gadget_officejs_monitoring_opml_edit.html"
data-gadget-scope="opml_gadget" data-gadget-sandbox="public"></div>
</form>
</body>
</html> </html>
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.14835.20658.8448</string> </value> <value> <string>1019.25707.33677.14080</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1714399889.98</float> <float>1727375273.45</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,19 +8,19 @@ ...@@ -8,19 +8,19 @@
// Acquired methods // Acquired methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareMethod("handle_submit", function (argument_list, options) { .declareMethod("handle_submit", function (argument_list, options, content) {
switch (options.options.portal_type) { switch (options.options.portal_type) {
case "Instance Tree": case "Instance Tree":
//TODO do the old parameter gadget save here and fix it //TODO do the old parameter gadget save here and fix it
return this.redirect({command: 'reload'}); return this.redirect({command: 'reload'});
case "Opml": case "Opml":
console.log("opml submit argument_list, options:", argument_list, options);
//TODO fix submit
var gadget = this, var gadget = this,
doc, doc,
opml_gadget; opml_gadget;
...@@ -30,18 +30,12 @@ ...@@ -30,18 +30,12 @@
}) })
.push(function (g) { .push(function (g) {
opml_gadget = g; opml_gadget = g;
return gadget.getDeclaredGadget('form_view'); doc = content;
}) if (doc.password !== options.doc.password) {
.push(function (form_gadget) {
return form_gadget.getContent();
})
.push(function (form_doc) {
doc = form_doc;
if (doc.password !== gadget.state.password) {
// password was modified, update on backend // password was modified, update on backend
doc.new_password = doc.password; doc.new_password = doc.password;
doc.confirm_new_password = doc.new_password; doc.confirm_new_password = doc.new_password;
doc.password = gadget.state.password; doc.password = options.doc.password;
doc.verify_password = 1; doc.verify_password = 1;
} else { } else {
doc.verify_password = (doc.verify_password === "on") ? 1 : 0; doc.verify_password = (doc.verify_password === "on") ? 1 : 0;
...@@ -54,10 +48,10 @@ ...@@ -54,10 +48,10 @@
.push(function () { .push(function () {
var verify_opml = doc.title === "" || doc.title === undefined || var verify_opml = doc.title === "" || doc.title === undefined ||
doc.verify_password === 1; doc.verify_password === 1;
if (gadget.state.active === false && doc.active === "on") { if (options.doc.active === false && doc.active === "on") {
verify_opml = true; verify_opml = true;
} }
doc.title = gadget.state.opml_title; doc.title = options.doc.title;
return opml_gadget.saveOPML(doc, verify_opml); return opml_gadget.saveOPML(doc, verify_opml);
}) })
.push(function (state) { .push(function (state) {
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.1223.8753.47035</string> </value> <value> <string>1019.37597.6963.8738</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1717428914.0</float> <float>1727389294.71</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, RSVP, console, XMLHttpRequest, document */ /*global window, rJS, RSVP, XMLHttpRequest, document */
/*jslint nomen: true, indent: 2, maxerr: 3*/ /*jslint nomen: true, indent: 2, maxerr: 3*/
(function (window, rJS, RSVP, console, XMLHttpRequest, document) { (function (window, rJS, RSVP, XMLHttpRequest, document) {
"use strict"; "use strict";
var gadget_klass = rJS(window); var gadget_klass = rJS(window);
...@@ -47,7 +47,9 @@ ...@@ -47,7 +47,9 @@
function syncAllStorage() { function syncAllStorage() {
var has_error = false, var has_error = false,
last_sync_time; last_sync_time,
classname = "success",
message = "Synchronisation finished.";
gadget.props.started = true; gadget.props.started = true;
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
...@@ -68,8 +70,7 @@ ...@@ -68,8 +70,7 @@
}) })
.push(undefined, function (error) { .push(undefined, function (error) {
// should include error message in error // should include error message in error
has_error = true; has_error = error;
console.error(error);
// return false so it will trigger the next run // return false so it will trigger the next run
return false; return false;
}) })
...@@ -77,34 +78,17 @@ ...@@ -77,34 +78,17 @@
last_sync_time = new Date().getTime(); last_sync_time = new Date().getTime();
return RSVP.all([ return RSVP.all([
gadget.setSetting('latest_sync_time', last_sync_time), gadget.setSetting('latest_sync_time', last_sync_time),
gadget.notifySubmitting() gadget.notifySubmitted()
]); ]);
}) })
.push(function () { .push(function () {
var classname = "success",
message = "Synchronisation finished.";
if (has_error) { if (has_error) {
classname = "error"; classname = "error";
message = "Synchronisation finished with error(s)."; message = "Synchronisation finished with error(s).";
message += " \nYou can retry with manual sync."; message += " \n" + has_error;
} }
return gadget.notifySubmitted({
message: message,
status: classname
});
})
.push(function () {
gadget.props.started = false; gadget.props.started = false;
/*return $.notify( return {msg: message, type: classname};
"Last Sync: " + formatDate(new Date(last_sync_time)),
{
position: "bottom right",
autoHide: true,
className: "success",
autoHideDelay: 30000
}
);*/
}); });
} }
...@@ -223,4 +207,4 @@ ...@@ -223,4 +207,4 @@
}); });
}); });
}(window, rJS, RSVP, console, XMLHttpRequest, document)); }(window, rJS, RSVP, XMLHttpRequest, document));
\ No newline at end of file \ No newline at end of file
...@@ -252,7 +252,7 @@ ...@@ -252,7 +252,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1014.7721.36434.2560</string> </value> <value> <string>1018.39204.41098.43246</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -272,7 +272,7 @@ ...@@ -272,7 +272,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1706281549.43</float> <float>1723554584.83</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*
* Copyright 2016, Nexedi SA
* Released under the LGPL license.
* http://www.gnu.org/licenses/lgpl.html
*/
/*jslint nomen: true*/
/*global jIO, RSVP */
(function (jIO, RSVP) {
"use strict";
var LIMIT = 100; //default
/**
* Monitor erp5 layer to wrap erp5 storages for monitor app
*
* @class ERP5Monitor
* @constructor
*/
function ERP5Monitor(spec) {
if (!spec.sub_storage || spec.sub_storage.type !== 'erp5') {
throw new TypeError("ERP5Monitor subtorage must be erp5 type");
}
if (spec.limit) {
LIMIT = spec.limit;
}
this._storage_definition = spec.sub_storage;
this._sub_storage = jIO.createJIO(spec.sub_storage);
}
ERP5Monitor.prototype.get = function (id) {
return this._sub_storage.get.apply(this._sub_storage, arguments);
};
ERP5Monitor.prototype.post = function () {
return this._sub_storage.post.apply(this._sub_storage, arguments);
};
ERP5Monitor.prototype.put = function () {
return this._sub_storage.put.apply(this._sub_storage, arguments);
};
ERP5Monitor.prototype.remove = function () {
return this._sub_storage.remove.apply(this._sub_storage, arguments);
};
ERP5Monitor.prototype.hasCapacity = function (capacity) {
return (capacity === "list") || (capacity === "limit") || (capacity === "include") || (capacity === "query") || (capacity === "select");
};
ERP5Monitor.prototype.buildQuery = function () {
var sub_storage = this._sub_storage, args = arguments, master_url = this._storage_definition.url, i;
if (!arguments[0].limit) {
arguments[0].limit = [0, LIMIT];
}
return sub_storage.allDocs.apply(sub_storage, args)
.push(function (result) {
for (i = 0; i < result.data.rows.length; i += 1) {
result.data.rows[i].master_url = master_url;
}
return result.data.rows;
});
};
jIO.addStorage('erp5monitor', ERP5Monitor);
}(jIO, RSVP));
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/public</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>monitoring_jio_erp5monitor_storage.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring_jio_erp5monitor_storage_js</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 Jio Erp5 Monitor Storage</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1723124663.84</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1019.25867.59368.11707</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1726686313.79</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="DateTime" module="DateTime.DateTime"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<tuple>
<float>1723124587.09</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
/* /*
* Copyright 2016, Nexedi SA * Copyright 2016, Nexedi SA
* Released under the LGPL license. * Released under the LGPL license.
* http://www.gnu.org/licenses/lgpl.html * http://www.gnu.org/licenses/lgpl.html
*/ */
/*jslint nomen: true */ /*jslint indent: 2 nomen: true */
/*global jIO, RSVP, Rusha, console, Blob */ /*global jIO, RSVP, rJS, Rusha, Blob, console, btoa, URLSearchParams */
(function (jIO, RSVP, Rusha, Blob, console) { (function (jIO, RSVP, rJS, Rusha, Blob, console, btoa, URLSearchParams) {
"use strict"; "use strict";
/** /**
...@@ -98,6 +98,11 @@ ...@@ -98,6 +98,11 @@
"is not defined"); "is not defined");
} }
this._local_sub_storage = jIO.createJIO(spec.local_sub_storage); this._local_sub_storage = jIO.createJIO(spec.local_sub_storage);
this._local_sub_storage_spec = spec.local_sub_storage;
if (spec.remote_sub_storage !== undefined) {
this._remote_sub_storage_spec = spec.remote_sub_storage;
this._remote_sub_storage = jIO.createJIO(spec.remote_sub_storage);
}
this._remote_storage_unreachable_status = this._remote_storage_unreachable_status =
spec.remote_storage_unreachable_status; spec.remote_storage_unreachable_status;
this._remote_storage_dict = {}; this._remote_storage_dict = {};
...@@ -139,6 +144,10 @@ ...@@ -139,6 +144,10 @@
}; };
ReplicatedOPMLStorage.prototype.hasCapacity = function (capacity) { ReplicatedOPMLStorage.prototype.hasCapacity = function (capacity) {
var this_storage_not_capacity_list = ['post', 'getAttachment', 'putAttachment'];
if (this_storage_not_capacity_list.indexOf(capacity) !== -1) {
return false;
}
if (capacity === 'include') { if (capacity === 'include') {
return true; return true;
} }
...@@ -146,12 +155,14 @@ ...@@ -146,12 +155,14 @@
arguments); arguments);
}; };
ReplicatedOPMLStorage.prototype.getAttachment = function () { ReplicatedOPMLStorage.prototype.allAttachments = function () {
return this._local_sub_storage.getAttachment.apply(this._local_sub_storage, return this._local_sub_storage.allAttachments.apply(this._local_sub_storage,
arguments); arguments);
}; };
ReplicatedOPMLStorage.prototype.remove = function (id) { ReplicatedOPMLStorage.prototype.remove = function (id) {
//the removal of an opml involves to remove the full opml tree asociated
//note: if the opml belongs to a slapos master, next sync will restore it
var storage = this._local_sub_storage; var storage = this._local_sub_storage;
return storage.get(id) return storage.get(id)
.push(function (doc) { .push(function (doc) {
...@@ -249,11 +260,6 @@ ...@@ -249,11 +260,6 @@
}); });
}; };
ReplicatedOPMLStorage.prototype.allAttachments = function () {
return this._local_sub_storage.allAttachments.apply(this._local_sub_storage,
arguments);
};
function getStorageUrl(storage_spec) { function getStorageUrl(storage_spec) {
var spec = storage_spec; var spec = storage_spec;
while (spec !== undefined) { while (spec !== undefined) {
...@@ -406,6 +412,15 @@ ...@@ -406,6 +412,15 @@
}); });
} }
function fixDateTimezone(date_string) {
// set default timezone offset to UTC
// XXX should be removed later
if (ZONE_LIST.indexOf(date_string.slice(-5)) === -1) {
return date_string + "+0000";
}
return date_string;
}
function updateInstanceTreeState(hosting, element) { function updateInstanceTreeState(hosting, element) {
var status = element.status.toUpperCase(); var status = element.status.toUpperCase();
...@@ -418,21 +433,13 @@ ...@@ -418,21 +433,13 @@
hosting.status = status; hosting.status = status;
} else if (status === "WARNING") { } else if (status === "WARNING") {
hosting.status = status; hosting.status = status;
} if (status === "OK" && hosting.status !== status) {
hosting.status = status;
} }
if (status === "OK" && hosting.status !== status) {
hosting.status = status;
} }
function fixDateTimezone(date_string) {
// set default timezone offset to UTC
// XXX should be removed later
if (ZONE_LIST.indexOf(date_string.slice(-5)) === -1) {
return date_string + "+0000";
}
return date_string;
} }
function getOpmlTree(context, opml_url, opml_spec, basic_login, opml_title) { function getOpmlTree(context, opml_url, opml_spec, basic_login, opml_title, slapos_master_url) {
var opml_storage, var opml_storage,
opml_document_list = [], opml_document_list = [],
delete_key_list = [], delete_key_list = [],
...@@ -453,7 +460,8 @@ ...@@ -453,7 +460,8 @@
opml_url: opml_url, opml_url: opml_url,
status: "WARNING", status: "WARNING",
instance_amount: 0, instance_amount: 0,
status_date: (new Date()).toUTCString() + "+0000" status_date: (new Date()).toUTCString() + "+0000",
slapos_master_url: slapos_master_url
}; };
return getDocumentAsAttachment(context, opml_url, OPML_ATTACHMENT_NAME) return getDocumentAsAttachment(context, opml_url, OPML_ATTACHMENT_NAME)
.push(function (opml_doc) { .push(function (opml_doc) {
...@@ -578,7 +586,8 @@ ...@@ -578,7 +586,8 @@
parent_id: id, parent_id: id,
parent_url: opml_url, parent_url: opml_url,
reference: id_hash, reference: id_hash,
active: true active: true,
slapos_master_url: slapos_master_url
}); });
Object.assign(item.doc, header_dict); Object.assign(item.doc, header_dict);
if (!skip_add) { if (!skip_add) {
...@@ -659,7 +668,8 @@ ...@@ -659,7 +668,8 @@
item_result.type, item_result.type,
status: status, status: status,
reference: element.reference || id_hash, reference: element.reference || id_hash,
active: true active: true,
slapos_master_url: slapos_master_url
}); });
opml_document_list.push({ opml_document_list.push({
id: id_hash, id: id_hash,
...@@ -679,14 +689,18 @@ ...@@ -679,14 +689,18 @@
if (result_list[i].type === PROMISE_TYPE) { if (result_list[i].type === PROMISE_TYPE) {
// the first element of rss is the header // the first element of rss is the header
extra_dict = { extra_dict = {
lastBuildDate: fixDateTimezone(result_list[i].result.data. lastBuildDate: fixDateTimezone(result_list[i].result.data
rows[0].doc.lastBuildDate), .rows[0].doc.lastBuildDate),
channel: result_list[i].result.data.rows[0].doc.description, channel: result_list[i].result.data.rows[0].doc.description,
channel_item: result_list[i].result.data.rows[0].doc.title channel_item: result_list[i].result.data.rows[0].doc.title,
description: ""
}; };
start = 1; start = 1;
} }
for (j = start; j < result_list[i].result.data.total_rows; j += 1) { for (j = start; j < result_list[i].result.data.total_rows; j += 1) {
if (result_list[i].type === PROMISE_TYPE) {
extra_dict.output_message = result_list[i].result.data.rows[j].doc.description;
}
applyItemToTree( applyItemToTree(
result_list[i].result.data.rows[j], result_list[i].result.data.rows[j],
result_list[i], result_list[i],
...@@ -706,8 +720,7 @@ ...@@ -706,8 +720,7 @@
name: result_list[i].url, name: result_list[i].url,
doc: result_list[i].current_signature doc: result_list[i].current_signature
}); });
} } else if (context._remote_storage_unreachable_status !== undefined) {
else if (context._remote_storage_unreachable_status !== undefined) {
if (result_list[i].type === "webhttp") { if (result_list[i].type === "webhttp") {
// In case it was impossible to get software Instance // In case it was impossible to get software Instance
// Add an empty Software Instance with unreachable status // Add an empty Software Instance with unreachable status
...@@ -811,7 +824,7 @@ ...@@ -811,7 +824,7 @@
function syncOpmlStorage(context) { function syncOpmlStorage(context) {
return context._local_sub_storage.allDocs({ return context._local_sub_storage.allDocs({
query: '(portal_type:"' + OPML_PORTAL_TYPE + '") AND (active:true) AND (url:"https://%")', query: '(portal_type:"' + OPML_PORTAL_TYPE + '") AND (active:true) AND (url:"https://%")',
select_list: ["title", "url", "basic_login"] select_list: ["title", "url", "basic_login", "slapos_master_url"]
}) })
.push(function (storage_result) { .push(function (storage_result) {
var i, var i,
...@@ -834,7 +847,8 @@ ...@@ -834,7 +847,8 @@
} }
}, },
storage_spec.basic_login, storage_spec.basic_login,
storage_spec.title storage_spec.title,
storage_spec.slapos_master_url
); );
}) })
.push(function (result_list) { .push(function (result_list) {
...@@ -855,9 +869,212 @@ ...@@ -855,9 +869,212 @@
ReplicatedOPMLStorage.prototype.repair = function () { ReplicatedOPMLStorage.prototype.repair = function () {
var context = this, var context = this,
has_failed = false,
error_msg = "",
argument_list = arguments; argument_list = arguments;
function getParameterDictFromUrl(uri_param) {
if (uri_param.has('url') && uri_param.has('password') &&
uri_param.has('username') && uri_param.get('url').startsWith('http')) {
return {
opml_url: uri_param.get('url').trim(),
username: uri_param.get('username').trim(),
password: uri_param.get('password').trim()
};
}
}
function getParameterFromconnectionDict(connection_dict) {
if (connection_dict["monitor-url"] &&
connection_dict["monitor-url"].startsWith('http') &&
connection_dict["monitor-user"] &&
connection_dict["monitor-password"]) {
return {
opml_url: connection_dict["monitor-url"].trim(),
username: connection_dict["monitor-user"].trim(),
password: connection_dict["monitor-password"].trim()
};
}
}
function readMonitoringParameter(parmeter_xml) {
var xml_doc = rJS.parseDocumentStringOrFail(parmeter_xml, "text/xml"),
parameter,
uri_param,
json_parameter,
parameter_dict,
monitor_dict = {};
json_parameter = xml_doc.getElementById("_");
if (json_parameter !== undefined && json_parameter !== null) {
parameter_dict = JSON.parse(json_parameter.textContent);
if (parameter_dict.hasOwnProperty("monitor-setup-url")) {
return getParameterDictFromUrl(
new URLSearchParams(parameter_dict["monitor-setup-url"])
);
}
return getParameterFromconnectionDict(parameter_dict);
}
parameter = xml_doc.getElementById("monitor-setup-url");
if (parameter !== undefined && parameter !== null) {
// monitor-setup-url exists
uri_param = new URLSearchParams(parameter.textContent);
return getParameterDictFromUrl(uri_param);
}
parameter = xml_doc.getElementById("monitor-url");
if (parameter !== undefined && parameter !== null) {
monitor_dict.url = parameter.textContent.trim();
parameter = xml_doc.getElementById("monitor-user");
if (parameter === undefined && parameter !== null) {
return;
}
monitor_dict.username = parameter.textContent.trim();
parameter = xml_doc.getElementById("monitor-password");
if (parameter === undefined && parameter !== null) {
return;
}
monitor_dict.password = parameter.textContent.trim();
return monitor_dict;
}
}
function getInstanceOPMLList(storage) {
if (!storage) {
return [];
}
var instance_tree_list = [],
opml_list = [],
uid_dict = {};
return storage.allDocs({
query: '(portal_type:"Instance Tree") AND (validation_state:"validated")',
select_list: ['title', 'default_successor_uid', 'uid', 'slap_state', 'id']
})
.push(function (result) {
var i, slapos_id, slapos_master_url = "",
uid_search_list = [];
for (i = 0; i < result.data.total_rows; i += 1) {
if (result.data.rows[i].value.slap_state !== "destroy_requested") {
//TODO could slapos_id be used to desambiguate identic title
//instances trees between different storages?
slapos_id = result.data.rows[i].value.title;
if (result.data.rows[i].master_url) {
slapos_master_url = result.data.rows[i].master_url;
}
instance_tree_list.push({
title: result.data.rows[i].value.title,
relative_url: result.data.rows[i].id,
slapos_id: slapos_id,
slapos_master_url: slapos_master_url,
active: (result.data.rows[i].value.slap_state ===
"start_requested") ? true : false,
state: (result.data.rows[i].value.slap_state ===
"start_requested") ? "Started" : "Stopped"
});
uid_search_list.push(result.data.rows[i].value.uid);
if (result.data.rows[i].value.default_successor_uid) {
uid_dict[result.data.rows[i].value.default_successor_uid] = i;
}
}
}
return storage.allDocs({
query: '(portal_type:"Software Instance") AND ' +
'(successor_related_uid:("' + uid_search_list.join('","') + '"))',
select_list: ['uid', 'successor_related_uid', 'connection_xml']
});
})
.push(function (result) {
var i,
tmp_parameter,
tmp_uid,
slapos_master_url = "";
for (i = 0; i < result.data.total_rows; i += 1) {
tmp_uid = result.data.rows[i].value.uid;
if (uid_dict.hasOwnProperty(tmp_uid)) {
try {
tmp_parameter = readMonitoringParameter(result.data.rows[i].value.connection_xml);
} catch (error) {
if (error.name == 'DOMParserError') {
tmp_parameter = undefined;
} else {
throw error;
}
}
if (tmp_parameter === undefined) {
tmp_parameter = {username: "", password: "", opml_url: undefined};
}
if (instance_tree_list[uid_dict[tmp_uid]]) {
if (result.data.rows[i].master_url) {
slapos_master_url = result.data.rows[i].master_url;
}
opml_list.push({
portal_type: OPML_PORTAL_TYPE,
title: instance_tree_list[uid_dict[tmp_uid]]
.title,
relative_url: instance_tree_list[uid_dict[tmp_uid]]
.relative_url,
url: tmp_parameter.opml_url || String(tmp_uid) + " NO MONITOR",
has_monitor: tmp_parameter.opml_url !== undefined,
username: tmp_parameter.username,
password: tmp_parameter.password,
basic_login: btoa(tmp_parameter.username + ':' +
tmp_parameter.password),
active: tmp_parameter.opml_url !== undefined &&
instance_tree_list[uid_dict[tmp_uid]].active,
state: instance_tree_list[uid_dict[tmp_uid]].state,
slapos_master_url: slapos_master_url
});
}
}
}
return opml_list;
});
}
function cleanOpmlStorage(context) {
//TODO use slapos_master_url in the query instead of iterate later
return context._local_sub_storage.allDocs({
query: '(portal_type:"' + OPML_PORTAL_TYPE + '")',
select_list: ["title", "url", "basic_login", "slapos_master_url", "manually_added"]
})
.push(function (result) {
function removeAllOPML(remove_opml_list, jio) {
var remove_queue = new RSVP.Queue(), i;
function remove_opml(id) {
remove_queue
.push(function () {
return jio.remove(id);
});
}
for (i = 0; i < remove_opml_list.length; i += 1) {
remove_opml(remove_opml_list[i].id);
}
return remove_queue;
}
var slapos_master_url_list = [], spec_list = context._remote_sub_storage_spec.storage_list,
i, remove_opml_list = [], opml_list = result.data.rows;
if (spec_list) {
for (i = 0; i < spec_list.length; i += 1) {
if (spec_list[i].sub_storage && spec_list[i].sub_storage.url) {
slapos_master_url_list.push(spec_list[i].sub_storage.url);
}
}
}
if (slapos_master_url_list.length > 0) {
for (i = 0; i < opml_list.length; i += 1) {
if (!opml_list[i].value.manually_added) {
if (!slapos_master_url_list.includes(opml_list[i].value.slapos_master_url)) {
remove_opml_list.push(opml_list[i]);
}
}
}
}
return removeAllOPML(remove_opml_list, context);
});
}
return new RSVP.Queue() return new RSVP.Queue()
//repair sub storage layers (local and remote)
.push(function () { .push(function () {
return context._local_sub_storage.repair.apply( return context._local_sub_storage.repair.apply(
context._local_sub_storage, context._local_sub_storage,
...@@ -865,10 +1082,67 @@ ...@@ -865,10 +1082,67 @@
); );
}) })
.push(function () { .push(function () {
if (context._remote_sub_storage) {
return context._remote_sub_storage.repair.apply(
context._remote_sub_storage,
argument_list
);
}
})
.push(function () {
//delete all opmls trees of no longer present slapos masters
//(in case master url list was updated)
return cleanOpmlStorage(context);
})
.push(function () {
//get opml list from remote slapos master(s)
return getInstanceOPMLList(context._remote_sub_storage);
})
.push(undefined, function (error) {
has_failed = true;
if (error.target) {
if (error.target.status === 401) {
error_msg = ": unauthorized access to slapos master";
}
if (error.target.status === 404) {
error_msg = ": slapos master url not found";
}
if (error.target.status - 500 > 0) {
error_msg = ": server error on slapos master side - " + error.target.status;
}
if (error.target.responseURL) {
error_msg += ". URL: " + error.target.responseURL;
}
} else {
console.log(error);
}
if (!error_msg) {
throw error;
}
throw new Error("Failed to import remote configurations" + error_msg);
})
.push(function (opml_list) {
//store opmls in local sub storage
var i, push_queue = new RSVP.Queue();
function pushOPML(opml_dict) {
push_queue
.push(function () {
return context._local_sub_storage.put(opml_dict.url, opml_dict);
});
}
for (i = 0; i < opml_list.length; i += 1) {
pushOPML(opml_list[i]);
}
return push_queue;
})
.push(function () {
if (!has_failed) {
//sync storage using updated opml list
return syncOpmlStorage(context); return syncOpmlStorage(context);
}
}); });
}; };
jIO.addStorage('replicatedopml', ReplicatedOPMLStorage); jIO.addStorage('replicatedopml', ReplicatedOPMLStorage);
}(jIO, RSVP, Rusha, Blob, console)); }(jIO, RSVP, rJS, Rusha, Blob, console, btoa, URLSearchParams));
...@@ -249,7 +249,7 @@ ...@@ -249,7 +249,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1017.22812.19597.42137</string> </value> <value> <string>1019.38541.57829.32512</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1718724260.35</float> <float>1727445979.03</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, rJS, RSVP, Handlebars */ /*global window, rJS, RSVP, Handlebars, atob */
/*jslint indent: 2, maxerr: 3 */ /*jslint indent: 2, maxerr: 3 */
(function (window, rJS, RSVP, Handlebars) { (function (window, rJS, RSVP, Handlebars, atob) {
"use strict"; "use strict";
var gadget_klass = rJS(window), var gadget_klass = rJS(window),
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
return gadget.changeState(state_dict); return gadget.changeState(state_dict);
}); });
case "software_instance": case "software_instance":
if (software_instance.reference) { if (software_instance && software_instance.reference) {
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
return gadget.getUrlFor({command: 'push_history', options: { return gadget.getUrlFor({command: 'push_history', options: {
...@@ -94,21 +94,54 @@ ...@@ -94,21 +94,54 @@
return gadget.changeState(state_dict); return gadget.changeState(state_dict);
} }
case "computer": case "computer":
if (software_instance) {
state_dict.content = software_instance.aggregate_reference; state_dict.content = software_instance.aggregate_reference;
}
return gadget.changeState(state_dict); return gadget.changeState(state_dict);
case "partition": case "partition":
if (software_instance) {
state_dict.content = software_instance.partition_id; state_dict.content = software_instance.partition_id;
}
return gadget.changeState(state_dict); return gadget.changeState(state_dict);
case "partition_ipv6": case "partition_ipv6":
if (software_instance) {
state_dict.content = software_instance.ipv6; state_dict.content = software_instance.ipv6;
}
return gadget.changeState(state_dict); return gadget.changeState(state_dict);
case "software_release": case "software_release":
if (software_instance) {
state_dict.content = link_template({ state_dict.content = link_template({
url: software_instance.software_release, url: software_instance.software_release,
title: "Access Software release", title: "Access Software release",
target: "_blank" target: "_blank"
}); });
}
return gadget.changeState(state_dict);
case "public_url":
state_dict.content = link_template({
url: options.link.replace('private', 'public'),
title: "Access Public files",
target: "_blank"
});
return gadget.changeState(state_dict); return gadget.changeState(state_dict);
case "private_url":
return gadget.jio_get(options.parent_id)
.push(function (outline_doc) {
return RSVP.all([outline_doc.parent_id,
gadget.jio_get(outline_doc.parent_url)]);
})
.push(function (doc_list) {
if (software_instance && software_instance._links) {
var pass_url = "https://" + atob(doc_list[1].basic_login) +
"@" + software_instance._links.private_url.href.split("//")[1];
state_dict.content = link_template({
url: pass_url,
title: "Access Private files",
target: "_blank"
});
}
return gadget.changeState(state_dict);
});
default: default:
state_dict.content = ""; state_dict.content = "";
return gadget.changeState(state_dict); return gadget.changeState(state_dict);
...@@ -120,4 +153,4 @@ ...@@ -120,4 +153,4 @@
this.element.innerHTML = modification_dict.content; this.element.innerHTML = modification_dict.content;
}); });
}(window, rJS, RSVP, Handlebars)); }(window, rJS, RSVP, Handlebars, atob));
\ No newline at end of file \ No newline at end of file
...@@ -244,7 +244,7 @@ ...@@ -244,7 +244,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.27890.23432.33160</string> </value> <value> <string>1019.38589.15925.60637</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1715096834.79</float> <float>1727448911.56</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_defined_in_class</string> </key> <key> <string>_defined_in_class</string> </key>
<value> <bool>True</bool> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>_hookname</string> </key> <key> <string>_hookname</string> </key>
...@@ -544,7 +544,7 @@ ...@@ -544,7 +544,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1015.32811.46439.54528</string> </value> <value> <string>1019.25707.33677.14080</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -564,7 +564,7 @@ ...@@ -564,7 +564,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1716562039.61</float> <float>1727370343.76</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_defined_in_class</string> </key> <key> <string>_defined_in_class</string> </key>
<value> <bool>True</bool> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>_hookname</string> </key> <key> <string>_hookname</string> </key>
...@@ -579,7 +579,7 @@ WebSection_getMonitorPrecacheManifestList</string> </value> ...@@ -579,7 +579,7 @@ WebSection_getMonitorPrecacheManifestList</string> </value>
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1015.45944.11619.35208</string> </value> <value> <string>1019.25707.33677.14080</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -599,7 +599,7 @@ WebSection_getMonitorPrecacheManifestList</string> </value> ...@@ -599,7 +599,7 @@ WebSection_getMonitorPrecacheManifestList</string> </value>
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1716562039.61</float> <float>1727370348.54</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_defined_in_class</string> </key> <key> <string>_defined_in_class</string> </key>
<value> <bool>True</bool> </value> <value> <int>1</int> </value>
</item> </item>
<item> <item>
<key> <string>_hookname</string> </key> <key> <string>_hookname</string> </key>
...@@ -339,7 +339,7 @@ ...@@ -339,7 +339,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1014.3364.27014.64238</string> </value> <value> <string>1019.25707.33677.14080</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1716562039.61</float> <float>1727370343.75</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<key> <string>center</string> </key> <key> <string>center</string> </key>
<value> <value>
<list> <list>
<string>my_description</string> <string>my_output_message</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -109,8 +109,8 @@ ...@@ -109,8 +109,8 @@
<string>my_category</string> <string>my_category</string>
<string>my_pubDate</string> <string>my_pubDate</string>
<string>my_lastBuildDate</string> <string>my_lastBuildDate</string>
<string>my_public_url</string> <string>my_parent_public_url</string>
<string>my_private_url</string> <string>my_parent_private_url</string>
</list> </list>
</value> </value>
</item> </item>
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="TextAreaField" module="Products.Formulator.StandardFields"/> <global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_description</string> </value> <value> <string>my_output_message</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
...@@ -19,20 +19,8 @@ ...@@ -19,20 +19,8 @@
<value> <string>The input failed the external validator.</string> </value> <value> <string>The input failed the external validator.</string> </value>
</item> </item>
<item> <item>
<key> <string>line_too_long</string> </key> <key> <string>no_validator</string> </key>
<value> <string>A line was too long.</string> </value> <value> <string>Does not support this operation.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>You entered too many characters.</string> </value>
</item>
<item>
<key> <string>too_many_lines</string> </key>
<value> <string>You entered too many lines.</string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
...@@ -49,6 +37,10 @@ ...@@ -49,6 +37,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -74,7 +66,7 @@ ...@@ -74,7 +66,7 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>gadget_url</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -82,19 +74,11 @@ ...@@ -82,19 +74,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_lines</string> </key> <key> <string>renderjs_extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -102,15 +86,11 @@ ...@@ -102,15 +86,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>unicode</string> </key> <key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>width</string> </key> <key> <string>validator_form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -128,6 +108,10 @@ ...@@ -128,6 +108,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -153,7 +137,7 @@ ...@@ -153,7 +137,7 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>gadget_url</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -161,19 +145,11 @@ ...@@ -161,19 +145,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_lines</string> </key> <key> <string>renderjs_extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
...@@ -181,15 +157,11 @@ ...@@ -181,15 +157,11 @@
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>unicode</string> </key> <key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>width</string> </key> <key> <string>validator_form_id</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -207,6 +179,10 @@ ...@@ -207,6 +179,10 @@
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -229,47 +205,46 @@ ...@@ -229,47 +205,46 @@
</item> </item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string encoding="cdata"><![CDATA[
if (context_document && context_document.output_message) { result.default = "<p style=\'margin: 0;\'>" + context_document.output_message + "</p>"; result.default = result.default.replaceAll("\\n", "</p><p style=\'margin: 0;\'>"); result.default = result.default.replaceAll("\\\\n", "</p><p style=\'margin: 0;\'>"); }
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>height</string> </key> <key> <string>gadget_url</string> </key>
<value> <int>5</int> </value> <value> <string>gadget_editor.html</string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>max_length</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>max_lines</string> </key> <key> <string>renderjs_extra</string> </key>
<value> <string></string> </value> <value>
</item> <list>
<item> <tuple>
<key> <string>required</string> </key> <string>{"editor": "fck_editor", "maximize": true}</string>
<value> <int>0</int> </value> <string>{"editor": "fck_editor", "maximize": true}</string>
</tuple>
</list>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Output message</string> </value> <value> <string>Output message</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode</string> </key> <key> <string>validator_field_id</string> </key>
<value> <int>0</int> </value> <value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>width</string> </key> <key> <string>validator_form_id</string> </key>
<value> <int>40</int> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</value> </value>
......
...@@ -2,28 +2,45 @@ ...@@ -2,28 +2,45 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="HyperLinkField" module="Products.ERP5Form.HyperLinkField"/> <global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_private_url</string> </value> <value> <string>my_parent_private_url</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
<value> <value>
<dictionary/> <dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>no_validator</string> </key>
<value> <string>Does not support this operation.</string> </value>
</item>
</dictionary>
</value> </value>
</item> </item>
<item> <item>
<key> <string>overrides</string> </key> <key> <string>overrides</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -40,22 +57,42 @@ ...@@ -40,22 +57,42 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>href</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -63,10 +100,18 @@ ...@@ -63,10 +100,18 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -83,22 +128,42 @@ ...@@ -83,22 +128,42 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>href</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -106,13 +171,21 @@ ...@@ -106,13 +171,21 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string>Access Private files</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -126,26 +199,49 @@ ...@@ -126,26 +199,49 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string></string> </value>
</item>
if (context_document && context_document.link) { result.href = context_document.link; } <item>
<key> <string>gadget_url</string> </key>
]]></string> </value> <value> <string>gadget_erp5_field_parent.html</string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>href</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string>*</string> </value> <value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value>
<list>
<tuple>
<string>{"field": "private_url"}</string>
<string>{"field": "private_url"}</string>
</tuple>
</list>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Private Logs Url</string> </value> <value> <string>Private Logs Url</string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
...@@ -2,28 +2,45 @@ ...@@ -2,28 +2,45 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="HyperLinkField" module="Products.ERP5Form.HyperLinkField"/> <global name="GadgetField" module="Products.ERP5Form.GadgetField"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_public_url</string> </value> <value> <string>my_parent_public_url</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
<value> <value>
<dictionary/> <dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>no_validator</string> </key>
<value> <string>Does not support this operation.</string> </value>
</item>
</dictionary>
</value> </value>
</item> </item>
<item> <item>
<key> <string>overrides</string> </key> <key> <string>overrides</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -40,22 +57,42 @@ ...@@ -40,22 +57,42 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>href</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -63,10 +100,18 @@ ...@@ -63,10 +100,18 @@
<key> <string>tales</string> </key> <key> <string>tales</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
...@@ -83,22 +128,42 @@ ...@@ -83,22 +128,42 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>gadget_url</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>href</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
...@@ -106,13 +171,21 @@ ...@@ -106,13 +171,21 @@
<key> <string>values</string> </key> <key> <string>values</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>css_class</string> </key> <key> <string>css_class</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item>
<key> <string>data_url</string> </key>
<value> <int>0</int> </value>
</item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string>Access Public files</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -126,26 +199,49 @@ ...@@ -126,26 +199,49 @@
<key> <string>enabled</string> </key> <key> <string>enabled</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item> <item>
<key> <string>extra</string> </key> <key> <string>extra</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string></string> </value>
</item>
if (context_document && context_document.link) { result.href = context_document.link.replace(\'private\', \'public\'); } <item>
<key> <string>gadget_url</string> </key>
]]></string> </value> <value> <string>gadget_erp5_field_parent.html</string> </value>
</item> </item>
<item> <item>
<key> <string>hidden</string> </key> <key> <string>hidden</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item> <item>
<key> <string>href</string> </key> <key> <string>js_sandbox</string> </key>
<value> <string>*</string> </value> <value> <string></string> </value>
</item>
<item>
<key> <string>renderjs_extra</string> </key>
<value>
<list>
<tuple>
<string>{"field": "public_url"}</string>
<string>{"field": "public_url"}</string>
</tuple>
</list>
</value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Public Logs Url</string> </value> <value> <string>Public Logs Url</string> </value>
</item> </item>
<item>
<key> <string>validator_field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>validator_form_id</string> </key>
<value> <string></string> </value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
...@@ -16,6 +16,7 @@ url_list = [ ...@@ -16,6 +16,7 @@ url_list = [
"erp5_launcher_nojqm.js", "erp5_launcher_nojqm.js",
"monitoring_jio_storage.js", "monitoring_jio_storage.js",
"monitoring_jio_web_storage.js", "monitoring_jio_web_storage.js",
"monitoring_jio_erp5monitor_storage.js",
"jio_ojs_storage.js", "jio_ojs_storage.js",
"jio_configuration_storage.js", "jio_configuration_storage.js",
"jio_appcachestorage.js", "jio_appcachestorage.js",
...@@ -125,6 +126,7 @@ url_list = [ ...@@ -125,6 +126,7 @@ url_list = [
"gadget_erp5_editor_panel.js", "gadget_erp5_editor_panel.js",
"gadget_officejs_monitoring_jio_alldocs.html", "gadget_officejs_monitoring_jio_alldocs.html",
"gadget_officejs_monitoring_jio_alldocs.js", "gadget_officejs_monitoring_jio_alldocs.js",
"gadget_officejs_monitoring_jio_alldocs.css",
"gadget_erp5_page_ojsm_parameters_view.html", "gadget_erp5_page_ojsm_parameters_view.html",
"gadget_erp5_page_ojsm_parameters_view.js", "gadget_erp5_page_ojsm_parameters_view.js",
"gadget_officejs_monitoring_options_header.html", "gadget_officejs_monitoring_options_header.html",
......
...@@ -15,6 +15,7 @@ web_page_module/gadget_officejs_monitoring.configuration ...@@ -15,6 +15,7 @@ web_page_module/gadget_officejs_monitoring.configuration
web_page_module/gadget_officejs_monitoring_* web_page_module/gadget_officejs_monitoring_*
web_page_module/gadget_ojsm_* web_page_module/gadget_ojsm_*
web_page_module/jsen_json_validator_js web_page_module/jsen_json_validator_js
web_page_module/monitoring_jio_erp5monitor_storage_js
web_page_module/monitoring_jio_storage_js web_page_module/monitoring_jio_storage_js
web_page_module/monitoring_jio_web_storage_js web_page_module/monitoring_jio_web_storage_js
web_page_module/ojsm_gadget_erp5_parent* web_page_module/ojsm_gadget_erp5_parent*
......
...@@ -15,6 +15,7 @@ web_page_module/gadget_officejs_monitoring.configuration ...@@ -15,6 +15,7 @@ web_page_module/gadget_officejs_monitoring.configuration
web_page_module/gadget_officejs_monitoring_* web_page_module/gadget_officejs_monitoring_*
web_page_module/gadget_ojsm_* web_page_module/gadget_ojsm_*
web_page_module/jsen_json_validator_js web_page_module/jsen_json_validator_js
web_page_module/monitoring_jio_erp5monitor_storage_js
web_page_module/monitoring_jio_storage_js web_page_module/monitoring_jio_storage_js
web_page_module/monitoring_jio_web_storage_js web_page_module/monitoring_jio_web_storage_js
web_page_module/ojsm_gadget_erp5_parent* web_page_module/ojsm_gadget_erp5_parent*
......
...@@ -15,6 +15,7 @@ web_page_module/gadget_officejs_monitoring.configuration ...@@ -15,6 +15,7 @@ web_page_module/gadget_officejs_monitoring.configuration
web_page_module/gadget_officejs_monitoring_* web_page_module/gadget_officejs_monitoring_*
web_page_module/gadget_ojsm_* web_page_module/gadget_ojsm_*
web_page_module/jsen_json_validator_js web_page_module/jsen_json_validator_js
web_page_module/monitoring_jio_erp5monitor_storage_js
web_page_module/monitoring_jio_storage_js web_page_module/monitoring_jio_storage_js
web_page_module/monitoring_jio_web_storage_js web_page_module/monitoring_jio_web_storage_js
web_page_module/ojsm_gadget_erp5_parent* web_page_module/ojsm_gadget_erp5_parent*
......
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