mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
minor fixes (#2957)
* minor fixes * more minor touchups * minor fix * fix release notes display
This commit is contained in:
@@ -520,4 +520,5 @@ export default {
|
||||
518: 'Verwerfen',
|
||||
519: 'Um Clearnet-Domains zu veröffentlichen, musst du oben auf „Öffentlich machen“ klicken.',
|
||||
520: 'Update verfügbar',
|
||||
521: 'Um das Problem zu beheben, siehe',
|
||||
} satisfies i18n
|
||||
|
||||
@@ -519,4 +519,5 @@ export const ENGLISH = {
|
||||
'Dismiss': 518, // as in, dismiss or delete a task
|
||||
'To publish clearnet domains, you must click "Make Public", above.': 519,
|
||||
'Update available': 520,
|
||||
'To resolve the issue, refer to': 521,
|
||||
} as const
|
||||
|
||||
@@ -520,4 +520,5 @@ export default {
|
||||
518: 'Descartar',
|
||||
519: 'Para publicar dominios en clearnet, debes hacer clic en "Hacer público" arriba.',
|
||||
520: 'Actualización disponible',
|
||||
521: 'Para resolver el problema, consulta',
|
||||
} satisfies i18n
|
||||
|
||||
@@ -520,4 +520,5 @@ export default {
|
||||
518: 'Ignorer',
|
||||
519: 'Pour publier des domaines clearnet, vous devez cliquer sur « Rendre public » ci-dessus.',
|
||||
520: 'Mise à jour disponible',
|
||||
521: 'Pour résoudre le problème, consultez',
|
||||
} satisfies i18n
|
||||
|
||||
@@ -520,4 +520,5 @@ export default {
|
||||
518: 'Odrzuć',
|
||||
519: 'Aby opublikować domeny w clearnet, kliknij „Upublicznij” powyżej.',
|
||||
520: 'Aktualizacja dostępna',
|
||||
521: 'Aby rozwiązać problem, zapoznaj się z',
|
||||
} satisfies i18n
|
||||
|
||||
@@ -20,7 +20,7 @@ export function formatProgress({ phases, overall }: T.FullProgress): {
|
||||
}
|
||||
} => p.progress !== true && p.progress !== null,
|
||||
)
|
||||
.map(p => `<b>${p.name}</b>: (${getPhaseBytes(p.progress)})`)
|
||||
.map(p => `<b>${p.name}</b>${getPhaseBytes(p.progress)}`)
|
||||
.join(', '),
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,6 @@ function getPhaseBytes(
|
||||
done: number
|
||||
total: number | null
|
||||
},
|
||||
): string {
|
||||
return !progress ? 'unknown' : `${progress.done}/${progress.total}`
|
||||
) {
|
||||
return progress ? `: ${progress.done}/${progress.total}` : ''
|
||||
}
|
||||
|
||||
@@ -5,11 +5,16 @@ import {
|
||||
computed,
|
||||
inject,
|
||||
} from '@angular/core'
|
||||
import { toSignal } from '@angular/core/rxjs-interop'
|
||||
import { i18nKey, i18nPipe } from '@start9labs/shared'
|
||||
import { TuiDialogContext, TuiIcon, TuiTitle } from '@taiga-ui/core'
|
||||
import { TuiCell } from '@taiga-ui/layout'
|
||||
import { injectContext, PolymorpheusComponent } from '@taiga-ui/polymorpheus'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
import { scan } from 'rxjs'
|
||||
import { BackupReport } from 'src/app/services/api/api.types'
|
||||
import { getManifest } from '../utils/get-package-data'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
@@ -25,10 +30,11 @@ import { BackupReport } from 'src/app/services/api/api.types'
|
||||
</div>
|
||||
<tui-icon [icon]="system().icon" [style.color]="system().color" />
|
||||
</div>
|
||||
@if (pkgTitles(); as titles) {
|
||||
@for (pkg of data.content.packages | keyvalue; track $index) {
|
||||
<div tuiCell>
|
||||
<div tuiTitle>
|
||||
<strong>{{ pkg.key }}</strong>
|
||||
<strong>{{ titles[pkg.key] || pkg.key }}</strong>
|
||||
<div tuiSubtitle [style.color]="getColor(pkg.value.error)">
|
||||
{{
|
||||
pkg.value.error
|
||||
@@ -43,18 +49,32 @@ import { BackupReport } from 'src/app/services/api/api.types'
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [CommonModule, TuiIcon, TuiCell, TuiTitle, i18nPipe],
|
||||
})
|
||||
export class BackupsReportModal {
|
||||
private readonly i18n = inject(i18nPipe)
|
||||
private readonly patch = inject(PatchDB)
|
||||
|
||||
readonly data =
|
||||
injectContext<
|
||||
TuiDialogContext<void, { content: BackupReport; createdAt: string }>
|
||||
>().data
|
||||
|
||||
readonly pkgTitles = toSignal(
|
||||
this.patch.watch$('packageData').pipe(
|
||||
scan<T.PackageDataEntry, Record<string, string>>((acc, pkg) => {
|
||||
const { id, title } = getManifest(pkg)
|
||||
return {
|
||||
...acc,
|
||||
[id]: title,
|
||||
}
|
||||
}, {}),
|
||||
),
|
||||
)
|
||||
|
||||
readonly system = computed(
|
||||
(): { result: i18nKey; icon: string; color: string } => {
|
||||
if (!this.data.content.server.attempted) {
|
||||
|
||||
@@ -43,7 +43,7 @@ import { TimeService } from 'src/app/services/time.service'
|
||||
<div tuiTitle>
|
||||
{{ 'Clock sync failure' | i18n }}
|
||||
<div tuiSubtitle>
|
||||
To resolve it, refer to
|
||||
{{ 'To resolve the issue, refer to' | i18n }}
|
||||
<a
|
||||
tuiLink
|
||||
docsLink
|
||||
|
||||
@@ -29,7 +29,12 @@ import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
<span tuiTitle>
|
||||
{{ d.value.title || d.key }}
|
||||
@if (getError(d.key); as error) {
|
||||
<span tuiSubtitle class="g-warning">{{ error | i18n }}</span>
|
||||
<span tuiSubtitle class="g-warning">
|
||||
{{ error | i18n }}
|
||||
@if (getHealthCheckName(d.key); as healthCheckName) {
|
||||
: {{ getHealthCheckName }}
|
||||
}
|
||||
</span>
|
||||
} @else {
|
||||
<span tuiSubtitle class="g-positive">{{ 'Satisfied' | i18n }}</span>
|
||||
}
|
||||
@@ -100,4 +105,11 @@ export class ServiceDependenciesComponent {
|
||||
return 'Unknown error'
|
||||
}
|
||||
}
|
||||
|
||||
getHealthCheckName(id: string) {
|
||||
const depError = this.errors[id]
|
||||
return depError?.type === 'healthChecksFailed'
|
||||
? depError.check.name
|
||||
: undefined
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,12 @@ export class StatusComponent {
|
||||
|
||||
get healthy(): boolean {
|
||||
const { primary, health } = this.getStatus(this.pkg)
|
||||
return !this.hasDepErrors && primary !== 'error' && health !== 'failure'
|
||||
return (
|
||||
!this.hasDepErrors &&
|
||||
primary !== 'actionRequired' &&
|
||||
primary !== 'error' &&
|
||||
health !== 'failure'
|
||||
)
|
||||
}
|
||||
|
||||
get loading(): boolean {
|
||||
|
||||
@@ -43,7 +43,9 @@ const INACTIVE: PrimaryStatus[] = [
|
||||
<tui-avatar><img alt="" [src]="service()?.icon" /></tui-avatar>
|
||||
<span tuiTitle>
|
||||
<strong tuiFade>{{ manifest()?.title }}</strong>
|
||||
<span tuiSubtitle>{{ manifest()?.version }}</span>
|
||||
<span tuiSubtitle [style.textTransform]="'none'">
|
||||
{{ manifest()?.version }}
|
||||
</span>
|
||||
</span>
|
||||
</header>
|
||||
<nav [attr.inert]="isInactive() ? '' : null">
|
||||
|
||||
@@ -91,8 +91,11 @@ import { BACKUP_RESTORE } from './restore.component'
|
||||
</hgroup>
|
||||
</header>
|
||||
|
||||
@if (type === 'create' && server(); as s) {
|
||||
<tui-notification [appearance]="s.lastBackup | tuiMapper: toAppearance">
|
||||
@if (type === 'create' && !(os.backingUp$ | async) && server(); as s) {
|
||||
<tui-notification
|
||||
[appearance]="s.lastBackup | tuiMapper: toAppearance"
|
||||
icon=""
|
||||
>
|
||||
<div tuiTitle>
|
||||
{{ 'Last Backup' | i18n }}
|
||||
<div tuiSubtitle>
|
||||
|
||||
@@ -151,10 +151,7 @@ import { SystemWipeComponent } from './wipe.component'
|
||||
<span tuiTitle>
|
||||
<strong>
|
||||
{{ 'Kiosk Mode' | i18n }}
|
||||
<tui-badge
|
||||
size="m"
|
||||
[appearance]="server.kiosk ? 'primary-success' : ''"
|
||||
>
|
||||
<tui-badge size="m" appearance="primary-grayscale">
|
||||
{{ server.kiosk ? ('Enabled' | i18n) : ('Disabled' | i18n) }}
|
||||
</tui-badge>
|
||||
</strong>
|
||||
@@ -170,11 +167,7 @@ import { SystemWipeComponent } from './wipe.component'
|
||||
</span>
|
||||
</span>
|
||||
@if (server.kiosk !== null) {
|
||||
<button
|
||||
tuiButton
|
||||
[appearance]="server.kiosk ? 'primary-destructive' : 'primary'"
|
||||
(click)="tryToggleKiosk()"
|
||||
>
|
||||
<button tuiButton appearance="primary" (click)="tryToggleKiosk()">
|
||||
{{ server.kiosk ? ('Disable' | i18n) : ('Enable' | i18n) }}
|
||||
</button>
|
||||
}
|
||||
@@ -428,7 +421,11 @@ export default class SystemGeneralComponent {
|
||||
}
|
||||
|
||||
private update() {
|
||||
this.dialogs.open(UPDATE).subscribe()
|
||||
this.dialogs
|
||||
.open(UPDATE, {
|
||||
data: { currentVersion: this.server()?.version },
|
||||
})
|
||||
.subscribe()
|
||||
}
|
||||
|
||||
private async check(): Promise<void> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CommonModule } from '@angular/common'
|
||||
import { CommonModule, TitleCasePipe } from '@angular/common'
|
||||
import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'
|
||||
import {
|
||||
ErrorService,
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
MarkdownPipe,
|
||||
SafeLinksDirective,
|
||||
} from '@start9labs/shared'
|
||||
import { Version } from '@start9labs/start-sdk'
|
||||
import { TuiAutoFocus } from '@taiga-ui/cdk'
|
||||
import { TuiButton, TuiDialogContext, TuiScrollbar } from '@taiga-ui/core'
|
||||
import { NgDompurifyPipe } from '@taiga-ui/dompurify'
|
||||
@@ -22,13 +23,10 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
|
||||
@Component({
|
||||
template: `
|
||||
<h2 style="margin-top: 0">StartOS {{ versions[0]?.version }}</h2>
|
||||
<h3 style="color: var(--tui-text-secondary); font-weight: normal">
|
||||
{{ 'Release notes' | i18n }}
|
||||
</h3>
|
||||
<h2 style="margin-top: 0">{{ 'Release notes' | i18n | titlecase }}</h2>
|
||||
<tui-scrollbar style="margin-bottom: 24px; max-height: 50vh;">
|
||||
@for (v of versions; track $index) {
|
||||
<h4 class="g-title">{{ v.version }}</h4>
|
||||
<h4 class="version-header">{{ v.version }}</h4>
|
||||
<div safeLinks [innerHTML]="v.notes | markdown | dompurify"></div>
|
||||
}
|
||||
</tui-scrollbar>
|
||||
@@ -36,6 +34,14 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
{{ 'Begin Update' | i18n }}
|
||||
</button>
|
||||
`,
|
||||
styles: `
|
||||
.version-header {
|
||||
font-weight: bold;
|
||||
font-size: 1.4rem;
|
||||
margin: 2rem 0 0 0;
|
||||
color: var(--tui-text-secondary);
|
||||
}
|
||||
`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [
|
||||
CommonModule,
|
||||
@@ -46,19 +52,26 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
TuiButton,
|
||||
TuiScrollbar,
|
||||
i18nPipe,
|
||||
TitleCasePipe,
|
||||
],
|
||||
})
|
||||
export class SystemUpdateModal {
|
||||
readonly versions = Object.entries(this.os.osUpdate!)
|
||||
.sort(([a], [b]) => a.localeCompare(b))
|
||||
.reverse()
|
||||
.map(([version, info]) => ({
|
||||
version,
|
||||
notes: info.releaseNotes,
|
||||
}))
|
||||
.filter(
|
||||
([version]) =>
|
||||
Version.parse(version).compare(
|
||||
Version.parse(this.context.data.currentVersion),
|
||||
) === 'greater',
|
||||
)
|
||||
.sort(([a], [b]) => Version.parse(b).compareForSort(Version.parse(a)))
|
||||
.map(([version, info]) => ({ version, notes: info.releaseNotes }))
|
||||
|
||||
constructor(
|
||||
@Inject(POLYMORPHEUS_CONTEXT) private readonly context: TuiDialogContext,
|
||||
@Inject(POLYMORPHEUS_CONTEXT)
|
||||
private readonly context: TuiDialogContext<
|
||||
void,
|
||||
{ currentVersion: string }
|
||||
>,
|
||||
private readonly loader: LoadingService,
|
||||
private readonly errorService: ErrorService,
|
||||
private readonly embassyApi: ApiService,
|
||||
|
||||
@@ -31,9 +31,9 @@ export namespace Mock {
|
||||
}
|
||||
|
||||
export const RegistryOSUpdate: RR.CheckOsUpdateRes = {
|
||||
'0.3.6-alpha.17': {
|
||||
headline: 'v0.3.6-alpha.17',
|
||||
releaseNotes: '',
|
||||
'0.4.1': {
|
||||
headline: 'v0.4.1',
|
||||
releaseNotes: 'Testing some release notes',
|
||||
sourceVersion: '>=0.3.5:0 <=0.3.6-alpha.17:0',
|
||||
authorized: ['G24CSA5HNYEPIXJNMK7ZM4KD5SX5N6X4'],
|
||||
iso: {},
|
||||
@@ -101,9 +101,9 @@ export namespace Mock {
|
||||
},
|
||||
img: {},
|
||||
},
|
||||
'0.4.0-alpha.5': {
|
||||
headline: 'v0.4.0-alpha.5',
|
||||
releaseNotes: '',
|
||||
'0.4.1-alpha.5': {
|
||||
headline: 'v0.4.1-alpha.5',
|
||||
releaseNotes: 'Some more release notes',
|
||||
sourceVersion: '>=0.3.5:0 <=0.4.0-alpha.5:0',
|
||||
authorized: ['G24CSA5HNYEPIXJNMK7ZM4KD5SX5N6X4'],
|
||||
iso: {},
|
||||
|
||||
@@ -197,7 +197,7 @@ export const mockPatchData: DataModel = {
|
||||
state: 'installed',
|
||||
manifest: {
|
||||
...Mock.MockManifestBitcoind,
|
||||
version: '0.20.0:0',
|
||||
version: '0.20.0:0-alpha.1',
|
||||
},
|
||||
},
|
||||
dataVersion: '0.20.0:0',
|
||||
|
||||
Reference in New Issue
Block a user