forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.blade.php
More file actions
192 lines (187 loc) · 10.9 KB
/
settings.blade.php
File metadata and controls
192 lines (187 loc) · 10.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
{{-- Copyright (c) 2015 - 2016 Dane Everitt <dane@daneeveritt.com> --}}
{{-- Permission is hereby granted, free of charge, to any person obtaining a copy --}}
{{-- of this software and associated documentation files (the "Software"), to deal --}}
{{-- in the Software without restriction, including without limitation the rights --}}
{{-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell --}}
{{-- copies of the Software, and to permit persons to whom the Software is --}}
{{-- furnished to do so, subject to the following conditions: --}}
{{-- The above copyright notice and this permission notice shall be included in all --}}
{{-- copies or substantial portions of the Software. --}}
{{-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR --}}
{{-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, --}}
{{-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE --}}
{{-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER --}}
{{-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, --}}
{{-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE --}}
{{-- SOFTWARE. --}}
@extends('layouts.master')
@section('title')
Server Settings
@endsection
@section('content')
<div class="col-md-12">
<h3 class="nopad">Server Settings</h3><hr />
<ul class="nav nav-tabs tabs_with_panel" id="config_tabs">
@can('view-sftp', $server)<li class="active"><a href="#tab_sftp" data-toggle="tab">SFTP Settings</a></li>@endcan
@can('view-startup', $server)<li><a href="#tab_startup" data-toggle="tab">Startup Configuration</a></li>@endcan
@can('view-databases', $server)<li><a href="#tab_databases" data-toggle="tab">Databases</a></li>@endcan
</ul>
<div class="tab-content">
@can('view-sftp', $server)
<div class="tab-pane active" id="tab_sftp">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">SFTP Connection Address:</label>
<div>
<input type="text" readonly="readonly" class="form-control" value="{{ $node->fqdn }}:{{ $node->daemonSFTP }}" />
</div>
</div>
<div class="form-group col-md-6">
<label class="control-label">SFTP Username:</label>
<div>
<input type="text" readonly="readonly" class="form-control" value="{{ $server->username }}" />
</div>
</div>
</div>
@can('reset-sftp', $server)
<form action="{{ route('server.settings.sftp', $server->uuidShort) }}" method="POST">
<div class="row">
<div class="form-group col-md-6">
<label class="control-label">New SFTP Password:</label>
<div>
<input type="password" name="sftp_pass" class="form-control" />
<p class="text-muted"><small>Passwords must meet the following requirements: at least one uppercase character, one lowercase character, one digit, and be at least 8 characters in length. <a href="#" data-action="generate-password">Click here</a> to generate one to use.</small></p>
</div>
</div>
<div class="form-group col-md-6">
<label class="control-label"> </label>
<div>
{!! csrf_field() !!}
<input type="submit" class="btn btn-sm btn-primary" value="Update Password" />
</div>
</div>
</div>
</form>
@endcan
</div>
</div>
</div>
@endcan
@can('view-startup', $server)
<div class="tab-pane" id="tab_startup">
<form action="{{ route('server.settings.startup', $server->uuidShort) }}" method="POST">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
<div class="row">
<div class="form-group col-md-12">
<label class="control-label">Startup Command:</label>
<div class="input-group">
<span class="input-group-addon">{{ $service->executable }}</span>
<input type="text" class="form-control" readonly="readonly" value="{{ $processedStartup }}" />
</div>
</div>
</div>
</div>
@can('edit-startup', $server)
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
<div class="panel-body">
<div class="row">
@foreach($variables as $item)
<div class="form-group col-md-6">
<label class="control-label">
@if($item->required === 1)<span class="label label-primary">Required</span> @endif
{{ $item->name }}
</label>
<div>
<input type="text"
@if($item->user_editable === 1)
name="{{ $item->env_variable }}"
@else
readonly="readonly"
@endif
class="form-control" value="{{ old($item->env_variable, $item->a_serverValue) }}" data-action="matchRegex" data-regex="{{ $item->regex }}" />
</div>
<p class="text-muted"><small>{{ $item->description }}<br />Regex: <code>{{ $item->regex }}</code><br />Access as: <code>{{{{$item->env_variable}}}}</code></small></p>
</div>
@endforeach
</div>
</div>
<div class="panel-heading" style="border-top: 1px solid #ddd;"></div>
<div class="panel-body">
<div class="row">
<div class="col-md-12">
{!! csrf_field() !!}
<input type="submit" class="btn btn-primary btn-sm" value="Update Startup Arguments" />
</div>
</div>
</div>
@endcan
</div>
</form>
</div>
@endcan
@can('view-databases', $server)
<div class="tab-pane active" id="tab_databases">
<div class="panel panel-default">
<div class="panel-heading"></div>
<div class="panel-body">
@if(count($databases) > 0)
<table class="table table-bordered table-hover" style="margin-bottom:0;">
<thead>
<tr>
<th>Database</th>
<th>User (Connections From)</th>
<th>Password</th>
<th>DB Server</th>
</th>
</thead>
<tbody>
@foreach($databases as $database)
<tr>
<td>{{ $database->database }}</td>
<td>{{ $database->username }} ({{ $database->remote }})</td>
<td><code>{{ Crypt::decrypt($database->password) }}</code></td>
<td><code>{{ $database->a_host }}:{{ $database->a_port }}</code></td>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="alert alert-info" style="margin-bottom:0;">
There are no databases configured for this server.
@if(Auth::user()->root_admin === 1)
<a href="{{ route('admin.servers.view', [
'id' => $server->id,
'tab' => 'tab_database'
]) }}" target="_blank">Add a new database.</a>
@endif
</div>
@endif
</div>
</div>
</div>
@endcan
</div>
</div>
<script>
$(document).ready(function () {
$('.server-settings').addClass('active');
$('[data-action="matchRegex"]').keyup(function (event) {
if (!$(this).data('regex')) return;
var input = $(this).val();
console.log(escapeRegExp($(this).data('regex')));
var regex = new RegExp(escapeRegExp($(this).data('regex')));
console.log(regex);
if (!regex.test(input)) {
$(this).parent().parent().removeClass('has-success').addClass('has-error');
} else {
$(this).parent().parent().removeClass('has-error').addClass('has-success');
}
});
});
</script>
@endsection