Merge branch 'develop' into feature/admin-retheme

This commit is contained in:
Dane Everitt 2017-02-23 21:24:17 -05:00
commit 8f96b35db1
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
12 changed files with 31 additions and 15 deletions

View file

@ -163,7 +163,7 @@ class NodesController extends Controller
public function deallocateBlock(Request $request, $node)
{
$query = Models\Allocation::where('node', $node)->whereNull('server_id')->where('ip', $request->input('ip'))->delete();
$query = Models\Allocation::where('node_id', $node)->whereNull('server_id')->where('ip', $request->input('ip'))->delete();
if ((int) $query === 0) {
Alert::danger('There was an error while attempting to delete allocations on that IP.')->flash();
@ -199,7 +199,7 @@ class NodesController extends Controller
public function getAllocationsJson(Request $request, $id)
{
$allocations = Models\Allocation::select('ip')->where('node', $id)->groupBy('ip')->get();
$allocations = Models\Allocation::select('ip')->where('node_id', $id)->groupBy('ip')->get();
return response()->json($allocations);
}

View file

@ -254,7 +254,7 @@ class ServersController extends Controller
try {
$res = $server->node->guzzleClient([
'X-Access-Server' => $server->uuid,
'X-Access-Token' => $node->daemonSecret,
'X-Access-Token' => $server->node->daemonSecret,
])->request('POST', '/server/rebuild');
Alert::success('A rebuild has been queued successfully. It will run the next time this server is booted.')->flash();
} catch (\GuzzleHttp\Exception\TransferException $ex) {

View file

@ -80,6 +80,7 @@ class APIController extends Controller
return response('', 204);
} catch (\Exception $ex) {
Log::error($ex);
return response()->json([
'error' => 'An error occured while attempting to remove this key.',
], 503);