mirror of https://github.com/docker/docs.git
Added a feature to recover Kitematic setup.
This commit is contained in:
parent
aff459f1d3
commit
8e91ce11fc
|
@ -131,6 +131,7 @@ Installer.steps = [
|
||||||
},
|
},
|
||||||
pastMessage: 'Started the Kitematic VM',
|
pastMessage: 'Started the Kitematic VM',
|
||||||
message: 'Starting the Kitematic VM',
|
message: 'Starting the Kitematic VM',
|
||||||
|
subMessage: '(This may take a few minutes)',
|
||||||
futureMessage: 'Start the Kitematic VM'
|
futureMessage: 'Start the Kitematic VM'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -164,6 +165,7 @@ Installer.steps = [
|
||||||
];
|
];
|
||||||
|
|
||||||
Installer.run = function (callback) {
|
Installer.run = function (callback) {
|
||||||
|
Session.set('installing', true);
|
||||||
var currentStep = 0;
|
var currentStep = 0;
|
||||||
Session.set('currentInstallStep', currentStep);
|
Session.set('currentInstallStep', currentStep);
|
||||||
Session.set('numberOfInstallSteps', this.steps.length);
|
Session.set('numberOfInstallSteps', this.steps.length);
|
||||||
|
@ -191,6 +193,7 @@ Installer.run = function (callback) {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
// Setup Finished
|
// Setup Finished
|
||||||
|
Session.set('installing', false);
|
||||||
console.log('Setup finished.');
|
console.log('Setup finished.');
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ Handlebars.registerHelper('timeSince', function (date) {
|
||||||
return moment(date).fromNow();
|
return moment(date).fromNow();
|
||||||
});
|
});
|
||||||
|
|
||||||
Handlebars.registerHelper('isUpdating', function (date) {
|
Handlebars.registerHelper('isUpdating', function () {
|
||||||
return Session.get('isUpdating');
|
return Session.get('isUpdating');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ Meteor.setInterval(function () {
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
Meteor.setInterval(function () {
|
Meteor.setInterval(function () {
|
||||||
if (Installer.isUpToDate()) {
|
if (!Session.get('installing')) {
|
||||||
Sync.resolveWatchers(function () {});
|
Sync.resolveWatchers(function () {});
|
||||||
if (!Session.get('boot2dockerOff')) {
|
if (!Session.get('boot2dockerOff')) {
|
||||||
fixBoot2DockerVM(function (err) {
|
fixBoot2DockerVM(function (err) {
|
||||||
|
|
|
@ -52,4 +52,13 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="section dashboard-settings">
|
||||||
|
<div class="left-section">
|
||||||
|
<h4>Repair Kitematic</h4>
|
||||||
|
<p class="help-block">You can repair Kitematic installation if the app stops working properly.</p>
|
||||||
|
</div>
|
||||||
|
<div class="right-section">
|
||||||
|
<a onclick="trackLink('repair kitematic')" class="btn btn-negative btn-repair">Repair Kitematic</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
var remote = require('remote');
|
||||||
|
var dialog = remote.require('dialog');
|
||||||
|
|
||||||
Template.dashboard_settings.events({
|
Template.dashboard_settings.events({
|
||||||
'click .btn-start-boot2docker': function (e) {
|
'click .btn-start-boot2docker': function (e) {
|
||||||
var $btn = $(e.currentTarget);
|
var $btn = $(e.currentTarget);
|
||||||
|
@ -36,6 +39,17 @@ Template.dashboard_settings.events({
|
||||||
tracking: false
|
tracking: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
'click .btn-repair': function () {
|
||||||
|
dialog.showMessageBox({
|
||||||
|
message: 'Repairing Kitematic will clear your current Docker VM and the state of the app. Please make sure your work is backed up. Do you wish to continue?',
|
||||||
|
buttons: ['Repair', 'Cancel']
|
||||||
|
}, function (index) {
|
||||||
|
if (index !== 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Router.go('setup_intro');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Template.setup_finish.events({
|
Template.setup_finish.events({
|
||||||
'click .finish-button': function (e) {
|
'click .finish-button': function (e) {
|
||||||
var enableDiagnostics = $('.install-diagonistics input').attr('checked') ? true : false;
|
var enableDiagnostics = $('.install-diagonistics input').prop('checked');
|
||||||
var status = enableDiagnostics ? 'on' : 'off';
|
var status = enableDiagnostics ? 'on' : 'off';
|
||||||
ga('send', 'event', 'link', 'click', 'turn ' + status + ' usage analytics');
|
ga('send', 'event', 'link', 'click', 'turn ' + status + ' usage analytics');
|
||||||
Installs.insert({version: Installer.CURRENT_VERSION});
|
Installs.insert({version: Installer.CURRENT_VERSION});
|
||||||
|
|
|
@ -52,12 +52,5 @@
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
<div class="install-finish text-center">
|
|
||||||
{{#if installComplete}}
|
|
||||||
<a onclick="trackLink('finish install')" class="btn btn-action" href="/apps">
|
|
||||||
Start Using Kitematic
|
|
||||||
</a>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -1,18 +1,3 @@
|
||||||
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 {
|
|
||||||
Router.go('setup_finish');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Template.setup_install.steps = function () {
|
Template.setup_install.steps = function () {
|
||||||
return Installer.steps.map(function (step, index) {
|
return Installer.steps.map(function (step, index) {
|
||||||
step.index = index;
|
step.index = index;
|
||||||
|
@ -27,9 +12,6 @@ Template.setup_install.helpers({
|
||||||
currentInstallStepProgress: function () {
|
currentInstallStepProgress: function () {
|
||||||
return Session.get('currentInstallStepProgress');
|
return Session.get('currentInstallStepProgress');
|
||||||
},
|
},
|
||||||
installComplete: function () {
|
|
||||||
return Session.get('currentInstallStep') === Installer.steps.length;
|
|
||||||
},
|
|
||||||
failedStep: function () {
|
failedStep: function () {
|
||||||
return Session.get('failedStep');
|
return Session.get('failedStep');
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
Template.setup_intro.events({
|
Template.setup_intro.events({
|
||||||
'click .continue-button': function (e) {
|
'click .continue-button': function (e) {
|
||||||
Router.go('setup_install');
|
Router.go('setup_install');
|
||||||
|
Installer.run(function (err) {
|
||||||
|
if (err) {
|
||||||
|
console.log('Setup failed.');
|
||||||
|
console.log(err);
|
||||||
|
} else {
|
||||||
|
Router.go('setup_finish');
|
||||||
|
}
|
||||||
|
});
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue