mirror of
https://github.com/Dahlgren/arma-server-web-admin.git
synced 2024-08-30 17:22:10 +00:00
Merge pull request #30 from Dahlgren/feature/auto-start
Auto Start selected servers when Manager launches
This commit is contained in:
commit
b8dca85609
@ -81,6 +81,12 @@ Manager.prototype.load = (function () {
|
||||
} catch(e) {
|
||||
console.error("Manager load error: " + e);
|
||||
}
|
||||
|
||||
self.getServers().map(function (server) {
|
||||
if (server.auto_start) {
|
||||
server.start();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -96,6 +102,7 @@ Manager.prototype.save = (function () {
|
||||
this.serversArr.forEach(function (server) {
|
||||
data.push({
|
||||
admin_password: server.admin_password,
|
||||
auto_start: server.auto_start,
|
||||
battle_eye: server.battle_eye,
|
||||
headless: server.headless,
|
||||
max_players: server.max_players,
|
||||
|
@ -41,6 +41,7 @@ Server.prototype = new events.EventEmitter();
|
||||
|
||||
Server.prototype.update = function (options) {
|
||||
this.admin_password = options.admin_password;
|
||||
this.auto_start = options.auto_start;
|
||||
this.battle_eye = options.battle_eye;
|
||||
this.headless = options.headless;
|
||||
this.max_players = options.max_players;
|
||||
@ -227,6 +228,7 @@ Server.prototype.stop = function(cb) {
|
||||
Server.prototype.toJSON = function () {
|
||||
return {
|
||||
admin_password: this.admin_password,
|
||||
auto_start: this.auto_start,
|
||||
battle_eye: this.battle_eye,
|
||||
headless: this.headless,
|
||||
id: this.id,
|
||||
|
@ -9,6 +9,7 @@ define(function (require) {
|
||||
return Backbone.Model.extend({
|
||||
defaults: {
|
||||
admin_password: '',
|
||||
auto_start: false,
|
||||
battle_eye: false,
|
||||
headless: false,
|
||||
max_players: null,
|
||||
|
@ -20,6 +20,7 @@ define(function (require) {
|
||||
serialize : function() {
|
||||
return {
|
||||
admin_password: this.$("form .admin-password").val(),
|
||||
auto_start: this.$("form .auto-start").prop("checked"),
|
||||
battle_eye: this.$("form .battle-eye").prop("checked"),
|
||||
headless: this.$("form .headless").prop("checked"),
|
||||
max_players: this.$("form .max-players").val(),
|
||||
|
@ -35,6 +35,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" class="auto-start" <% if (auto_start) { %>checked="checked"<% } %>> Auto Start when manager launches
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="checkbox">
|
||||
|
Loading…
Reference in New Issue
Block a user