| @@ 112-127 (lines=16) @@ | ||
| 109 | return redirect()->route('admin.nodes.new')->withInput(); |
|
| 110 | } |
|
| 111 | ||
| 112 | public function getView(Request $request, $id) |
|
| 113 | { |
|
| 114 | $node = Models\Node::with( |
|
| 115 | 'servers.user', |
|
| 116 | 'servers.service', |
|
| 117 | 'servers.allocations', |
|
| 118 | 'location' |
|
| 119 | )->findOrFail($id); |
|
| 120 | $node->setRelation('allocations', $node->allocations()->paginate(40)); |
|
| 121 | ||
| 122 | return view('admin.nodes.view', [ |
|
| 123 | 'node' => $node, |
|
| 124 | 'stats' => Models\Server::select(DB::raw('SUM(memory) as memory, SUM(disk) as disk'))->where('node_id', $node->id)->first(), |
|
| 125 | 'locations' => Models\Location::all(), |
|
| 126 | ]); |
|
| 127 | } |
|
| 128 | ||
| 129 | public function postView(Request $request, $id) |
|
| 130 | { |
|
| @@ 131-144 (lines=14) @@ | ||
| 128 | return redirect()->route('admin.services.service', $service); |
|
| 129 | } |
|
| 130 | ||
| 131 | public function getOption(Request $request, $service, $option) |
|
| 132 | { |
|
| 133 | $opt = Models\ServiceOptions::findOrFail($option); |
|
| 134 | ||
| 135 | return view('admin.services.options.view', [ |
|
| 136 | 'service' => Models\Service::findOrFail($opt->parent_service), |
|
| 137 | 'option' => $opt, |
|
| 138 | 'variables' => Models\ServiceVariables::where('option_id', $option)->get(), |
|
| 139 | 'servers' => Models\Server::select('servers.*', 'users.email as a_ownerEmail') |
|
| 140 | ->join('users', 'users.id', '=', 'servers.owner_id') |
|
| 141 | ->where('option', $option) |
|
| 142 | ->paginate(10), |
|
| 143 | ]); |
|
| 144 | } |
|
| 145 | ||
| 146 | public function postOption(Request $request, $service, $option) |
|
| 147 | { |
|