feature #4217: Remove deprecated Marketplace tab

This commit is contained in:
Daniel Molina committed 2016-02-02 17:46:56 +01:00
1 parent 4ef0e947a3
commit eeb4de945c
20 files changed
-1162

No files matched your search

@@ -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:
@@ -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:
-16
View File
@@ -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:
@@ -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
-4
View File
@@ -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
-1
View File
@@ -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',
@@ -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: '<i class="fa fa-lg fa-fw fa-shopping-cart"></i>&emsp;' + Locale.tr("Marketplace"),
listHeader: '<i class="fa fa-fw fa-shopping-cart"></i>&emsp;'+Locale.tr("OpenNebula Marketplace"),
infoHeader: '<i class="fa fa-fw fa-shopping-cart"></i>&emsp;'+Locale.tr("Appliance"),
subheader: '<span/> <small></small>&emsp;',
resource: 'Marketplace',
content: '<div class="row marketplace_error_message" hidden>\
<div class="small-6 columns small-centered text-center">\
<div class="alert-box alert radius">'+Locale.tr("Cannot connect to OpenNebula Marketplace")+'</div>\
</div>\
</div>',
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;
});
@@ -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;
});
@@ -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;
});
@@ -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 [
'<input class="check_item" type="checkbox" id="'+
RESOURCE.toLowerCase()+'_' +
element._id.$oid + '" name="selected_items" value="' +
element._id.$oid + '"/>',
element._id.$oid,
element.name,
publisher,
hypervisor,
arch,
format,
tags
];
}
});
@@ -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(
'<span class="fa-stack fa-2x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-spinner fa-spin fa-stack-1x fa-inverse"></i>'+
'</span>');
$(".market_template_result", context).html(
'<span class="fa-stack fa-2x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-spinner fa-spin fa-stack-1x fa-inverse"></i>'+
'</span>');
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(
'<span class="fa-stack fa-2x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-check fa-stack-1x fa-inverse"></i>'+
'</span>');
$(".market_image_response", file_context).html(
'<p style="font-size:12px" class="running-color">'+
Locale.tr("Image created successfully")+' ID:'+response.IMAGE.ID+
'</p>');
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(
'<span class="fa-stack fa-2x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-warning fa-stack-1x fa-inverse"></i>'+
'</span>');
$(".market_image_response", local_context).html(
'<p style="font-size:12px" class="error-color">'+
(error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?"))+
'</p>');
$("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(
'<span class="fa-stack fa-2x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-warning fa-stack-1x fa-inverse"></i>'+
'</span>');
$(".market_template_response", template_context).html(
'<p style="font-size:12px" class="error-color">'+
(error.message || Locale.tr("Cannot contact server: is it running and reachable?"))+
'</p>');
$("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(
'<span class="fa-stack fa-2x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-check fa-stack-1x fa-inverse"></i>'+
'</span>');
$(".market_template_response", template_context).html(
'<p style="font-size:12px" class="running-color">'+
Locale.tr("Template created successfully")+' ID:'+response.VMTEMPLATE.ID+
'</p>');
$("button", context).hide();
},
error: function (request, error_json){
$(".market_template_result", template_context).html(
'<span class="fa-stack fa-2x" style="color: #dfdfdf">'+
'<i class="fa fa-cloud fa-stack-2x"></i>'+
'<i class="fa fa-warning fa-stack-1x fa-inverse"></i>'+
'</span>');
$(".market_template_response", template_context).html(
'<p style="font-size:12px" class="error-color">'+
(error_json.error.message || Locale.tr("Cannot contact server: is it running and reachable?"))+
'</p>');
$("input", template_context).removeAttr("disabled");
$("button", context).removeAttr("disabled");
that.template_created = false;
}
});
} else {
$("button", context).hide();
}
}
}
});
@@ -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. }}
{{! -------------------------------------------------------------------------- }}
<div class="row">
<div class="large-12 columns">
<p style="font-size:14px">{{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"}} </p>
</div>
</div>
<div class="row">
<div class="large-10 large-centered columns">
<div class="large-10 columns">
<label for="market_img_datastore">{{tr "Select the datastore for the images"}}
</label>
<div id="market_img_datastore" name="market_img_datastore">
</div>
</div>
<div class="large-2 columns">
</div>
</div>
</div>
{{#each element.files}}
<div class="row" id="market_import_file_{{@index}}">
<div class="large-10 large-centered columns">
<div class="large-10 columns">
<label>
<i class="fa fa-fw fa-download"/>
&emsp;{{@index}} - {{tr "Image Name"}}
<span class="right">{{humanizeSize "B" size}}</span>
</label>
{{#if name}}
<input type="text" class="name" value="{{name}}"/>
{{else}}
<input type="text" class="name" value="{{element.name}}"/>
{{/if}}
</div>
<div class="large-2 columns market_image_result">
</div>
</div>
<div class="large-10 columns market_image_response">
</div>
</div>
{{/each}}
{{#if element.opennebula_template}}
<br>
<div class="row">
<div class="large-12 columns">
<p style="font-size:14px">{{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"}} </p>
</div>
</div>
<div class="row" id="market_import_file_template">
<div class="large-10 large-centered columns">
<div class="large-10 columns">
<label>
<i class="fa fa-fw fa-file-text-o"/>&emsp;{{tr "Template Name"}}
</label>
{{#if NAME}}
<input type="text" class="name" value="NAME"/>
{{else}}
<input type="text" class="name" value="{{element.name}}"/>
{{/if}}
</div>
<div class="large-2 columns market_template_result">
</div>
</div>
<div class="large-10 columns market_template_response">
</div>
</div>
{{/if}}
@@ -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';
});
@@ -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. }}
{{! -------------------------------------------------------------------------- }}
<div id="{{dialogId}}" class="reveal-modal medium" role="dialog" data-reveal >
<div class="row">
<h3 class="subheader">{{tr "Import Appliance"}}</h3>
</div>
<form data-abide="ajax" id="{{dialogId}}Form">
<div id="market_import_dialog_content">
</div>
<div class="form_buttons row">
<button type="submit" class="button radius right">
{{tr "Import"}}
</button>
</div>
<a class="close-reveal-modal">&#215;</a>
</form>
</div>
@@ -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
};
});
@@ -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;
}
});
@@ -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. }}
{{! -------------------------------------------------------------------------- }}
<div class="row">
<div class="large-6 columns">
<table class="dataTable">
<thead>
<tr><th colspan="2">{{tr "Information"}}</th></tr>
</thead>
<tbody>
<tr>
<td class="key_td">{{tr "ID"}}</td>
<td class="value_td">{{element._id.$oid}}</td>
</tr>
<tr>
<td class="key_td">{{tr "Name"}}</td>
<td class="value_td">{{htmlDecode element.name}}</td>
</tr>
<tr>
<td class="key_td">{{tr "URL"}}</td>
<td class="value_td">
<a href="{{url}}" target="_blank">{{tr "link"}}</a>
</td>
</tr>
<tr>
<td class="key_td">{{tr "Publisher"}}</td>
<td class="value_td">{{htmlDecode element.publisher}}</td>
</tr>
<tr>
<td class="key_td">{{tr "Downloads"}}</td>
<td class="value_td">{{htmlDecode element.downloads}}</td>
</tr>
{{#if element.status}}
<tr>
<td class="key_td">{{tr "Status"}}</td>
<td class="value_td">{{htmlDecode element.status}}</td>
</tr>
{{/if}}
{{#if element.tags}}
<tr>
<td class="key_td">{{tr "Tags"}}</td>
<td class="value_td">{{htmlDecode element.tags}}</td>
</tr>
{{/if}}
{{#if element.catalog}}
<tr>
<td class="key_td">{{tr "Catalog"}}</td>
<td class="value_td">{{htmlDecode element.catalog}}</td>
</tr>
{{/if}}
<tr>
<td class="key_td">{{tr "OS"}}</td>
<td class="value_td">{{htmlDecode element.os-id}} {{htmlDecode element.os-release}}</td>
</tr>
<tr>
<td class="key_td">{{tr "Arch"}}</td>
<td class="value_td">{{htmlDecode element.os-arch}}</td>
</tr>
{{#if element.files}}
<tr>
<td class="key_td">{{tr "Size"}}</td>
<td class="value_td">{{humanizeSize "B" element.files.[0].size}}</td>
</tr>
{{/if}}
<tr>
<td class="key_td">{{tr "Hypervisor"}}</td>
<td class="value_td">{{htmlDecode element.hypervisor}}</td>
</tr>
<tr>
<td class="key_td">{{tr "Format"}}</td>
<td class="value_td">{{htmlDecode element.format}}</td>
</tr>
</tbody>
</table>
</div>
<div class="large-6 columns">
{{#if element.short_description}}
<table class="dataTable">
<thead>
<tr>
<th colspan="2">{{tr "Short Description"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="value_td" style="white-space: pre-wrap;">
{{~htmlDecode element.short_description~}}
</td>
</tr>
</tbody>
</table>
{{/if}}
<table class="dataTable">
<thead>
<tr>
<th colspan="2">{{tr "Description"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="value_td" style="white-space: pre-wrap;">
{{~htmlDecode element.description~}}
</td>
</tr>
</tbody>
</table>
<table class="dataTable">
<thead>
<tr>
<th colspan="2">{{tr "Images"}}</th>
</tr>
</thead>
<tbody>
{{#each element.files}}
<tr>
<td class="value_td">{{htmlDecode name}}</td>
<td class="value_td">{{humanizeSize "B" size}}</td>
</tr>
{{else}}
<tr>
<td colspan="2" class="value_td">{{tr "No Images defined"}}</td>
</tr>
{{/each}}
</tbody>
</table>
{{#if element.opennebula_template}}
<table class="dataTable">
<thead>
<tr>
<th colspan="2">{{tr "OpenNebula Template"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="value_td"><pre>{{htmlDecode element.opennebula_template}}</pre></td>
</tr>
</tbody>
</table>
{{/if}}
</div>
</div>
@@ -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';
});
@@ -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';
});
-11
View File
@@ -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
##############################################################################