1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

Feature #4217: Add MarketPlace apps panel

This commit is contained in:
Daniel Molina 2016-02-09 16:39:10 +01:00
parent 56aada8d2c
commit b8705a5496
5 changed files with 110 additions and 3 deletions

View File

@ -586,7 +586,7 @@ tabs:
marketplaces-tab: marketplaces-tab:
panel_tabs: panel_tabs:
marketplace_info_tab: true marketplace_info_tab: true
#marketplaces_apps_tab: true marketplace_apps_tab: true
table_columns: table_columns:
- 0 # Checkbox - 0 # Checkbox
- 1 # ID - 1 # ID

View File

@ -581,7 +581,7 @@ tabs:
marketplaces-tab: marketplaces-tab:
panel_tabs: panel_tabs:
marketplace_info_tab: true marketplace_info_tab: true
#marketplaces_apps_tab: true marketplaces_app_tab: true
table_columns: table_columns:
- 0 # Checkbox - 0 # Checkbox
- 1 # ID - 1 # ID

View File

@ -27,7 +27,8 @@ define(function(require) {
]; ];
var _panels = [ var _panels = [
require('./marketplaces-tab/panels/info') require('./marketplaces-tab/panels/info'),
require('./marketplaces-tab/panels/apps')
]; ];
var _panelsHooks = [ var _panelsHooks = [

View File

@ -0,0 +1,87 @@
/* -------------------------------------------------------------------------- */
/* 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 Locale = require('utils/locale');
var MarketPlaceAppsTable = require('tabs/marketplaceapps-tab/datatable');
/*
CONSTANTS
*/
var PANEL_ID = require('./apps/panelId');
var MARKETPLACEAPPS_TABLE_ID = PANEL_ID + "MarketPlaceAppsTable"
var XML_ROOT = "MARKETPLACE"
/*
CONSTRUCTOR
*/
function Panel(info) {
this.title = Locale.tr("Apps");
this.icon = "fa-shopping-cart";
this.element = info[XML_ROOT.toUpperCase()];
return this;
};
Panel.PANEL_ID = PANEL_ID;
Panel.prototype.html = _html;
Panel.prototype.setup = _setup;
return Panel;
/*
FUNCTION DEFINITIONS
*/
function _html() {
var marketPlaceApps = [];
if (this.element.MARKETPLACEAPPS.ID != undefined){
marketPlaceApps = this.element.MARKETPLACEAPPS.ID;
if (!$.isArray(marketPlaceApps)){
marketPlaceApps = [marketPlaceApps];
}
}
var opts = {
info: true,
select: true,
selectOptions: {
read_only: true,
fixed_ids: marketPlaceApps
}
};
this.marketPlaceAppsDataTable = new MarketPlaceAppsTable(MARKETPLACEAPPS_TABLE_ID, opts);
return this.marketPlaceAppsDataTable.dataTableHTML;
}
function _setup(context) {
this.marketPlaceAppsDataTable.initialize();
this.marketPlaceAppsDataTable.refreshResourceTableSelect();
return false;
}
})

View File

@ -0,0 +1,19 @@
/* -------------------------------------------------------------------------- */
/* 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_apps_tab';
});