1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

Feature : Add MarketPlaceApp info panel

This commit is contained in:
Daniel Molina 2016-02-09 17:06:20 +01:00
parent 5acedb72ab
commit ebd1199f23
6 changed files with 182 additions and 5 deletions
src/sunstone
etc/sunstone-views
public/app/tabs

@ -608,8 +608,7 @@ tabs:
MarketPlace.delete: true
marketplaceapps-tab:
panel_tabs:
#marketplaces_info_tab: true
#marketplaces_apps_tab: true
marketplaceapp_info_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID

@ -603,8 +603,7 @@ tabs:
MarketPlace.delete: true
marketplaceapps-tab:
panel_tabs:
#marketplaces_info_tab: true
#marketplaces_apps_tab: true
marketplaceapp_info_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID

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

@ -0,0 +1,96 @@
/* -------------------------------------------------------------------------- */
/* 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 Humanize = require('utils/humanize');
var RenameTr = require('utils/panel/rename-tr');
var TemplateTable = require('utils/panel/template-table');
var PermissionsTable = require('utils/panel/permissions-table');
var OpenNebulaMarketPlaceApp = require('opennebula/marketplaceapp');
/*
TEMPLATES
*/
var TemplateInfo = require('hbs!./info/html');
/*
CONSTANTS
*/
var TAB_ID = require('../tabId');
var PANEL_ID = require('./info/panelId');
var RESOURCE = "MarketPlaceApp"
var XML_ROOT = "MARKETPLACEAPP"
/*
CONSTRUCTOR
*/
function Panel(info) {
this.title = Locale.tr("Info");
this.icon = "fa-info-circle";
this.element = info[XML_ROOT];
return this;
};
Panel.PANEL_ID = PANEL_ID;
Panel.prototype.html = _html;
Panel.prototype.setup = _setup;
return Panel;
/*
FUNCTION DEFINITIONS
*/
function _html() {
var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME);
var templateTableHTML = TemplateTable.html(
this.element.TEMPLATE, RESOURCE,
Locale.tr("Attributes"));
var permissionsTableHTML = PermissionsTable.html(TAB_ID, RESOURCE, this.element);
var stateStr = OpenNebulaMarketPlaceApp.stateStr(this.element.STATE);
var typeStr = OpenNebulaMarketPlaceApp.typeStr(this.element.TYPE);
var sizeStr = Humanize.sizeFromMB(this.element.SIZE);
return TemplateInfo({
'element': this.element,
'renameTrHTML': renameTrHTML,
'templateTableHTML': templateTableHTML,
'permissionsTableHTML': permissionsTableHTML,
'stateStr': stateStr,
'typeStr': typeStr,
'sizeStr': sizeStr
});
}
function _setup(context) {
RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context);
TemplateTable.setup(this.element.TEMPLATE, RESOURCE, this.element.ID, context);
PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context);
return false;
}
});

@ -0,0 +1,64 @@
{{! -------------------------------------------------------------------------- }}
{{! 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="3">{{tr "Information"}}</th>
</tr>
</thead>
<tbody>
<tr>
<td class="key_td">{{tr "ID"}}</td>
<td class="value_td" colspan="2">{{element.ID}}</td>
</tr>
{{{renameTrHTML}}}
<tr>
<td class="key_td">{{tr "MarketPlace"}}</td>
<td class="value_td">{{element.MARKETPLACE}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Register time"}}</td>
<td class="value_td">{{prettyRegTime}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Type"}}</td>
<td class="value_td">{{typeStr}}</td>
<td></td>
</tr>
<tr>
<td class="key_td">{{tr "Size"}}</td>
<td class="value_td" colspan="2">{{sizeStr}}</td>
</tr>
<tr>
<td class="key_td">{{tr "State"}}</td>
<td class="value_td">{{stateStr}}</td>
<td></td>
</tr>
</tbody>
</table>
</div>
<div class="large-6 columns">
{{{permissionsTableHTML}}}
</div>
</div>
<div class="row">
<div class="large-9 columns">{{{templateTableHTML}}}</div>
</div>

@ -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 'marketplaceapp_info_tab';
});