diff --git a/web/app/Controllers/CloudApiController.php b/web/app/Controllers/CloudApiController.php index bce5f44f..8ae9417e 100644 --- a/web/app/Controllers/CloudApiController.php +++ b/web/app/Controllers/CloudApiController.php @@ -17,6 +17,7 @@ use App\Services\Cloud\CloudEngineClient; use App\Services\Cloud\CloudError; use App\Services\Cloud\CloudInput; use App\Services\Cloud\CloudInstanceMetadata; +use App\Services\Cloud\CloudInstanceNameService; use App\Services\Cloud\CloudInstancePageService; use App\Services\Cloud\CloudInstanceRuntimeService; use App\Services\Cloud\CloudJobService; @@ -689,6 +690,7 @@ final class CloudApiController 'is_owner' => $owner, 'can_operate' => $canOperate, 'can_delete' => $canDelete, + 'can_rename' => $canDelete, 'can_view_credential' => $owner || $global, 'can_renew' => $lifecycleActive && $owner && $instance->expires_at !== null && (int) $instance->renewal_days > 0 @@ -955,6 +957,18 @@ final class CloudApiController return $this->json($response, $this->vmData(CloudAccess::instance($args['id'], $actor), $actor)); } + /** Rename only the PHP-owned display label; no engine operation is sent. */ + public function displayName($request, $response, $args) + { + $body = CloudInput::object($request); + CloudInput::only($body, ['name']); + return $this->json($response, CloudInstanceNameService::rename( + $args['id'] ?? null, + $this->actor($request), + $body['name'] ?? null + )); + } + public function operationLogs($request, $response, $args) { $actor = $this->actor($request); diff --git a/web/app/Controllers/CloudPageController.php b/web/app/Controllers/CloudPageController.php index ec829aca..f592c857 100644 --- a/web/app/Controllers/CloudPageController.php +++ b/web/app/Controllers/CloudPageController.php @@ -761,6 +761,7 @@ final class CloudPageController && (string) ($vm['os_source'] ?? '') === 'cloud_template', 'guest_hostname' => trim((string) ($vm['guest_hostname'] ?? '')) ?: '未记录', 'can_delete' => (bool) ($vm['can_delete'] ?? false), + 'can_rename' => (bool) ($vm['can_rename'] ?? false), 'service_status_label' => $serviceLabel, 'service_status_class' => $serviceClass, 'network_status_label' => $networkLabel, diff --git a/web/app/Middleware/CloudApi.php b/web/app/Middleware/CloudApi.php index 49aab4cf..ea322003 100644 --- a/web/app/Middleware/CloudApi.php +++ b/web/app/Middleware/CloudApi.php @@ -24,6 +24,7 @@ final class CloudApi || preg_match('#^/api/v1/admin/hosts/[0-9]+/(?:scheduling|capacity-sync)$#D', $path) === 1 || preg_match('#^/api/v1/ssh-keys(?:/|$)#D', $path) === 1 || preg_match('#^/api/v1/vms/[0-9]+/operations$#D', $path) === 1 + || preg_match('#^/api/v1/vms/[0-9]+/display-name$#D', $path) === 1 || $path === '/api/v1/announcements' || $path === '/api/v1/vms/page' // The normal list status poll reads only cloud_instance_runtime. diff --git a/web/app/Services/Cloud/CloudInstanceNameService.php b/web/app/Services/Cloud/CloudInstanceNameService.php new file mode 100644 index 00000000..13ebb26c --- /dev/null +++ b/web/app/Services/Cloud/CloudInstanceNameService.php @@ -0,0 +1,45 @@ +status !== 'active') { + throw new CloudError('当前实例状态不允许修改名称', 409); + } + + $initialName = (string) $instance->name; + return $instance->getConnection()->transaction(static function () use ( + $instance, $initialName, $name + ): array { + // Compare under a row lock in PHP. The production column uses a + // case-insensitive collation, so a SQL name predicate cannot be a + // safe compare-and-swap guard for case-preserving display names. + $current = CloudInstance::where('id', (int) $instance->id) + ->where('uuid', (string) $instance->uuid) + ->where('user_id', (int) $instance->user_id) + ->lockForUpdate() + ->first(['id', 'name', 'status']); + if ($current === null || (string) $current->status !== 'active') { + throw new CloudError('实例状态已变化,请刷新后重试', 409); + } + $currentName = (string) $current->name; + if (hash_equals($currentName, $name)) { + return ['id' => (string) $current->id, 'name' => $name]; + } + if (!hash_equals($currentName, $initialName)) { + throw new CloudError('实例名称已变化,请刷新后重试', 409); + } + $current->name = $name; + $current->updated_at = time(); + $current->save(); + return ['id' => (string) $current->id, 'name' => $name]; + }); + } +} diff --git a/web/app/Services/Cloud/CloudInstancePageService.php b/web/app/Services/Cloud/CloudInstancePageService.php index 477249ba..a380b9f1 100644 --- a/web/app/Services/Cloud/CloudInstancePageService.php +++ b/web/app/Services/Cloud/CloudInstancePageService.php @@ -142,6 +142,7 @@ final class CloudInstancePageService 'is_owner' => $owner, 'can_operate' => $canDelete && $instance->serviceAvailable(), 'can_delete' => $canDelete, + 'can_rename' => $canDelete, ]; } @@ -258,6 +259,7 @@ final class CloudInstancePageService 'is_owner' => (bool) $snapshot['is_owner'], 'can_operate' => (bool) $snapshot['can_operate'], 'can_delete' => (bool) $snapshot['can_delete'], + 'can_rename' => (bool) $snapshot['can_rename'], ]; } @@ -549,6 +551,7 @@ final class CloudInstancePageService 'is_owner' => $owner, 'can_operate' => $canOperate, 'can_delete' => $canDelete, + 'can_rename' => $canDelete, 'can_view_credential' => $owner || $global, 'can_renew' => $lifecycleActive && $owner && $instance->expires_at !== null diff --git a/web/app/Services/Cloud/CloudWorkerService.php b/web/app/Services/Cloud/CloudWorkerService.php index 3f1ede54..2163ba5e 100644 --- a/web/app/Services/Cloud/CloudWorkerService.php +++ b/web/app/Services/Cloud/CloudWorkerService.php @@ -516,7 +516,9 @@ final class CloudWorkerService '引擎成功结果与预留公网 IP 不一致,必须人工核查', 502 ); } - $instance = CloudInstance::where('order_id', $order->id)->first() ?? new CloudInstance(); + $instance = CloudInstance::where('order_id', $order->id)->first(); + $newInstance = $instance === null; + $instance ??= new CloudInstance(); $instance->uuid = $uuid; $instance->host_id = $order->host_id; $instance->user_id = $order->user_id; @@ -533,7 +535,11 @@ final class CloudWorkerService $traffic = $billingSnapshot ? max(0, (int) $spec['traffic_quota_bytes']) : 0; $instance->plan_id = $order->plan_id; - $instance->name = $payload['body']['name']; + // A late/replayed create result must not overwrite a display + // name the owner changed after the first success committed. + if ($newInstance) { + $instance->name = $payload['body']['name']; + } $instance->status = 'active'; // Orders submitted by a pre-billing release do not contain an // immutable term/quota snapshot. Never invent a 30-day expiry diff --git a/web/config/routes_cloud.php b/web/config/routes_cloud.php index 933d9b65..86f22855 100644 --- a/web/config/routes_cloud.php +++ b/web/config/routes_cloud.php @@ -34,6 +34,7 @@ $app->group('/api/v1', function () { $this->get('/vms/{id:[0-9]+}/metadata', 'App\Controllers\CloudApiController:vmMetadataOne'); $this->get('/vms/{id:[0-9]+}/status', 'App\Controllers\CloudApiController:vmStatus'); $this->get('/vms/{id:[0-9]+}/operations', 'App\Controllers\CloudApiController:operationLogs'); + $this->patch('/vms/{id:[0-9]+}/display-name', 'App\Controllers\CloudApiController:displayName'); $this->get('/vms', 'App\Controllers\CloudApiController:vms'); $this->get('/vms/{id}', 'App\Controllers\CloudApiController:vm'); $this->get('/vms/{id}/metrics', 'App\Controllers\CloudApiController:metrics'); diff --git a/web/public/cloud/detail.js b/web/public/cloud/detail.js index f7706f8c..806ccb55 100644 --- a/web/public/cloud/detail.js +++ b/web/public/cloud/detail.js @@ -11,7 +11,7 @@ const { } = await import(runtimeUrl.href); const VM_METADATA_FIELDS = Object.freeze([ - 'name', 'region', 'location', 'created_at', 'os_source', 'os_name', + 'region', 'location', 'created_at', 'os_source', 'os_name', 'install_iso', 'guest_hostname', 'public_ip_cidr', 'public_ip', 'login_name', 'vcpu', 'cpu_cores', 'memory_mib', 'ram_mib', 'disks', 'disk_gib', 'engine_metadata_version', @@ -22,6 +22,113 @@ let operationLogsRequest = null; let operationLogsLoadedVmId = null; let operationLogsPage = 1; let operationLogsPageCount = 1; +let displayNameSaving = false; +let displayNameStatusTimer = null; +const DISPLAY_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,62}$/; + +function setDisplayNameStatus(message = '', kind = '') { + const status = byId('vm-detail-name-status'); + if (!status) return; + window.clearTimeout(displayNameStatusTimer); + displayNameStatusTimer = null; + status.textContent = message; + status.className = `vm-detail-name-status${kind ? ` ${kind}` : ''}`; + status.hidden = !message; +} + +function setDisplayNameEditing(editing) { + const display = byId('vm-detail-name-display'); + const form = byId('vm-detail-name-form'); + const trigger = byId('vm-detail-name-trigger'); + if (!display || !form || !trigger) return; + display.hidden = editing; + form.hidden = !editing; + trigger.setAttribute('aria-expanded', editing ? 'true' : 'false'); + if (editing) { + const input = byId('vm-detail-name-input'); + input.value = String(selectedVm()?.name || ''); + setDisplayNameStatus(); + window.requestAnimationFrame(() => { input.focus(); input.select(); }); + } +} + +function bindDisplayNameEditor(vmId) { + const trigger = byId('vm-detail-name-trigger'); + const form = byId('vm-detail-name-form'); + const input = byId('vm-detail-name-input'); + const save = byId('vm-detail-name-save'); + const cancel = byId('vm-detail-name-cancel'); + if (!trigger || !form || !input || !save || !cancel) return; + + trigger.addEventListener('click', () => setDisplayNameEditing(true)); + cancel.addEventListener('click', () => { + if (displayNameSaving) return; + setDisplayNameEditing(false); + setDisplayNameStatus(); + trigger.focus(); + }); + input.addEventListener('keydown', event => { + if (event.key !== 'Escape' || displayNameSaving) return; + event.preventDefault(); + setDisplayNameEditing(false); + setDisplayNameStatus(); + trigger.focus(); + }); + form.addEventListener('submit', async event => { + event.preventDefault(); + if (displayNameSaving) return; + const name = input.value.trim(); + if (!DISPLAY_NAME_PATTERN.test(name)) { + setDisplayNameStatus('名称需以英文或数字开头,可包含英文、数字、点、下划线和连字符,最多 63 个字符。', 'error'); + input.focus(); + return; + } + const vm = selectedVm(); + if (!vm) { + setDisplayNameStatus('实例信息已失效,请刷新页面后重试。', 'error'); + return; + } + if (name === String(vm.name || '')) { + setDisplayNameEditing(false); + trigger.focus(); + return; + } + + displayNameSaving = true; + save.disabled = true; + cancel.disabled = true; + input.disabled = true; + save.textContent = '保存中…'; + setDisplayNameStatus('正在保存名称…'); + try { + const result = await api(`/api/v1/vms/${encodeURIComponent(vmId)}/display-name`, { + method: 'PATCH', body: { name }, + }); + if (!result || typeof result.name !== 'string' + || !DISPLAY_NAME_PATTERN.test(result.name)) { + throw new Error('服务返回的实例名称无效,请刷新页面确认。'); + } + const current = selectedVm(); + if (current && String(current.api_id) === String(vmId)) current.name = result.name; + byId('vm-detail-name-value').textContent = result.name; + input.value = result.name; + setDisplayNameEditing(false); + setDisplayNameStatus('名称已保存。', 'success'); + trigger.focus(); + void loadVmStatus(vmId, { force: true }); + displayNameStatusTimer = window.setTimeout(() => setDisplayNameStatus(), 2600); + } catch (error) { + setDisplayNameStatus(error?.message || '名称保存失败,请稍后重试。', 'error'); + window.requestAnimationFrame(() => input.focus()); + } finally { + displayNameSaving = false; + save.disabled = false; + cancel.disabled = false; + input.disabled = false; + save.textContent = '保存'; + } + }); +} const OPERATION_STATUS_LABELS = Object.freeze({ queued: ['排队中', 'queued'], running: ['执行中', 'running'], @@ -470,6 +577,7 @@ export async function initialize() { if (operationLogsPage < operationLogsPageCount) void loadOperationLogs(vmId, true, operationLogsPage + 1); }); bindDetailTabs(vmId); + bindDisplayNameEditor(vmId); bindInstanceSettings(vmId); bindConsole(); window.addEventListener('resize', () => { diff --git a/web/public/cloud/instances.js b/web/public/cloud/instances.js index a0bb0aa8..bf703d4a 100644 --- a/web/public/cloud/instances.js +++ b/web/public/cloud/instances.js @@ -417,7 +417,7 @@ function vmMatchesUpdate(vm, update) { } const VM_METADATA_FIELDS = Object.freeze([ - 'name', 'region', 'location', 'os_source', 'os_name', 'install_iso', + 'region', 'location', 'os_source', 'os_name', 'install_iso', 'public_ip_cidr', 'public_ip', 'login_name', 'vcpu', 'cpu_cores', 'memory_mib', 'ram_mib', 'disks', 'disk_gib', 'engine_metadata_version', ]); @@ -477,6 +477,7 @@ async function refreshMetadata() { function applyStatuses(payload) { const updates = statusItems(payload); let statusFilterChanged = false; + let displayNameChanged = false; for (const update of updates) { const vm = state.vms.find(item => vmMatchesUpdate(item, update)); if (!vm) continue; @@ -485,6 +486,7 @@ function applyStatuses(payload) { const hasState = candidateState !== '' && normalizedState !== 'unknown' && normalizedState !== 'nostate'; const previousCategory = stateCategoryForVm(vm); + const previousName = String(vm.name || ''); const liveState = update?.live_state_available === true; const nextState = hasState ? candidateState : vm.state; const nextSync = firstText(update.state_sync_status, update.sync_status, @@ -500,6 +502,7 @@ function applyStatuses(payload) { state_label_hint: Object.prototype.hasOwnProperty.call(update, 'state_label_hint') ? firstText(update.state_label_hint) : vm.state_label_hint, }); + if (String(vm.name || '') !== previousName) displayNameChanged = true; const nextCategory = stateCategoryForVm(vm); if (previousCategory !== nextCategory) { if (previousCategory === 'running') state.stats.running = Math.max(0, state.stats.running - 1); @@ -534,7 +537,10 @@ function applyStatuses(payload) { } state.liveStatsReady = state.vms.length === 0 || state.vms.every(runtimeStateReady); renderStats(); - if (statusFilterChanged && (byId('state-filter')?.value || 'all') !== 'all') renderVms(); + if (displayNameChanged + || (statusFilterChanged && (byId('state-filter')?.value || 'all') !== 'all')) { + renderVms(); + } } async function refreshStatuses(scheduleNext = true) { diff --git a/web/public/cloud/runtime.js b/web/public/cloud/runtime.js index 5ac4aa68..802655bf 100644 --- a/web/public/cloud/runtime.js +++ b/web/public/cloud/runtime.js @@ -312,7 +312,7 @@ function powerTransition(vm) { } function renderVmDetail(vm) { const display = detailStateDisplay(vm); - text('vm-detail-name', vm.name); text('vm-detail-state', display.label); byId('vm-detail-state').className = `state-pill ${display.category}`; + text('vm-detail-name-value', vm.name); text('vm-detail-state', display.label); byId('vm-detail-state').className = `state-pill ${display.category}`; const syncElement = byId('vm-detail-state-sync'); if (syncElement) { syncElement.textContent = display.note; diff --git a/web/public/cloud/styles.css b/web/public/cloud/styles.css index 3defa66a..c9fc1d9c 100644 --- a/web/public/cloud/styles.css +++ b/web/public/cloud/styles.css @@ -130,6 +130,7 @@ tbody tr:hover{background:#fcfefe} .empty-state{text-align:center;padding:65px 20px 72px}.empty-icon{margin:0 auto 16px;width:54px;height:54px;display:flex;align-items:center;justify-content:center;border-radius:16px;background:#eaf7f7;color:#17a3aa;font-size:28px}.empty-state h3{font-size:16px;color:#34465a;margin:0 0 8px}.empty-state p{font-size:12px;color:#a0aebe;margin:0} .footer-note{text-align:right;color:#a9b4c0;font-size:10px;margin-top:18px} .vm-detail-back{padding-left:0;margin-bottom:22px;color:#267b86}.vm-detail-heading{align-items:center}.vm-detail-heading .heading-actions{align-items:center}.vm-detail-heading .state-pill{min-height:31px}.vm-detail-summary{display:flex;align-items:center;flex-wrap:wrap;gap:5px 18px}.vm-detail-summary span{white-space:nowrap}.vm-detail-summary strong{color:#455a70;font-weight:700;margin-left:4px}.vm-detail-tabs{display:flex;width:max-content;max-width:100%;gap:4px;margin:0 0 18px;padding:5px;overflow-x:auto;border:1px solid #dfeaec;border-radius:11px;background:#f3f8f9}.vm-detail-tab{min-height:39px;padding:9px 18px;border:0;border-radius:8px;background:transparent;color:#718497;font:inherit;font-size:12px;font-weight:800;white-space:nowrap;cursor:pointer}.vm-detail-tab:hover{color:#237f88;background:#e8f4f4}.vm-detail-tab.active{background:#fff;color:#157f88;box-shadow:0 2px 9px rgba(27,71,87,.1)}.vm-detail-tab:focus-visible{outline:2px solid #25adb4;outline-offset:2px}.vm-detail-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr);gap:18px;align-items:start}.vm-detail-panel{min-height:0}.vm-detail-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;margin:0;padding:6px 24px 17px}.vm-detail-facts>div{min-width:0;padding:17px 9px 17px 0;border-bottom:1px solid #edf1f5}.vm-detail-facts dt{font-size:11px;font-weight:700;color:#91a0af;margin-bottom:9px}.vm-detail-facts dd{margin:0;color:#273c52;font-size:13px;font-weight:700;line-height:1.5;overflow-wrap:anywhere}.vm-detail-operations{display:grid;gap:18px}.vm-detail-actions{display:flex;flex-wrap:wrap;gap:10px;padding:20px 24px 23px}.vm-detail-actions .row-button{min-height:39px;padding:9px 15px;border-color:#dce9ea;font-size:12px}.vm-detail-actions .row-button.primary{border-color:#cbecee}.vm-danger-panel .panel-heading h2{color:#a4434f}.vm-danger-panel .row-button.danger{border-color:#f2dfe2;background:#fff9f9}.vm-danger-panel .row-button.danger:not(:disabled):hover{background:#ffedef} +.vm-detail-name-control{position:relative;width:max-content;max-width:min(100%,680px)}.vm-detail-name-display{position:relative;display:flex;align-items:center;width:max-content;max-width:100%}.vm-detail-name-display h1{min-width:0;max-width:100%}.vm-detail-name-trigger{display:flex;align-items:center;gap:9px;min-width:0;max-width:100%;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;letter-spacing:inherit;text-align:left;cursor:pointer}.vm-detail-name-trigger:hover #vm-detail-name-value{color:#167f88}.vm-detail-name-trigger:focus-visible{outline:2px solid #25adb4;outline-offset:5px;border-radius:4px}.vm-detail-name-trigger #vm-detail-name-value{min-width:0;overflow-wrap:anywhere;transition:color .15s ease}.vm-detail-name-bubble{display:grid;place-items:center;flex:0 0 23px;width:23px;height:23px;border:1px solid #d5e6e8;border-radius:50%;background:#f3f9f9;color:#218b94;font-size:13px;transition:border-color .15s ease,background-color .15s ease}.vm-detail-name-trigger:hover .vm-detail-name-bubble,.vm-detail-name-trigger:focus-visible .vm-detail-name-bubble{border-color:#8ccdd1;background:#e7f6f6}.vm-detail-name-tooltip{position:absolute;z-index:20;top:calc(100% - 2px);left:100%;width:max-content;max-width:220px;padding:7px 10px;border:1px solid #d8e6e9;border-radius:8px;background:#29475b;color:#fff;font-size:10px;font-weight:700;line-height:1.4;box-shadow:0 8px 20px rgba(27,58,75,.16);opacity:0;pointer-events:none;transform:translate(-18px,7px);transition:opacity .15s ease,transform .15s ease}.vm-detail-name-display:hover .vm-detail-name-tooltip,.vm-detail-name-display:focus-within .vm-detail-name-tooltip{opacity:1;transform:translate(-18px,3px)}.vm-detail-name-form{display:flex;align-items:center;gap:8px;margin:9px 0 8px}.vm-detail-name-form input{width:min(360px,calc(100vw - 230px));min-width:180px;height:40px;margin:0;font-size:15px;font-weight:750}.vm-detail-name-form .button{flex:none}.vm-detail-name-status{margin:-2px 0 8px;color:#6b8190;font-size:10px;line-height:1.5}.vm-detail-name-status.success{color:#21785b}.vm-detail-name-status.error{color:#b13f4d} .vm-detail-inline,.vm-ip-copy-row{display:flex;align-items:center;flex-wrap:wrap;gap:7px}.vm-detail-inline{min-height:25px}.vm-detail-secret{font:600 12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;overflow-wrap:anywhere}.vm-detail-mini-button,.vm-copy-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;border:1px solid #d9e9ea;border-radius:6px;background:#f5fbfb;color:#1b8790;font-size:11px;font-weight:700;min-height:25px;padding:3px 7px}.vm-detail-mini-button:not(:disabled):hover,.vm-copy-icon:not(:disabled):hover{background:#e6f6f7;border-color:#b6dcdf}.vm-copy-icon{width:25px;padding:3px}.vm-copy-icon svg{display:block;width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round} .vm-operation-log-view .panel-heading{align-items:center}.vm-operation-log-status{margin:0;padding:13px 24px;border-top:1px solid #edf1f5;background:#f7fbfc;color:#6f8496;font-size:12px;line-height:1.5}.vm-operation-log-status.warning{color:#a56c24;background:#fff8eb}.vm-operation-log-table{overflow-x:auto}.vm-operation-log-row{display:grid;grid-template-columns:minmax(120px,1fr) minmax(180px,1.35fr) minmax(75px,auto);align-items:center;gap:18px;padding:14px 24px;border-top:1px solid #edf1f5;color:#536b7e;font-size:12px}.vm-operation-log-header{border-top:0;background:#f7fbfc;color:#8a9baa;font-size:10px;font-weight:800;letter-spacing:.04em}.vm-operation-log-cell{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vm-operation-log-cell.operation{color:#2c465a;font-weight:800}.vm-operation-log-cell.result{justify-self:end;overflow:visible;padding:5px 10px;border-radius:999px;background:#f1f4f6;color:#738495;font-size:11px;font-weight:800}.vm-operation-log-cell.result.queued,.vm-operation-log-cell.result.running{background:#eaf8f8;color:#21848c}.vm-operation-log-cell.result.succeeded{background:#eaf8f1;color:#23845d}.vm-operation-log-cell.result.failed{background:#fff0f1;color:#b34b57}.vm-operation-log-cell.result.uncertain{background:#fff7e9;color:#9a6a22}.vm-operation-log-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 24px;border-top:1px solid #edf1f5;color:#7b8e9e;font-size:11px}.vm-operation-log-footer nav{display:flex;align-items:center;gap:8px}.vm-operation-log-footer .button{min-height:30px;padding:5px 10px;font-size:11px}.vm-operation-log-footer nav>span{min-width:42px;text-align:center;color:#536b7e;font-weight:700}.vm-operation-log-empty{margin:0;padding:24px;color:#8a9aa8;font-size:12px;text-align:center} .vm-credential-icon{width:30px;min-height:30px}.vm-credential-icon svg{width:17px;height:17px}.vm-credential-icon .vm-eye-slash{visibility:hidden}.vm-credential-icon[aria-pressed="true"] .vm-eye-slash{visibility:visible} @@ -180,7 +181,7 @@ tbody tr:hover{background:#fcfefe} @media(max-width:510px){.workspace-form-body{padding:22px 19px 25px}.workspace-form-actions{padding:15px 19px}.workspace-form-actions .button{flex:1 1 100%}.workspace-form-back{margin-bottom:10px}} @media(max-width:510px){.register-code-row{flex-wrap:wrap}.register-code-row input{flex-basis:100%}.register-code-row .button{width:100%}.pending-user-row{align-items:flex-start;flex-direction:column}.pending-user-row .button{width:100%}.smtp-card .form-grid{grid-template-columns:1fr}} @media(max-width:510px){.ssh-key-row{align-items:flex-start;flex-direction:column;justify-content:flex-start}.ssh-key-actions{width:100%}.ssh-key-actions .row-button{flex:1}} -@media(max-width:510px){.vm-detail-heading .heading-actions{justify-content:space-between}.vm-detail-heading .heading-actions .button{flex:0 0 auto}.vm-detail-facts{grid-template-columns:1fr}.vm-detail-facts>div{padding:12px 0}.vm-detail-actions .row-button{flex:1 1 135px}.vm-table td{padding:10px 11px}.vm-identity{min-width:0}.vm-name-link{max-width:calc(100vw - 130px)}.vm-settings-navigation{padding-inline:8px}.vm-settings-navigation-button{padding-inline:10px;font-size:11px}.vm-settings-content{padding:24px 17px 28px}.vm-settings-actions .button{width:100%}} +@media(max-width:510px){.vm-detail-heading .heading-actions{justify-content:space-between}.vm-detail-heading .heading-actions .button{flex:0 0 auto}.vm-detail-name-control{width:100%;max-width:100%}.vm-detail-name-display{max-width:100%}.vm-detail-name-tooltip{right:0;left:auto;transform:translateY(7px)}.vm-detail-name-display:hover .vm-detail-name-tooltip,.vm-detail-name-display:focus-within .vm-detail-name-tooltip{transform:translateY(3px)}.vm-detail-name-form{align-items:stretch;flex-wrap:wrap}.vm-detail-name-form input{width:100%;min-width:0;flex:1 1 100%}.vm-detail-name-form .button{flex:1}.vm-detail-facts{grid-template-columns:1fr}.vm-detail-facts>div{padding:12px 0}.vm-detail-actions .row-button{flex:1 1 135px}.vm-table td{padding:10px 11px}.vm-identity{min-width:0}.vm-name-link{max-width:calc(100vw - 130px)}.vm-settings-navigation{padding-inline:8px}.vm-settings-navigation-button{padding-inline:10px;font-size:11px}.vm-settings-content{padding:24px 17px 28px}.vm-settings-actions .button{width:100%}} @media(max-width:510px){.vm-operation-log-view .panel-heading{align-items:flex-start}.vm-operation-log-view .panel-heading .button{width:100%}.vm-operation-log-status{padding-inline:17px}.vm-operation-log-row{grid-template-columns:minmax(78px,1fr) minmax(130px,1.45fr) minmax(62px,auto);gap:8px;padding-inline:17px;font-size:11px}.vm-operation-log-header{font-size:9px}.vm-operation-log-cell.result{padding:4px 7px;font-size:10px}.vm-operation-log-footer{align-items:flex-start;flex-direction:column;padding-inline:17px}.vm-operation-log-footer nav{width:100%;justify-content:space-between}} .rescue-status{margin:8px 0 17px;padding:12px 14px;border:1px solid #c8e9e8;border-radius:9px;background:#f0fbfa;color:#236d71;font-size:12px;line-height:1.6} .rescue-directory-note{margin:0 0 17px;padding:10px 12px;border:1px solid #d6e8ee;border-radius:8px;background:#f6fafc;color:#557085;font-size:11px;line-height:1.6;overflow-wrap:anywhere} diff --git a/web/resources/views/venix/cloud/pages/detail.tpl b/web/resources/views/venix/cloud/pages/detail.tpl index ba6e0a3b..230583a9 100644 --- a/web/resources/views/venix/cloud/pages/detail.tpl +++ b/web/resources/views/venix/cloud/pages/detail.tpl @@ -1,7 +1,7 @@
服务器 IP:{$cloud_vm_view.ip|default:'未获取'|escape:"html"}区域:{$cloud_vm_view.region|default:'未设置'|escape:"html"}{$cloud_vm_view.created_display|default:'未记录'|escape:"html"}
服务器 IP:{$cloud_vm_view.ip|default:'未获取'|escape:"html"}区域:{$cloud_vm_view.region|default:'未设置'|escape:"html"}{$cloud_vm_view.created_display|default:'未记录'|escape:"html"}