| @@ 107-121 (lines=15) @@ | ||
| 104 | return redirect()->route('admin.services.service', $service)->withInput(); |
|
| 105 | } |
|
| 106 | ||
| 107 | public function deleteService(Request $request, $service) |
|
| 108 | { |
|
| 109 | try { |
|
| 110 | $repo = new ServiceRepository\Service; |
|
| 111 | $repo->delete($service); |
|
| 112 | Alert::success('Successfully deleted that service.')->flash(); |
|
| 113 | ||
| 114 | return redirect()->route('admin.services'); |
|
| 115 | } catch (DisplayException $ex) { |
|
| 116 | Alert::danger($ex->getMessage())->flash(); |
|
| 117 | } catch (\Exception $ex) { |
|
| 118 | Log::error($ex); |
|
| 119 | Alert::danger('An error was encountered while attempting to delete that service.')->flash(); |
|
| 120 | } |
|
| 121 | ||
| 122 | return redirect()->route('admin.services.service', $service); |
|
| 123 | } |
|
| 124 | ||
| @@ 152-169 (lines=18) @@ | ||
| 149 | return redirect()->route('admin.services.option', [$service, $option])->withInput(); |
|
| 150 | } |
|
| 151 | ||
| 152 | public function deleteOption(Request $request, $service, $option) |
|
| 153 | { |
|
| 154 | try { |
|
| 155 | $repo = new ServiceRepository\Option; |
|
| 156 | $repo->delete($option); |
|
| 157 | ||
| 158 | Alert::success('Successfully deleted that option.')->flash(); |
|
| 159 | ||
| 160 | return redirect()->route('admin.services.service', $service); |
|
| 161 | } catch (DisplayException $ex) { |
|
| 162 | Alert::danger($ex->getMessage())->flash(); |
|
| 163 | } catch (\Exception $ex) { |
|
| 164 | Log::error($ex); |
|
| 165 | Alert::danger('An error was encountered while attempting to delete this option.')->flash(); |
|
| 166 | } |
|
| 167 | ||
| 168 | return redirect()->route('admin.services.option', [$service, $option]); |
|
| 169 | } |
|
| 170 | ||
| 171 | public function postOptionVariable(Request $request, $service, $option, $variable) |
|
| 172 | { |
|
| @@ 332-349 (lines=18) @@ | ||
| 329 | * @param int $id |
|
| 330 | * @return \Illuminate\Http\RedirectResponse |
|
| 331 | */ |
|
| 332 | public function delete(Request $request, $id) |
|
| 333 | { |
|
| 334 | $repo = new NodeRepository; |
|
| 335 | ||
| 336 | try { |
|
| 337 | $repo->delete($id); |
|
| 338 | Alert::success('Successfully deleted the requested node from the panel.')->flash(); |
|
| 339 | ||
| 340 | return redirect()->route('admin.nodes'); |
|
| 341 | } catch (DisplayException $ex) { |
|
| 342 | Alert::danger($ex->getMessage())->flash(); |
|
| 343 | } catch (\Exception $ex) { |
|
| 344 | Log::error($ex); |
|
| 345 | Alert::danger('An unhandled exception occured while attempting to delete this node. Please try again.')->flash(); |
|
| 346 | } |
|
| 347 | ||
| 348 | return redirect()->route('admin.nodes.view', $id); |
|
| 349 | } |
|
| 350 | ||
| 351 | /** |
|
| 352 | * Returns the configuration token to auto-deploy a node. |
|
| @@ 306-321 (lines=16) @@ | ||
| 303 | * @param int $id |
|
| 304 | * @return \Illuminate\Response\RedirectResponse |
|
| 305 | */ |
|
| 306 | public function toggleInstall(Request $request, $id) |
|
| 307 | { |
|
| 308 | $repo = new ServerRepository; |
|
| 309 | try { |
|
| 310 | $repo->toggleInstall($id); |
|
| 311 | ||
| 312 | Alert::success('Server install status was successfully toggled.')->flash(); |
|
| 313 | } catch (DisplayException $ex) { |
|
| 314 | Alert::danger($ex->getMessage())->flash(); |
|
| 315 | } catch (\Exception $ex) { |
|
| 316 | Log::error($ex); |
|
| 317 | Alert::danger('An unhandled exception occured while attemping to toggle this servers status. This error has been logged.')->flash(); |
|
| 318 | } |
|
| 319 | ||
| 320 | return redirect()->route('admin.servers.view.manage', $id); |
|
| 321 | } |
|
| 322 | ||
| 323 | /** |
|
| 324 | * Setup a server to have a container rebuild. |
|
| @@ 418-433 (lines=16) @@ | ||
| 415 | * @param int $id |
|
| 416 | * @return \Illuminate\Response\RedirectResponse |
|
| 417 | */ |
|
| 418 | public function delete(Request $request, $id) |
|
| 419 | { |
|
| 420 | $repo = new ServerRepository; |
|
| 421 | ||
| 422 | try { |
|
| 423 | $repo->queueDeletion($id, ($request->input('is_force') > 0)); |
|
| 424 | Alert::success('Server has been marked for deletion on the system.')->flash(); |
|
| 425 | } catch (DisplayException $ex) { |
|
| 426 | Alert::danger($ex->getMessage())->flash(); |
|
| 427 | } catch (\Exception $ex) { |
|
| 428 | Log::error($ex); |
|
| 429 | Alert::danger('An unhandled exception occured while attemping to delete this server. This error has been logged.')->flash(); |
|
| 430 | } |
|
| 431 | ||
| 432 | return redirect()->route('admin.servers.view.delete', $id); |
|
| 433 | } |
|
| 434 | ||
| 435 | /** |
|
| 436 | * Cancels a pending server deletion request. |
|
| @@ 73-87 (lines=15) @@ | ||
| 70 | ]); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function deleteUser(Request $request, $id) |
|
| 74 | { |
|
| 75 | try { |
|
| 76 | $repo = new UserRepository; |
|
| 77 | $repo->delete($id); |
|
| 78 | Alert::success('Successfully deleted user from system.')->flash(); |
|
| 79 | ||
| 80 | return redirect()->route('admin.users'); |
|
| 81 | } catch (DisplayException $ex) { |
|
| 82 | Alert::danger($ex->getMessage())->flash(); |
|
| 83 | } catch (\Exception $ex) { |
|
| 84 | Log::error($ex); |
|
| 85 | Alert::danger('An exception was encountered while attempting to delete this user.')->flash(); |
|
| 86 | } |
|
| 87 | ||
| 88 | return redirect()->route('admin.users.view', $id); |
|
| 89 | } |
|
| 90 | ||