refactor: move restart field from ServerInfo to ServerStatus

The restart reason belongs with other server state (shutting_down,
restarting, update_progress) rather than on the top-level ServerInfo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt Hill
2026-03-28 23:13:59 -06:00
parent 104567e457
commit b01e5d9f09
12 changed files with 29 additions and 24 deletions

View File

@@ -149,7 +149,9 @@ export class PortalComponent {
readonly name = toSignal(this.patch.watch$('serverInfo', 'name'))
readonly update = toSignal(inject(OSService).updating$)
readonly restartReason = toSignal(this.patch.watch$('serverInfo', 'restart'))
readonly restartReason = toSignal(
this.patch.watch$('serverInfo', 'statusInfo', 'restart'),
)
readonly bar = signal(true)
getProgress(size: number, downloaded: number): number {

View File

@@ -26,6 +26,7 @@ export namespace Mock {
updateProgress: null,
restarting: false,
shuttingDown: false,
restart: null,
}
export const RegistryOSUpdate: T.OsVersionInfoMap = {

View File

@@ -445,7 +445,7 @@ export class MockApiService extends ApiService {
this.mockRevision([
{
op: PatchOp.REPLACE,
path: '/serverInfo/restart',
path: '/serverInfo/statusInfo/restart',
value: 'kiosk',
},
])
@@ -471,7 +471,7 @@ export class MockApiService extends ApiService {
this.mockRevision([
{
op: PatchOp.REPLACE,
path: '/serverInfo/restart',
path: '/serverInfo/statusInfo/restart',
value: 'mdns',
},
])
@@ -507,7 +507,7 @@ export class MockApiService extends ApiService {
this.mockRevision([
{
op: PatchOp.REPLACE,
path: '/serverInfo/restart',
path: '/serverInfo/statusInfo/restart',
value: 'language',
},
])
@@ -1852,7 +1852,7 @@ export class MockApiService extends ApiService {
const patch3: Operation<string>[] = [
{
op: PatchOp.REPLACE,
path: '/serverInfo/restart',
path: '/serverInfo/statusInfo/restart',
value: 'update',
},
{

View File

@@ -231,8 +231,8 @@ export const mockPatchData: DataModel = {
restarting: false,
shuttingDown: false,
backupProgress: null,
restart: null,
},
restart: null,
name: 'Random Words',
hostname: 'random-words',
pubkey: 'npub1sg6plzptd64u62a878hep2kev88swjh3tw00gjsfl8f237lmu63q0uf63m',