Skip to content

Commit 16c720f

Browse files
committed
UI: Add initial UCS section to infrastructure page
1 parent bbff5e8 commit 16c720f

4 files changed

Lines changed: 296 additions & 2 deletions

File tree

ui/css/cloudstack3.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5010,6 +5010,11 @@ Dialogs*/
50105010
top: 497px;
50115011
}
50125012

5013+
.system-chart.compute ul.resources li.ucs {
5014+
left: 199px;
5015+
top: 406px;
5016+
}
5017+
50135018
/** Network*/
50145019
.system-chart.network {
50155020
}
@@ -11870,8 +11875,9 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
1187011875

1187111876
.attach .icon,
1187211877
.attachISO .icon,
11873-
.attachDisk .icon {
11874-
background-position: -101px -3px;
11878+
.attachDisk .icon,
11879+
.associateProfileToBlade .icon {
11880+
background-position: -104px -3px;
1187511881
}
1187611882

1187711883
.attach:hover .icon,
8.65 KB
Loading

ui/scripts/system.js

Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6930,6 +6930,7 @@
69306930

69316931
return listView;
69326932
},
6933+
69336934
secondaryStorage: function() {
69346935
var listView = $.extend(
69356936
true, {},
@@ -12988,6 +12989,286 @@
1298812989
}
1298912990
},
1299012991

12992+
ucs: {
12993+
title: 'UCS',
12994+
id: 'ucs',
12995+
listView: {
12996+
id: 'ucsManagers',
12997+
fields: {
12998+
name: { label: 'label.name' },
12999+
url: { label: 'label.url' }
13000+
},
13001+
dataProvider: function(args) {
13002+
/*
13003+
$.ajax({
13004+
url: createURL('listUcsManager'),
13005+
data: {
13006+
zoneid: args.context.physicalResources[0].id
13007+
},
13008+
success: function(json) {
13009+
13010+
}
13011+
});
13012+
*/
13013+
13014+
args.response.success({
13015+
data: [
13016+
{ id: '73695389-13ba-48e4-b661-a5e56966f577', name: 'UCS Manager 1', url: '10.196.72.1' },
13017+
{ id: '32588a3e-9d70-4a23-9117-42da48fa8c10', name: 'UCS Manager 2', url: '10.196.72.2' }
13018+
]
13019+
});
13020+
},
13021+
actions: {
13022+
add: {
13023+
label: 'Add UCS Manager',
13024+
13025+
messages: {
13026+
notification: function(args) {
13027+
return 'Add UCS Manager';
13028+
}
13029+
},
13030+
13031+
createForm: {
13032+
title: 'Add UCS Manager',
13033+
fields: {
13034+
name: {
13035+
label: 'label.name',
13036+
validation: { required: false }
13037+
},
13038+
url: {
13039+
label: 'label.url',
13040+
validation: { required: true }
13041+
},
13042+
username: {
13043+
label: 'label.username',
13044+
validation: { required: true }
13045+
},
13046+
password: {
13047+
label: 'label.password',
13048+
validation: { required: true }
13049+
}
13050+
}
13051+
},
13052+
13053+
action: function(args) {
13054+
var data = {
13055+
zoneid: args.context.physicalResources[0].id,
13056+
url: args.data.url,
13057+
username: args.data.username,
13058+
password: args.data.password
13059+
};
13060+
if(args.data.name != null && args.data.name.length > 0) {
13061+
$.extend(data, {
13062+
name: args.data.name
13063+
});
13064+
}
13065+
/*
13066+
$.ajax({
13067+
url: createURL('addUcsManager'),
13068+
data: data,
13069+
success: function(json) {
13070+
13071+
},
13072+
error: function(data) {
13073+
args.response.error(parseXMLHttpResponse(data));
13074+
}
13075+
});
13076+
*/
13077+
13078+
args.response.success({data: { id: '85a2ff00-ed42-4a18-8f5f-bb75c9ffd413', name: 'UCS Manager 3', url: '10.196.72.3' }});
13079+
13080+
},
13081+
13082+
notification: {
13083+
poll: function(args) {
13084+
args.complete();
13085+
}
13086+
}
13087+
}
13088+
},
13089+
13090+
detailView: {
13091+
isMaximized: true,
13092+
noCompact: true,
13093+
tabs: {
13094+
blades: {
13095+
title: 'Blades',
13096+
listView: {
13097+
fields: {
13098+
//dn: { label: 'Distinguished Name' },
13099+
chassis: { label: 'Chassis' },
13100+
bladeid: { label: 'Blade ID' },
13101+
associatedProfileDn: { label: 'Associated Profile' }
13102+
},
13103+
dataProvider: function(args) {
13104+
/*
13105+
$.ajax({
13106+
url: createURL('listUcsBlade'),
13107+
data: {
13108+
ucsmanagerid: args.context.ucsManagers[0].id
13109+
},
13110+
success: function(json) {
13111+
13112+
}
13113+
});
13114+
*/
13115+
13116+
var data = [
13117+
{ id: '85a2ff00-ed42-4a18-8f5f-bb75c9ffd413', hostId: '62be4b10-a828-4ea2-aed8-9ad1d0812ff9', dn: 'sys/chassis-1/blade-1', associatedProfileDn: '' },
13118+
{ id: '85a2ff00-ed42-4a18-8f5f-bb75c9ffd413', hostId: '62be4b10-a828-4ea2-aed8-9ad1d0812ff9', dn: 'sys/chassis-2/blade-2', associatedProfileDn: '' },
13119+
{ id: '85a2ff00-ed42-4a18-8f5f-bb75c9ffd413', hostId: '62be4b10-a828-4ea2-aed8-9ad1d0812ff9', dn: 'sys/chassis-3/blade-3', associatedProfileDn: '' }
13120+
];
13121+
13122+
for(var i = 0; i < data.length; i++) {
13123+
var array1 = data[i].dn.split('/');
13124+
data[i].chassis = array1[1];
13125+
data[i].bladeid = array1[2];
13126+
}
13127+
13128+
args.response.success({
13129+
data: data
13130+
});
13131+
},
13132+
actions: {
13133+
associateProfileToBlade: {
13134+
label: 'Associate Profile to Blade',
13135+
addRow: 'false',
13136+
messages: {
13137+
notification: function(args) {
13138+
return 'Associate Profile to Blade';
13139+
}
13140+
},
13141+
createForm: {
13142+
title: 'Associate Profile to Blade',
13143+
fields: {
13144+
profiledn: {
13145+
label: 'Select Profile',
13146+
select: function(args) {
13147+
var items = [];
13148+
13149+
/*
13150+
$.ajax({
13151+
url: createURL('listUcsProfile'),
13152+
data: {
13153+
ucsmanagerid: args.context.ucsManagers[0].id
13154+
},
13155+
success: function(json) {
13156+
13157+
}
13158+
});
13159+
*/
13160+
13161+
items.push({id: 'Service_Profile_Demo1', description: 'Service_Profile_Demo1'});
13162+
items.push({id: 'Service_Profile_Demo2', description: 'Service_Profile_Demo2'});
13163+
items.push({id: 'Service_Profile_Demo3', description: 'Service_Profile_Demo3'});
13164+
items.push({id: 'Service_Profile_Demo4', description: 'Service_Profile_Demo4'});
13165+
items.push({id: 'Service_Profile_Demo5', description: 'Service_Profile_Demo5'});
13166+
items.push({id: 'Service_Profile_Demo6', description: 'Service_Profile_Demo6'});
13167+
items.push({id: 'Service_Profile_Demo7', description: 'Service_Profile_Demo7'});
13168+
args.response.success({data: items});
13169+
},
13170+
validation: { required: true }
13171+
}
13172+
}
13173+
},
13174+
action: function(args) {
13175+
/*
13176+
$.ajax({
13177+
url: createURL('associatesUscProfileToBlade'),
13178+
data: {
13179+
ucsmanagerid: args.context.ucsManagers[0].id,
13180+
profiledn: args.data.profiledn,
13181+
bladeid: '1234567890' //to change later
13182+
},
13183+
success: function(json) {
13184+
13185+
}
13186+
});
13187+
*/
13188+
args.response.success({data: { associatedProfileDn: args.data.profiledn }});
13189+
},
13190+
notification: {
13191+
poll: function(args) {
13192+
args.complete();
13193+
}
13194+
}
13195+
}
13196+
}
13197+
13198+
/*,
13199+
detailView: {
13200+
name: 'blade details',
13201+
noCompact: true,
13202+
actions: {
13203+
associateProfileToBlade: {
13204+
label: 'Associate Profile to Blade',
13205+
messages: {
13206+
notification: function(args) {
13207+
return 'Associate Profile to Blade';
13208+
}
13209+
},
13210+
createForm: {
13211+
title: 'Associate Profile to Blade',
13212+
fields: {
13213+
profiledn: {
13214+
label: 'profile',
13215+
select: function(args) {
13216+
var items = [];
13217+
13218+
items.push({id: 'profile_1', description: 'profile_1'});
13219+
items.push({id: 'profile_2', description: 'profile_2'});
13220+
items.push({id: 'profile_3', description: 'profile_3'});
13221+
args.response.success({data: items});
13222+
},
13223+
validation: { required: true }
13224+
}
13225+
}
13226+
},
13227+
action: function(args) {
13228+
args.response.success();
13229+
},
13230+
notification: {
13231+
poll: function(args) {
13232+
args.complete();
13233+
}
13234+
}
13235+
}
13236+
},
13237+
tabs: {
13238+
details: {
13239+
title: 'label.details',
13240+
13241+
fields: [
13242+
{
13243+
fieldA: { label: 'fieldA' }
13244+
},
13245+
{
13246+
fieldB: { label: 'fieldB' }
13247+
}
13248+
],
13249+
13250+
dataProvider: function(args) {
13251+
args.response.success(
13252+
{
13253+
data: {
13254+
fieldA: 'fieldAAA',
13255+
fieldB: 'fieldBBB'
13256+
}
13257+
}
13258+
);
13259+
}
13260+
}
13261+
}
13262+
}
13263+
*/
13264+
13265+
}
13266+
}
13267+
}
13268+
}
13269+
}
13270+
},
13271+
1299113272
'secondary-storage': {
1299213273
title: 'label.secondary.storage',
1299313274
id: 'secondarystorages',

ui/scripts/ui-custom/zoneChart.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@
140140
}
141141
},
142142

143+
ucs: {
144+
label: 'UCS',
145+
viewAll: {
146+
action: actions.listView('ucs', context)
147+
}
148+
},
149+
143150
secondaryStorage: {
144151
label: 'Secondary Storage',
145152
viewAll: {

0 commit comments

Comments
 (0)