\ No newline at end of file
diff --git a/src/sunstone/public/app/utils/vcenter/networks/html.hbs b/src/sunstone/public/app/utils/vcenter/common/empty-fieldset.hbs
similarity index 84%
rename from src/sunstone/public/app/utils/vcenter/networks/html.hbs
rename to src/sunstone/public/app/utils/vcenter/common/empty-fieldset.hbs
index de44dbe7fe..a17a96a94e 100644
--- a/src/sunstone/public/app/utils/vcenter/networks/html.hbs
+++ b/src/sunstone/public/app/utils/vcenter/common/empty-fieldset.hbs
@@ -14,9 +14,17 @@
{{! limitations under the License. }}
{{! -------------------------------------------------------------------------- }}
-
-
-
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/utils/vcenter/common/fieldset-table.hbs b/src/sunstone/public/app/utils/vcenter/common/fieldset-table.hbs
new file mode 100644
index 0000000000..1f91ce7326
--- /dev/null
+++ b/src/sunstone/public/app/utils/vcenter/common/fieldset-table.hbs
@@ -0,0 +1,67 @@
+{{! -------------------------------------------------------------------------- }}
+{{! Copyright 2002-2016, 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. }}
+{{! -------------------------------------------------------------------------- }}
+
+
+
\ No newline at end of file
diff --git a/src/sunstone/public/app/utils/vcenter/clusters/html.hbs b/src/sunstone/public/app/utils/vcenter/common/html.hbs
similarity index 100%
rename from src/sunstone/public/app/utils/vcenter/clusters/html.hbs
rename to src/sunstone/public/app/utils/vcenter/common/html.hbs
diff --git a/src/sunstone/public/app/utils/vcenter/datastores.js b/src/sunstone/public/app/utils/vcenter/datastores.js
index c47da4e137..7232a3bbd8 100644
--- a/src/sunstone/public/app/utils/vcenter/datastores.js
+++ b/src/sunstone/public/app/utils/vcenter/datastores.js
@@ -22,15 +22,19 @@ define(function(require) {
var DomDataTable = require('utils/dom-datatable');
var Notifier = require('utils/notifier');
var UniqueId = require('utils/unique-id');
+ var VCenterCommon = require('./vcenter-common');
- var TemplateHTML = require('hbs!./datastores/html');
+ var TemplateHTML = require('hbs!./common/html');
+ var RowTemplate = require('hbs!./datastores/row');
+ var EmptyFieldsetHTML = require('hbs!./common/empty-fieldset');
+ var FieldsetTableHTML = require('hbs!./common/fieldset-table');
function VCenterDatastores() {
return this;
}
VCenterDatastores.prototype = {
- 'html': _html,
+ 'html': VCenterCommon.html,
'insert': _fillVCenterDatastores,
'import': _import
};
@@ -38,10 +42,6 @@ define(function(require) {
return VCenterDatastores;
- function _html() {
- return '';
- }
-
/*
Retrieve the list of Datastores from vCenter and fill the container with them
@@ -60,7 +60,6 @@ define(function(require) {
var context = $(".vcenter_import", opts.container);
context.html( TemplateHTML({}) );
-
context.show();
$.ajax({
@@ -79,85 +78,33 @@ define(function(require) {
$.each(response, function(datacenter_name, elements){
var content;
if (elements.length == 0) {
- content =
- '';
+ content = EmptyFieldsetHTML({
+ title : datacenter_name + ' ' + Locale.tr("DataCenter"),
+ message : Locale.tr("No new datastores found in this DataCenter")
+ });
$(".vcenter_datacenter_list", context).append(content);
} else {
var tableId = "vcenter_import_table" + UniqueId.id();
- content =
- '';
+ content = FieldsetTableHTML({
+ tableId : tableId,
+ title : datacenter_name + ' ' + Locale.tr("DataCenter"),
+ clearImported : Locale.tr("Clear Imported Datastores"),
+ toggleAdvanced : false,
+ columns : [
+ '',
+ Locale.tr("Name"),
+ Locale.tr("Datacenter"),
+ ""
+ ]
+ });
var newdiv = $(content).appendTo($(".vcenter_datacenter_list", context));
var tbody = $('#' + tableId + ' tbody', context);
$.each(elements, function(id, element){
- var trow = $(
- '