Add ui elements for handling server transfers, add TransferJob.php and TransferService.php
This commit is contained in:
parent
49f0421e90
commit
a2eab3ca43
11 changed files with 526 additions and 71 deletions
|
@ -27,5 +27,8 @@ return [
|
|||
'details_updated' => 'Server details have been successfully updated.',
|
||||
'docker_image_updated' => 'Successfully changed the default Docker image to use for this server. A reboot is required to apply this change.',
|
||||
'node_required' => 'You must have at least one node configured before you can add a server to this panel.',
|
||||
'transfer_nodes_required' => 'You must have at least two nodes configured before you can transfer servers.',
|
||||
'transfer_started' => 'Server transfer has been started.',
|
||||
'transfer_not_viable' => 'The node you selected is not viable for this transfer.',
|
||||
],
|
||||
];
|
||||
|
|
|
@ -20,80 +20,164 @@
|
|||
@endsection
|
||||
|
||||
@section('content')
|
||||
@include('admin.servers.partials.navigation')
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Reinstall Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will reinstall the server with the assigned pack and service scripts. <strong>Danger!</strong> This could overwrite server data.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
@if($server->installed === 1)
|
||||
<form action="{{ route('admin.servers.view.manage.reinstall', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-danger">Reinstall Server</button>
|
||||
</form>
|
||||
@else
|
||||
<button class="btn btn-danger disabled">Server Must Install Properly to Reinstall</button>
|
||||
@endif
|
||||
@include('admin.servers.partials.navigation')
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Reinstall Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will reinstall the server with the assigned pack and service scripts. <strong>Danger!</strong> This could overwrite server data.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
@if($server->installed === 1)
|
||||
<form action="{{ route('admin.servers.view.manage.reinstall', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-danger">Reinstall Server</button>
|
||||
</form>
|
||||
@else
|
||||
<button class="btn btn-danger disabled">Server Must Install Properly to Reinstall</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Install Status</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>If you need to change the install status from uninstalled to installed, or vice versa, you may do so with the button below.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.toggle', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-primary">Toggle Install Status</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(! $server->suspended)
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Suspend Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will suspend the server, stop any running processes, and immediately block the user from being able to access their files or otherwise manage the server through the panel or API.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.suspension', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="action" value="suspend" />
|
||||
<button type="submit" class="btn btn-warning">Suspend Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Unsuspend Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will unsuspend the server and restore normal user access.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.suspension', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="action" value="unsuspend" />
|
||||
<button type="submit" class="btn btn-success">Unsuspend Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($canTransfer)
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Transfer Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>
|
||||
Hopefully, you will soon be able to move servers around without needing to do a bunch of confusing
|
||||
operations manually and it will work fluidly and with no problems.
|
||||
</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button class="btn btn-success" data-toggle="modal" data-target="#transferServerModal">Transfer Server</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Install Status</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>If you need to change the install status from uninstalled to installed, or vice versa, you may do so with the button below.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.toggle', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<button type="submit" class="btn btn-primary">Toggle Install Status</button>
|
||||
|
||||
<div class="modal fade" id="transferServerModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<!-- TODO: Change route -->
|
||||
<form action="{{ route('admin.servers.view.manage.transfer', $server->id) }}" method="POST">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">Transfer Server</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="pNodeId">Node</label>
|
||||
<select name="node_id" id="pNodeId" class="form-control">
|
||||
@foreach($locations as $location)
|
||||
<optgroup label="{{ $location->long }} ({{ $location->short }})">
|
||||
@foreach($location->nodes as $node)
|
||||
|
||||
@if($node->id != $server->node_id)
|
||||
<option value="{{ $node->id }}"
|
||||
@if($location->id === old('location_id')) selected @endif
|
||||
>{{ $node->name }}</option>
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
</optgroup>
|
||||
@endforeach
|
||||
</select>
|
||||
<p class="small text-muted no-margin">The node which this server will be transferred to.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="pAllocation">Default Allocation</label>
|
||||
<select name="allocation_id" id="pAllocation" class="form-control"></select>
|
||||
<p class="small text-muted no-margin">The main allocation that will be assigned to this server.</p>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<label for="pAllocationAdditional">Additional Allocation(s)</label>
|
||||
<select name="allocation_additional[]" id="pAllocationAdditional" class="form-control" multiple></select>
|
||||
<p class="small text-muted no-margin">Additional allocations to assign to this server on creation.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
{!! csrf_field() !!}
|
||||
<button type="button" class="btn btn-default btn-sm pull-left" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-success btn-sm">Confirm</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(! $server->suspended)
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Suspend Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will suspend the server, stop any running processes, and immediately block the user from being able to access their files or otherwise manage the server through the panel or API.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.suspension', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="action" value="suspend" />
|
||||
<button type="submit" class="btn btn-warning">Suspend Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="col-sm-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Unsuspend Server</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<p>This will unsuspend the server and restore normal user access.</p>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<form action="{{ route('admin.servers.view.manage.suspension', $server->id) }}" method="POST">
|
||||
{!! csrf_field() !!}
|
||||
<input type="hidden" name="action" value="unsuspend" />
|
||||
<button type="submit" class="btn btn-success">Unsuspend Server</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('footer-scripts')
|
||||
@parent
|
||||
{!! Theme::js('vendor/lodash/lodash.js') !!}
|
||||
|
||||
@if($canTransfer)
|
||||
{!! Theme::js('js/admin/server/transfer.js') !!}
|
||||
@endif
|
||||
@endsection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue