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