Skip to content

Commit 3e3da89

Browse files
authored
Merge pull request pterodactyl#540 from OrangeJuiced/develop
Fix node creation page not displaying old values and change redirect after creation
2 parents e252140 + a1376db commit 3e3da89

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

app/Http/Controllers/Admin/NodesController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ public function store(Request $request)
9494
'daemonBase', 'daemonSFTP', 'daemonListen',
9595
])
9696
));
97-
Alert::success('Successfully created new node that can be configured automatically on your remote machine by visiting the configuration tab. <strong>Before you can add any servers you need to first assign some IP addresses and ports.</strong>')->flash();
97+
Alert::success('Successfully created new node that can be configured automatically on your remote machine by visiting the configuration tab. <strong>Before you can add any servers you need to first assign some IP addresses and ports by adding an allocation.</strong>')->flash();
9898

99-
return redirect()->route('admin.nodes.view', $node->id);
99+
return redirect()->route('admin.nodes.view.allocation', $node->id);
100100
} catch (DisplayValidationException $e) {
101101
return redirect()->route('admin.nodes.new')->withErrors(json_decode($e->getMessage()))->withInput();
102102
} catch (DisplayException $e) {

resources/themes/pterodactyl/admin/nodes/new.blade.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,21 +43,26 @@
4343
<div class="box-body">
4444
<div class="form-group">
4545
<label for="pName" class="form-label">Name</label>
46-
<input type="text" name="name" id="pName" class="form-control" />
46+
<input type="text" name="name" id="pName" class="form-control" value="{{ old('name') }}"/>
4747
<p class="text-muted small">Character limits: <code>a-zA-Z0-9_.-</code> and <code>[Space]</code> (min 1, max 100 characters).</p>
4848
</div>
4949
<div class="form-group">
5050
<label for="pLocationId" class="form-label">Location</label>
5151
<select name="location_id" id="pLocationId">
5252
@foreach($locations as $location)
53-
<option value="{{ $location->id }}">{{ $location->short }}</option>
53+
@if($location->id == old('location_id'))
54+
<option value="{{ $location->id }}" selected>{{ $location->short }}</option>
55+
@else
56+
<option value="{{ $location->id }}">{{ $location->short }}</option>
57+
@endif
5458
@endforeach
5559
</select>
5660
</div>
5761
<div class="form-group">
5862
<label class="form-label">Node Visibility</label>
5963
<div>
6064
<div class="radio radio-success radio-inline">
65+
6166
<input type="radio" id="pPublicTrue" value="1" name="public" checked>
6267
<label for="pPublicTrue"> Public </label>
6368
</div>
@@ -70,7 +75,7 @@
7075
</div>
7176
<div class="form-group">
7277
<label for="pFQDN" class="form-label">FQDN</label>
73-
<input type="text" name="fqdn" id="pFQDN" class="form-control" />
78+
<input type="text" name="fqdn" id="pFQDN" class="form-control" value="{{ old('fqdn') }}"/>
7479
<p class="text-muted small">Please enter domain name (e.g <code>node.example.com</code>) to be used for connecting to the daemon. An IP address may be used <em>only</em> if you are not using SSL for this node.</p>
7580
</div>
7681
<div class="form-group">
@@ -119,14 +124,14 @@
119124
<div class="form-group col-md-6">
120125
<label for="pMemory" class="form-label">Total Memory</label>
121126
<div class="input-group">
122-
<input type="text" name="memory" data-multiplicator="true" class="form-control" id="pMemory"/>
127+
<input type="text" name="memory" data-multiplicator="true" class="form-control" id="pMemory" value="{{ old('memory') }}"/>
123128
<span class="input-group-addon">MB</span>
124129
</div>
125130
</div>
126131
<div class="form-group col-md-6">
127132
<label for="pMemoryOverallocate" class="form-label">Memory Over-Allocation</label>
128133
<div class="input-group">
129-
<input type="text" name="memory_overallocate" class="form-control" id="pMemoryOverallocate"/>
134+
<input type="text" name="memory_overallocate" class="form-control" id="pMemoryOverallocate" value="{{ old('memory_overallocate') }}"/>
130135
<span class="input-group-addon">%</span>
131136
</div>
132137
</div>
@@ -138,14 +143,14 @@
138143
<div class="form-group col-md-6">
139144
<label for="pDisk" class="form-label">Total Disk Space</label>
140145
<div class="input-group">
141-
<input type="text" name="disk" data-multiplicator="true" class="form-control" id="pDisk"/>
146+
<input type="text" name="disk" data-multiplicator="true" class="form-control" id="pDisk" value="{{ old('disk') }}"/>
142147
<span class="input-group-addon">MB</span>
143148
</div>
144149
</div>
145150
<div class="form-group col-md-6">
146151
<label for="pDiskOverallocate" class="form-label">Disk Over-Allocation</label>
147152
<div class="input-group">
148-
<input type="text" name="disk_overallocate" class="form-control" id="pDiskOverallocate"/>
153+
<input type="text" name="disk_overallocate" class="form-control" id="pDiskOverallocate" value="{{ old('disk_overallocate') }}"/>
149154
<span class="input-group-addon">%</span>
150155
</div>
151156
</div>

0 commit comments

Comments
 (0)