docs/meteor/client/views/dashboard/setup/setup-install.js

39 lines
903 B
JavaScript

var installStarted = false;
Template.setup_install.rendered = function() {
if(!installStarted) {
installStarted = true;
Installer.run(function (err) {
if (err) {
console.log('Setup failed.');
console.log(err);
} else {
Installs.insert({});
startFixInterval();
Router.go('dashboard_apps');
}
});
}
};
Template.setup_install.steps = function () {
return Installer.steps.map(function (step, index) {
step.index = index;
return step;
});
};
Template.setup_install.helpers({
currentInstallStep: function () {
return Session.get('currentInstallStep');
},
installComplete: function () {
return Session.get('currentInstallStep') === Installer.steps.length;
},
failedStep: function () {
return Session.get('failedStep');
},
failedError: function () {
return Session.get('failedError');
}
});