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
e0633f56
Commit
e0633f56
authored
Sep 22, 2015
by
Leigh B Stoller
Browse files
Various fixes and improvements for image snapshot/clone.
parent
0b49431e
Changes
4
Hide whitespace changes
Inline
Side-by-side
www/aptui/js/image.js
View file @
e0633f56
...
...
@@ -29,7 +29,7 @@ define(['underscore', 'js/quickvm_sup', 'filesize',
if
(
imaging_modal_active
)
{
sup
.
HideModal
(
"
#imaging-modal
"
);
imaging_modal_active
=
false
;
$
(
'
#imaging
_
modal
'
).
off
(
'
hidden.bs.modal
'
);
$
(
'
#imaging
-
modal
'
).
off
(
'
hidden.bs.modal
'
);
}
sup
.
SpitOops
(
"
oops
"
,
"
Server says:
"
+
json
.
value
);
completion_callback
(
1
);
...
...
@@ -42,9 +42,9 @@ define(['underscore', 'js/quickvm_sup', 'filesize',
imaging_modal_display
=
false
;
// Handler so we know the user closed the modal.
$
(
'
#imaging
_
modal
'
).
on
(
'
hidden.bs.modal
'
,
function
(
e
)
{
$
(
'
#imaging
-
modal
'
).
on
(
'
hidden.bs.modal
'
,
function
(
e
)
{
imaging_modal_active
=
false
;
$
(
'
#imaging
_
modal
'
).
off
(
'
hidden.bs.modal
'
);
$
(
'
#imaging
-
modal
'
).
off
(
'
hidden.bs.modal
'
);
})
}
...
...
@@ -85,6 +85,20 @@ define(['underscore', 'js/quickvm_sup', 'filesize',
$
(
'
#tracker-ready
'
).
removeClass
(
'
progtrckr-todo
'
);
$
(
'
#tracker-ready
'
).
addClass
(
'
progtrckr-done
'
);
$
(
'
#imaging-spinner
'
).
addClass
(
"
hidden
"
);
if
(
_
.
has
(
value
,
"
image_name
"
))
{
$
(
'
#imaging-done-modal-imagename
'
)
.
text
(
value
[
"
image_name
"
]);
$
(
'
#imaging-modal-imagename
'
)
.
text
(
value
[
"
image_name
"
]);
if
(
!
imaging_modal_active
)
{
sup
.
ShowModal
(
"
#imaging-done-modal
"
);
}
else
{
$
(
'
#imaging_modal_done_div
'
)
.
removeClass
(
"
hidden
"
);
}
}
$
(
'
#imaging-close
'
).
removeClass
(
"
hidden
"
);
completion_callback
(
0
);
return
;
...
...
@@ -135,9 +149,10 @@ define(['underscore', 'js/quickvm_sup', 'filesize',
if
(
imagingTemplate
==
null
)
{
imagingTemplate
=
_
.
template
(
imagingString
);
var
imaging_html
=
imagingTemplate
({});
$
(
'
#imaging_div
'
).
html
(
imaging_html
);
}
var
imaging_html
=
imagingTemplate
({});
$
(
'
#imaging_div
'
).
html
(
imaging_html
);
imaging_modal_display
=
true
;
ShowImagingModal
();
}
...
...
www/aptui/js/status.js
View file @
e0633f56
...
...
@@ -23,6 +23,7 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
var
oneonly
=
0
;
var
isadmin
=
0
;
var
isguest
=
0
;
var
ispprofile
=
0
;
var
dossh
=
1
;
var
profile_uuid
=
null
;
var
extend
=
null
;
...
...
@@ -48,6 +49,7 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
isguest
=
(
window
.
APT_OPTIONS
.
registered
?
false
:
true
);
dossh
=
window
.
APT_OPTIONS
.
dossh
;
extend
=
window
.
APT_OPTIONS
.
extend
||
null
;
ispprofile
=
window
.
APT_OPTIONS
.
ispprofile
;
profile_uuid
=
window
.
APT_OPTIONS
.
profileUUID
;
lockout
=
window
.
APT_OPTIONS
.
lockout
;
lockdown
=
window
.
APT_OPTIONS
.
lockdown
;
...
...
@@ -388,7 +390,10 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
$
(
"
#status_progress_bar
"
).
width
(
"
100%
"
);
}
EnableButtons
();
AutoStartSSH
();
// We should be looking at the node status instead.
if
(
lastStatus
!=
"
imaging
"
)
{
AutoStartSSH
();
}
}
else
if
(
status
==
'
failed
'
)
{
bgtype
=
"
panel-danger
"
;
...
...
@@ -1378,10 +1383,20 @@ function (_, sup, moment, marked, UriTemplate, ShowImagingModal,
if
(
node_id
)
{
// Default to checked any time we show the modal.
$
(
'
#snapshot_update_profile
'
).
prop
(
"
checked
"
,
true
);
$
(
'
#snapshot_update_profile_div
'
).
removeClass
(
"
hidden
"
);
if
(
ispprofile
)
{
$
(
'
#snapshot_update_profile_div
'
).
addClass
(
"
hidden
"
);
$
(
'
#snapshot_update_script_div
'
).
removeClass
(
"
hidden
"
);
}
else
{
$
(
'
#snapshot_update_profile_div
'
).
removeClass
(
"
hidden
"
);
$
(
'
#snapshot_update_script_div
'
).
addClass
(
"
hidden
"
);
}
}
else
{
$
(
'
#snapshot_update_profile_div
'
).
addClass
(
"
hidden
"
);
if
(
ispprofile
)
{
$
(
'
#snapshot_update_script_div
'
).
removeClass
(
"
hidden
"
);
}
}
sup
.
ShowModal
(
'
#snapshot_modal
'
);
...
...
www/aptui/manage_profile.ajax
View file @
e0633f56
...
...
@@ -63,6 +63,9 @@ function Do_CloneStatus()
# Success, but not sure what to report. Come back to this later.
$blob
[
"exited"
]
=
$webtask
->
exited
();
$blob
[
"exitcode"
]
=
$webtask
->
exitcode
();
if
(
isset
(
$taskdata
[
"image_name"
]))
{
$blob
[
"image_name"
]
=
$taskdata
[
"image_name"
];
}
}
#
# Size is in KB to avoid bigint problems. But kill the KB.
...
...
www/aptui/status.ajax
View file @
e0633f56
...
...
@@ -826,6 +826,9 @@ function Do_SnapshotStatus()
# Success, but not sure what to report. Come back to this later.
$blob
[
"exited"
]
=
$webtask
->
exited
();
$blob
[
"exitcode"
]
=
$webtask
->
exitcode
();
if
(
isset
(
$taskdata
[
"image_name"
]))
{
$blob
[
"image_name"
]
=
$taskdata
[
"image_name"
];
}
$webtask
->
Delete
();
}
SPITAJAX_RESPONSE
(
$blob
);
...
...
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