Commit 566e2482 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_jio: Fixup render sub-forms on readonly

parent 8acfbf11
...@@ -266,7 +266,6 @@ ...@@ -266,7 +266,6 @@
input, input,
default_value, default_value,
default_used_list = [], default_used_list = [],
default_div,
is_required; is_required;
if (default_dict === undefined) { if (default_dict === undefined) {
...@@ -277,7 +276,7 @@ ...@@ -277,7 +276,7 @@
path = "/"; path = "/";
} }
if (editable && json_field.patternProperties !== undefined) { if (json_field.patternProperties !== undefined) {
if (json_field.patternProperties['.*'] !== undefined) { if (json_field.patternProperties['.*'] !== undefined) {
div = domsugar("div", { div = domsugar("div", {
...@@ -285,7 +284,7 @@ ...@@ -285,7 +284,7 @@
title: json_field.description title: json_field.description
}); });
if (editable) {
div_input = domsugar("div", { div_input = domsugar("div", {
"class": "input" "class": "input"
}, [ }, [
...@@ -303,13 +302,12 @@ ...@@ -303,13 +302,12 @@
}) })
]); ]);
div.appendChild(div_input); div.appendChild(div_input);
}
for (default_value in default_dict) { for (default_value in default_dict) {
if (default_dict.hasOwnProperty(default_value)) { if (default_dict.hasOwnProperty(default_value)) {
default_div = domsugar("div", { if (editable) {
"class": "slapos-parameter-dict-key" label = domsugar('label', {
}, [
domsugar('label', {
text: default_value, text: default_value,
'class': "slapos-parameter-dict-key" 'class': "slapos-parameter-dict-key"
}, [ }, [
...@@ -318,13 +316,20 @@ ...@@ -318,13 +316,20 @@
"class": "bt_close CLOSE" + path + "/" + default_value, "class": "bt_close CLOSE" + path + "/" + default_value,
title: "Remove this parameter section." title: "Remove this parameter section."
}) })
])
]); ]);
} else {
label = domsugar('label', {
text: default_value,
'class': "slapos-parameter-dict-key"
});
}
div.appendChild(render_subform( div.appendChild(render_subform(
json_field.patternProperties['.*'], json_field.patternProperties['.*'],
default_dict[default_value], default_dict[default_value],
default_div, domsugar("div", {
"class": "slapos-parameter-dict-key"
}, [label]),
path + "/" + default_value, path + "/" + default_value,
editable editable
)); ));
...@@ -518,7 +523,6 @@ ...@@ -518,7 +523,6 @@
convertOnMultiLevel(entry, json_dict[entry], multi_level_dict); convertOnMultiLevel(entry, json_dict[entry], multi_level_dict);
} }
} }
return multi_level_dict; return multi_level_dict;
} }
......
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1004.31309.44548.40652</string> </value> <value> <string>1004.35236.24159.46370</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1669089218.99</float> <float>1669302506.42</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