docs/meteor/client/views/dashboard/layouts/dashboard-apps-layout.js

49 lines
1.3 KiB
JavaScript

Template.dashboardAppsLayout.rendered = function () {
Meteor.setInterval(function () {
$('.header .icons a').tooltip();
}, 1000);
};
Template.dashboardAppsLayout.events({
'click .btn-view': function (e) {
try {
var open = require('open');
e.preventDefault();
e.stopPropagation();
var $btn = $(e.currentTarget);
var url = $btn.attr('href');
open(url);
} catch (exception) {
console.log(exception);
}
},
'click .btn-image': function () {
$('.header .icons a').tooltip('hide');
},
'click .btn-logs': function () {
AppUtil.logs(this._id);
},
'click .btn-terminal': function () {
var cmd = Boot2Docker.command() + ' ssh -t "sudo docker-enter ' + this.docker.Id + '"';
Util.openTerminal(cmd);
},
'click .btn-restart': function () {
AppUtil.restart(this._id);
},
'click .btn-folder': function () {
var exec = require('child_process').exec;
var appPath = path.join(Util.KITE_PATH, this.name);
exec('open ' + appPath, function (err) {
if (err) { throw err; }
});
},
'click .btn-start': function () {
AppUtil.start(this._id);
$('.btn-icon').tooltip('hide');
},
'click .btn-stop': function () {
AppUtil.stop(this._id);
$('.btn-icon').tooltip('hide');
}
});