From 1bb0136c8e9575e7113cd38d44effbc02a8127e3 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 16 Apr 2013 12:41:04 -0700 Subject: [PATCH 1/7] Add granular settings widget --- ui/index.jsp | 1 + ui/scripts/ui-custom/granularSettings.js | 46 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 ui/scripts/ui-custom/granularSettings.js diff --git a/ui/index.jsp b/ui/index.jsp index 46f49f00984..ce1183d4924 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -1647,6 +1647,7 @@ under the License. + diff --git a/ui/scripts/ui-custom/granularSettings.js b/ui/scripts/ui-custom/granularSettings.js new file mode 100644 index 00000000000..02d5c1fcbaa --- /dev/null +++ b/ui/scripts/ui-custom/granularSettings.js @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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. + +(function($, cloudStack) { + cloudStack.uiCustom.granularSettings = function(args) { + var dataProvider = args.dataProvider; + var actions = args.actions; + + return function(args) { + var context = args.context; + + var listView = { + id: 'settings', + fields: { + name: { label: 'label.name' }, + value: { label: 'label.value', editable: true } + }, + actions: { + edit: { + label: 'label.change.value', + action: actions.edit + } + }, + dataProvider: dataProvider + }; + + var $listView = $('
').listView({ context: context, listView: listView }); + + return $listView; + } + }; +}(jQuery, cloudStack)); From 019e8cd0ff8fe45d0e867a42e9643c8b571c1725 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 16 Apr 2013 12:41:20 -0700 Subject: [PATCH 2/7] Add zone-level granular settings UI --- ui/scripts/system.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index a9054125774..11ae1f20e47 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -5381,6 +5381,28 @@ } } } + }, + + // Granular settings for zone + settings: { + title: 'label.menu.global.settings', + custom: cloudStack.uiCustom.granularSettings({ + dataProvider: function(args) { + args.response.success({ + data: [ + { name: 'config.param.1', value: 1 }, + { name: 'config.param.2', value: 2 } + ] + }); + }, + actions: { + edit: function(args) { + debugger; + // call updateZoneLevelParamter + args.response.success(); + } + } + }) } } } From 59d0541bac54b805dc80ef575dea097d8314a849 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 16 Apr 2013 12:46:23 -0700 Subject: [PATCH 3/7] Add cluster-level parameters --- ui/scripts/system.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 11ae1f20e47..2a18eed1f42 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -5397,7 +5397,6 @@ }, actions: { edit: function(args) { - debugger; // call updateZoneLevelParamter args.response.success(); } @@ -8800,6 +8799,27 @@ }); } } + }, + + // Granular settings for cluster + settings: { + title: 'label.menu.global.settings', + custom: cloudStack.uiCustom.granularSettings({ + dataProvider: function(args) { + args.response.success({ + data: [ + { name: 'config.param.1', value: 1 }, + { name: 'config.param.2', value: 2 } + ] + }); + }, + actions: { + edit: function(args) { + // call updateClusterLevelParameters + args.response.success(); + } + } + }) } } } From e8295dd4b0fe40134824a1c971aae63579505e44 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 16 Apr 2013 12:46:44 -0700 Subject: [PATCH 4/7] Add primary storage-level parameters UI --- ui/scripts/system.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 2a18eed1f42..46dd6045840 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -10439,6 +10439,27 @@ } }); } + }, + + // Granular settings for storage pool + settings: { + title: 'label.menu.global.settings', + custom: cloudStack.uiCustom.granularSettings({ + dataProvider: function(args) { + args.response.success({ + data: [ + { name: 'config.param.1', value: 1 }, + { name: 'config.param.2', value: 2 } + ] + }); + }, + actions: { + edit: function(args) { + // call updateStorageLevelParameters + args.response.success(); + } + } + }) } } } From 9130cd04995a0262bde5347c5a7f750fa33615ba Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 16 Apr 2013 12:46:58 -0700 Subject: [PATCH 5/7] Add seondary storage-level parameters UI --- ui/scripts/system.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 46dd6045840..23822b26972 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -10653,6 +10653,27 @@ } }); } + }, + + // Granular settings for storage pool + settings: { + title: 'label.menu.global.settings', + custom: cloudStack.uiCustom.granularSettings({ + dataProvider: function(args) { + args.response.success({ + data: [ + { name: 'config.param.1', value: 1 }, + { name: 'config.param.2', value: 2 } + ] + }); + }, + actions: { + edit: function(args) { + // call updateStorageLevelParameters + args.response.success(); + } + } + }) } } } From ad38060e3a9fd45dda7de4fd10450b116db2283a Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 16 Apr 2013 12:47:08 -0700 Subject: [PATCH 6/7] Add account-level parameter UI --- ui/scripts/accounts.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 8353d70536e..e663db856bf 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -895,6 +895,27 @@ } }); } + }, + + // Granular settings for account + settings: { + title: 'label.menu.global.settings', + custom: cloudStack.uiCustom.granularSettings({ + dataProvider: function(args) { + args.response.success({ + data: [ + { name: 'config.param.1', value: 1 }, + { name: 'config.param.2', value: 2 } + ] + }); + }, + actions: { + edit: function(args) { + // call updateAccountLevelParameters + args.response.success(); + } + } + }) } } } From b54f643b91a144e5f67dd21e8d49e8ee8f7a69a5 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 16 Apr 2013 12:51:07 -0700 Subject: [PATCH 7/7] Always maximize detail views with settings tab (to fit listView layout) --- ui/scripts/accounts.js | 1 + ui/scripts/system.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index e663db856bf..cea748d2305 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -277,6 +277,7 @@ detailView: { name: 'Account details', + isMaximized: true, viewAll: { path: 'accounts.users', label: 'label.users' }, actions: { diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 23822b26972..d44a6944ad7 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -10255,6 +10255,7 @@ detailView: { name: "Primary storage details", + isMaximized: true, actions: { edit: { label: 'label.edit', @@ -10598,6 +10599,7 @@ detailView: { name: 'Secondary storage details', + isMaximized: true, actions: { remove: { label: 'label.action.delete.secondary.storage' ,