Assorted model code updates.
This commit is contained in:
parent
ba175e6b55
commit
efef356870
|
@ -112,10 +112,8 @@ class NodesController extends Controller
|
|||
public function getView(Request $request, $id)
|
||||
{
|
||||
$node = Models\Node::with(
|
||||
'servers.user',
|
||||
'servers.service',
|
||||
'servers.allocations',
|
||||
'location'
|
||||
'servers.user', 'servers.service',
|
||||
'servers.allocations', 'location'
|
||||
)->findOrFail($id);
|
||||
$node->setRelation('allocations', $node->allocations()->paginate(40));
|
||||
|
||||
|
@ -131,20 +129,12 @@ class NodesController extends Controller
|
|||
try {
|
||||
$node = new NodeRepository;
|
||||
$node->update($id, $request->only([
|
||||
'name',
|
||||
'location',
|
||||
'public',
|
||||
'fqdn',
|
||||
'scheme',
|
||||
'memory',
|
||||
'memory_overallocate',
|
||||
'disk',
|
||||
'disk_overallocate',
|
||||
'upload_size',
|
||||
'daemonBase',
|
||||
'daemonSFTP',
|
||||
'daemonListen',
|
||||
'reset_secret',
|
||||
'name', 'location', 'public',
|
||||
'fqdn', 'scheme', 'memory',
|
||||
'memory_overallocate', 'disk',
|
||||
'disk_overallocate', 'upload_size',
|
||||
'daemonBase', 'daemonSFTP',
|
||||
'daemonListen', 'reset_secret',
|
||||
]));
|
||||
Alert::success('Successfully update this node\'s information. If you changed any daemon settings you will need to restart it now.')->flash();
|
||||
|
||||
|
|
|
@ -73,12 +73,8 @@ class PackController extends Controller
|
|||
try {
|
||||
$repo = new Pack;
|
||||
$pack = $repo->create($request->only([
|
||||
'name',
|
||||
'version',
|
||||
'description',
|
||||
'option',
|
||||
'selectable',
|
||||
'visible',
|
||||
'name', 'version', 'description',
|
||||
'option', 'selectable', 'visible',
|
||||
'file_upload',
|
||||
]));
|
||||
Alert::success('Successfully created new service!')->flash();
|
||||
|
@ -128,12 +124,8 @@ class PackController extends Controller
|
|||
try {
|
||||
$repo = new Pack;
|
||||
$repo->update($id, $request->only([
|
||||
'name',
|
||||
'version',
|
||||
'description',
|
||||
'option',
|
||||
'selectable',
|
||||
'visible',
|
||||
'name', 'version', 'description',
|
||||
'option', 'selectable', 'visible',
|
||||
]));
|
||||
Alert::success('Service pack has been successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
|
|
|
@ -279,13 +279,9 @@ class ServersController extends Controller
|
|||
try {
|
||||
$server = new ServerRepository;
|
||||
$server->changeBuild($id, $request->only([
|
||||
'default',
|
||||
'add_additional',
|
||||
'remove_additional',
|
||||
'memory',
|
||||
'swap',
|
||||
'io',
|
||||
'cpu',
|
||||
'default', 'add_additional',
|
||||
'remove_additional', 'memory',
|
||||
'swap', 'io', 'cpu',
|
||||
]));
|
||||
Alert::success('Server details were successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
|
@ -377,9 +373,7 @@ class ServersController extends Controller
|
|||
try {
|
||||
$repo = new DatabaseRepository;
|
||||
$repo->create($id, $request->only([
|
||||
'db_server',
|
||||
'database',
|
||||
'remote',
|
||||
'db_server', 'database', 'remote',
|
||||
]));
|
||||
Alert::success('Added new database to this server.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
|
|
|
@ -59,11 +59,8 @@ class ServiceController extends Controller
|
|||
try {
|
||||
$repo = new ServiceRepository\Service;
|
||||
$service = $repo->create($request->only([
|
||||
'name',
|
||||
'description',
|
||||
'file',
|
||||
'executable',
|
||||
'startup',
|
||||
'name', 'description', 'file',
|
||||
'executable', 'startup',
|
||||
]));
|
||||
Alert::success('Successfully created new service!')->flash();
|
||||
|
||||
|
@ -92,11 +89,8 @@ class ServiceController extends Controller
|
|||
try {
|
||||
$repo = new ServiceRepository\Service;
|
||||
$repo->update($service, $request->only([
|
||||
'name',
|
||||
'description',
|
||||
'file',
|
||||
'executable',
|
||||
'startup',
|
||||
'name', 'description', 'file',
|
||||
'executable', 'startup',
|
||||
]));
|
||||
Alert::success('Successfully updated this service.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
|
@ -134,9 +128,7 @@ class ServiceController extends Controller
|
|||
$option = Models\ServiceOptions::with('service', 'variables')->findOrFail($option);
|
||||
$option->setRelation('servers', $option->servers()->with('user')->paginate(25));
|
||||
|
||||
return view('admin.services.options.view', [
|
||||
'option' => $option,
|
||||
]);
|
||||
return view('admin.services.options.view', ['option' => $option]);
|
||||
}
|
||||
|
||||
public function postOption(Request $request, $service, $option)
|
||||
|
@ -144,12 +136,8 @@ class ServiceController extends Controller
|
|||
try {
|
||||
$repo = new ServiceRepository\Option;
|
||||
$repo->update($option, $request->only([
|
||||
'name',
|
||||
'description',
|
||||
'tag',
|
||||
'executable',
|
||||
'docker_image',
|
||||
'startup',
|
||||
'name', 'description', 'tag',
|
||||
'executable', 'docker_image', 'startup',
|
||||
]));
|
||||
Alert::success('Option settings successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
|
@ -227,14 +215,9 @@ class ServiceController extends Controller
|
|||
try {
|
||||
$repo = new ServiceRepository\Variable;
|
||||
$repo->create($option, $request->only([
|
||||
'name',
|
||||
'description',
|
||||
'env_variable',
|
||||
'default_value',
|
||||
'user_viewable',
|
||||
'user_editable',
|
||||
'required',
|
||||
'regex',
|
||||
'name', 'description', 'env_variable',
|
||||
'default_value', 'user_viewable',
|
||||
'user_editable', 'required', 'regex',
|
||||
]));
|
||||
Alert::success('Successfully added new variable to this option.')->flash();
|
||||
|
||||
|
@ -311,10 +294,7 @@ class ServiceController extends Controller
|
|||
{
|
||||
try {
|
||||
$repo = new ServiceRepository\Service;
|
||||
$repo->updateFile($serviceId, $request->only([
|
||||
'file',
|
||||
'contents',
|
||||
]));
|
||||
$repo->updateFile($serviceId, $request->only(['file', 'contents']));
|
||||
|
||||
return response('', 204);
|
||||
} catch (DisplayException $ex) {
|
||||
|
|
|
@ -88,12 +88,8 @@ class UserController extends Controller
|
|||
try {
|
||||
$user = new UserRepository;
|
||||
$userid = $user->create($request->only([
|
||||
'email',
|
||||
'password',
|
||||
'name_first',
|
||||
'name_last',
|
||||
'username',
|
||||
'root_admin',
|
||||
'email', 'password', 'name_first',
|
||||
'name_last', 'username', 'root_admin',
|
||||
]));
|
||||
Alert::success('Account has been successfully created.')->flash();
|
||||
|
||||
|
@ -113,12 +109,8 @@ class UserController extends Controller
|
|||
try {
|
||||
$repo = new UserRepository;
|
||||
$repo->update($user, $request->only([
|
||||
'email',
|
||||
'password',
|
||||
'name_first',
|
||||
'name_last',
|
||||
'username',
|
||||
'root_admin',
|
||||
'email', 'password', 'name_first',
|
||||
'name_last', 'username', 'root_admin',
|
||||
]));
|
||||
Alert::success('User account was successfully updated.')->flash();
|
||||
} catch (DisplayValidationException $ex) {
|
||||
|
|
Loading…
Reference in New Issue