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
e54fc488
Commit
e54fc488
authored
Jan 20, 2015
by
Jonathon Duerig
Browse files
Make parameterizable topology view a viewer rather than an editor.
parent
30c826e5
Changes
7
Hide whitespace changes
Inline
Side-by-side
www/aptui/instantiate.php
View file @
e54fc488
...
...
@@ -236,6 +236,7 @@ function SPITFORM($formfields, $newuser, $errors)
SPITHEADER
(
1
);
echo
"<div id='ppviewmodal_div'></div>
\n
"
;
echo
"<div class='row'>
<div class='col-lg-6 col-lg-offset-3
col-md-6 col-md-offset-3
...
...
www/aptui/js/JacksEditor.js
View file @
e54fc488
...
...
@@ -56,13 +56,18 @@ function (_, editModalString)
alert
(
'
Failed to fetch Jacks context from
'
+
contextUrl
);
}
function
JacksEditor
(
root
)
function
JacksEditor
(
root
,
isViewer
)
{
this
.
root
=
root
;
this
.
instance
=
null
;
this
.
input
=
null
;
this
.
output
=
null
;
this
.
xml
=
null
;
this
.
mode
=
'
editor
'
;
if
(
isViewer
)
{
this
.
mode
=
'
viewer
'
;
}
this
.
render
();
}
...
...
@@ -71,12 +76,16 @@ function (_, editModalString)
render
:
function
()
{
this
.
root
.
html
(
editModalString
);
if
(
this
.
mode
!==
'
editor
'
)
{
this
.
root
.
find
(
'
.modal-header h3
'
).
html
(
'
Topology Viewer
'
);
}
this
.
root
.
find
(
'
#quickvm_editmodal
'
).
on
(
'
shown.bs.modal
'
,
_
.
bind
(
this
.
handleShown
,
this
));
this
.
root
.
find
(
'
#edit-save
'
).
click
(
_
.
bind
(
this
.
fetchXml
,
this
));
this
.
root
.
find
(
'
#edit-cancel, #edit-dismiss
'
)
.
click
(
_
.
bind
(
this
.
cancelEdit
,
this
));
this
.
instance
=
new
window
.
Jacks
({
mode
:
'
editor
'
,
mode
:
this
.
mode
,
source
:
'
rspec
'
,
root
:
'
#edit_nopicker
'
,
nodeSelect
:
true
,
...
...
www/aptui/js/manage_profile.js
View file @
e54fc488
...
...
@@ -370,7 +370,7 @@ function (_, sup, filesize, JacksEditor, ShowImagingModal, moment, ppstart,
registered
:
true
,
amlist
:
amlist
,
amdefault
:
window
.
AMDEFAULT
,
editor
:
editor
});
});
return
;
}
sup
.
ShowModal
(
'
#instantiate_modal
'
);
...
...
www/aptui/js/ppstart.js
View file @
e54fc488
...
...
@@ -254,13 +254,7 @@ function(_, sup, JacksEditor, ppmodalString, ppbodyString, chooserString)
return
;
}
// Caller might already have an editor instance.
if
(
_
.
has
(
args
,
"
editor
"
))
{
editor
=
args
.
editor
;
}
else
{
editor
=
new
JacksEditor
(
$
(
'
#editmodal_div
'
));
}
editor
=
new
JacksEditor
(
$
(
'
#ppviewmodal_div
'
),
true
);
// Callback; instead of instantiate, send rspec to callback.
if
(
_
.
has
(
args
,
"
callback
"
))
{
callback_done
=
args
.
callback
;
...
...
www/aptui/manage_profile.php
View file @
e54fc488
...
...
@@ -95,6 +95,7 @@ function SPITFORM($formfields, $errors)
SPITHEADER
(
1
);
echo
"<div id='ppviewmodal_div'></div>
\n
"
;
# Place to hang the toplevel template.
echo
"<div id='manage-body'></div>
\n
"
;
...
...
www/aptui/ppstart.php
View file @
e54fc488
...
...
@@ -63,7 +63,7 @@ function SPITFORM($formfrag, $formfields, $errors)
# Place to hang the toplevel template.
echo
"<div id='main-body'></div>
\n
"
;
# For the editor.
echo
"<div id='
edit
modal_div'></div>
\n
"
;
echo
"<div id='
ppview
modal_div'></div>
\n
"
;
# I think this will take care of XSS prevention?
echo
"<script type='text/plain' id='form-json'>
\n
"
;
...
...
www/aptui/show-profile.php
View file @
e54fc488
...
...
@@ -45,6 +45,7 @@ $reqargs = RequiredPageArguments("uuid", PAGEARG_STRING);
SPITHEADER
(
1
);
echo
"<div id='ppviewmodal_div'></div>
\n
"
;
if
(
!
isset
(
$uuid
))
{
SPITUSERERROR
(
"Must provide uuid!"
);
}
...
...
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