You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2013/04/15 23:56:48 UTC
[1/2] git commit: updated refs/heads/ui-vm-affinity to 5d235f6
Updated Branches:
refs/heads/ui-vm-affinity 106961017 -> 5d235f690
Update affinity UI labels
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/38ca7373
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/38ca7373
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/38ca7373
Branch: refs/heads/ui-vm-affinity
Commit: 38ca7373187cd1d18bd84d4aec6ebfbf7fd5f97f
Parents: 1069610
Author: Brian Federle <br...@citrix.com>
Authored: Mon Apr 15 14:56:23 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Apr 15 14:56:23 2013 -0700
----------------------------------------------------------------------
.../WEB-INF/classes/resources/messages.properties | 4 ++++
ui/dictionary.jsp | 14 +++++++++-----
2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38ca7373/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index abd1e30..349ca2e 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -17,6 +17,10 @@
#new labels (begin) **********************************************************************************************
+label.add.affinity.group=Add new affinity group
+message.delete.affinity.group=Please confirm that you would like to remove this affinity group.
+label.delete.affinity.group=Delete Affinity Group
+label.edit.affinity.group=Edit Affinity Group
label.affinity=Affinity
label.anti.affinity=Anti-affinity
label.affinity.groups=Affinity Groups
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/38ca7373/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index ffe0e89..1880be5 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -25,12 +25,16 @@ under the License.
<% long now = System.currentTimeMillis(); %>
<script language="javascript">
dictionary = {
+'label.add.affinity.group': '<fmt:message key="label.add.affinity.group"/>',
+'message.delete.affinity.group': '<fmt:message key="message.delete.affinity.group"/>',
+'label.delete.affinity.group': '<fmt:message key="label.delete.affinity.group"/>',
+'label.edit.affinity.group': '<fmt:message key="label.edit.affinity.group"/>',
'label.affinity': '<fmt:message key="label.affinity"/>',
-'label.anti.affinity': '<fmt:message key="-affinitylabel.anti.affinity"/>',
-'label.affinity.groups': '<fmt:message key=" Groupslabel.affinity.groups"/>',
-'label.anti.affinity.groups': '<fmt:message key="-affinity Groupslabel.anti.affinity.groups"/>',
-'label.affinity.group': '<fmt:message key=" Grouplabel.affinity.group"/>',
-'label.anti.affinity.group': '<fmt:message key="-affinity Grouplabel.anti.affinity.group"/>',
+'label.anti.affinity': '<fmt:message key="label.anti.affinity"/>',
+'label.affinity.groups': '<fmt:message key="label.affinity.groups"/>',
+'label.anti.affinity.groups': '<fmt:message key="label.anti.affinity.groups"/>',
+'label.affinity.group': '<fmt:message key="label.affinity.group"/>',
+'label.anti.affinity.group': '<fmt:message key="label.anti.affinity.group"/>',
'message.redirecting.region': '<fmt:message key="message.redirecting.region"/>',
'label.use.vm.ip': '<fmt:message key="label.use.vm.ip"/>',
'label.cpu.limits': '<fmt:message key="label.cpu.limits"/>',
[2/2] git commit: updated refs/heads/ui-vm-affinity to 5d235f6
Posted by bf...@apache.org.
Add new 'affinity' UI section for managing affinity groups
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5d235f69
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5d235f69
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5d235f69
Branch: refs/heads/ui-vm-affinity
Commit: 5d235f690d4d8a5413a4dc0e530e1760dee3514a
Parents: 38ca737
Author: Brian Federle <br...@citrix.com>
Authored: Mon Apr 15 14:56:44 2013 -0700
Committer: Brian Federle <br...@citrix.com>
Committed: Mon Apr 15 14:56:44 2013 -0700
----------------------------------------------------------------------
ui/scripts/affinity.js | 147 +++++++++++++++++++++++++++++++++
ui/scripts/cloudStack.js | 9 +-
ui/scripts/ui-custom/affinity.js | 2 +-
3 files changed, 153 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5d235f69/ui/scripts/affinity.js
----------------------------------------------------------------------
diff --git a/ui/scripts/affinity.js b/ui/scripts/affinity.js
new file mode 100644
index 0000000..8bfd844
--- /dev/null
+++ b/ui/scripts/affinity.js
@@ -0,0 +1,147 @@
+// 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.sections.affinityGroups = {
+ title: 'label.affinity.groups',
+ listView: {
+ id: 'affinityGroups',
+ fields: {
+ name: { label: 'label.name' },
+ type: { label: 'label.type' }
+ },
+ dataProvider: function(args) {
+ args.response.success({
+ data: [
+ { id: 1, name: 'Affinity Group 1', type: 'Affinity' },
+ { id: 2, name: 'Affinity Group 2', type: 'Anti-affinity' },
+ { id: 3, name: 'Anti-affinity Group', type: 'Anti-affinity' }
+ ]
+ });
+ },
+ actions: {
+ add: {
+ label: 'label.add.affinity.group',
+
+ messages: {
+ confirm: function(args) {
+ return 'message.add.volume';
+ },
+ notification: function(args) {
+ return 'label.add.affinity.group';
+ }
+ },
+
+ createForm: {
+ title: 'label.add.affinity.group',
+ fields: {
+ name: {
+ label: 'label.name',
+ validation: { required: true }
+ },
+ type: {
+ label: 'label.availability.zone',
+ select: function(args) {
+ args.response.success({
+ data: [
+ { id: 'Affinity', description: 'Affinity' },
+ { id: 'AntiAffinity', description: 'Anti-Affinity' }
+ ]
+ });
+ }
+ },
+ availabilityZone: {
+ label: 'label.availability.zone',
+ select: function(args) {
+ $.ajax({
+ url: createURL("listZones&available=true"),
+ dataType: "json",
+ async: true,
+ success: function(json) {
+ var items = json.listzonesresponse.zone;
+ args.response.success({descriptionField: 'name', data: items});
+ }
+ });
+ }
+ },
+ }
+ },
+
+ action: function(args) {
+ args.response.success();
+ },
+
+ notification: {
+ poll: function(args) { args.complete(); }
+ }
+ }
+ },
+ detailView: {
+ actions: {
+ edit: {
+ label: 'label.edit',
+ action: function(args) {
+ args.response.success();
+ },
+ messages: {
+ notification: function(args) { return 'label.edit.affinity.group'; }
+ }
+ },
+ remove: {
+ label: 'label.delete.affinity.group',
+ action: function(args) {
+ args.response.success();
+ },
+ messages: {
+ confirm: function(args) {
+ return 'message.delete.affinity.group';
+ },
+ notification: function(args) {
+ return 'label.delete.affinity.group';
+ }
+ },
+ notification: {
+ // poll: pollAsyncJobResult,
+ poll: function(args) { args.complete(); }
+ }
+ }
+ },
+
+ viewAll: { path: 'instances', label: 'label.instances' },
+
+ tabs: {
+ details: {
+ title: 'label.details',
+ fields: [
+ {
+ name: { label: 'label.name', isEditable: true }
+ },
+ {
+ type: { label: 'label.type', isCompact: true }
+ }
+ ],
+
+ dataProvider: function(args) {
+ setTimeout(function() {
+ args.response.success({ data: args.context.affinityGroups[0] });
+ }, 20);
+ }
+ }
+ }
+ }
+ }
+ };
+})(cloudStack);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5d235f69/ui/scripts/cloudStack.js
----------------------------------------------------------------------
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index a8bca91..3e9bef0 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -22,16 +22,16 @@
var sections = [];
if(isAdmin()) {
- sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects", "regions"];
+ sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects", "regions", "affinityGroups"];
}
else if(isDomainAdmin()) {
- sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"];
+ sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects", "affinityGroups"];
}
else if (g_userProjectsEnabled) {
- sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects"];
+ sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects", "affinityGroups"];
}
else { //normal user
- sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events"];
+ sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "affinityGroups"];
}
if (cloudStack.plugins.length) {
@@ -46,6 +46,7 @@
*/
dashboard: {},
instances: {},
+ affinityGroups: {},
storage: {},
network: {},
templates: {},
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5d235f69/ui/scripts/ui-custom/affinity.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/affinity.js b/ui/scripts/ui-custom/affinity.js
index 281ea2f..1012e7b 100644
--- a/ui/scripts/ui-custom/affinity.js
+++ b/ui/scripts/ui-custom/affinity.js
@@ -69,7 +69,7 @@
}).dialog({
dialogClass: 'multi-edit-add-list panel',
width: 825,
- title: _l('label.select.vm.for.static.nat'),
+ title: _l('label.affinity.groups'),
buttons: [
{
text: _l('label.apply'),