Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos.core
Commits
5a6f2ed1
Commit
5a6f2ed1
authored
Sep 26, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_web: add button to remove sub parameter section from instance parameters form
parent
d69e2a1b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
2 deletions
+38
-2
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_parameter_form_js.js
...plateItem/web_page_module/rjs_slapos_parameter_form_js.js
+21
-0
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_parameter_form_js.xml
...lateItem/web_page_module/rjs_slapos_parameter_form_js.xml
+2
-2
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/vifib_style/vifib.css.zpt
.../portal_skins/vifib_jauks_theme/vifib_style/vifib.css.zpt
+15
-0
No files found.
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_parameter_form_js.js
View file @
5a6f2ed1
...
...
@@ -120,6 +120,7 @@
key
,
div
,
label
,
close_span
,
input
,
default_value
,
default_used_list
=
[],
...
...
@@ -170,6 +171,11 @@
label
=
document
.
createElement
(
"
label
"
);
label
.
textContent
=
default_value
;
label
.
setAttribute
(
"
class
"
,
"
slapos-parameter-dict-key
"
);
close_span
=
document
.
createElement
(
"
span
"
);
close_span
.
textContent
=
"
×
"
;
close_span
.
setAttribute
(
"
class
"
,
"
bt_close
"
);
close_span
.
setAttribute
(
"
title
"
,
"
Remove this parameter section.
"
);
label
.
appendChild
(
close_span
);
default_div
.
appendChild
(
label
);
default_div
=
render_subform
(
json_field
.
patternProperties
[
'
.*
'
],
...
...
@@ -315,6 +321,11 @@
return
element
;
}
function
removeSubParameter
(
element
)
{
$
(
element
).
parent
().
parent
().
remove
();
return
false
;
}
function
addSubForm
(
element
)
{
var
subform_json
=
JSON
.
parse
(
atob
(
element
.
value
)),
input_text
=
element
.
parentNode
.
querySelector
(
"
input[type='text']
"
),
...
...
@@ -344,6 +355,7 @@
field_list
=
g
.
props
.
element
.
querySelectorAll
(
"
.slapos-parameter
"
),
button_list
=
g
.
props
.
element
.
querySelectorAll
(
'
button.add-sub-form
'
),
label_list
=
g
.
props
.
element
.
querySelectorAll
(
'
label.slapos-parameter-dict-key
'
),
close_list
=
g
.
props
.
element
.
querySelectorAll
(
"
.bt_close
"
),
i
,
promise_list
=
[];
...
...
@@ -374,6 +386,15 @@
));
}
for
(
i
=
0
;
i
<
close_list
.
length
;
i
=
i
+
1
)
{
promise_list
.
push
(
loopEventListener
(
close_list
[
i
],
'
click
'
,
false
,
removeSubParameter
.
bind
(
g
,
close_list
[
i
])
));
}
return
RSVP
.
all
(
promise_list
);
}
...
...
master/bt5/slapos_web/PathTemplateItem/web_page_module/rjs_slapos_parameter_form_js.xml
View file @
5a6f2ed1
...
...
@@ -236,7 +236,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
95
0.63459.41632.30105
</string>
</value>
<value>
<string>
95
4.11326.56915.27153
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>
14
62374087.7
6
</float>
<float>
14
74892353.4
6
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
master/bt5/slapos_web/SkinTemplateItem/portal_skins/vifib_jauks_theme/vifib_style/vifib.css.zpt
View file @
5a6f2ed1
...
...
@@ -325,6 +325,21 @@ fieldset > .subfield > label {
text-decoration: none;
}
.bt_close, .subfield .slapos-parameter-dict-key span.bt_close{
padding: 0 6px;
display: block;
float: right;
text-overflow:clip;
white-space:nowrap;
overflow: hidden;
font-size: 1.5em;
border-radius: 2px;
}
.bt_close:hover {
background: #81afab;
color: #fff;
}
.hs-short-title{
margin-left:6px;
padding-bottom: 10px;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment