From 1771ee42369d203cc39062621388bf60ee9dcd66 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 9 Jun 2015 19:01:36 +0200 Subject: [PATCH] feature #3748: Add template panel --- src/sunstone/public/app/tabs/vms-tab.js | 3 +- .../app/tabs/vms-tab/panels/template.js | 53 +++++++++++++++++++ .../tabs/vms-tab/panels/template/panelId.js | 3 ++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/sunstone/public/app/tabs/vms-tab/panels/template.js create mode 100644 src/sunstone/public/app/tabs/vms-tab/panels/template/panelId.js diff --git a/src/sunstone/public/app/tabs/vms-tab.js b/src/sunstone/public/app/tabs/vms-tab.js index cbaa7d4833..8db2673028 100644 --- a/src/sunstone/public/app/tabs/vms-tab.js +++ b/src/sunstone/public/app/tabs/vms-tab.js @@ -24,7 +24,8 @@ define(function(require) { require('./vms-tab/panels/snapshots'), require('./vms-tab/panels/placement'), require('./vms-tab/panels/actions'), - // require('./vms-tab/panels/template') + require('./vms-tab/panels/template'), + require('./vms-tab/panels/log') ]; var _formPanels = [ diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/template.js b/src/sunstone/public/app/tabs/vms-tab/panels/template.js new file mode 100644 index 0000000000..a438251c27 --- /dev/null +++ b/src/sunstone/public/app/tabs/vms-tab/panels/template.js @@ -0,0 +1,53 @@ +define(function(require) { + /* + DEPENDENCIES + */ + + var Locale = require('utils/locale'); + var Humanize = require('utils/humanize'); + + /* + CONSTANTS + */ + + var TAB_ID = require('../tabId'); + var PANEL_ID = require('./template/panelId'); + var RESOURCE = "VM" + var XML_ROOT = "VM" + + /* + CONSTRUCTOR + */ + + function Panel(info) { + this.title = Locale.tr("Template"); + this.icon = "fa-file-o"; + + 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() { + return '
\ +
\ + ' + + Humanize.prettyPrintJSON(this.element.TEMPLATE) + + '
\ +
\ +
' + } + + function _setup(context) { + } +}); diff --git a/src/sunstone/public/app/tabs/vms-tab/panels/template/panelId.js b/src/sunstone/public/app/tabs/vms-tab/panels/template/panelId.js new file mode 100644 index 0000000000..7dbf23c05f --- /dev/null +++ b/src/sunstone/public/app/tabs/vms-tab/panels/template/panelId.js @@ -0,0 +1,3 @@ +define(function(require){ + return 'vm_template_tab'; +}); \ No newline at end of file