mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
@@ -4,7 +4,7 @@ import {
|
||||
inject,
|
||||
Input,
|
||||
} from '@angular/core'
|
||||
import { Manifest } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { tuiPure } from '@taiga-ui/cdk'
|
||||
import {
|
||||
TuiButtonModule,
|
||||
@@ -86,7 +86,7 @@ export class ServiceActionsComponent {
|
||||
return this.pkg.status.configured
|
||||
}
|
||||
|
||||
get manifest(): Manifest {
|
||||
get manifest(): T.Manifest {
|
||||
return getManifest(this.pkg)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
input,
|
||||
} from '@angular/core'
|
||||
import { RouterLink } from '@angular/router'
|
||||
import { PackageDataEntry } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { TuiButtonModule } from '@taiga-ui/experimental'
|
||||
|
||||
@Component({
|
||||
@@ -52,7 +52,7 @@ import { TuiButtonModule } from '@taiga-ui/experimental'
|
||||
imports: [TuiButtonModule, RouterLink, I18nPluralPipe],
|
||||
})
|
||||
export class ServiceBackupsComponent {
|
||||
pkg = input.required<PackageDataEntry>()
|
||||
pkg = input.required<T.PackageDataEntry>()
|
||||
|
||||
readonly previous = computed(() =>
|
||||
daysBetween(new Date(), new Date(this.pkg().lastBackup || new Date())),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CommonModule } from '@angular/common'
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
||||
import { HealthCheckResult } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { TuiLoaderModule, TuiSvgModule } from '@taiga-ui/core'
|
||||
|
||||
@Component({
|
||||
@@ -43,7 +43,7 @@ import { TuiLoaderModule, TuiSvgModule } from '@taiga-ui/core'
|
||||
})
|
||||
export class ServiceHealthCheckComponent {
|
||||
@Input({ required: true })
|
||||
check!: HealthCheckResult
|
||||
check!: T.HealthCheckResult
|
||||
|
||||
@Input()
|
||||
connected = false
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
inject,
|
||||
Input,
|
||||
} from '@angular/core'
|
||||
import { HealthCheckResult } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { ServiceHealthCheckComponent } from 'src/app/routes/portal/routes/service/components/health-check.component'
|
||||
import { ConnectionService } from 'src/app/services/connection.service'
|
||||
|
||||
@@ -31,7 +31,7 @@ import { ConnectionService } from 'src/app/services/connection.service'
|
||||
})
|
||||
export class ServiceHealthChecksComponent {
|
||||
@Input({ required: true })
|
||||
checks: readonly HealthCheckResult[] = []
|
||||
checks: readonly T.HealthCheckResult[] = []
|
||||
|
||||
readonly connected$ = inject(ConnectionService).connected$
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
||||
import { Progress } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { TuiProgressModule } from '@taiga-ui/kit'
|
||||
import { InstallingProgressPipe } from 'src/app/routes/portal/routes/service/pipes/install-progress.pipe'
|
||||
|
||||
@@ -26,5 +26,5 @@ import { InstallingProgressPipe } from 'src/app/routes/portal/routes/service/pip
|
||||
imports: [TuiProgressModule, InstallingProgressPipe],
|
||||
})
|
||||
export class ServiceProgressComponent {
|
||||
@Input({ required: true }) progress!: Progress
|
||||
@Input({ required: true }) progress!: T.Progress
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { inject, Pipe, PipeTransform } from '@angular/core'
|
||||
import { CopyService, MarkdownComponent } from '@start9labs/shared'
|
||||
import { Manifest } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { TuiDialogService } from '@taiga-ui/core'
|
||||
import { PolymorpheusComponent } from '@tinkoff/ng-polymorpheus'
|
||||
import { from } from 'rxjs'
|
||||
@@ -68,7 +68,7 @@ export class ToAdditionalPipe implements PipeTransform {
|
||||
]
|
||||
}
|
||||
|
||||
private showLicense({ id, version }: Manifest) {
|
||||
private showLicense({ id, version }: T.Manifest) {
|
||||
this.dialogs
|
||||
.open(new PolymorpheusComponent(MarkdownComponent), {
|
||||
label: 'License',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { inject, Pipe, PipeTransform } from '@angular/core'
|
||||
import { Params } from '@angular/router'
|
||||
import { MarkdownComponent } from '@start9labs/shared'
|
||||
import { Manifest } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { TuiDialogService } from '@taiga-ui/core'
|
||||
import { PolymorpheusComponent } from '@tinkoff/ng-polymorpheus'
|
||||
import { from } from 'rxjs'
|
||||
@@ -114,7 +114,7 @@ export class ToMenuPipe implements PipeTransform {
|
||||
]
|
||||
}
|
||||
|
||||
private showInstructions({ title, id, version }: Manifest) {
|
||||
private showInstructions({ title, id, version }: T.Manifest) {
|
||||
this.api
|
||||
.setDbValue<boolean>(['ack-instructions', id], true)
|
||||
.catch(e => console.error('Failed to mark instructions as seen', e))
|
||||
@@ -134,7 +134,7 @@ export class ToMenuPipe implements PipeTransform {
|
||||
.subscribe()
|
||||
}
|
||||
|
||||
private openConfig({ title, id }: Manifest) {
|
||||
private openConfig({ title, id }: T.Manifest) {
|
||||
this.formDialog.open<PackageConfigData>(ConfigModal, {
|
||||
label: `${title} configuration`,
|
||||
data: { pkgId: id },
|
||||
|
||||
@@ -2,7 +2,7 @@ import { CommonModule } from '@angular/common'
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
|
||||
import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'
|
||||
import { isEmptyObject } from '@start9labs/shared'
|
||||
import { HealthCheckResult, MainStatus, Manifest } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
import { combineLatest, map, switchMap } from 'rxjs'
|
||||
import {
|
||||
@@ -217,7 +217,7 @@ export class ServiceRoute {
|
||||
|
||||
private getDepValues(
|
||||
pkg: PackageDataEntry,
|
||||
pkgManifest: Manifest,
|
||||
pkgManifest: T.Manifest,
|
||||
depId: string,
|
||||
depErrors: PkgDependencyErrors,
|
||||
): DependencyInfo {
|
||||
@@ -249,7 +249,7 @@ export class ServiceRoute {
|
||||
|
||||
private getDepErrors(
|
||||
pkg: PackageDataEntry,
|
||||
pkgManifest: Manifest,
|
||||
pkgManifest: T.Manifest,
|
||||
depId: string,
|
||||
depErrors: PkgDependencyErrors,
|
||||
) {
|
||||
@@ -291,7 +291,7 @@ export class ServiceRoute {
|
||||
|
||||
async fixDep(
|
||||
pkg: PackageDataEntry,
|
||||
pkgManifest: Manifest,
|
||||
pkgManifest: T.Manifest,
|
||||
action: 'install' | 'update' | 'configure',
|
||||
depId: string,
|
||||
): Promise<void> {
|
||||
@@ -312,7 +312,7 @@ export class ServiceRoute {
|
||||
|
||||
private async installDep(
|
||||
pkg: PackageDataEntry,
|
||||
manifest: Manifest,
|
||||
manifest: T.Manifest,
|
||||
depId: string,
|
||||
): Promise<void> {
|
||||
const dependentInfo: DependentInfo = {
|
||||
@@ -333,7 +333,7 @@ export class ServiceRoute {
|
||||
}
|
||||
}
|
||||
|
||||
function toHealthCheck(main: MainStatus): HealthCheckResult[] | null {
|
||||
function toHealthCheck(main: T.MainStatus): T.HealthCheckResult[] | null {
|
||||
return main.status !== 'running' || isEmptyObject(main.health)
|
||||
? null
|
||||
: Object.values(main.health)
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
Input,
|
||||
} from '@angular/core'
|
||||
import { RouterLink } from '@angular/router'
|
||||
import { Manifest } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { tuiPure } from '@taiga-ui/cdk'
|
||||
import { TuiSvgModule } from '@taiga-ui/core'
|
||||
import { TuiLineClampModule } from '@taiga-ui/kit'
|
||||
@@ -67,7 +67,7 @@ export class NotificationItemComponent {
|
||||
overflow = false
|
||||
|
||||
@tuiPure
|
||||
get manifest$(): Observable<Manifest> {
|
||||
get manifest$(): Observable<T.Manifest> {
|
||||
return this.patch
|
||||
.watch$(
|
||||
'packageData',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { inject, Injectable } from '@angular/core'
|
||||
import { ErrorService, LoadingService } from '@start9labs/shared'
|
||||
import { Manifest } from '@startos'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { TuiDialogOptions, TuiDialogService } from '@taiga-ui/core'
|
||||
import { TUI_PROMPT, TuiPromptData } from '@taiga-ui/kit'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
@@ -26,14 +26,14 @@ export class ActionsService {
|
||||
private readonly formDialog = inject(FormDialogService)
|
||||
private readonly patch = inject(PatchDB<DataModel>)
|
||||
|
||||
configure(manifest: Manifest): void {
|
||||
configure(manifest: T.Manifest): void {
|
||||
this.formDialog.open<PackageConfigData>(ConfigModal, {
|
||||
label: `${manifest.title} configuration`,
|
||||
data: { pkgId: manifest.id },
|
||||
})
|
||||
}
|
||||
|
||||
async start(manifest: Manifest, unmet: boolean): Promise<void> {
|
||||
async start(manifest: T.Manifest, unmet: boolean): Promise<void> {
|
||||
const deps = `${manifest.title} has unmet dependencies. It will not work as expected.`
|
||||
|
||||
if (
|
||||
@@ -44,7 +44,7 @@ export class ActionsService {
|
||||
}
|
||||
}
|
||||
|
||||
async stop({ id, title, alerts }: Manifest): Promise<void> {
|
||||
async stop({ id, title, alerts }: T.Manifest): Promise<void> {
|
||||
let content = alerts.stop || ''
|
||||
|
||||
if (hasCurrentDeps(id, await getAllPackages(this.patch))) {
|
||||
@@ -62,7 +62,7 @@ export class ActionsService {
|
||||
}
|
||||
}
|
||||
|
||||
async restart({ id, title }: Manifest): Promise<void> {
|
||||
async restart({ id, title }: T.Manifest): Promise<void> {
|
||||
if (hasCurrentDeps(id, await getAllPackages(this.patch))) {
|
||||
this.dialogs
|
||||
.open(
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
"paths": {
|
||||
/* These paths are relative to each app base folder */
|
||||
"@start9labs/marketplace": ["../marketplace/index"],
|
||||
"@start9labs/shared": ["../shared/src/public-api"],
|
||||
"@startos": ["../../../core/startos/bindings/index"]
|
||||
"@start9labs/shared": ["../shared/src/public-api"]
|
||||
},
|
||||
"typeRoots": ["node_modules/@types"],
|
||||
"types": ["node"]
|
||||
|
||||
Reference in New Issue
Block a user