|
| 1 | +{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}} |
| 2 | + |
| 3 | +{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}} |
| 4 | +{{-- of this software and associated documentation files (the "Software"), to deal --}} |
| 5 | +{{-- in the Software without restriction, including without limitation the rights --}} |
| 6 | +{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}} |
| 7 | +{{-- copies of the Software, and to permit persons to whom the Software is --}} |
| 8 | +{{-- furnished to do so, subject to the following conditions: --}} |
| 9 | + |
| 10 | +{{-- The above copyright notice and this permission notice shall be included in all --}} |
| 11 | +{{-- copies or substantial portions of the Software. --}} |
| 12 | + |
| 13 | +{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}} |
| 14 | +{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}} |
| 15 | +{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}} |
| 16 | +{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}} |
| 17 | +{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}} |
| 18 | +{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}} |
| 19 | +{{-- SOFTWARE. --}} |
| 20 | +@extends('layouts.master') |
| 21 | + |
| 22 | +@section('title') |
| 23 | + @lang('server.config.allocation.header') |
| 24 | +@endsection |
| 25 | + |
| 26 | +@section('content-header') |
| 27 | + <h1>@lang('server.config.allocation.header')<small>@lang('server.config.allocation.header_sub')</small></h1> |
| 28 | + <ol class="breadcrumb"> |
| 29 | + <li><a href="{{ route('index') }}">@lang('strings.home')</a></li> |
| 30 | + <li><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></li> |
| 31 | + <li>@lang('navigation.server.configuration')</li> |
| 32 | + <li class="active">@lang('navigation.server.port_allocations')</li> |
| 33 | + </ol> |
| 34 | +@endsection |
| 35 | + |
| 36 | +@section('content') |
| 37 | +<div class="row"> |
| 38 | + <div class="col-sm-8"> |
| 39 | + <div class="box"> |
| 40 | + <div class="box-header with-border"> |
| 41 | + <h3 class="box-title">@lang('server.config.allocation.available')</h3> |
| 42 | + </div> |
| 43 | + <div class="box-body table-responsive no-padding"> |
| 44 | + <table class="table table-hover"> |
| 45 | + <tbody> |
| 46 | + <tr> |
| 47 | + <th>@lang('strings.ip')</th> |
| 48 | + <th>@lang('strings.alias')</th> |
| 49 | + <th>@lang('strings.port')</th> |
| 50 | + <th></th> |
| 51 | + </tr> |
| 52 | + @foreach ($allocations as $allocation) |
| 53 | + <tr> |
| 54 | + <td> |
| 55 | + <code>{{ $allocation->ip }}</code> |
| 56 | + </td> |
| 57 | + <td class="middle"> |
| 58 | + @if(is_null($allocation->ip_alias)) |
| 59 | + <span class="label label-default">@lang('strings.none')</span> |
| 60 | + @else |
| 61 | + <code>{{ $allocation->ip_alias }}</code> |
| 62 | + @endif |
| 63 | + </td> |
| 64 | + <td><code>{{ $allocation->port }}</code></td> |
| 65 | + <td class="col-xs-2 middle"> |
| 66 | + @if($allocation->id === $server->allocation) |
| 67 | + <span class="label label-success" data-allocation="{{ $allocation->id }}">@lang('strings.primary')</span> |
| 68 | + @else |
| 69 | + <span class="label label-default" data-action="set-connection" data-allocation="{{ $allocation->id }}">@lang('strings.make_primary')</span> |
| 70 | + @endif |
| 71 | + </td> |
| 72 | + </tr> |
| 73 | + @endforeach |
| 74 | + </tbody> |
| 75 | + </table> |
| 76 | + </div> |
| 77 | + </div> |
| 78 | + </div> |
| 79 | + <div class="col-sm-4"> |
| 80 | + <div class="box"> |
| 81 | + <div class="box-header with-border"> |
| 82 | + <h3 class="box-title">@lang('server.config.allocation.help')</h3> |
| 83 | + </div> |
| 84 | + <div class="box-body"> |
| 85 | + <p>@lang('server.config.allocation.help_text')</p> |
| 86 | + </div> |
| 87 | + </div> |
| 88 | + <div> |
| 89 | +</div> |
| 90 | +@endsection |
| 91 | + |
| 92 | +@section('footer-scripts') |
| 93 | + @parent |
| 94 | + {!! Theme::js('js/frontend/server.socket.js') !!} |
| 95 | + <script> |
| 96 | + @can('reset-db-password', $server) |
| 97 | + $('[data-action="reset-database-password"]').click(function (e) { |
| 98 | + e.preventDefault(); |
| 99 | + var block = $(this); |
| 100 | + $(this).find('i').addClass('fa-spin'); |
| 101 | + $.ajax({ |
| 102 | + type: 'POST', |
| 103 | + url: Router.route('server.ajax.reset-database-password', { server: Pterodactyl.server.uuidShort }), |
| 104 | + headers: { |
| 105 | + 'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'), |
| 106 | + }, |
| 107 | + data: { |
| 108 | + 'database': $(this).data('id') |
| 109 | + } |
| 110 | + }).done(function (data) { |
| 111 | + block.parent().find('code').html(data); |
| 112 | + }).fail(function(jqXHR, textStatus, errorThrown) { |
| 113 | + console.error(jqXHR); |
| 114 | + var error = 'An error occured while trying to process this request.'; |
| 115 | + if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') { |
| 116 | + error = jqXHR.responseJSON.error; |
| 117 | + } |
| 118 | + swal({ |
| 119 | + type: 'error', |
| 120 | + title: 'Whoops!', |
| 121 | + text: error |
| 122 | + }); |
| 123 | + }).always(function () { |
| 124 | + block.find('i').removeClass('fa-spin'); |
| 125 | + }); |
| 126 | + }); |
| 127 | + @endcan |
| 128 | + </script> |
| 129 | +@endsection |
0 commit comments