Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
22ca1780
Commit
22ca1780
authored
Dec 09, 2014
by
Jonathon Duerig
Browse files
When loaded via CloudLab interface, load CloudLab context for Jacks dynamically.
parent
b499d505
Changes
2
Hide whitespace changes
Inline
Side-by-side
www/aptui/js/JacksEditor.js
View file @
22ca1780
...
...
@@ -3,6 +3,57 @@ function (_, editModalString)
{
'
use strict
'
;
var
context
=
{
canvasOptions
:
{
"
defaults
"
:
[
{
"
name
"
:
"
Add VM
"
,
"
image
"
:
"
urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:UBUNTU12-64-STD
"
,
"
type
"
:
"
emulab-xen
"
}
],
"
images
"
:
[
/*
{
"id": "urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:FBSD100-64-STD",
"name": "FreeBSD 10.0 64-bit version"
},
*/
{
"
id
"
:
"
urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:UBUNTU12-64-STD
"
,
"
name
"
:
"
Ubuntu 12.04 LTS 64-bit
"
}
/*,
{
"id": "urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:UBUNTU14-64-STD",
"name": "Ubuntu 14.04 LTS 64-bit"
}*/
],
"
types
"
:
[
{
"
id
"
:
"
emulab-xen
"
,
"
name
"
:
"
Emulab Xen VM
"
}
]
}
};
var
contextUrl
=
'
https://www.emulab.net/protogeni/jacks-context/cloudlab-utah.json
'
;
if
(
window
.
ISCLOUD
)
{
$
.
get
(
contextUrl
).
then
(
contextReady
,
contextFail
);
}
function
contextReady
(
data
)
{
context
=
data
;
}
function
contextFail
(
fail1
,
fail2
)
{
console
.
log
(
'
Failed to fetch Jacks context
'
,
fail1
,
fail2
);
alert
(
'
Failed to fetch Jacks context from
'
+
contextUrl
);
}
function
JacksEditor
(
root
)
{
this
.
root
=
root
;
...
...
@@ -33,37 +84,8 @@ function (_, editModalString)
menu
:
true
,
selectInfo
:
true
},
canvasOptions
:
{
"
defaults
"
:
[
{
"
name
"
:
"
Add VM
"
,
"
image
"
:
"
urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:UBUNTU12-64-STD
"
,
"
type
"
:
"
emulab-xen
"
}
],
"
images
"
:
[
/*
{
"id": "urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:FBSD100-64-STD",
"name": "FreeBSD 10.0 64-bit version"
},
*/
{
"
id
"
:
"
urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:UBUNTU12-64-STD
"
,
"
name
"
:
"
Ubuntu 12.04 LTS 64-bit
"
}
/*,
{
"id": "urn:publicid:IDN+utahddc.geniracks.net+image+emulab-ops:UBUNTU14-64-STD",
"name": "Ubuntu 14.04 LTS 64-bit"
}*/
],
"
types
"
:
[
{
"
id
"
:
"
emulab-xen
"
,
"
name
"
:
"
Emulab Xen VM
"
}
]
}
canvasOptions
:
context
.
canvasOptions
,
constraints
:
context
.
constraints
});
},
...
...
www/aptui/manage_profile.php
View file @
22ca1780
...
...
@@ -160,6 +160,11 @@ function SPITFORM($formfields, $errors)
echo
" window.TITLE = '
$title
';
\n
"
;
echo
" window.AMDEFAULT= '
$amdefault
';
\n
"
;
echo
" window.BUTTONLABEL = '
$button_label
';
\n
"
;
if
(
$ISCLOUD
)
{
echo
" window.ISCLOUD = true;"
;
}
else
{
echo
" window.ISCLOUD = false;"
;
}
if
(
isset
(
$snapuuid
))
{
echo
" window.SNAPUUID = '
$snapuuid
';
\n
"
;
}
...
...
Write
Preview
Supports
Markdown
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