Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/views/admin/servers/view/details.blade.php
7461 views
1
@extends('layouts.admin')
2
3
@section('title')
4
Server — {{ $server->name }}: Details
5
@endsection
6
7
@section('content-header')
8
<h1>{{ $server->name }}<small>Edit details for this server including owner and container.</small></h1>
9
<ol class="breadcrumb">
10
<li><a href="{{ route('admin.index') }}">Admin</a></li>
11
<li><a href="{{ route('admin.servers') }}">Servers</a></li>
12
<li><a href="{{ route('admin.servers.view', $server->id) }}">{{ $server->name }}</a></li>
13
<li class="active">Details</li>
14
</ol>
15
@endsection
16
17
@section('content')
18
@include('admin.servers.partials.navigation')
19
<div class="row">
20
<div class="col-xs-12">
21
<div class="box box-primary">
22
<div class="box-header with-border">
23
<h3 class="box-title">Base Information</h3>
24
</div>
25
<form action="{{ route('admin.servers.view.details', $server->id) }}" method="POST">
26
<div class="box-body">
27
<div class="form-group">
28
<label for="name" class="control-label">Server Name <span class="field-required"></span></label>
29
<input type="text" name="name" value="{{ old('name', $server->name) }}" class="form-control" />
30
<p class="text-muted small">Character limits: <code>a-zA-Z0-9_-</code> and <code>[Space]</code>.</p>
31
</div>
32
<div class="form-group">
33
<label for="external_id" class="control-label">External Identifier</label>
34
<input type="text" name="external_id" value="{{ old('external_id', $server->external_id) }}" class="form-control" />
35
<p class="text-muted small">Leave empty to not assign an external identifier for this server. The external ID should be unique to this server and not be in use by any other servers.</p>
36
</div>
37
<div class="form-group">
38
<label for="pUserId" class="control-label">Server Owner <span class="field-required"></span></label>
39
<select name="owner_id" class="form-control" id="pUserId">
40
<option value="{{ $server->owner_id }}" selected>{{ $server->user->email }}</option>
41
</select>
42
<p class="text-muted small">You can change the owner of this server by changing this field to an email matching another use on this system. If you do this a new daemon security token will be generated automatically.</p>
43
</div>
44
<div class="form-group">
45
<label for="description" class="control-label">Server Description</label>
46
<textarea name="description" rows="3" class="form-control">{{ old('description', $server->description) }}</textarea>
47
<p class="text-muted small">A brief description of this server.</p>
48
</div>
49
</div>
50
<div class="box-footer">
51
{!! csrf_field() !!}
52
{!! method_field('PATCH') !!}
53
<input type="submit" class="btn btn-sm btn-primary" value="Update Details" />
54
</div>
55
</form>
56
</div>
57
</div>
58
</div>
59
@endsection
60
61
@section('footer-scripts')
62
@parent
63
<script>
64
function escapeHtml(str) {
65
var div = document.createElement('div');
66
div.appendChild(document.createTextNode(str));
67
return div.innerHTML;
68
}
69
70
$('#pUserId').select2({
71
ajax: {
72
url: '/admin/users/accounts.json',
73
dataType: 'json',
74
delay: 250,
75
data: function (params) {
76
return {
77
filter: { email: params.term },
78
page: params.page,
79
};
80
},
81
processResults: function (data, params) {
82
return { results: data };
83
},
84
cache: true,
85
},
86
escapeMarkup: function (markup) { return markup; },
87
minimumInputLength: 2,
88
templateResult: function (data) {
89
if (data.loading) return escapeHtml(data.text);
90
91
return '<div class="user-block"> \
92
<img class="img-circle img-bordered-xs" src="https://www.gravatar.com/avatar/' + escapeHtml(data.md5) + '?s=120" alt="User Image"> \
93
<span class="username"> \
94
<a href="#">' + escapeHtml(data.name_first) + ' ' + escapeHtml(data.name_last) +'</a> \
95
</span> \
96
<span class="description"><strong>' + escapeHtml(data.email) + '</strong> - ' + escapeHtml(data.username) + '</span> \
97
</div>';
98
},
99
templateSelection: function (data) {
100
if (typeof data.name_first === 'undefined') {
101
data = {
102
md5: '{{ md5(strtolower($server->user->email)) }}',
103
name_first: '{{ $server->user->name_first }}',
104
name_last: '{{ $server->user->name_last }}',
105
email: '{{ $server->user->email }}',
106
id: {{ $server->owner_id }}
107
};
108
}
109
110
return '<div> \
111
<span> \
112
<img class="img-rounded img-bordered-xs" src="https://www.gravatar.com/avatar/' + escapeHtml(data.md5) + '?s=120" style="height:28px;margin-top:-4px;" alt="User Image"> \
113
</span> \
114
<span style="padding-left:5px;"> \
115
' + escapeHtml(data.name_first) + ' ' + escapeHtml(data.name_last) + ' (<strong>' + escapeHtml(data.email) + '</strong>) \
116
</span> \
117
</div>';
118
}
119
});
120
</script>
121
@endsection
122
123