| @@ 335-352 (lines=18) @@ | ||
| 332 | * @param int $id |
|
| 333 | * @return \Illuminate\Http\RedirectResponse |
|
| 334 | */ |
|
| 335 | public function delete(Request $request, $id) |
|
| 336 | { |
|
| 337 | $repo = new NodeRepository; |
|
| 338 | ||
| 339 | try { |
|
| 340 | $repo->delete($id); |
|
| 341 | Alert::success('Successfully deleted the requested node from the panel.')->flash(); |
|
| 342 | ||
| 343 | return redirect()->route('admin.nodes'); |
|
| 344 | } catch (DisplayException $ex) { |
|
| 345 | Alert::danger($ex->getMessage())->flash(); |
|
| 346 | } catch (\Exception $ex) { |
|
| 347 | Log::error($ex); |
|
| 348 | Alert::danger('An unhandled exception occured while attempting to delete this node. Please try again.')->flash(); |
|
| 349 | } |
|
| 350 | ||
| 351 | return redirect()->route('admin.nodes.view', $id); |
|
| 352 | } |
|
| 353 | ||
| 354 | /** |
|
| 355 | * Returns the configuration token to auto-deploy a node. |
|
| @@ 90-104 (lines=15) @@ | ||
| 87 | * @param int $id |
|
| 88 | * @return \Illuminate\Http\RedirectResponse |
|
| 89 | */ |
|
| 90 | public function delete(Request $request, $id) |
|
| 91 | { |
|
| 92 | try { |
|
| 93 | $repo = new UserRepository; |
|
| 94 | $repo->delete($id); |
|
| 95 | Alert::success('Successfully deleted user from system.')->flash(); |
|
| 96 | ||
| 97 | return redirect()->route('admin.users'); |
|
| 98 | } catch (DisplayException $ex) { |
|
| 99 | Alert::danger($ex->getMessage())->flash(); |
|
| 100 | } catch (\Exception $ex) { |
|
| 101 | Log::error($ex); |
|
| 102 | Alert::danger('An exception was encountered while attempting to delete this user.')->flash(); |
|
| 103 | } |
|
| 104 | ||
| 105 | return redirect()->route('admin.users.view', $id); |
|
| 106 | } |
|
| 107 | ||
| @@ 308-323 (lines=16) @@ | ||
| 305 | * @param int $id |
|
| 306 | * @return \Illuminate\Http\RedirectResponse |
|
| 307 | */ |
|
| 308 | public function toggleInstall(Request $request, $id) |
|
| 309 | { |
|
| 310 | $repo = new ServerRepository; |
|
| 311 | try { |
|
| 312 | $repo->toggleInstall($id); |
|
| 313 | ||
| 314 | Alert::success('Server install status was successfully toggled.')->flash(); |
|
| 315 | } catch (DisplayException $ex) { |
|
| 316 | Alert::danger($ex->getMessage())->flash(); |
|
| 317 | } catch (\Exception $ex) { |
|
| 318 | Log::error($ex); |
|
| 319 | Alert::danger('An unhandled exception occured while attemping to toggle this servers status. This error has been logged.')->flash(); |
|
| 320 | } |
|
| 321 | ||
| 322 | return redirect()->route('admin.servers.view.manage', $id); |
|
| 323 | } |
|
| 324 | ||
| 325 | /** |
|
| 326 | * Setup a server to have a container rebuild. |
|