Commit c4b3afcb authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Use parameter form when request one instance

parent d54c8b06
/*global window, rJS, RSVP */ /*global window, rJS, RSVP, btoa */
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, rJS, RSVP) { (function (window, rJS, RSVP) {
"use strict"; "use strict";
...@@ -66,7 +66,15 @@ ...@@ -66,7 +66,15 @@
]); ]);
}) })
.push(function (result) { .push(function (result) {
var doc = result[1]; var doc = result[1],
parameter_dict = {
'parameter' : {
'json_url': doc.url_string + ".json",
//'json_url': "https://lab.node.vifib.com/nexedi/slapos/raw/master/software/kvm/software.cfg.json",
'parameter_hash': btoa('<?xml version="1.0" encoding="utf-8" ?><instance></instance>'),
'restricted_softwaretype': false
}
};
return result[0].render({ return result[0].render({
erp5_document: { erp5_document: {
"_embedded": {"_view": { "_embedded": {"_view": {
...@@ -77,7 +85,7 @@ ...@@ -77,7 +85,7 @@
"css_class": "", "css_class": "",
"required": 0, "required": 0,
"editable": 0, "editable": 0,
"key": "title", "key": "url_string",
"hidden": 0, "hidden": 0,
"type": "StringField" "type": "StringField"
}, },
...@@ -93,15 +101,17 @@ ...@@ -93,15 +101,17 @@
"type": "StringField" "type": "StringField"
}, },
"your_text_content": { "your_text_content": {
"description": "The name of a document in ERP5", "description": "",
"title": "Instance Parameter", "title": "Instance Parameter",
"default": "", "default": parameter_dict,
"css_class": "", "css_class": "",
"required": 1, "required": 1,
"editable": 1, "editable": 1,
"url": "gadget_erp5_page_slap_parameter_form.html",
"sandbox": "",
"key": "text_content", "key": "text_content",
"hidden": 0, "hidden": 0,
"type": "TextAreaField" "type": "GadgetField"
}, },
"your_computer_guid": { "your_computer_guid": {
"description": "The name of a document in ERP5", "description": "The name of a document in ERP5",
......
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>964.4358.51456.27204</string> </value> <value> <string>965.32456.3463.64409</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1513014787.37</float> <float>1518633464.67</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment