refactor: implement centralized cache key management and add utility traits for vCenter SSH operations.

This commit is contained in:
pbao9
2026-05-16 16:52:21 +07:00
parent 06dbd54ecd
commit 8a115c5175
36 changed files with 1694 additions and 517 deletions
@@ -102,7 +102,7 @@ class VPSController extends Controller
], 400);
}
$result = $this->vCenterService->restartVM($vps, $vps->vmware_id);
$result = $this->vCenterService->StartVirtualMachine($vps, $vps->vmware_id);
if (is_string($result)) {
return response()->json([
@@ -114,7 +114,7 @@ class VPSController extends Controller
if ($result['error'] ?? true) {
return response()->json([
'error' => true,
'message' => $result['message'] ?? 'Failed to power on VM'
'message' => $result['data'] ?? 'Failed to power on VM'
], 400);
}
@@ -147,7 +147,7 @@ class VPSController extends Controller
], 400);
}
$result = $this->vCenterService->restartVM($vps, $vps->vmware_id);
$result = $this->vCenterService->ShutdownGuestVirtualMachine($vps, $vps->vmware_id);
if (is_string($result)) {
return response()->json([
@@ -159,7 +159,7 @@ class VPSController extends Controller
if ($result['error'] ?? true) {
return response()->json([
'error' => true,
'message' => $result['message'] ?? 'Failed to power off VM'
'message' => $result['data'] ?? 'Failed to power off VM'
], 400);
}