update
This commit is contained in:
@@ -13,7 +13,7 @@ class LoginController extends Controller
|
||||
//
|
||||
public function index()
|
||||
{
|
||||
return view("administrator.pages.s.auth.login");
|
||||
return view("administrator.pages.auth.login");
|
||||
}
|
||||
public function store(Request $request)
|
||||
{
|
||||
|
||||
@@ -147,7 +147,7 @@ class MainController extends Controller
|
||||
);
|
||||
$title = 'System Activity Log';
|
||||
|
||||
return view('administrator.pages.s.log', compact('title', 'logs'));
|
||||
return view('administrator.pages.log', compact('title', 'logs'));
|
||||
}
|
||||
|
||||
public function ClearCache()
|
||||
|
||||
@@ -23,14 +23,14 @@ class SettingController extends Controller
|
||||
{
|
||||
$title = 'General Setting';
|
||||
|
||||
return view('administrator.pages.setting', compact('title'));
|
||||
return view('administrator.pagesetting', compact('title'));
|
||||
}
|
||||
|
||||
public function smtp()
|
||||
{
|
||||
$title = 'SMTP Setting';
|
||||
|
||||
return view('administrator.pages.smtp', compact('title'));
|
||||
return view('administrator.pagesmtp', compact('title'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
|
||||
@@ -23,7 +23,7 @@ class SupportController extends Controller
|
||||
|
||||
$tickets = $this->ticketRepository->filter($request->merge(['page' => $request->get('1') ?? 1])->all());
|
||||
$title = "All Support Ticket";
|
||||
return view('administrator.pages.support.index', compact('title', 'tickets'));
|
||||
return view('administrator.pagesupport.index', compact('title', 'tickets'));
|
||||
}
|
||||
|
||||
public function edit(int $ticket_num = 0)
|
||||
@@ -40,7 +40,7 @@ class SupportController extends Controller
|
||||
|
||||
$title = "Ticket #" . $ticket_num;
|
||||
|
||||
return view("administrator.pages.support.view", compact('title', 'ticket'));
|
||||
return view("administrator.pagesupport.view", compact('title', 'ticket'));
|
||||
}
|
||||
|
||||
public function reply(int $id = 0, TicketReplyRequest $request)
|
||||
|
||||
@@ -43,7 +43,7 @@ class Network extends Controller
|
||||
{
|
||||
$title = 'Add Network';
|
||||
|
||||
return view('administrator.pages.s.package.network.add', compact('title'));
|
||||
return view('administrator.pages.package.network.add', compact('title'));
|
||||
}
|
||||
public function store(NetworkRequest $request)
|
||||
{
|
||||
|
||||
@@ -42,8 +42,7 @@ class OsVersion extends Controller
|
||||
{
|
||||
$validatedData = $request->validated();
|
||||
|
||||
// Remove unnecessary fields
|
||||
unset($validatedData['vcenter_id'], $validatedData['module_datacenter_id']);
|
||||
unset($validatedData['module_datacenter_id']);
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
@@ -88,22 +87,21 @@ class OsVersion extends Controller
|
||||
}
|
||||
return redirect()->route('package.version.index')->with('success', 'Update successfully');
|
||||
}
|
||||
public function destroy(Request $request)
|
||||
public function destroy($id)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
'oid' => 'numeric'
|
||||
]);
|
||||
if ($validator->fails()) {
|
||||
return back()->withErrors($validator->getMessageBag());
|
||||
}
|
||||
try {
|
||||
$version = $this->osRepository->find($id);
|
||||
if (!$version) {
|
||||
return back()->withErrors('Can\'t find version os by ID #' . $id);
|
||||
}
|
||||
|
||||
$version = Os::find($request->oid);
|
||||
if (! $version) {
|
||||
return back()->withErrors('Can\'t find version os by ID #' . $request->oid);
|
||||
}
|
||||
$version->delete();
|
||||
$version->delete();
|
||||
|
||||
return back()->with('success', 'Delete success');
|
||||
return redirect()->route('package.version.index')
|
||||
->with('success', 'OS Version deleted successfully');
|
||||
} catch (\Exception $error) {
|
||||
return back()->withErrors('Failed to delete OS Version: ' . $error->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable(Request $request)
|
||||
@@ -124,10 +122,18 @@ class OsVersion extends Controller
|
||||
return $d->getStatus();
|
||||
})
|
||||
->addColumn('action', function ($d) {
|
||||
return '<a href="' . route('package.version.edit', $d->id) . '"
|
||||
class="btn btn-primary btn-sm">
|
||||
Edit
|
||||
$editBtn = '<a href="' . route('package.version.edit', $d->id) . '"
|
||||
class="btn btn-primary">
|
||||
<i data-lucide="edit" class="w-12px h-12px"></i>
|
||||
</a>';
|
||||
|
||||
$deleteBtn = '<button type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="showDeleteModal(' . $d->id . ', \'' . addslashes($d->version) . '\')">
|
||||
<i data-lucide="trash-2" class="w-12px h-12px"></i>
|
||||
</button>';
|
||||
|
||||
return '<div class="btn-group" role="group">' . $editBtn . $deleteBtn . '</div>';
|
||||
})
|
||||
->filterColumn('host', function ($query, $keyword) {
|
||||
$query->whereHas('host', function ($q) use ($keyword) {
|
||||
|
||||
Reference in New Issue
Block a user