Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Elijah Grubb
emulab-devel
Commits
4698bb02
Commit
4698bb02
authored
Oct 12, 2015
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for the sites array, which was not getting turned into a proper
array inside of the formfields array.
parent
cf12fb1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
www/aptui/js/instantiate.js
www/aptui/js/instantiate.js
+17
-2
No files found.
www/aptui/js/instantiate.js
View file @
4698bb02
...
...
@@ -522,6 +522,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
{
// Current form contents as formfields array.
var
formfields
=
{};
var
sites
=
{};
var
rpc_callback
=
function
(
json
)
{
console
.
info
(
json
);
...
...
@@ -532,8 +533,22 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
// form handler pages expect.
var
fields
=
$
(
'
.step-forms
'
).
serializeArray
();
$
.
each
(
fields
,
function
(
i
,
field
)
{
formfields
[
field
.
name
]
=
field
.
value
;
/*
* The sites array is special since we want that to be
* an array inside of the formfields array, and serialize
* is not going to do that for us.
*/
var
site
=
/^sites
\[(
.*
)\]
$/g
.
exec
(
field
.
name
);
if
(
site
)
{
sites
[
site
[
1
]]
=
field
.
value
;
}
else
{
formfields
[
field
.
name
]
=
field
.
value
;
}
});
if
(
Object
.
keys
(
sites
).
length
)
{
formfields
[
"
sites
"
]
=
sites
;
}
console
.
info
(
formfields
);
var
xmlthing
=
sup
.
CallServerMethod
(
null
,
"
instantiate
"
,
(
checkonly
?
...
...
@@ -898,7 +913,7 @@ function (_, Constraints, sup, ppstart, JacksEditor, wt,
"
Site
"
+
siteid
+
"
Cluster:</a>
"
+
"
</label>
"
+
"
<div class='col-sm-6'>
"
+
"
<select name=
\"
formfields[
sites
]
[
"
+
siteid
+
"
]
\"
"
+
"
<select name=
\"
sites[
"
+
siteid
+
"
]
\"
"
+
"
class='form-control'>
"
+
"
<option value=''>Please Select</option>
"
+
options
+
...
...
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