Merge branch 'next/minor' of github.com:Start9Labs/start-os into next/major

This commit is contained in:
Matt Hill
2024-12-02 16:50:37 -07:00
42 changed files with 605 additions and 194 deletions

4
web/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "startos-ui",
"version": "0.3.6-alpha.8",
"version": "0.3.6-alpha.9",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "startos-ui",
"version": "0.3.6-alpha.8",
"version": "0.3.6-alpha.9",
"license": "MIT",
"dependencies": {
"@angular/animations": "^17.3.1",

View File

@@ -1,6 +1,6 @@
{
"name": "startos-ui",
"version": "0.3.6-alpha.8",
"version": "0.3.6-alpha.9",
"author": "Start9 Labs, Inc",
"homepage": "https://start9.com/",
"license": "MIT",

View File

@@ -21,5 +21,5 @@
"ackInstructions": {},
"theme": "Dark",
"widgets": [],
"ack-welcome": "0.3.6-alpha.8"
"ack-welcome": "0.3.6-alpha.9"
}

View File

@@ -2,7 +2,10 @@ import { inject } from '@angular/core'
import { FormControlComponent } from './form-control/form-control.component'
import { IST } from '@start9labs/start-sdk'
export abstract class Control<Spec extends Exclude<IST.ValueSpec, IST.ValueSpecHidden>, Value> {
export abstract class Control<
Spec extends Exclude<IST.ValueSpec, IST.ValueSpecHidden>,
Value,
> {
private readonly control: FormControlComponent<Spec, Value> =
inject(FormControlComponent)

View File

@@ -37,4 +37,4 @@
Accept
</button>
</div>
</ng-template>
</ng-template>

View File

@@ -12,7 +12,12 @@ export const FORM_CONTROL_PROVIDERS: Provider[] = [
{
provide: TUI_VALIDATION_ERRORS,
deps: [forwardRef(() => FormControlComponent)],
useFactory: (control: FormControlComponent<Exclude<IST.ValueSpec, IST.ValueSpecHidden>, string>) => ({
useFactory: (
control: FormControlComponent<
Exclude<IST.ValueSpec, IST.ValueSpecHidden>,
string
>,
) => ({
required: 'Required',
pattern: ({ requiredPattern }: ValidatorsPatternError) =>
('patterns' in control.spec &&

View File

@@ -10,6 +10,8 @@ import { configBuilderToSpec } from 'src/app/utils/configBuilderToSpec'
import { T, ISB, IST } from '@start9labs/start-sdk'
import { GetPackagesRes } from '@start9labs/marketplace'
import markdown from 'raw-loader!../../../../../shared/assets/markdown/md-sample.md'
const mockMerkleArchiveCommitment: T.MerkleArchiveCommitment = {
rootSighash: 'fakehash',
rootMaxsize: 0,
@@ -811,6 +813,17 @@ export module Mock {
data: null,
read: false,
},
{
id: 5,
packageId: null,
createdAt: '2019-12-26T14:20:30.872Z',
code: 2,
level: 'success',
title: 'Welcome to StartOS 0.3.6!',
message: 'Click "View Details" to learn all about the new version',
data: markdown,
read: false,
},
]
export function getMetrics(): ServerMetrics {

View File

@@ -602,7 +602,9 @@ export type NotificationData<T> = T extends 0
? null
: T extends 1
? BackupReport
: any
: T extends 2
? string
: any
export type BackupReport = {
server: {

View File

@@ -4,7 +4,6 @@ import { Mock } from './api.fixures'
export const mockPatchData: DataModel = {
ui: {
name: `Matt's Server`,
ackWelcome: '1.0.0',
theme: 'Dark',
desktop: ['lnd'],
marketplace: {

View File

@@ -1,14 +1,10 @@
import { Injectable } from '@angular/core'
import { TuiDialogService } from '@taiga-ui/core'
import { filter, share, switchMap, Observable, map } from 'rxjs'
import { Observable } from 'rxjs'
import { filter, map, share, switchMap } from 'rxjs/operators'
import { PatchDB } from 'patch-db-client'
import { DataModel } from 'src/app/services/patch-db/data-model'
import { EOSService } from 'src/app/services/eos.service'
import { WelcomeComponent } from 'src/app/components/welcome.component'
import { ConfigService } from 'src/app/services/config.service'
import { ApiService } from 'src/app/services/api/embassy-api.service'
import { ConnectionService } from 'src/app/services/connection.service'
import { PolymorpheusComponent } from '@taiga-ui/polymorpheus'
import { LocalStorageBootstrap } from './patch-db/local-storage-bootstrap'
// Get data from PatchDb after is starts and act upon it
@@ -25,8 +21,6 @@ export class PatchDataService extends Observable<void> {
if (index === 0) {
// check for updates to StartOS and services
this.checkForUpdates()
// show eos welcome message
this.showEosWelcome(cache.ui.ackWelcome)
}
}),
share(),
@@ -35,9 +29,6 @@ export class PatchDataService extends Observable<void> {
constructor(
private readonly patch: PatchDB<DataModel>,
private readonly eosService: EOSService,
private readonly config: ConfigService,
private readonly dialogs: TuiDialogService,
private readonly embassyApi: ApiService,
private readonly connection$: ConnectionService,
private readonly bootstrapper: LocalStorageBootstrap,
) {
@@ -48,22 +39,4 @@ export class PatchDataService extends Observable<void> {
this.eosService.loadEos()
// this.marketplaceService.getMarketplace$().pipe(take(1)).subscribe()
}
private showEosWelcome(ackVersion: string) {
if (this.config.skipStartupAlerts || ackVersion === this.config.version) {
return
}
this.dialogs
.open(new PolymorpheusComponent(WelcomeComponent), {
label: 'Release Notes',
})
.subscribe({
complete: () => {
this.embassyApi
.setDbValue<string>(['ackWelcome'], this.config.version)
.catch()
},
})
}
}

View File

@@ -9,7 +9,6 @@ export type DataModel = {
export type UIData = {
name: string | null
ackWelcome: string // emver
marketplace: UIMarketplaceData
gaming: {
snake: {