fix: fix build after minor merged into major

This commit is contained in:
waterplea
2024-08-15 12:40:49 +04:00
parent b43ad93c54
commit a730543c76
189 changed files with 714 additions and 3652 deletions

View File

@@ -0,0 +1,32 @@
import { DatePipe } from '@angular/common'
import { Component, inject, input } from '@angular/core'
import { TuiDialogService, TuiIcon, TuiTitle } from '@taiga-ui/core'
import { TuiCell } from '@taiga-ui/layout'
import { StartOSDiskInfo } from '../types/api'
@Component({
standalone: true,
selector: 'button[server]',
template: `
<tui-icon icon="@tui.save" />
<span tuiTitle>
<strong>{{ server().hostname }}.local</strong>
<span tuiSubtitle>
<b>StartOS Version</b>
: {{ server().version }}
</span>
<span tuiSubtitle>
<b>Created</b>
: {{ server().timestamp | date: 'medium' }}
</span>
</span>
`,
styles: ':host { width: stretch; border-radius: var(--tui-radius-l); }',
hostDirectives: [TuiCell],
imports: [DatePipe, TuiIcon, TuiTitle],
})
export class ServerComponent {
private readonly dialogs = inject(TuiDialogService)
readonly server = input.required<StartOSDiskInfo>()
}

View File

@@ -15,6 +15,7 @@ export * from './components/markdown/markdown.component.module'
export * from './components/ticker/ticker.component'
export * from './components/ticker/ticker.module'
export * from './components/drive.component'
export * from './components/server.component'
export * from './directives/drag-scroller.directive'
export * from './directives/safe-links.directive'
@@ -50,6 +51,7 @@ export * from './tokens/theme'
export * from './util/base-64'
export * from './util/convert-ansi'
export * from './util/copy-to-clipboard'
export * from './util/format-progress'
export * from './util/get-new-entries'
export * from './util/get-pkg-id'
export * from './util/invert'

View File

@@ -0,0 +1,33 @@
// @TODO Matt this is T.FullProgress but shared does not depend on sdk
type Progress = null | boolean | { done: number; total: number | null }
type NamedProgress = { name: string; progress: Progress }
type FullProgress = { overall: Progress; phases: Array<NamedProgress> }
export function formatProgress({ phases, overall }: FullProgress): {
total: number
message: string
} {
return {
total: getDecimal(overall),
message: phases
.filter(p => p.progress !== true && p.progress !== null)
.map(p => `${p.name}${getPhaseBytes(p.progress)}`)
.join(', '),
}
}
function getDecimal(progress: Progress): number {
if (progress === true) {
return 1
} else if (!progress || !progress.total) {
return 0
} else {
return progress.total && progress.done / progress.total
}
}
function getPhaseBytes(progress: Progress): string {
return progress === true || !progress
? ''
: `: (${progress.done}/${progress.total})`
}