Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions frontend/user/ApplicationListModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,35 +139,34 @@ class ApplicationListModel {
}
}

startApplication() {
let selectedIndex = this.selectedIndex;
let currentApp = this.appList[selectedIndex];
startApplication(index) {
let appStarting = this.appList[index];

currentApp.status = Status.STARTING;
currentApp.delayed = true;
appStarting.status = Status.STARTING;
appStarting.delayed = true;

let configurablesData = {};
currentApp.configurables.forEach(function(configurable) {
appStarting.configurables.forEach(function(configurable) {
let tag = configurable.tag;
configurablesData[tag] = configurable.asConfigDict();
});

let startPromise = $.Deferred();

resources.Container.create({
mapping_id: currentApp.appData.mapping_id,
mapping_id: appStarting.appData.mapping_id,
configurables: configurablesData
})
.done(() => {
this.updateIdx(selectedIndex)
this.updateIdx(index)
.done(startPromise.resolve)
.fail((error) => {
currentApp.status = Status.STOPPED;
appStarting.status = Status.STOPPED;
startPromise.reject(error);
});
})
.fail((error) => {
currentApp.status = Status.STOPPED;
appStarting.status = Status.STOPPED;
startPromise.reject(error);
});

Expand Down
4 changes: 2 additions & 2 deletions frontend/user/vue-components/ApplicationView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@
startApplication: function() {
let startingApp = this.currentApp;
let startingAppName = this.$options.filters.appName(startingApp.appData.image);
this.model.startApplication()
this.model.startApplication(this.model.selectedIndex)
.done(() => {
this.$emit('startApplication', startingApp);
})
.fail((error) => {
this.$emit('error', {
title: "Error when starting " + startingAppName,
title: 'Error when starting ' + startingAppName,
code: error.code,
message: error.message
});
Expand Down