refactor(hub): rename Device ID to Hub ID in console layer

Rename the business-layer concept from "Device ID" to "Hub ID" for
better user comprehension. The underlying network transport layer
still uses deviceId — Hub ID is passed as the deviceId value.

- Rename device.ts → hub-identity.ts, getDeviceId → getHubId
- Storage file: ~/.super-multica/device-id → ~/.super-multica/hub-id
- Hub property: deviceId → hubId
- API response field: deviceId → hubId
- Console UI label: "Device ID" → "Hub ID"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
yushen 2026-01-30 16:02:00 +08:00
parent b66bbdde06
commit eb4ce85602
5 changed files with 14 additions and 14 deletions

View file

@ -17,7 +17,7 @@ export class AppController {
@Get("hub")
getHub() {
return {
deviceId: this.hub.deviceId,
hubId: this.hub.hubId,
url: this.hub.url,
connectionState: this.hub.connectionState,
agentCount: this.hub.listAgents().length,

View file

@ -335,7 +335,7 @@
<!-- Stats -->
<div class="stats" id="stats">
<div class="stat-card">
<div class="stat-label">Device ID</div>
<div class="stat-label">Hub ID</div>
<div class="stat-value" id="stat-device"></div>
</div>
<div class="stat-card">
@ -425,7 +425,7 @@
]);
// Stats
const deviceId = hubRes.deviceId || '—';
const deviceId = hubRes.hubId || '—';
document.getElementById('stat-device').innerHTML =
`<span title="${deviceId}">${truncateId(deviceId)}</span>` +
(deviceId !== '—' ? `<button class="copy-btn" onclick="copyText('${deviceId}', this)">${copyIcon()}</button>` : '');