|
20 | 20 | </div> |
21 | 21 | @endforeach |
22 | 22 | @endforeach |
23 | | - <ul class="nav nav-tabs" id="config_tabs"> |
24 | | - <li class="active"><a href="#stats" data-toggle="tab">{{ trans('server.index.info_use') }}</a></li> |
25 | | - <li id="triggerConsoleView"><a href="#console" data-toggle="tab">{{ trans('server.index.control') }}</a></li> |
26 | | - </ul><br /> |
| 23 | + <ul class="nav nav-tabs tabs_with_panel" id="config_tabs"> |
| 24 | + <li id="triggerConsoleView" class="active"><a href="#console" data-toggle="tab">{{ trans('server.index.control') }}</a></li> |
| 25 | + <li><a href="#stats" data-toggle="tab">{{ trans('server.index.usage') }}</a></li> |
| 26 | + <li><a href="#allocation" data-toggle="tab">{{ trans('server.index.allocation') }}</a></li> |
| 27 | + </ul> |
27 | 28 | <div class="tab-content"> |
28 | | - <div class="tab-pane active" id="stats"> |
29 | | - <div class="row"> |
30 | | - <div class="col-md-12" id="chart_memory" style="height:250px;"></div> |
31 | | - <div class="col-md-12" id="chart_cpu" style="height:250px;"></div> |
32 | | - </div> |
33 | | - <div class="row"> |
34 | | - <div class="col-md-12" id="stats_players"> |
35 | | - <h3 class="nopad">Active Players</h3><hr /> |
36 | | - <div id="players_notice" class="alert alert-info"> |
37 | | - <i class="fa fa-spinner fa-spin"></i> Waiting for response from server... |
| 29 | + <div class="tab-pane active" id="console"> |
| 30 | + <div class="panel panel-default"> |
| 31 | + <div class="panel-heading"></div> |
| 32 | + <div class="panel-body"> |
| 33 | + <div class="row"> |
| 34 | + <div class="col-md-12"> |
| 35 | + <textarea id="live_console" class="form-control console" readonly="readonly">Loading Previous Content...</textarea> |
| 36 | + </div> |
| 37 | + <div class="col-md-6"> |
| 38 | + <hr /> |
| 39 | + <form action="#" method="post" id="console_command" style="display:none;"> |
| 40 | + <fieldset> |
| 41 | + <div class="input-group"> |
| 42 | + <input type="text" class="form-control" name="command" id="ccmd" placeholder="{{ trans('server.index.command') }}" /> |
| 43 | + <span class="input-group-btn"> |
| 44 | + <button id="sending_command" class="btn btn-primary btn-sm">→</button> |
| 45 | + </span> |
| 46 | + </div> |
| 47 | + </fieldset> |
| 48 | + </form> |
| 49 | + <div class="alert alert-danger" id="sc_resp" style="display:none;margin-top: 15px;"></div> |
| 50 | + </div> |
| 51 | + <div class="col-md-6" style="text-align:center;"> |
| 52 | + <hr /> |
| 53 | + <button class="btn btn-success btn-sm disabled" data-attr="power" data-action="start">Start</button> |
| 54 | + <button class="btn btn-primary btn-sm disabled" data-attr="power" data-action="restart">Restart</button> |
| 55 | + <button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="stop">Stop</button> |
| 56 | + <button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="kill"><i class="fa fa-ban" data-toggle="tooltip" data-placement="top" title="Kill Running Process"></i></button> |
| 57 | + <button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#pauseConsole" id="pause_console"><small><i class="fa fa-pause fa-fw"></i></small></button> |
| 58 | + <div id="pw_resp" style="display:none;margin-top: 15px;"></div> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + <div class="row"> |
| 62 | + <div class="col-md-12" id="stats_players"> |
| 63 | + <h3>Active Players</h3><hr /> |
| 64 | + <div id="players_notice" class="alert alert-info"> |
| 65 | + <i class="fa fa-spinner fa-spin"></i> Waiting for response from server... |
| 66 | + </div> |
| 67 | + <span id="toggle_players" style="display:none;"> |
| 68 | + <p class="text-muted">No players are online.</p> |
| 69 | + </span> |
| 70 | + </div> |
38 | 71 | </div> |
39 | | - <span id="toggle_players" style="display:none;"> |
40 | | - <p class="text-muted">No players are online.</p> |
41 | | - </span> |
42 | | - </div> |
43 | | - <div class="col-md-12"> |
44 | | - <h3>{{ trans('server.index.server_info') }}</h3><hr /> |
45 | | - <table class="table table-striped table-bordered table-hover"> |
46 | | - <tbody> |
47 | | - <tr> |
48 | | - <td><strong>{{ trans('server.index.connection') }}</strong></td> |
49 | | - <td><code>{{ $server->ip }}:{{ $server->port }}</code></td> |
50 | | - </tr> |
51 | | - <tr> |
52 | | - <td><strong>{{ trans('strings.node') }}</strong></td> |
53 | | - <td>{{ $node->name }}</td> |
54 | | - </tr> |
55 | | - <tr> |
56 | | - <td><strong>{{ trans('server.index.mem_limit') }}</strong></td> |
57 | | - <td>{{ $server->memory }} MB</td> |
58 | | - </tr> |
59 | | - <tr> |
60 | | - <td><strong>{{ trans('server.index.disk_space') }}</strong></td> |
61 | | - <td>{{ $server->disk }} MB</td> |
62 | | - </tr> |
63 | | - </tbody> |
64 | | - </table> |
65 | 72 | </div> |
66 | 73 | </div> |
67 | 74 | </div> |
68 | | - <div class="tab-pane" id="console"> |
69 | | - <div class="row"> |
70 | | - <div class="col-md-12"> |
71 | | - <textarea id="live_console" class="form-control console" readonly="readonly">Loading Previous Content...</textarea> |
72 | | - </div> |
73 | | - <div class="col-md-6"> |
74 | | - <hr /> |
75 | | - <form action="#" method="post" id="console_command" style="display:none;"> |
76 | | - <fieldset> |
77 | | - <div class="input-group"> |
78 | | - <input type="text" class="form-control" name="command" id="ccmd" placeholder="{{ trans('server.index.command') }}" /> |
79 | | - <span class="input-group-btn"> |
80 | | - <button id="sending_command" class="btn btn-primary btn-sm">→</button> |
81 | | - </span> |
82 | | - </div> |
83 | | - </fieldset> |
84 | | - </form> |
85 | | - <div class="alert alert-danger" id="sc_resp" style="display:none;margin-top: 15px;"></div> |
| 75 | + <div class="tab-pane" id="stats"> |
| 76 | + <div class="panel panel-default"> |
| 77 | + <div class="panel-heading"></div> |
| 78 | + <div class="panel-body"> |
| 79 | + <div class="row"> |
| 80 | + <div class="col-xs-11 text-center" id="chart_memory" style="height:250px;"></div> |
| 81 | + <div class="col-xs-11 text-center" id="chart_cpu" style="height:250px;"></div> |
| 82 | + </div> |
86 | 83 | </div> |
87 | | - <div class="col-md-6" style="text-align:center;"> |
88 | | - <hr /> |
89 | | - <button class="btn btn-success btn-sm disabled" data-attr="power" data-action="start">Start</button> |
90 | | - <button class="btn btn-primary btn-sm disabled" data-attr="power" data-action="restart">Restart</button> |
91 | | - <button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="stop">Stop</button> |
92 | | - <button class="btn btn-danger btn-sm disabled" data-attr="power" data-action="kill"><i class="fa fa-ban" data-toggle="tooltip" data-placement="top" title="Kill Running Process"></i></button> |
93 | | - <button class="btn btn-primary btn-sm" data-toggle="modal" data-target="#pauseConsole" id="pause_console"><small><i class="fa fa-pause fa-fw"></i></small></button> |
94 | | - <div id="pw_resp" style="display:none;margin-top: 15px;"></div> |
| 84 | + </div> |
| 85 | + </div> |
| 86 | + <div class="tab-pane" id="allocation"> |
| 87 | + <div class="panel panel-default"> |
| 88 | + <div class="panel-heading"></div> |
| 89 | + <div class="panel-body"> |
| 90 | + <div class="alert alert-info">Below is a listing of all avaliable IPs and Ports for your service. To change the default connection address for your server, simply click on the one you would like to make default below.</div> |
| 91 | + <ul class="nav nav-pills nav-stacked"> |
| 92 | + @foreach ($allocations as $allocation) |
| 93 | + <li role="presentation" @if($allocation->ip === $server->ip && $allocation->port === $server->port) class="active" @endif><a href="#/set-connnection/{{ $allocation->ip }}:{{ $allocation->port }}" data-action="set-connection" data-connection="{{ $allocation->ip }}:{{ $allocation->port }}">{{ $allocation->ip }} <span class="badge">{{ $allocation->port }}</span></a></li> |
| 94 | + @endforeach |
| 95 | + </ul> |
95 | 96 | </div> |
96 | 97 | </div> |
97 | 98 | </div> |
98 | 99 | </div> |
| 100 | + <div class="row"> |
| 101 | + <div class="col-xs-11" id="col11_setter"></div> |
| 102 | + </div> |
99 | 103 | </div> |
100 | 104 | <div class="modal fade" id="pauseConsole" tabindex="-1" role="dialog" aria-labelledby="PauseConsole" aria-hidden="true"> |
101 | 105 | <div class="modal-dialog"> |
|
124 | 128 | // -----------------+ |
125 | 129 | // Charting Methods | |
126 | 130 | // -----------------+ |
| 131 | + $(window).resize(function() { |
| 132 | + $('#chart_memory').highcharts().setSize($('#col11_setter').width(), 250); |
| 133 | + $('#chart_cpu').highcharts().setSize($('#col11_setter').width(), 250); |
| 134 | + }); |
127 | 135 | $('#chart_memory').highcharts({ |
128 | 136 | chart: { |
129 | 137 | type: 'area', |
130 | 138 | animation: Highcharts.svg, |
131 | 139 | marginRight: 10, |
| 140 | + renderTo: 'container', |
| 141 | + width: $('#col11_setter').width() |
132 | 142 | }, |
133 | 143 | colors: [ |
134 | 144 | '#113F8C', |
|
196 | 206 | type: 'area', |
197 | 207 | animation: Highcharts.svg, |
198 | 208 | marginRight: 10, |
| 209 | + renderTo: 'container', |
| 210 | + width: $('#col11_setter').width() |
199 | 211 | }, |
200 | 212 | colors: [ |
201 | 213 | '#113F8C', |
@@ -365,6 +377,7 @@ function updatePlayerListVisibility(data) { |
365 | 377 | $('#stats_players').hide(); |
366 | 378 | } |
367 | 379 | } |
| 380 | +
|
368 | 381 | @can('command', $server) |
369 | 382 | // Send Command to Server |
370 | 383 | $('#console_command').submit(function (event) { |
@@ -442,8 +455,6 @@ function updateServerPowerControls (data) { |
442 | 455 | }), |
443 | 456 | url: '{{ $node->scheme }}://{{ $node->fqdn }}:{{ $node->daemonListen }}/server/power', |
444 | 457 | timeout: 10000 |
445 | | - }).done(function(data) { |
446 | | - $('#pw_resp').attr('class', 'alert alert-success').html('Server has been ' + action + 'ed successfully.').fadeIn().delay(5000).fadeOut(); |
447 | 458 | }).fail(function(jqXHR) { |
448 | 459 | var error = 'An unknown error occured processing this request.'; |
449 | 460 | if (typeof jqXHR.responseJSON.error !== 'undefined') { |
|
0 commit comments