diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index 83cd9bd4ae..6c86a4eab0 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -21,7 +21,6 @@ enabled_tabs: - secgroups-tab - vrouters-tab - zones-tab - - marketplace-tab - oneflow-dashboard - oneflow-services-tab - oneflow-templates-tab @@ -468,21 +467,6 @@ tabs: VirtualRouter.delete: true VirtualRouter.attachnic: true VirtualRouter.detachnic: true - marketplace-tab: - panel_tabs: - marketplace_info_tab: true - table_columns: - - 0 # Checkbox - #- 1 # ID - - 2 # Name - - 3 # Publisher - - 4 # Hypervisor - - 5 # Arch - - 6 # Format - #- 7 # Tags - actions: - Marketplace.refresh: true - Marketplace.import: true oneflow-dashboard: panel_tabs: table_columns: diff --git a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml index 12c331fa2e..424ed9d84f 100644 --- a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml @@ -20,7 +20,6 @@ enabled_tabs: #- secgroups-tab - vrouters-tab - zones-tab - #- marketplace-tab - oneflow-dashboard - oneflow-services-tab - oneflow-templates-tab @@ -462,21 +461,6 @@ tabs: VirtualRouter.delete: true VirtualRouter.attachnic: true VirtualRouter.detachnic: true - marketplace-tab: - panel_tabs: - marketplace_info_tab: true - table_columns: - - 0 # Checkbox - #- 1 # ID - - 2 # Name - - 3 # Publisher - - 4 # Hypervisor - - 5 # Arch - - 6 # Format - #- 7 # Tags - actions: - Marketplace.refresh: true - Marketplace.import: true oneflow-dashboard: panel_tabs: table_columns: diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml index fe51f38cd7..3c04a2f77a 100644 --- a/src/sunstone/etc/sunstone-views/user.yaml +++ b/src/sunstone/etc/sunstone-views/user.yaml @@ -20,7 +20,6 @@ enabled_tabs: - secgroups-tab - vrouters-tab #- zones-tab - - marketplace-tab - oneflow-dashboard - oneflow-services-tab - oneflow-templates-tab @@ -463,21 +462,6 @@ tabs: VirtualRouter.delete: true VirtualRouter.attachnic: true VirtualRouter.detachnic: true - marketplace-tab: - panel_tabs: - marketplace_info_tab: true - table_columns: - - 0 # Checkbox - #- 1 # ID - - 2 # Name - - 3 # Publisher - - 4 # Hypervisor - - 5 # Arch - - 6 # Format - #- 7 # Tags - actions: - Marketplace.refresh: true - Marketplace.import: true oneflow-dashboard: panel_tabs: table_columns: diff --git a/src/sunstone/models/SunstoneMarketplace.rb b/src/sunstone/models/SunstoneMarketplace.rb deleted file mode 100644 index 9ea1aa2a4f..0000000000 --- a/src/sunstone/models/SunstoneMarketplace.rb +++ /dev/null @@ -1,55 +0,0 @@ -# ---------------------------------------------------------------------------- # -# Copyright 2002-2015, OpenNebula Project, OpenNebula Systems # -# # -# Licensed under the Apache License, Version 2.0 (the "License"); you may # -# not use this file except in compliance with the License. You may obtain # -# a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software # -# distributed under the License is distributed on an "AS IS" BASIS, # -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# See the License for the specific language governing permissions and # -# limitations under the License. # -# ---------------------------------------------------------------------------- # - -require 'marketplace/marketplace_client' - -module SunstoneMarketplace - USER_AGENT = "Sunstone" - - def get_appliance_pool - client = Market::ApplianceClient.new( - @config[:marketplace_username], - @config[:marketplace_password], - @config[:marketplace_url], - USER_AGENT) - - response = client.list - - if CloudClient::is_error?(response) - error = Error.new(response.to_s) - return [response.code.to_i, error.to_json] - end - - [200, response.body] - end - - def get_appliance(app_id) - client = Market::ApplianceClient.new( - @config[:marketplace_username], - @config[:marketplace_password], - @config[:marketplace_url], - USER_AGENT) - - response = client.show(app_id) - - if CloudClient::is_error?(response) - error = Error.new(response.to_s) - return [response.code.to_i, error.to_json] - end - - [200, response.body] - end -end diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index f10bb25545..ee1ffab66d 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -23,8 +23,6 @@ require 'OpenNebulaVNC' require 'OpenNebulaJSON/JSONUtils' #include JSONUtils -require 'SunstoneMarketplace' - class SunstoneServer < CloudServer # FLAG that will filter the elements retrieved from the Pools POOL_FILTER = Pool::INFO_ALL @@ -32,8 +30,6 @@ class SunstoneServer < CloudServer # Secs to sleep between checks to see if image upload to repo is finished IMAGE_POLL_SLEEP_TIME = 5 - include SunstoneMarketplace - def initialize(client, config, logger) super(config, logger) @client = client diff --git a/src/sunstone/public/app/main.js b/src/sunstone/public/app/main.js index a415f40c5b..6ec3eb46fa 100644 --- a/src/sunstone/public/app/main.js +++ b/src/sunstone/public/app/main.js @@ -139,7 +139,6 @@ require.config({ 'tabs/secgroups-tab', 'tabs/vrouters-tab', 'tabs/zones-tab', - 'tabs/marketplace-tab', 'tabs/oneflow-dashboard', 'tabs/oneflow-services-tab', 'tabs/oneflow-templates-tab', diff --git a/src/sunstone/public/app/tabs/marketplace-tab.js b/src/sunstone/public/app/tabs/marketplace-tab.js deleted file mode 100644 index dc7b69a1c8..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab.js +++ /dev/null @@ -1,63 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - var Locale = require('utils/locale'); - var Buttons = require('./marketplace-tab/buttons'); - var Actions = require('./marketplace-tab/actions'); - var Table = require('./marketplace-tab/datatable'); - - var TAB_ID = require('./marketplace-tab/tabId'); - var DATATABLE_ID = "dataTableMarketplace"; - - var _dialogs = [ - require('./marketplace-tab/dialogs/import') - ]; - - var _panels = [ - require('./marketplace-tab/panels/info') - ]; - - var _panelsHooks = [ - require('./marketplace-tab/hooks/header') - ]; - - var _formPanels = [ - ]; - - var Tab = { - tabId: TAB_ID, - title: ' ' + Locale.tr("Marketplace"), - listHeader: ' '+Locale.tr("OpenNebula Marketplace"), - infoHeader: ' '+Locale.tr("Appliance"), - subheader: '  ', - resource: 'Marketplace', - content: '', - buttons: Buttons, - actions: Actions, - dataTable: new Table(DATATABLE_ID, {actions: true, info: true, oneSelection: true}), - panels: _panels, - panelsHooks: _panelsHooks, - formPanels: _formPanels, - dialogs: _dialogs - }; - - return Tab; -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/actions.js b/src/sunstone/public/app/tabs/marketplace-tab/actions.js deleted file mode 100644 index f6f6c62583..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/actions.js +++ /dev/null @@ -1,82 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - var Sunstone = require('sunstone'); - var Notifier = require('utils/notifier'); - var Locale = require('utils/locale'); - var DataTable = require('./datatable'); - var OpenNebulaResource = require('opennebula/marketplace'); - - var RESOURCE = "Marketplace"; - var TAB_ID = require('./tabId'); - var IMPORT_DIALOG_ID = require('./dialogs/import/dialogId'); - - var _actions = { - "Marketplace.list" : { - type: "list", - call: OpenNebulaResource.list, - callback: function(request, response) { - Sunstone.getDataTable(TAB_ID).updateView(request, response.appliances); - } - }, - - "Marketplace.refresh" : { - type: "custom", - call: function() { - var tab = $('#' + TAB_ID); - if (Sunstone.rightInfoVisible(tab)) { - Sunstone.runAction(RESOURCE+".show", Sunstone.rightInfoResourceId(tab)); - } else { - Sunstone.getDataTable(TAB_ID).waitingNodes(); - Sunstone.runAction(RESOURCE+".list", {force: true}); - } - }, - }, - - "Marketplace.import" : { - type: "multiple", - call: OpenNebulaResource.show, - callback: function(request, response) { - if (response['status'] && response['status'] != 'ready') { - Notifier.notifyError(Locale.tr("The appliance is not ready")); - return; - } - - Sunstone.getDialog(IMPORT_DIALOG_ID).setParams({element: response}); - Sunstone.getDialog(IMPORT_DIALOG_ID).reset(); - Sunstone.getDialog(IMPORT_DIALOG_ID).show(); - }, - elements: function() { - return Sunstone.getDataTable(TAB_ID).elements(); - }, - error: Notifier.onError - }, - - "Marketplace.show" : { - type: "single", - call: OpenNebulaResource.show, - callback: function(request, response) { - if (Sunstone.rightInfoVisible($('#'+TAB_ID))) { - Sunstone.insertPanels(TAB_ID, response); - } - }, - error: Notifier.onError - } - }; - - return _actions; -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/buttons.js b/src/sunstone/public/app/tabs/marketplace-tab/buttons.js deleted file mode 100644 index 52ff943fa4..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/buttons.js +++ /dev/null @@ -1,34 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - var Locale = require('utils/locale'); - - var Buttons = { - "Marketplace.refresh" : { - type: "action", - layout: "refresh", - alwaysActive: true - }, - "Marketplace.import" : { - type: "action", - layout: "main", - text: Locale.tr('Import') - } - }; - - return Buttons; -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/datatable.js b/src/sunstone/public/app/tabs/marketplace-tab/datatable.js deleted file mode 100644 index 79396ed7cd..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/datatable.js +++ /dev/null @@ -1,126 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - /* - DEPENDENCIES - */ - - var TabDataTable = require('utils/tab-datatable'); - var SunstoneConfig = require('sunstone-config'); - var Locale = require('utils/locale'); - - /* - CONSTANTS - */ - - var RESOURCE = "Marketplace"; - //var XML_ROOT = ""; - var TAB_NAME = require('./tabId'); - - /* - CONSTRUCTOR - */ - - function Table(dataTableId, conf) { - this.conf = conf || {}; - this.tabId = TAB_NAME; - this.dataTableId = dataTableId; - this.resource = RESOURCE; - //this.xmlRoot = XML_ROOT; - - this.dataTableOptions = { - "bAutoWidth": false, - "bSortClasses" : false, - "bDeferRender": true, - "aoColumnDefs": [ - {"bSortable": false, "aTargets": ["check"]}, - {"sWidth": "35px", "aTargets": [0]}, - {"bVisible": true, "aTargets": SunstoneConfig.tabTableColumns(TAB_NAME)}, - {"bVisible": false, "aTargets": ['_all']} - ] - }; - - this.columns = [ - Locale.tr("ID"), - Locale.tr("Name"), - Locale.tr("Publisher"), - Locale.tr("Hypervisor"), - Locale.tr("Arch"), - Locale.tr("Format"), - Locale.tr("Tags") - ]; - /* - this.selectOptions = { - }; - */ - TabDataTable.call(this); - } - - Table.prototype = Object.create(TabDataTable.prototype); - Table.prototype.constructor = Table; - Table.prototype.elementArray = _elementArray; - - return Table; - - /* - FUNCTION DEFINITIONS - */ - - function _elementArray(element) { - var publisher = '-'; - var hypervisor = '-'; - var arch = '-'; - var format = '-'; - var tags = '-'; - - if(element.publisher != undefined){ - publisher = element.publisher; - } - - if(element.files != undefined && element.files.length > 0){ - if(element.files[0]["hypervisor"] != undefined){ - hypervisor = element.files[0]["hypervisor"]; - } - - if(element.files[0]["os-arch"] != undefined){ - arch = element.files[0]["os-arch"]; - } - - if(element.files[0]["format"] != undefined){ - format = element.files[0]["format"]; - } - } - - if(element.tags != undefined){ - tags = element.tags; - } - - return [ - '', - element._id.$oid, - element.name, - publisher, - hypervisor, - arch, - format, - tags - ]; - } -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import.js b/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import.js deleted file mode 100644 index af342220bd..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import.js +++ /dev/null @@ -1,295 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - /* - DEPENDENCIES - */ - - var BaseDialog = require('utils/dialogs/dialog'); - var TemplateHTML = require('hbs!./import/html'); - var ContentHTML = require('hbs!./import/content'); - var Sunstone = require('sunstone'); - var Notifier = require('utils/notifier'); - var Locale = require('utils/locale'); - var ResourceSelect = require('utils/resource-select'); - var OpenNebulaDatastore = require('opennebula/datastore'); - var OpenNebulaImage = require('opennebula/image'); - var OpenNebulaTemplate = require('opennebula/template'); - var TemplateUtils = require('utils/template-utils'); - - /* - CONSTANTS - */ - - var DIALOG_ID = require('./import/dialogId'); - var TAB_ID = require('../tabId'); - - /* - CONSTRUCTOR - */ - - function Dialog() { - this.dialogId = DIALOG_ID; - - BaseDialog.call(this); - } - - Dialog.DIALOG_ID = DIALOG_ID; - Dialog.prototype = Object.create(BaseDialog.prototype); - Dialog.prototype.constructor = Dialog; - Dialog.prototype.html = _html; - Dialog.prototype.onShow = _onShow; - Dialog.prototype.setup = _setup; - Dialog.prototype.setParams = _setParams; - Dialog.prototype.try_to_create_template = _try_to_create_template; - - return Dialog; - - /* - FUNCTION DEFINITIONS - */ - - function _html() { - return TemplateHTML({ - 'dialogId': this.dialogId - }); - } - - function _setup(context) { - var that = this; - - context.foundation('abide', 'reflow'); - $("#market_import_dialog_content", context).html( - ContentHTML({'element': this.element}) - ); - - ResourceSelect.insert({ - context: $('#market_img_datastore', context), - resourceName: 'Datastore', - filterKey: 'TYPE', - filterValue: '' + OpenNebulaDatastore.TYPES.IMAGE_DS - }); - - context.off('invalid.fndtn.abide', '#' + DIALOG_ID + 'Form'); - context.off('valid.fndtn.abide', '#' + DIALOG_ID + 'Form'); - - context.on('invalid.fndtn.abide', '#' + DIALOG_ID + 'Form', function(e) { - Notifier.notifyError(Locale.tr("One or more required fields are missing or malformed.")); - }).on('valid.fndtn.abide', '#' + DIALOG_ID + 'Form', function(e) { - that.number_of_files = that.element['files'].length; - that.template_created = false; - that.images_information = []; - - - $("input, button", context).attr("disabled", "disabled"); - $(".market_image_result:not(.success)", context).html( - ''+ - ''+ - ''+ - ''); - $(".market_template_result", context).html( - ''+ - ''+ - ''+ - ''); - - var template_context = $("#market_import_file_template", context); - - $.each(that.element['files'], function(index, value){ - var local_context = $("#market_import_file_"+index, context); - - if ($(".market_image_result:not(.success)", local_context).length > 0) { - img_obj = { - "image" : { - "NAME": $("input.name",local_context).val(), - "PATH": that.element['links']['download']['href']+'/'+index, - "TYPE": value['type'], - "MD5": value['md5'], - "SHA1": value['sha1'], - "DRIVER": value['driver'], - "DEV_PREFIX": value['dev_prefix'], - "FROM_APP": that.element['_id']["$oid"], - "FROM_APP_NAME": that.element['name'], - "FROM_APP_FILE": index - }, - "ds_id" : $("#market_img_datastore select", context).val() - }; - - OpenNebulaImage.create({ - timeout: true, - data: img_obj, - success: function (file_index, file_context){ - return function(request, response) { - $(".market_image_result", file_context).addClass("success").html( - ''+ - ''+ - ''+ - ''); - - $(".market_image_response", file_context).html( - '

'+ - Locale.tr("Image created successfully")+' ID:'+response.IMAGE.ID+ - '

'); - - that.images_information[file_index] = response; - - that.try_to_create_template(context); - }; - }(index, local_context), - error: function (request, error_json){ - $(".market_template_result", template_context).html(''); - - $(".market_image_result", local_context).html( - ''+ - ''+ - ''+ - ''); - - $(".market_image_response", local_context).html( - '

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

'); - - $("input", template_context).removeAttr("disabled"); - $("input", local_context).removeAttr("disabled"); - $("button", context).removeAttr("disabled"); - } - }); - } - }); - - that.try_to_create_template(context); - - return false; - }); - - return false; - } - - function _onShow(context) { - - return false; - } - - /** - * @param {object} params - * - params.element : Marketplace appliance as returned by a .show call - */ - function _setParams(params) { - this.element = params.element; - } - - - function _try_to_create_template(context){ - var that = this; - - var template_context = $("#market_import_file_template", context); - - var images_created = $(".market_image_result.success", context).length; - - if ((images_created == this.number_of_files) && !that.template_created) { - that.template_created = true; - - if (that.element['opennebula_template'] && that.element['opennebula_template'] !== "CPU=1") { - var vm_template; - try { - vm_template = JSON.parse( TemplateUtils.htmlDecode(that.element['opennebula_template']) ); - } catch (error) { - $(".market_template_result", template_context).html( - ''+ - ''+ - ''+ - ''); - - $(".market_template_response", template_context).html( - '

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

'); - - $("input", template_context).removeAttr("disabled"); - $("button", context).removeAttr("disabled"); - that.template_created = false; - return; - } - - if ($.isEmptyObject(vm_template.DISK)){ - vm_template.DISK = []; - } else if (!$.isArray(vm_template.DISK)){ - vm_template.DISK = [vm_template.DISK]; - } - - vm_template.NAME = $("input", template_context).val(); - if (!vm_template.CPU){ - vm_template.CPU = "1"; - } - if (!vm_template.MEMORY){ - vm_template.MEMORY = "1024"; - } - - $.each(that.images_information, function(image_index, image_info){ - if (!vm_template.DISK[image_index]) { - vm_template.DISK[image_index] = {}; - } - - vm_template.DISK[image_index].IMAGE = image_info.IMAGE.NAME; - vm_template.DISK[image_index].IMAGE_UNAME = image_info.IMAGE.UNAME; - }); - - vm_template.FROM_APP = that.element['_id']["$oid"]; - vm_template.FROM_APP_NAME = that.element['name']; - - OpenNebulaTemplate.create({ - timeout: true, - data: {vmtemplate: vm_template}, - success: function (request, response){ - $(".market_template_result", template_context).addClass("success").html( - ''+ - ''+ - ''+ - ''); - - $(".market_template_response", template_context).html( - '

'+ - Locale.tr("Template created successfully")+' ID:'+response.VMTEMPLATE.ID+ - '

'); - - $("button", context).hide(); - }, - error: function (request, error_json){ - $(".market_template_result", template_context).html( - ''+ - ''+ - ''+ - ''); - - $(".market_template_response", template_context).html( - '

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

'); - - $("input", template_context).removeAttr("disabled"); - $("button", context).removeAttr("disabled"); - that.template_created = false; - } - }); - } else { - $("button", context).hide(); - } - } - } - -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/content.hbs b/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/content.hbs deleted file mode 100644 index 8f652a06b2..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/content.hbs +++ /dev/null @@ -1,81 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - -
-
-

{{tr "The following images will be created in OpenNebula."}} {{tr "If you want to edit parameters of the image you can do it later in the images tab"}}

-
-
-
-
-
- -
-
-
-
-
-
-
-{{#each element.files}} -
-
-
- - {{#if name}} - - {{else}} - - {{/if}} -
-
-
-
-
-
-
-{{/each}} -{{#if element.opennebula_template}} -
-
-
-

{{tr "The following template will be created in OpenNebula and the previous images will be referenced in the disks"}} {{tr "If you want to edit parameters of the template you can do it later in the templates tab"}}

-
-
-
-
-
- - {{#if NAME}} - - {{else}} - - {{/if}} -
-
-
-
-
-
-
-{{/if}} diff --git a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/dialogId.js b/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/dialogId.js deleted file mode 100644 index 04947a6055..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/dialogId.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require){ - return 'importMarketplaceDialog'; -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/html.hbs b/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/html.hbs deleted file mode 100644 index 25315e0511..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/dialogs/import/html.hbs +++ /dev/null @@ -1,31 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - - diff --git a/src/sunstone/public/app/tabs/marketplace-tab/hooks/header.js b/src/sunstone/public/app/tabs/marketplace-tab/hooks/header.js deleted file mode 100644 index 334b1caefb..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/hooks/header.js +++ /dev/null @@ -1,43 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - - /* - CONSTANTS - */ - - var TAB_ID = require('../tabId'); - - /* - FUNCTION DEFINITIONS - */ - - function _pre(info, contextTabId) { - var element = info; - - $('.resource-id', '#' + TAB_ID).hide(); - $('.resource-info-header', '#' + TAB_ID).text(element.name); - } - - function _post(info, contextTabId) { - } - - return { - 'pre': _pre, - 'post': _post - }; -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/panels/info.js b/src/sunstone/public/app/tabs/marketplace-tab/panels/info.js deleted file mode 100644 index f32d8a35b5..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/panels/info.js +++ /dev/null @@ -1,77 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require) { - /* - DEPENDENCIES - */ - - var TemplateInfo = require('hbs!./info/html'); - var Locale = require('utils/locale'); - var Humanize = require('utils/humanize'); - var TemplateUtils = require('utils/template-utils'); - - /* - TEMPLATES - */ - - var TemplateTable = require('utils/panel/template-table'); - - /* - CONSTANTS - */ - - var PANEL_ID = require('./info/panelId'); - var RESOURCE = "Marketplace"; - var TAB_ID = require('../tabId'); - - /* - CONSTRUCTOR - */ - - function Panel(info) { - this.title = Locale.tr("Info"); - this.icon = "fa-info-circle"; - - this.element = info; - - return this; - } - - Panel.PANEL_ID = PANEL_ID; - Panel.prototype.html = _html; - Panel.prototype.setup = _setup; - - return Panel; - - /* - FUNCTION DEFINITIONS - */ - - function _html() { - var url = this.element.links.download.href; - url = url.replace(/\/download$/, ''); - - return TemplateInfo({ - 'element': this.element, - 'url': url - }); - } - - function _setup(context) { - return false; - } -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/panels/info/html.hbs b/src/sunstone/public/app/tabs/marketplace-tab/panels/info/html.hbs deleted file mode 100644 index 38a114c697..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/panels/info/html.hbs +++ /dev/null @@ -1,154 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2015, OpenNebula Project, OpenNebula Systems }} -{{! }} -{{! Licensed under the Apache License, Version 2.0 (the "License"); you may }} -{{! not use this file except in compliance with the License. You may obtain }} -{{! a copy of the License at }} -{{! }} -{{! http://www.apache.org/licenses/LICENSE-2.0 }} -{{! }} -{{! Unless required by applicable law or agreed to in writing, software }} -{{! distributed under the License is distributed on an "AS IS" BASIS, }} -{{! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. }} -{{! See the License for the specific language governing permissions and }} -{{! limitations under the License. }} -{{! -------------------------------------------------------------------------- }} - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - {{#if element.status}} - - - - - {{/if}} - {{#if element.tags}} - - - - - {{/if}} - {{#if element.catalog}} - - - - - {{/if}} - - - - - - - - - {{#if element.files}} - - - - - {{/if}} - - - - - - - - - -
{{tr "Information"}}
{{tr "ID"}}{{element._id.$oid}}
{{tr "Name"}}{{htmlDecode element.name}}
{{tr "URL"}} - {{tr "link"}} -
{{tr "Publisher"}}{{htmlDecode element.publisher}}
{{tr "Downloads"}}{{htmlDecode element.downloads}}
{{tr "Status"}}{{htmlDecode element.status}}
{{tr "Tags"}}{{htmlDecode element.tags}}
{{tr "Catalog"}}{{htmlDecode element.catalog}}
{{tr "OS"}}{{htmlDecode element.os-id}} {{htmlDecode element.os-release}}
{{tr "Arch"}}{{htmlDecode element.os-arch}}
{{tr "Size"}}{{humanizeSize "B" element.files.[0].size}}
{{tr "Hypervisor"}}{{htmlDecode element.hypervisor}}
{{tr "Format"}}{{htmlDecode element.format}}
-
-
- {{#if element.short_description}} - - - - - - - - - - - -
{{tr "Short Description"}}
- {{~htmlDecode element.short_description~}} -
- {{/if}} - - - - - - - - - - - -
{{tr "Description"}}
- {{~htmlDecode element.description~}} -
- - - - - - - - {{#each element.files}} - - - - - {{else}} - - - - {{/each}} - -
{{tr "Images"}}
{{htmlDecode name}}{{humanizeSize "B" size}}
{{tr "No Images defined"}}
- {{#if element.opennebula_template}} - - - - - - - - - - - -
{{tr "OpenNebula Template"}}
{{htmlDecode element.opennebula_template}}
- {{/if}} -
-
diff --git a/src/sunstone/public/app/tabs/marketplace-tab/panels/info/panelId.js b/src/sunstone/public/app/tabs/marketplace-tab/panels/info/panelId.js deleted file mode 100644 index 4ea290399b..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/panels/info/panelId.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require){ - return 'marketplace_info_tab'; -}); diff --git a/src/sunstone/public/app/tabs/marketplace-tab/tabId.js b/src/sunstone/public/app/tabs/marketplace-tab/tabId.js deleted file mode 100644 index 1a71ef113b..0000000000 --- a/src/sunstone/public/app/tabs/marketplace-tab/tabId.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); you may */ -/* not use this file except in compliance with the License. You may obtain */ -/* a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ -/* See the License for the specific language governing permissions and */ -/* limitations under the License. */ -/* -------------------------------------------------------------------------- */ - -define(function(require){ - return 'marketplace-tab'; -}); diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 42716690c8..af8065cb38 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -587,17 +587,6 @@ get '/vm/showback' do @SunstoneServer.get_vm_showback(params) end -############################################################################## -# Marketplace -############################################################################## -get '/marketplace' do - @SunstoneServer.get_appliance_pool -end - -get '/marketplace/:id' do - @SunstoneServer.get_appliance(params[:id]) -end - ############################################################################## # GET Pool information ##############################################################################