From 7c933382bd507a92eed120bcea59aefd35828ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 22 Jun 2015 13:40:43 +0200 Subject: [PATCH] Feature #3748: Remove unused VM import code from host creation form --- .../app/tabs/hosts-tab/form-panels/create.js | 55 ------------------- 1 file changed, 55 deletions(-) diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js index d5c0b01c0f..2610886b08 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js @@ -11,7 +11,6 @@ define(function(require) { var ResourceSelect = require('utils/resource-select'); var OpenNebulaError = require('opennebula/error'); var OpenNebulaHost = require('opennebula/host'); - var OpenNebulaVM = require('opennebula/vm'); var VCenterTemplates = require('utils/vcenter/templates'); var VCenterNetworks = require('utils/vcenter/networks'); @@ -176,8 +175,6 @@ define(function(require) { } }); - var vms_container = $(".vcenter_vms", context); - var vcenter_user = $("#vcenter_user", context).val(); var vcenter_password = $("#vcenter_password", context).val(); var vcenter_host = $("#vcenter_host", context).val(); @@ -263,58 +260,6 @@ define(function(require) { }); }); - $.each($(".vm_name:checked", context), function() { - var vm_context = $(this).closest(".vcenter_vm"); - - $(".vcenter_vm_result:not(.success)", vm_context).html( - '' + - '' + - '' + - ''); - - var vm_json = { - "vm": { - "vm_raw": $(this).data("one_vm") - } - }; - - var host_id_to_deploy = $(this).data("vm_to_host"); - - OpenNebulaVM.create({ - timeout: true, - data: vm_json, - success: function(request, response) { - var extra_info = {}; - - extra_info['host_id'] = host_id_to_deploy; - extra_info['ds_id'] = -1; - extra_info['enforce'] = false; - - Sunstone.runAction("VM.deploy_action", response.VM.ID, extra_info); - - $(".vcenter_vm_result", vm_context).addClass("success").html( - '' + - '' + - '' + - ''); - - $(".vcenter_vm_response", vm_context).html('

' + - Locale.tr("VM imported successfully") + ' ID:' + response.VM.ID + - '

'); - }, - error: function (request, error_json) { - $(".vcenter_vm_response", vm_context).html('' + - '' + - '' + - ''); - - $(".vcenter_vm_response", vm_context).html('

' + - (error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?")) + - '

'); - } - }); - }); - that.vCenterTemplates.import(); that.vCenterNetworks.import();