mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-8075: UI > Instances menu > Add Instance > Select template/ISO > add a new tab "shared" which will list shared templates/ISOs when being clicked.
This commit is contained in:
parent
5f9e0fcd7e
commit
1a8c85a7a8
@ -16,7 +16,7 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
|
|
||||||
(function($, cloudStack) {
|
(function($, cloudStack) {
|
||||||
var zoneObjs, hypervisorObjs, featuredTemplateObjs, communityTemplateObjs, myTemplateObjs, featuredIsoObjs, serviceOfferingObjs, community, networkObjs;
|
var zoneObjs, hypervisorObjs, featuredTemplateObjs, communityTemplateObjs, myTemplateObjs, sharedTemplateObjs, featuredIsoObjs, communityIsoObjs, myIsoObjs, sharedIsoObjs, serviceOfferingObjs, community, networkObjs;
|
||||||
var selectedZoneObj, selectedTemplateObj, selectedHypervisor, selectedDiskOfferingObj;
|
var selectedZoneObj, selectedTemplateObj, selectedHypervisor, selectedDiskOfferingObj;
|
||||||
var selectedTemplateOrIso; //'select-template', 'select-iso'
|
var selectedTemplateOrIso; //'select-template', 'select-iso'
|
||||||
var step6ContainerType = 'nothing-to-select'; //'nothing-to-select', 'select-network', 'select-security-group', 'select-advanced-sg'(advanced sg-enabled zone)
|
var step6ContainerType = 'nothing-to-select'; //'nothing-to-select', 'select-network', 'select-security-group', 'select-advanced-sg'(advanced sg-enabled zone)
|
||||||
@ -184,7 +184,22 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$.ajax({
|
||||||
|
url: createURL("listTemplates&templatefilter=sharedexecutable&zoneid=" + args.currentData.zoneid),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
if (json.listtemplatesresponse.template == null) {
|
||||||
|
sharedTemplateObjs = null;
|
||||||
|
} else {
|
||||||
|
sharedTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) {
|
||||||
|
if ($.inArray(item.hypervisor, hypervisorArray) > -1)
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
} else if (selectedTemplateOrIso == 'select-iso') {
|
} else if (selectedTemplateOrIso == 'select-iso') {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"),
|
url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"),
|
||||||
@ -222,6 +237,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$.ajax({
|
||||||
|
url: createURL("listIsos&isofilter=sharedexecutable&zoneid=" + args.currentData.zoneid + "&bootable=true"),
|
||||||
|
dataType: "json",
|
||||||
|
async: false,
|
||||||
|
success: function(json) {
|
||||||
|
if (json.listisosresponse.iso == null) {
|
||||||
|
sharedIsoObjs = null;
|
||||||
|
} else {
|
||||||
|
sharedIsoObjs = json.listisosresponse.iso;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
//***** get templates/ISOs (end) *****
|
//***** get templates/ISOs (end) *****
|
||||||
|
|
||||||
@ -232,14 +259,14 @@
|
|||||||
featuredtemplates: featuredTemplateObjs,
|
featuredtemplates: featuredTemplateObjs,
|
||||||
communitytemplates: communityTemplateObjs,
|
communitytemplates: communityTemplateObjs,
|
||||||
mytemplates: myTemplateObjs,
|
mytemplates: myTemplateObjs,
|
||||||
sharedtemplates: [] // ** Needs implementation **
|
sharedtemplates: sharedTemplateObjs
|
||||||
};
|
};
|
||||||
} else if (selectedTemplateOrIso == 'select-iso') {
|
} else if (selectedTemplateOrIso == 'select-iso') {
|
||||||
templatesObj = {
|
templatesObj = {
|
||||||
featuredisos: featuredIsoObjs,
|
featuredisos: featuredIsoObjs,
|
||||||
communityisos: communityIsoObjs,
|
communityisos: communityIsoObjs,
|
||||||
myisos: myIsoObjs,
|
myisos: myIsoObjs,
|
||||||
sharedisos: [] // ** Needs implementation **
|
sharedisos: sharedIsoObjs
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
args.response.success({
|
args.response.success({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user