Add ability to change server name, closes #563

This commit is contained in:
Dane Everitt 2018-03-10 14:44:21 -06:00
parent e55d3c1a9a
commit f8e98e9c9e
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 156 additions and 3 deletions

View file

@ -27,5 +27,6 @@ return [
'edit_file' => 'Edit File',
'admin_header' => 'ADMINISTRATIVE',
'admin' => 'Server Configuration',
'server_name' => 'Server Name',
],
];

View file

@ -289,6 +289,11 @@ return [
],
],
'config' => [
'name' => [
'header' => 'Server Name',
'header_sub' => 'Change this server\'s name.',
'details' => 'The server name is only a reference to this server on the panel, and will not affect any server specific configurations that may display to users in games.',
],
'startup' => [
'header' => 'Start Configuration',
'header_sub' => 'Control server startup arguments.',

View file

@ -184,6 +184,9 @@
</span>
</a>
<ul class="treeview-menu">
@can('view-name', $server)
<li class="{{ Route::currentRouteName() !== 'server.settings.name' ?: 'active' }}"><a href="{{ route('server.settings.name', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> @lang('navigation.server.server_name')</a></li>
@endcan
@can('view-allocations', $server)
<li class="{{ Route::currentRouteName() !== 'server.settings.allocation' ?: 'active' }}"><a href="{{ route('server.settings.allocation', $server->uuidShort) }}"><i class="fa fa-angle-right"></i> @lang('navigation.server.port_allocations')</a></li>
@endcan

View file

@ -0,0 +1,50 @@
{{-- Pterodactyl - Panel --}}
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
{{-- This software is licensed under the terms of the MIT license. --}}
{{-- https://opensource.org/licenses/MIT --}}
@extends('layouts.master')
@section('title')
@lang('server.config.name.header')
@endsection
@section('content-header')
<h1>@lang('server.config.name.header')<small>@lang('server.config.name.header_sub')</small></h1>
<ol class="breadcrumb">
<li><a href="{{ route('index') }}">@lang('strings.home')</a></li>
<li><a href="{{ route('server.index', $server->uuidShort) }}">{{ $server->name }}</a></li>
<li>@lang('navigation.server.configuration')</li>
<li class="active">@lang('navigation.server.server_name')</li>
</ol>
@endsection
@section('content')
<div class="row">
<div class="col-xs-12">
<form action="{{ route('server.settings.name', $server->uuidShort) }}" method="POST">
<div class="box">
<div class="box-body">
<div class="form-group no-margin-bottom">
<label class="control-label" for="pServerName">@lang('server.config.name.header')</label>
<div>
<input type="text" name="name" id="pServerName" class="form-control" value="{{ $server->name }}" />
<p class="small text-muted no-margin-bottom">@lang('server.config.name.details')</p>
</div>
</div>
</div>
<div class="box-footer">
{{ method_field('PATCH') }}
{{ csrf_field() }}
<input type="submit" class="btn btn-sm btn-primary pull-right" value="@lang('strings.submit')" />
</div>
</div>
</form>
</div>
</div>
@endsection
@section('footer-scripts')
@parent
{!! Theme::js('js/frontend/server.socket.js') !!}
@endsection