1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00

Fixed url hash

This commit is contained in:
Retspen 2015-04-21 15:40:18 +03:00
parent 86e1915a49
commit 1fcb49ffc8
4 changed files with 30 additions and 8 deletions

View file

@ -1051,13 +1051,35 @@
} }
}); });
} }
if (~$.inArray(hash, ['#media', '#autostart', '#xmledit', '#vncedit'])) { if (~$.inArray(hash, ['#media', '#clone', '#autostart', '#xmledit', '#vncsettings', '#migrate'])) {
var btnsect = $('#navbtn>li>a'); var btnsect = $('#navbtn>li>a');
$(btnsect).each(function () { $(btnsect).each(function () {
if ($(this).attr('href') === '#settings') { if ($(this).attr('href') === '#settings') {
$(this).trigger('click'); $(this).trigger('click');
} }
}); });
var btn = $('#settings>div>ul>li>a');
$(btn).each(function () {
if ($(this).attr('href') === hash) {
$(this).trigger('click');
}
});
}
if (~$.inArray(hash, ['#takesnapshot', '#restoresnapshot'])) {
var btnsect = $('#navbtn>li>a');
$(btnsect).each(function () {
if ($(this).attr('href') === '#snapshots') {
$(this).trigger('click');
}
});
var btn = $('#snapshots>div>ul>li>a');
$(btn).each(function () {
if ($(this).attr('href') === hash) {
$(this).trigger('click');
}
});
} }
</script> </script>
{% endblock %} {% endblock %}

View file

@ -297,14 +297,14 @@ def instance(request, compute_id, vname):
conn.create_snapshot(name) conn.create_snapshot(name)
msg = _("New snapshot") msg = _("New snapshot")
addlogmsg(request.user.id, instance.id, msg) addlogmsg(request.user.id, instance.id, msg)
return HttpResponseRedirect(request.get_full_path() + '#snapshot') return HttpResponseRedirect(request.get_full_path() + '#takesnapshot')
if 'delete_snapshot' in request.POST: if 'delete_snapshot' in request.POST:
snap_name = request.POST.get('name', '') snap_name = request.POST.get('name', '')
conn.snapshot_delete(snap_name) conn.snapshot_delete(snap_name)
msg = _("Delete snapshot") msg = _("Delete snapshot")
addlogmsg(request.user.id, instance.id, msg) addlogmsg(request.user.id, instance.id, msg)
return HttpResponseRedirect(request.get_full_path() + '#snapshot') return HttpResponseRedirect(request.get_full_path() + '#restoresnapshot')
if 'revert_snapshot' in request.POST: if 'revert_snapshot' in request.POST:
snap_name = request.POST.get('name', '') snap_name = request.POST.get('name', '')
@ -366,7 +366,7 @@ def instance(request, compute_id, vname):
else: else:
msg = _("Set VNC password") msg = _("Set VNC password")
addlogmsg(request.user.id, instance.id, msg) addlogmsg(request.user.id, instance.id, msg)
return HttpResponseRedirect(request.get_full_path() + '#vncedit') return HttpResponseRedirect(request.get_full_path() + '#vncsettings')
if 'set_console_keymap' in request.POST: if 'set_console_keymap' in request.POST:
keymap = request.POST.get('console_keymap', '') keymap = request.POST.get('console_keymap', '')
@ -377,14 +377,14 @@ def instance(request, compute_id, vname):
conn.set_console_keymap(keymap) conn.set_console_keymap(keymap)
msg = _("Set VNC keymap") msg = _("Set VNC keymap")
addlogmsg(request.user.id, instance.id, msg) addlogmsg(request.user.id, instance.id, msg)
return HttpResponseRedirect(request.get_full_path() + '#vncedit') return HttpResponseRedirect(request.get_full_path() + '#vncsettings')
if 'set_console_type' in request.POST: if 'set_console_type' in request.POST:
console_type = request.POST.get('console_type', '') console_type = request.POST.get('console_type', '')
conn.set_console_type(console_type) conn.set_console_type(console_type)
msg = _("Set VNC type") msg = _("Set VNC type")
addlogmsg(request.user.id, instance.id, msg) addlogmsg(request.user.id, instance.id, msg)
return HttpResponseRedirect(request.get_full_path() + '#vncedit') return HttpResponseRedirect(request.get_full_path() + '#vncsettings')
if 'migrate' in request.POST: if 'migrate' in request.POST:
compute_id = request.POST.get('compute_id', '') compute_id = request.POST.get('compute_id', '')

View file

@ -74,7 +74,7 @@
<div class="form-group meta-prealloc"> <div class="form-group meta-prealloc">
<label class="col-sm-3 control-label">{% trans "Metadata" %}</label> <label class="col-sm-3 control-label">{% trans "Metadata" %}</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="checkbox" name="meta_prealloc" value="true" checked> <input type="checkbox" name="meta_prealloc" value="true">
</div> </div>
</div> </div>
</div> </div>

View file

@ -143,7 +143,7 @@
<div class="form-group meta-prealloc" style="display: none;"> <div class="form-group meta-prealloc" style="display: none;">
<label class="col-sm-3 control-label">{% trans "Metadata" %}</label> <label class="col-sm-3 control-label">{% trans "Metadata" %}</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="checkbox" name="meta_prealloc" value="true" checked> <input type="checkbox" name="meta_prealloc" value="true">
</div> </div>
</div> </div>
</div> </div>