Merge "Retrieve hosts under initAction"

This commit is contained in:
Zuul 2018-06-19 03:16:43 +00:00 committed by Gerrit Code Review
commit 696492d34f

View File

@ -77,16 +77,6 @@
// model
var model;
// get hosts for zun
zun.getHosts().then(onGetZunHosts);
function onGetZunHosts(response) {
var hs = [];
response.data.items.forEach(function (host) {
hs.push({value: host.id, name: host.hostname});
});
push.apply(hosts, hs);
}
var message = {
success: gettext('Container %s was successfully restarted.')
};
@ -104,6 +94,15 @@
// include this function in your service
// if you plan to emit events to the parent controller
function initAction() {
// get hosts for zun
zun.getHosts().then(onGetZunHosts);
function onGetZunHosts(response) {
var hs = [];
response.data.items.forEach(function (host) {
hs.push({value: host.id, name: host.hostname});
});
push.apply(hosts, hs);
}
}
function allowed() {