first commit
This commit is contained in:
commit
788cf3e917
47 changed files with 2007 additions and 0 deletions
23
webroot/index.php
Normal file
23
webroot/index.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
use MingTsay\Akanyan\App;
|
||||
use MingTsay\Akanyan\Minecraft;
|
||||
|
||||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
App::requireAllowed();
|
||||
|
||||
$status = exec('sudo -u mt docker inspect -f \'{{.State.Status}}\' akanyan-server-1');
|
||||
|
||||
// start the server
|
||||
$isStarting = isset($_POST['start']);
|
||||
if ($isStarting) exec('sudo -u mt docker start akanyan-server-1');
|
||||
|
||||
// get query
|
||||
$query = $status === 'running' ? Minecraft::query() : null;
|
||||
|
||||
App::render('index', [
|
||||
'status' => $status,
|
||||
'isStarting' => $isStarting,
|
||||
'query' => $query,
|
||||
]);
|
||||
Loading…
Add table
Add a link
Reference in a new issue