Commit e7d82c3f by Őry Máté

dashboard: add generic vm-operation js

parent f3e07864
...@@ -2,22 +2,21 @@ ...@@ -2,22 +2,21 @@
$(function() { $(function() {
/* vm migrate */ /* vm operations */
$('.vm-migrate').click(function(e) { $('.operation.btn').click(function(e) {
var icon = $(this).children("i"); var icon = $(this).children("i").addClass('icon-spinner icon-spin');
var vm = $(this).data("vm-pk");
icon.removeClass("icon-truck").addClass("icon-spinner icon-spin");
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '/dashboard/vm/' + vm + '/migrate/', url: $(this).attr('href'),
success: function(data) { success: function(data) {
icon.addClass("icon-truck").removeClass("icon-spinner icon-spin"); icon.removeClass("icon-spinner icon-spin");
$('body').append(data); $('body').append(data);
$('#create-modal').modal('show'); $('#confirmation-modal').modal('show');
$('#create-modal').on('hidden.bs.modal', function() { $('#confirmation-modal').on('hidden.bs.modal', function() {
$('#create-modal').remove(); $('#confirmation-modal').remove();
}); });
$('#vm-migrate-node-list li').click(function(e) { $('#vm-migrate-node-list li').click(function(e) {
var li = $(this).closest('li'); var li = $(this).closest('li');
if (li.find('input').attr('disabled')) if (li.find('input').attr('disabled'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment