mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
Merge branch 'next/minor' of github.com:Start9Labs/start-os into next/major
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
import { Progress } from '../../../../../../../../../../core/startos/bindings/Progress'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
|
||||
@Pipe({
|
||||
standalone: true,
|
||||
name: 'installingProgressString',
|
||||
})
|
||||
export class InstallingProgressDisplayPipe implements PipeTransform {
|
||||
transform(progress: Progress): string {
|
||||
transform(progress: T.Progress): string {
|
||||
if (progress === true) return 'finalizing'
|
||||
if (progress === false || !progress.total) return 'unknown %'
|
||||
const percentage = Math.round((100 * progress.done) / progress.total)
|
||||
@@ -20,7 +20,7 @@ export class InstallingProgressDisplayPipe implements PipeTransform {
|
||||
name: 'installingProgress',
|
||||
})
|
||||
export class InstallingProgressPipe implements PipeTransform {
|
||||
transform(progress: Progress): number | null {
|
||||
transform(progress: T.Progress): number | null {
|
||||
if (progress === true) return 1
|
||||
if (progress === false || !progress.total) return null
|
||||
return Number((progress.done / progress.total).toFixed(2))
|
||||
|
||||
@@ -13,9 +13,7 @@ import { BTC_ICON, LND_ICON, PROXY_ICON } from './api-icons'
|
||||
import { DependencyMetadata, MarketplacePkg } from '@start9labs/marketplace'
|
||||
import { Log } from '@start9labs/shared'
|
||||
import { configBuilderToSpec } from 'src/app/util/configBuilderToSpec'
|
||||
import { CT } from '@start9labs/start-sdk'
|
||||
import { CB } from '@start9labs/start-sdk'
|
||||
import { Manifest } from '../../../../../../../core/startos/bindings/Manifest'
|
||||
import { CT, T, CB } from '@start9labs/start-sdk'
|
||||
|
||||
export module Mock {
|
||||
export const ServerUpdated: ServerStatusInfo = {
|
||||
@@ -26,9 +24,10 @@ export module Mock {
|
||||
shuttingDown: false,
|
||||
}
|
||||
export const MarketplaceEos: RR.GetMarketplaceEosRes = {
|
||||
version: '0.3.5.1',
|
||||
version: '0.3.5.2',
|
||||
headline: 'Our biggest release ever.',
|
||||
releaseNotes: {
|
||||
'0.3.5.2': 'Some **Markdown** release _notes_ for 0.3.5.2',
|
||||
'0.3.5.1': 'Some **Markdown** release _notes_ for 0.3.5.1',
|
||||
'0.3.4.4': 'Some **Markdown** release _notes_ for 0.3.4.4',
|
||||
'0.3.4.3': 'Some **Markdown** release _notes_ for 0.3.4.3',
|
||||
@@ -50,7 +49,7 @@ export module Mock {
|
||||
'0.19.0': 'release notes for Bitcoin 0.19.0',
|
||||
}
|
||||
|
||||
export const MockManifestBitcoind: Manifest = {
|
||||
export const MockManifestBitcoind: T.Manifest = {
|
||||
id: 'bitcoind',
|
||||
title: 'Bitcoin Core',
|
||||
version: '0.21.0',
|
||||
@@ -88,7 +87,7 @@ export module Mock {
|
||||
},
|
||||
}
|
||||
|
||||
export const MockManifestLnd: Manifest = {
|
||||
export const MockManifestLnd: T.Manifest = {
|
||||
id: 'lnd',
|
||||
title: 'Lightning Network Daemon',
|
||||
version: '0.11.1',
|
||||
@@ -136,7 +135,7 @@ export module Mock {
|
||||
},
|
||||
}
|
||||
|
||||
export const MockManifestBitcoinProxy: Manifest = {
|
||||
export const MockManifestBitcoinProxy: T.Manifest = {
|
||||
id: 'btc-rpc-proxy',
|
||||
title: 'Bitcoin Proxy',
|
||||
version: '0.2.2',
|
||||
|
||||
@@ -12,10 +12,8 @@ import {
|
||||
FollowLogsRes,
|
||||
FollowLogsReq,
|
||||
} from '@start9labs/shared'
|
||||
import { CT } from '@start9labs/start-sdk'
|
||||
import { CT, T } from '@start9labs/start-sdk'
|
||||
import { config } from '@start9labs/start-sdk'
|
||||
import { HealthCheckResult } from '../../../../../../../core/startos/bindings/HealthCheckResult'
|
||||
import { Manifest } from '../../../../../../../core/startos/bindings/Manifest'
|
||||
|
||||
export module RR {
|
||||
// DB
|
||||
@@ -367,7 +365,7 @@ export module RR {
|
||||
}
|
||||
|
||||
export type SideloadPackageReq = {
|
||||
manifest: Manifest
|
||||
manifest: T.Manifest
|
||||
icon: string // base64
|
||||
size: number // bytes
|
||||
}
|
||||
@@ -665,7 +663,7 @@ export interface DependencyErrorConfigUnsatisfied {
|
||||
|
||||
export interface DependencyErrorHealthChecksFailed {
|
||||
type: 'healthChecksFailed'
|
||||
check: HealthCheckResult
|
||||
check: T.HealthCheckResult
|
||||
}
|
||||
|
||||
export interface DependencyErrorTransitive {
|
||||
|
||||
@@ -36,9 +36,9 @@ import { WebSocketSubjectConfig } from 'rxjs/webSocket'
|
||||
import { AuthService } from '../auth.service'
|
||||
import { ConnectionService } from '../connection.service'
|
||||
import { StoreInfo } from '@start9labs/marketplace'
|
||||
import { FullProgress } from '../../../../../../../core/startos/bindings/FullProgress'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
|
||||
const PROGRESS: FullProgress = {
|
||||
const PROGRESS: T.FullProgress = {
|
||||
overall: {
|
||||
done: 0,
|
||||
total: 120,
|
||||
|
||||
@@ -3,11 +3,6 @@ import { Inject, Injectable } from '@angular/core'
|
||||
import { WorkspaceConfig } from '@start9labs/shared'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
import { PackageState } from '../../../../../../core/startos/bindings/PackageState'
|
||||
import { MainStatus } from '../../../../../../core/startos/bindings/MainStatus'
|
||||
import { ExportedOnionHostname } from '../../../../../../core/startos/bindings/ExportedOnionHostname'
|
||||
import { ExportedIpHostname } from '../../../../../../core/startos/bindings/ExportedIpHostname'
|
||||
import { ExportedHostnameInfo } from '../../../../../../core/startos/bindings/ExportedHostnameInfo'
|
||||
|
||||
const {
|
||||
gitHash,
|
||||
@@ -79,8 +74,8 @@ export class ConfigService {
|
||||
}
|
||||
|
||||
isLaunchable(
|
||||
state: PackageState['state'],
|
||||
status: MainStatus['status'],
|
||||
state: T.PackageState['state'],
|
||||
status: T.MainStatus['status'],
|
||||
): boolean {
|
||||
return state === 'installed' && status === 'running'
|
||||
}
|
||||
@@ -98,13 +93,13 @@ export class ConfigService {
|
||||
|
||||
if (host.kind === 'multi') {
|
||||
const onionHostname = host.hostnames.find(h => h.kind === 'onion')
|
||||
?.hostname as ExportedOnionHostname
|
||||
?.hostname as T.ExportedOnionHostname
|
||||
|
||||
if (this.isTor() && onionHostname) {
|
||||
url.hostname = onionHostname.value
|
||||
} else {
|
||||
const ipHostname = host.hostnames.find(h => h.kind === 'ip')
|
||||
?.hostname as ExportedIpHostname
|
||||
?.hostname as T.ExportedIpHostname
|
||||
|
||||
if (!ipHostname) return ''
|
||||
|
||||
@@ -112,13 +107,12 @@ export class ConfigService {
|
||||
url.port = String(ipHostname.sslPort || ipHostname.port)
|
||||
}
|
||||
} else {
|
||||
throw new Error('unimplemented')
|
||||
const hostname = {} as ExportedHostnameInfo // host.hostname
|
||||
const hostname = {} as T.ExportedHostnameInfo // host.hostname
|
||||
|
||||
if (!hostname) return ''
|
||||
|
||||
if (this.isTor() && hostname.kind === 'onion') {
|
||||
url.hostname = (hostname.hostname as ExportedOnionHostname).value
|
||||
url.hostname = (hostname.hostname as T.ExportedOnionHostname).value
|
||||
} else {
|
||||
url.hostname = this.hostname
|
||||
url.port = String(hostname.hostname.sslPort || hostname.hostname.port)
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { BackupJob, ServerNotifications } from '../api/api.types'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
import { config } from '@start9labs/start-sdk'
|
||||
import { PackageDataEntry as PDE } from '../../../../../../../core/startos/bindings/PackageDataEntry'
|
||||
import { FullProgress } from '../../../../../../../core/startos/bindings/FullProgress'
|
||||
import { Manifest } from '../../../../../../../core/startos/bindings/Manifest'
|
||||
|
||||
export type DataModel = {
|
||||
ui: UIData
|
||||
@@ -129,17 +126,18 @@ export interface ServerStatusInfo {
|
||||
shuttingDown: boolean
|
||||
}
|
||||
|
||||
export type PackageDataEntry<T extends StateInfo = StateInfo> = PDE & {
|
||||
stateInfo: T
|
||||
installedAt: string
|
||||
outboundProxy: string | null
|
||||
}
|
||||
export type PackageDataEntry<T extends StateInfo = StateInfo> =
|
||||
T.PackageDataEntry & {
|
||||
stateInfo: T
|
||||
installedAt: string
|
||||
outboundProxy: string | null
|
||||
}
|
||||
|
||||
export type StateInfo = InstalledState | InstallingState | UpdatingState
|
||||
|
||||
export type InstalledState = {
|
||||
state: 'installed' | 'removing'
|
||||
manifest: Manifest
|
||||
manifest: T.Manifest
|
||||
installingInfo?: undefined
|
||||
}
|
||||
|
||||
@@ -152,10 +150,10 @@ export type InstallingState = {
|
||||
export type UpdatingState = {
|
||||
state: 'updating'
|
||||
installingInfo: InstallingInfo
|
||||
manifest: Manifest
|
||||
manifest: T.Manifest
|
||||
}
|
||||
|
||||
export type InstallingInfo = {
|
||||
progress: FullProgress
|
||||
newManifest: Manifest
|
||||
progress: T.FullProgress
|
||||
newManifest: T.Manifest
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { PackageDataEntry } from 'src/app/services/patch-db/data-model'
|
||||
import { PkgDependencyErrors } from './dep-error.service'
|
||||
import { Status } from '../../../../../../core/startos/bindings/Status'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
|
||||
export interface PackageStatus {
|
||||
@@ -28,7 +27,7 @@ export function renderPkgStatus(
|
||||
return { primary, dependency, health }
|
||||
}
|
||||
|
||||
function getInstalledPrimaryStatus(status: Status): PrimaryStatus {
|
||||
function getInstalledPrimaryStatus(status: T.Status): PrimaryStatus {
|
||||
if (!status.configured) {
|
||||
return 'needsConfig'
|
||||
} else {
|
||||
@@ -40,7 +39,7 @@ function getDependencyStatus(depErrors: PkgDependencyErrors): DependencyStatus {
|
||||
return Object.values(depErrors).some(err => !!err) ? 'warning' : 'satisfied'
|
||||
}
|
||||
|
||||
function getHealthStatus(status: Status): T.HealthStatus | null {
|
||||
function getHealthStatus(status: T.Status): T.HealthStatus | null {
|
||||
if (status.main.status !== 'running' || !status.main.health) {
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
UpdatingState,
|
||||
} from 'src/app/services/patch-db/data-model'
|
||||
import { firstValueFrom } from 'rxjs'
|
||||
import { Manifest } from '../../../../../../core/startos/bindings/Manifest'
|
||||
import { T } from '@start9labs/start-sdk'
|
||||
|
||||
export async function getPackage(
|
||||
patch: PatchDB<DataModel>,
|
||||
@@ -22,7 +22,7 @@ export async function getAllPackages(
|
||||
return firstValueFrom(patch.watch$('packageData'))
|
||||
}
|
||||
|
||||
export function getManifest(pkg: PackageDataEntry): Manifest {
|
||||
export function getManifest(pkg: PackageDataEntry): T.Manifest {
|
||||
return isInstalling(pkg)
|
||||
? pkg.stateInfo.installingInfo.newManifest
|
||||
: pkg.stateInfo.manifest!
|
||||
|
||||
Reference in New Issue
Block a user