diff --git a/src/sunstone/public/app/tabs/datastores-tab.js b/src/sunstone/public/app/tabs/datastores-tab.js index 581460e92a..0655fdccfc 100644 --- a/src/sunstone/public/app/tabs/datastores-tab.js +++ b/src/sunstone/public/app/tabs/datastores-tab.js @@ -27,7 +27,7 @@ define(function(require) { resource: 'Datastore', buttons: Buttons, actions: Actions, - dataTable: new Table(DATATABLE_ID), + dataTable: new Table(DATATABLE_ID, {actions: true, info: true}), panels: _panels, dialogs: _dialogs }; diff --git a/src/sunstone/public/app/tabs/datastores-tab/datatable.js b/src/sunstone/public/app/tabs/datastores-tab/datatable.js index 704b0dfa76..013edba642 100644 --- a/src/sunstone/public/app/tabs/datastores-tab/datatable.js +++ b/src/sunstone/public/app/tabs/datastores-tab/datatable.js @@ -20,7 +20,8 @@ define(function(require) { CONSTRUCTOR */ - function Table(dataTableId) { + function Table(dataTableId, conf) { + this.conf = conf || {}; this.dataTableId = dataTableId; this.resource = RESOURCE; diff --git a/src/sunstone/public/app/tabs/images-tab.js b/src/sunstone/public/app/tabs/images-tab.js index b2b70cd2fe..e8d35cd655 100644 --- a/src/sunstone/public/app/tabs/images-tab.js +++ b/src/sunstone/public/app/tabs/images-tab.js @@ -27,7 +27,7 @@ define(function(require) { content: '
', buttons: Buttons, actions: Actions, - dataTable: new Table(DATATABLE_ID), + dataTable: new Table(DATATABLE_ID, {actions: true, info: true}), //panels: _panels, //dialogs: _dialogs }; diff --git a/src/sunstone/public/app/tabs/images-tab/datatable.js b/src/sunstone/public/app/tabs/images-tab/datatable.js index e4fdac2098..f93b9355e2 100644 --- a/src/sunstone/public/app/tabs/images-tab/datatable.js +++ b/src/sunstone/public/app/tabs/images-tab/datatable.js @@ -4,9 +4,10 @@ define(function(require) { */ var TabDataTable = require('utils/tab-datatable'); - var Locale = require('utils/locale'); var SunstoneConfig = require('sunstone-config'); + var Locale = require('utils/locale'); var Humanize = require('utils/humanize'); + var Notifier = require('utils/notifier'); var OpenNebulaImage = require('opennebula/image'); /* @@ -15,12 +16,16 @@ define(function(require) { var RESOURCE = "Image" var TAB_NAME = require('./tabId'); - + var COLUMN_IDS = { + "DATASTORE": 5 + } /* CONSTRUCTOR */ - function Table(dataTableId) { + function Table(dataTableId, conf, tabId) { + this.conf = conf || {}; + this.tabId = tabId; this.dataTableId = dataTableId; this.resource = RESOURCE; @@ -58,6 +63,8 @@ define(function(require) { Table.prototype = Object.create(TabDataTable.prototype); Table.prototype.constructor = Table; Table.prototype.elementArray = _elementArray; + Table.prototype.list = _list; + Table.COLUMN_IDS = COLUMN_IDS; return Table; @@ -89,4 +96,14 @@ define(function(require) { element.TEMPLATE.TARGET ? element.TEMPLATE.TARGET : '--' ]; } + + function _list(){ + var that = this; + OpenNebulaImage.list({ + success: function(req, resp) { + that.updateView(req, resp); + }, + error: Notifier.onError + }); + } }); \ No newline at end of file