2014-04-04 08:20:13 +00:00
|
|
|
define(function (require) {
|
2014-04-06 21:09:52 +00:00
|
|
|
|
2014-04-04 08:20:13 +00:00
|
|
|
"use strict";
|
2014-04-06 21:09:52 +00:00
|
|
|
|
2014-04-04 08:20:13 +00:00
|
|
|
var $ = require('jquery'),
|
|
|
|
_ = require('underscore'),
|
|
|
|
Backbone = require('backbone'),
|
|
|
|
Marionette = require('marionette'),
|
2014-04-06 21:09:52 +00:00
|
|
|
tpl = require('text!tpl/servers/info.html');
|
|
|
|
|
2014-04-04 08:20:13 +00:00
|
|
|
return Marionette.ItemView.extend({
|
|
|
|
template: _.template(tpl),
|
2014-04-06 21:09:52 +00:00
|
|
|
|
|
|
|
events: {
|
|
|
|
"click #start": "start"
|
|
|
|
},
|
|
|
|
|
|
|
|
start: function (event) {
|
|
|
|
var self = this;
|
|
|
|
event.preventDefault();
|
|
|
|
$.ajax({
|
|
|
|
url: "/api/servers/" + this.model.get('id') + "/start",
|
|
|
|
type: 'GET',
|
|
|
|
success: function (resp) {
|
|
|
|
console.log(resp);
|
|
|
|
},
|
|
|
|
error: $.noop
|
|
|
|
});
|
|
|
|
},
|
2014-04-04 08:20:13 +00:00
|
|
|
});
|
2014-04-06 21:09:52 +00:00
|
|
|
|
|
|
|
});
|