You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2013/10/15 03:09:03 UTC
[18/29] git commit: updated refs/heads/pluggable_vm_snapshot to
77fca0c
CLOUDSTACK-4850: UI > Infrastructure > zone detail > UCS manager > Blade tab > (1) change action "Associate Profile to Blade" to "Associate Template to Blade", change Profile dropdown to Template dropdown, add ProfileName field in dialog. (2) action "Disassociate Profile from Blade": add checkbox "Delete Profile".
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/d54c9eb6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/d54c9eb6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/d54c9eb6
Branch: refs/heads/pluggable_vm_snapshot
Commit: d54c9eb640fc7795910bb9b6e3fe3342345e4f8d
Parents: 4188916
Author: Jessica Wang <je...@apache.org>
Authored: Fri Oct 11 14:00:46 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Mon Oct 14 11:16:57 2013 -0700
----------------------------------------------------------------------
ui/scripts/system.js | 121 ++++++++++++++++++++++------------------------
1 file changed, 58 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d54c9eb6/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 3d25f34..41fd43b 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -13843,24 +13843,24 @@
});
},
actions: {
- associateProfileToBlade: {
- label: 'Associate Profile to Blade',
+ associateTemplateToBlade: {
+ label: 'Associate Template to Blade',
addRow: 'false',
messages: {
notification: function(args) {
- return 'Associate Profile to Blade';
+ return 'Associate Template to Blade';
}
},
createForm: {
- title: 'Associate Profile to Blade',
+ title: 'Associate Template to Blade',
fields: {
- profiledn: {
- label: 'Select Profile',
+ templatedn: {
+ label: 'Select Template',
select: function(args) {
var items = [];
$.ajax({
- url: createURL('listUcsProfiles'),
+ url: createURL('listUcsTemplates'),
data: {
ucsmanagerid: args.context.ucsManagers[0].id
},
@@ -13869,23 +13869,11 @@
//for testing only (begin)
/*
json = {
- "listucsprofileresponse": {
- "count": 5,
- "ucsprofile": [
+ "listucstemplatesresponse": {
+ "count": 1,
+ "ucstemplate": [
{
- "ucsdn": "org-root/ls-profile-for-blade-2"
- },
- {
- "ucsdn": "org-root/ls-profile-for-blade-1"
- },
- {
- "ucsdn": "org-root/ls-simpleProfile"
- },
- {
- "ucsdn": "org-root/ls-testProfile"
- },
- {
- "ucsdn": "org-root/ls-UCS_Test"
+ "ucsdn": "org-root/ls-test"
}
]
}
@@ -13893,30 +13881,18 @@
*/
//for testing only (end)
- var ucsprofiles = json.listucsprofileresponse.ucsprofile;
- if (ucsprofiles != null) {
- for (var i = 0; i < ucsprofiles.length; i++) {
+ var ucstemplates = json.listucstemplatesresponse.ucstemplate;
+ if (ucstemplates != null) {
+ for (var i = 0; i < ucstemplates.length; i++) {
items.push({
- id: ucsprofiles[i].ucsdn,
- description: ucsprofiles[i].ucsdn
+ id: ucstemplates[i].ucsdn,
+ description: ucstemplates[i].ucsdn
});
}
}
}
});
- //for testing only (begin)
- /*
- items.push({id: 'org-root/ls-testProfile1', description: 'org-root/ls-testProfile1'});
- items.push({id: 'org-root/ls-testProfile2', description: 'org-root/ls-testProfile2'});
- items.push({id: 'org-root/ls-testProfile3', description: 'org-root/ls-testProfile3'});
- items.push({id: 'org-root/ls-testProfile4', description: 'org-root/ls-testProfile4'});
- items.push({id: 'org-root/ls-testProfile5', description: 'org-root/ls-testProfile5'});
- items.push({id: 'org-root/ls-testProfile6', description: 'org-root/ls-testProfile6'});
- items.push({id: 'org-root/ls-testProfile7', description: 'org-root/ls-testProfile7'});
- */
- //for testing only (end)
-
args.response.success({
data: items
});
@@ -13925,29 +13901,40 @@
validation: {
required: true
}
+ },
+ profilename: {
+ label: 'Profile'
}
}
},
action: function(args) {
- $.ajax({
- url: createURL('associateUcsProfileToBlade'), //This API has been changed from sync to async at 7/25/2013
- data: {
+ var data = {
ucsmanagerid: args.context.ucsManagers[0].id,
- profiledn: args.data.profiledn,
+ templatedn: args.data.templatedn,
bladeid: args.context.blades[0].id
- },
+ };
+
+ if (args.data.profilename != null && args.data.profilename.length > 0) {
+ $.extend(data, {
+ profilename: args.data.profilename
+ });
+ }
+
+ $.ajax({
+ url: createURL('instantiateUcsTemplateAndAssocaciateToBlade'),
+ data: data,
success: function(json) {
//for testing only (begin)
/*
json = {
- "associateucsprofiletobladeresponse": {
- "jobid": "770bec68-7739-4127-8609-4b87bd7867d2"
+ "instantiateucstemplateandassociatetobladeresponse": {
+ "jobid": "cd9d0282-4dae-463f-80b6-451e168e2e92"
}
}
*/
//for testing only (end)
- var jid = json.associateucsprofiletobladeresponse.jobid;
+ var jid = json.instantiateucstemplateandassociatetobladeresponse.jobid;
args.response.success({
_custom: {
jobId: jid,
@@ -13956,23 +13943,23 @@
/*
json = {
"queryasyncjobresultresponse": {
- "accountid": "b24f6e36-f0ca-11e2-8c16-d637902e3581",
- "userid": "b24f7d8d-f0ca-11e2-8c16-d637902e3581",
- "cmd": "org.apache.cloudstack.api.AssociateUcsProfileToBladeCmd",
+ "accountid": "970b694a-2f8c-11e3-a77d-000c29b36ff5",
+ "userid": "970b7b4f-2f8c-11e3-a77d-000c29b36ff5",
+ "cmd": "org.apache.cloudstack.api.InstantiateUcsTemplateAndAssociateToBladeCmd",
"jobstatus": 1,
"jobprocstatus": 0,
"jobresultcode": 0,
"jobresulttype": "object",
"jobresult": {
"ucsblade": {
- "id": "80ab25c8-3dcf-400e-8849-84dc5e1e6594",
- "ucsmanagerid": "07b5b813-83ed-4859-952c-c95cafb63ac4",
- "bladedn": "sys/chassis-1/blade-4",
- "profiledn": "org-root/ls-profile-for-blade-4"
+ "id": "3d491c6e-f0b6-40b0-bf6e-f89efdd73c30",
+ "ucsmanagerid": "9a34c186-12fa-4bbc-af04-5f1a2bf7ae4a",
+ "bladedn": "sys/chassis-1/blade-3",
+ "profiledn": "org-root/ls-xxxx"
}
},
- "created": "2013-07-26T13:53:01-0700",
- "jobid": "770bec68-7739-4127-8609-4b87bd7867d2"
+ "created": "2013-10-10T17:29:00-0700",
+ "jobid": "cd9d0282-4dae-463f-80b6-451e168e2e92"
}
};
*/
@@ -13995,19 +13982,27 @@
label: 'Disassociate Profile from Blade',
addRow: 'false',
messages: {
- confirm: function(args) {
- return 'Please confirm that you want to disassociate Profile from Blade.';
- },
notification: function(args) {
return 'Disassociate Profile from Blade';
}
},
+ createForm: {
+ title: 'Disassociate Profile from Blade',
+ fields: {
+ deleteprofile: {
+ label: 'Delete Profile',
+ isBoolean: true,
+ isChecked: true
+ }
+ }
+ },
action: function(args) {
+ debugger;
$.ajax({
url: createURL('disassociateUcsProfileFromBlade'),
data: {
- //ucsmanagerid: args.context.ucsManagers[0].id,
- bladeid: args.context.blades[0].id
+ bladeid: args.context.blades[0].id,
+ deleteprofile: (args.data.deleteprofile == 'on'? true: false)
},
success: function(json) {
//for testing only (begin)
@@ -16152,7 +16147,7 @@
var jsonObj = args.context.item;
var allowedActions = [];
if(jsonObj.profiledn == null) {
- allowedActions.push("associateProfileToBlade");
+ allowedActions.push("associateTemplateToBlade");
} else {
allowedActions.push("disassociateProfileFromBlade");
}