feat: Enhance service management and transaction handling
- Implemented client access token verification middleware to secure API endpoints. - Updated ServiceController to fetch active hosting services for authenticated users. - Refactored OrderController to ensure order retrieval is customer-specific. - Improved error logging in VmController for unexpected vCenter responses. - Disabled VNPay auto-deposit in TransactionController, switching to manual deposit flow. - Enhanced ServiceClientDetailResource to include Plesk credentials for hosting accounts. - Adjusted VpsServiceResource to dynamically set page type based on product type. - Added logging for PowerShellService to capture errors in RDP port changes. - Provisioning job now resolves service plans and logs relevant information for hosting accounts. - Updated database migrations to add necessary fields for service plans and DNS servers. - Refactored Service and ServicePlan models to establish relationships with hosting accounts and DNS servers.
This commit is contained in:
@@ -22,6 +22,7 @@ class ServerController extends Controller
|
||||
$perPage = min((int) $request->get('per_page', 15), 500);
|
||||
$filter = $request->get('filter');
|
||||
$status = $request->get('status');
|
||||
$type = $request->get('type');
|
||||
|
||||
$query = $this->serverRepository->model->newQuery();
|
||||
|
||||
@@ -37,6 +38,14 @@ class ServerController extends Controller
|
||||
$query->where('status', $status);
|
||||
}
|
||||
|
||||
if ($type === 'hosting') {
|
||||
$query->whereIn('type', ['hosting', 'both']);
|
||||
} elseif ($type === 'domain') {
|
||||
$query->whereIn('type', ['domain', 'both']);
|
||||
} elseif ($type !== null && $type !== '') {
|
||||
$query->where('type', $type);
|
||||
}
|
||||
|
||||
$paginator = $query->orderByDesc('id')->paginate($perPage);
|
||||
|
||||
return response()->json([
|
||||
@@ -70,6 +79,7 @@ class ServerController extends Controller
|
||||
$validated = $request->validate([
|
||||
'name' => 'required|string|max:255',
|
||||
'ip_address' => 'required|string|max:255',
|
||||
'panel_port' => 'nullable|integer|min:1|max:65535',
|
||||
'username' => 'required|string|max:255',
|
||||
'password' => 'required|string|max:255',
|
||||
'api_key' => 'nullable|string',
|
||||
@@ -83,6 +93,7 @@ class ServerController extends Controller
|
||||
$server = $this->serverRepository->create([
|
||||
'name' => $validated['name'],
|
||||
'ip_address' => $validated['ip_address'],
|
||||
'panel_port' => $validated['panel_port'] ?? 8880,
|
||||
'username' => $validated['username'],
|
||||
'password' => Crypt::encryptString($validated['password']),
|
||||
'api_key' => $validated['api_key'] ?? null,
|
||||
@@ -114,6 +125,7 @@ class ServerController extends Controller
|
||||
$validated = $request->validate([
|
||||
'name' => 'sometimes|required|string|max:255',
|
||||
'ip_address' => 'sometimes|required|string|max:255',
|
||||
'panel_port' => 'nullable|integer|min:1|max:65535',
|
||||
'username' => 'sometimes|required|string|max:255',
|
||||
'password' => 'nullable|string|max:255',
|
||||
'api_key' => 'nullable|string',
|
||||
@@ -182,6 +194,7 @@ class ServerController extends Controller
|
||||
'id' => $server->id,
|
||||
'name' => $server->name,
|
||||
'ip_address' => $server->ip_address,
|
||||
'panel_port' => $server->panel_port,
|
||||
'username' => $server->username,
|
||||
'api_key' => $server->api_key,
|
||||
'status' => $server->status,
|
||||
|
||||
Reference in New Issue
Block a user