From 34b80d57125dfe12544d1c765dcf1f941cc8f965 Mon Sep 17 00:00:00 2001 From: Sergio Betanzos Date: Fri, 26 Mar 2021 14:59:40 +0100 Subject: [PATCH] M #~: Remove preview layout images (#1034) --- src/sunstone/public/app/tabs/dashboard-tab.js | 3 - src/sunstone/public/app/tabs/groups-tab.js | 3 +- .../app/tabs/groups-tab/dialogs/image.js | 84 ------------- .../tabs/groups-tab/dialogs/image/dialogId.js | 19 --- .../tabs/groups-tab/dialogs/image/html.hbs | 30 ----- .../app/tabs/groups-tab/form-panels/create.js | 29 +---- .../groups-tab/form-panels/create/wizard.hbs | 119 +++++++++--------- .../public/app/tabs/groups-tab/utils/views.js | 32 +---- src/sunstone/public/app/tabs/hosts-tab.js | 5 - .../public/app/utils/info-connection/info.hbs | 26 ++-- .../public/images/advanced_layout.png | Bin 97585 -> 0 bytes src/sunstone/public/images/cloud_layout.png | Bin 179120 -> 0 bytes src/sunstone/public/images/vcenter_layout.png | Bin 246475 -> 0 bytes 13 files changed, 79 insertions(+), 271 deletions(-) delete mode 100644 src/sunstone/public/app/tabs/groups-tab/dialogs/image.js delete mode 100644 src/sunstone/public/app/tabs/groups-tab/dialogs/image/dialogId.js delete mode 100644 src/sunstone/public/app/tabs/groups-tab/dialogs/image/html.hbs delete mode 100644 src/sunstone/public/images/advanced_layout.png delete mode 100644 src/sunstone/public/images/cloud_layout.png delete mode 100644 src/sunstone/public/images/vcenter_layout.png diff --git a/src/sunstone/public/app/tabs/dashboard-tab.js b/src/sunstone/public/app/tabs/dashboard-tab.js index 9037617828..1a57e63b76 100644 --- a/src/sunstone/public/app/tabs/dashboard-tab.js +++ b/src/sunstone/public/app/tabs/dashboard-tab.js @@ -18,9 +18,6 @@ define(function(require) { var Locale = require('utils/locale'); var Config = require('sunstone-config'); var Sunstone = require('sunstone'); - var Notifier = require('utils/notifier'); - var OpenNebulaVM = require('opennebula/vm'); - var Accounting = require('utils/accounting'); var OpenNebula = require('opennebula'); var QuotaWidgets = require('utils/quotas/quota-widgets'); var QuotaDefaults = require('utils/quotas/quota-defaults'); diff --git a/src/sunstone/public/app/tabs/groups-tab.js b/src/sunstone/public/app/tabs/groups-tab.js index 0601bd0488..a22e1a671b 100644 --- a/src/sunstone/public/app/tabs/groups-tab.js +++ b/src/sunstone/public/app/tabs/groups-tab.js @@ -24,8 +24,7 @@ define(function(require) { var DATATABLE_ID = "dataTableGroups"; var _dialogs = [ - require('./groups-tab/dialogs/quotas'), - require('./groups-tab/dialogs/image') + require('./groups-tab/dialogs/quotas') ]; var _panels = [ diff --git a/src/sunstone/public/app/tabs/groups-tab/dialogs/image.js b/src/sunstone/public/app/tabs/groups-tab/dialogs/image.js deleted file mode 100644 index f8f1ec6d89..0000000000 --- a/src/sunstone/public/app/tabs/groups-tab/dialogs/image.js +++ /dev/null @@ -1,84 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2021, 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 BaseDialog = require('utils/dialogs/dialog'); - var TemplateHTML = require('hbs!./image/html'); - var Locale = require('utils/locale'); - - /* - CONSTANTS - */ - - var DIALOG_ID = require('./image/dialogId'); - var TAB_ID = require('../tabId'); - var RESOURCE = "Group"; - var XML_ROOT = "GROUP"; - - /* - CONSTRUCTOR - */ - - function Dialog() { - this.dialogId = DIALOG_ID; - - this.element = undefined; - - BaseDialog.call(this); - } - - Dialog.DIALOG_ID = DIALOG_ID; - Dialog.prototype = Object.create(BaseDialog.prototype); - Dialog.prototype.constructor = Dialog; - Dialog.prototype.html = _html; - Dialog.prototype.onShow = _onShow; - Dialog.prototype.setup = _setup; - Dialog.prototype.setParams = _setParams; - - return Dialog; - - /* - FUNCTION DEFINITIONS - */ - - function _html() { - return TemplateHTML({ - 'dialogId': this.dialogId, - 'element': this.element - }); - } - - function _setup(context) { - var that = this; - return false; - } - - /** - * @param {object} params - * - params.element : group object, or empty object {} - */ - function _setParams(params) { - this.element = params.element; - } - - function _onShow(context) { - return false; - } -}); diff --git a/src/sunstone/public/app/tabs/groups-tab/dialogs/image/dialogId.js b/src/sunstone/public/app/tabs/groups-tab/dialogs/image/dialogId.js deleted file mode 100644 index 507cd2042b..0000000000 --- a/src/sunstone/public/app/tabs/groups-tab/dialogs/image/dialogId.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -------------------------------------------------------------------------- */ -/* Copyright 2002-2021, 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 'groupImagesDialog'; -}); diff --git a/src/sunstone/public/app/tabs/groups-tab/dialogs/image/html.hbs b/src/sunstone/public/app/tabs/groups-tab/dialogs/image/html.hbs deleted file mode 100644 index f522b3af08..0000000000 --- a/src/sunstone/public/app/tabs/groups-tab/dialogs/image/html.hbs +++ /dev/null @@ -1,30 +0,0 @@ -{{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2021, 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. }} -{{! -------------------------------------------------------------------------- }} - - diff --git a/src/sunstone/public/app/tabs/groups-tab/form-panels/create.js b/src/sunstone/public/app/tabs/groups-tab/form-panels/create.js index 5c030032e7..8252b42052 100644 --- a/src/sunstone/public/app/tabs/groups-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/groups-tab/form-panels/create.js @@ -40,7 +40,6 @@ define(function(require) { var FORM_PANEL_ID = require('./create/formPanelId'); var TAB_ID = require('../tabId'); - var IMAGE_DIALOG_ID = require('../dialogs/image/dialogId'); /* CONSTRUCTOR @@ -86,7 +85,6 @@ define(function(require) { var filtered_views = { cloud : [], advanced : [], - vcenter : [], other : [] }; @@ -101,9 +99,6 @@ define(function(require) { case 'cloud': filtered_views.cloud.push(view_info); break; - case 'vcenter': - filtered_views.vcenter.push(view_info); - break; default: filtered_views.other.push({ id: view_id, @@ -127,17 +122,12 @@ define(function(require) { $.each(filtered_views, function(view_type, views){ if (views.length > 0) { - var link = ""; - if(Views.types[view_type].preview){ - link = Views.types[view_type].preview.split(".")[0] - } viewTypes.push( { 'name': Views.types[view_type].name, 'description': Views.types[view_type].description, 'preview': Views.types[view_type].preview, - 'views': views, - 'link': link + 'views': views }); } }); @@ -199,23 +189,6 @@ define(function(require) { _generateViewsSelect(context, "admin", "groupadmin"); _generateViewsSelect(context, "user", "cloud"); } - - $.each(this.filtered_views, function(view_type, views){ - if (views.length > 0) { - if(Views.types[view_type].preview){ - $("#link_"+Views.types[view_type].preview.split(".")[0], context).on("click", function(){ - Sunstone.getDialog(IMAGE_DIALOG_ID).setParams({element: { - "preview":Views.types[view_type].preview, - "name": Views.types[view_type].name}}); - Sunstone.getDialog(IMAGE_DIALOG_ID).reset(); - Sunstone.getDialog(IMAGE_DIALOG_ID).show(); - }); - } - else{ - $("#link_", context).hide(); - } - } - }); } function _submitWizard(context) { diff --git a/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs index 7bbafa34b8..14d5146e8a 100644 --- a/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/groups-tab/form-panels/create/wizard.hbs @@ -17,7 +17,7 @@
- {{tr "New Groups are automatically added to the default VDC"}} + {{tr "New Groups are automatically added to the default VDC"}}
@@ -56,7 +56,7 @@ + @@ -65,7 +65,7 @@

{{tr "Allow users in this group to use the following Sunstone views"}} -   +   {{tr "Not required. Defaults to the one set in sunstone-views.yaml"}} @@ -90,10 +90,9 @@

{{name}} - {{#if description}} + {{#if description}} {{description}} {{/if}} - {{tr "Image"}}
@@ -105,26 +104,23 @@ {{/each}}
{{name}} {{tr "View"}} - {{#if description}} + {{#if description}} {{description}} {{/if}} - + - +
-
{{/each}} +
{{/each}} +
@@ -146,41 +142,42 @@
-
- - {{tr "Image & Datastore"}} - -
-
- {{tr "Make new images persistent by default"}} - - {{tr "Control the default value for the PERSISTENT attribute on image creation (oneimage create)."}} - -
-
- -
+
+ + {{tr "Image & Datastore"}} + +
+
+ {{tr "Make new images persistent by default"}} + + {{tr "Control the default value for the PERSISTENT attribute on image creation (oneimage create)."}} +
-
-
- {{tr "Make save-as and clone images persistent by default"}} - - {{tr "Control the default value for the PERSISTENT attribute on image creation (oneimage clone, onevm disk-saveas). If blank images will inherit the persistent attribute from the base image."}} - -
-
- -
+
+
-
+
+
+
+ {{tr "Make save-as and clone images persistent by default"}} + + {{tr "Control the default value for the PERSISTENT attribute on image creation (oneimage clone, onevm + disk-saveas). If blank images will inherit the persistent attribute from the base image."}} + +
+
+ +
+
+
@@ -189,7 +186,8 @@ {{tr "Allow users to view the VMs and Services of other users in the same group"}} - {{tr "An ACL Rule will be created to give users in this group access to all the resources in the same group."}} + {{tr "An ACL Rule will be created to give users in this group access to all the resources in the same + group."}}
@@ -198,9 +196,10 @@

{{tr "Allow users in this group to create the following resources"}} -   +   - {{tr "This will create new ACL Rules to define which virtual resources this group's users will be able to create."}} + {{tr "This will create new ACL Rules to define which virtual resources this group's users will be able to + create."}}

@@ -219,7 +218,8 @@ {{tr "Documents"}} - {{tr "Documents are a special tool used for general purposes, mainly by OneFlow. If you want to enable users of this group to use service composition via OneFlow, let it checked."}} + {{tr "Documents are a special tool used for general purposes, mainly by OneFlow. If you want to + enable users of this group to use service composition via OneFlow, let it checked."}} @@ -227,27 +227,30 @@ - + - + - + - + - + - + - + - + diff --git a/src/sunstone/public/app/tabs/groups-tab/utils/views.js b/src/sunstone/public/app/tabs/groups-tab/utils/views.js index 9f2d63901b..fb5f928dc9 100644 --- a/src/sunstone/public/app/tabs/groups-tab/utils/views.js +++ b/src/sunstone/public/app/tabs/groups-tab/utils/views.js @@ -20,23 +20,15 @@ define(function(require) { var _view_types = { advanced : { name: 'Advanced Layout', - description : Locale.tr("Exposes a complete view of the cloud, allowing administrators and advanced users full control of any physical or virtual resource."), - preview: "advanced_layout.png" + description : Locale.tr("Exposes a complete view of the cloud, allowing administrators and advanced users full control of any physical or virtual resource.") }, cloud : { name: 'Cloud Layout', - description : Locale.tr("Simplified version of the cloud allowing group admins and cloud end-users to manage any virtual resource."), - preview: "cloud_layout.png" - }, - vcenter : { - name: 'vCenter Layout', - description : Locale.tr("Set of views to present valid operations over a vCenter infrastructure"), - preview: "vcenter_layout.png" + description : Locale.tr("Simplified version of the cloud allowing group admins and cloud end-users to manage any virtual resource.") }, other : { name: 'Other Layouts', - description : '', - preview: null + description : '' } }; @@ -64,24 +56,6 @@ define(function(require) { name: "Cloud", description: Locale.tr("Simplified view mainly where users can provision new Virtual Machines easily from pre-defined Templates."), type: "cloud" - }, - admin_vcenter : { - id: 'admin_vcenter', - name: "Admin vCenter", - description: Locale.tr("View designed to present the valid operations over a vCenter infrastructure to a cloud administrator"), - type: "vcenter" - }, - groupadmin_vcenter : { - id: 'groupadmin_vcenter', - name: "Group Admin vCenter", - description: Locale.tr("View designed to present the valid operations over a vCenter infrastructure to a group administrator"), - type: "vcenter" - }, - cloud_vcenter : { - id: 'cloud_vcenter', - name: "Cloud vCenter", - description: Locale.tr("View designed to present the valid operations over a vCenter infrastructure to a cloud consumer"), - type: "vcenter" } }; diff --git a/src/sunstone/public/app/tabs/hosts-tab.js b/src/sunstone/public/app/tabs/hosts-tab.js index 6b4f4eeaeb..05dc61bd1c 100644 --- a/src/sunstone/public/app/tabs/hosts-tab.js +++ b/src/sunstone/public/app/tabs/hosts-tab.js @@ -23,11 +23,6 @@ define(function(require) { var TAB_ID = require('./hosts-tab/tabId'); var DATATABLE_ID = "dataTableHosts"; - //var _dialogs = [ - // require('./hosts-tab/dialogs/create'), - // require('./hosts-tab/dialogs/clone') - //]; - var _panels = [ require('./hosts-tab/panels/info'), require('./hosts-tab/panels/monitor'), diff --git a/src/sunstone/public/app/utils/info-connection/info.hbs b/src/sunstone/public/app/utils/info-connection/info.hbs index e80d5555ea..d7f7228ad6 100644 --- a/src/sunstone/public/app/utils/info-connection/info.hbs +++ b/src/sunstone/public/app/utils/info-connection/info.hbs @@ -1,17 +1,17 @@ {{! -------------------------------------------------------------------------- }} -{{! Copyright 2002-2021, 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. }} +{{! Copyright 2002-2021, 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. }} {{! -------------------------------------------------------------------------- }}