mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
rework LAN display and service launchability
This commit is contained in:
committed by
Keagan McClelland
parent
daf701a76c
commit
deb0b1e561
@@ -1,6 +1,7 @@
|
||||
import { AppStatus } from '../../models/app-model'
|
||||
import { AppAvailablePreview, AppAvailableFull, AppInstalledPreview, AppDependency, BaseApp, AppInstalledFull, DependentBreakage, AppAvailableVersionSpecificInfo } from '../../models/app-types'
|
||||
import { modulateTime } from 'src/app/util/misc.util'
|
||||
import { ApiAppInstalledFull } from './api-types'
|
||||
|
||||
export function toAvailablePreview (f: AppAvailableFull): AppAvailablePreview {
|
||||
return {
|
||||
@@ -23,8 +24,11 @@ export function toInstalledPreview (f: AppInstalledFull): AppInstalledPreview {
|
||||
title: f.title,
|
||||
iconURL: f.iconURL,
|
||||
torAddress: f.torAddress,
|
||||
ui: f.ui,
|
||||
lanAddress: f.lanAddress,
|
||||
lanUi: f.lanUi,
|
||||
torUi: f.torUi,
|
||||
hasUI: f.hasUI,
|
||||
launchable: f.launchable,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +49,7 @@ export function toServiceBreakage (f: BaseApp): DependentBreakage {
|
||||
}
|
||||
}
|
||||
|
||||
export const bitcoinI: AppInstalledFull = {
|
||||
export const bitcoinI: ApiAppInstalledFull = {
|
||||
id: 'bitcoind',
|
||||
versionInstalled: '0.18.1',
|
||||
lanAddress: 'bitcoinLan.local',
|
||||
@@ -57,8 +61,8 @@ export const bitcoinI: AppInstalledFull = {
|
||||
instructions: 'some instructions',
|
||||
lastBackup: new Date().toISOString(),
|
||||
configuredRequirements: [],
|
||||
hasFetchedFull: true,
|
||||
ui: false,
|
||||
lanUi: false,
|
||||
torUi: false,
|
||||
restoreAlert: 'if you restore this app horrible things will happen to the people you love.',
|
||||
actions: [
|
||||
{ id: 'sync-chain', name: 'Sync Chain', description: 'this will sync with the chain like from Avatar', allowedStatuses: [ AppStatus.RUNNING, AppStatus.RUNNING, AppStatus.RUNNING, AppStatus.RUNNING ]},
|
||||
@@ -66,14 +70,14 @@ export const bitcoinI: AppInstalledFull = {
|
||||
],
|
||||
}
|
||||
|
||||
export const lightningI: AppInstalledFull = {
|
||||
id: 'c-lightning',
|
||||
export const lightningI: ApiAppInstalledFull = {
|
||||
id: 'lightning',
|
||||
lanAddress: 'lightningLan.local',
|
||||
status: AppStatus.RUNNING,
|
||||
title: 'C Lightning',
|
||||
versionInstalled: '1.0.0',
|
||||
torAddress: '4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad.onion',
|
||||
iconURL: 'assets/img/service-icons/bitwarden.png',
|
||||
iconURL: 'assets/img/service-icons/c-lightning.png',
|
||||
instructions: 'some instructions',
|
||||
lastBackup: new Date().toISOString(),
|
||||
configuredRequirements: [
|
||||
@@ -86,12 +90,12 @@ export const lightningI: AppInstalledFull = {
|
||||
violation: null,
|
||||
}),
|
||||
],
|
||||
hasFetchedFull: true,
|
||||
ui: true,
|
||||
lanUi: false,
|
||||
torUi: true,
|
||||
actions: [],
|
||||
}
|
||||
|
||||
export const cupsI: AppInstalledFull = {
|
||||
export const cupsI: ApiAppInstalledFull = {
|
||||
id: 'cups',
|
||||
lanAddress: 'cupsLan.local',
|
||||
versionInstalled: '2.1.0',
|
||||
@@ -102,7 +106,6 @@ export const cupsI: AppInstalledFull = {
|
||||
|
||||
instructions: 'some instructions',
|
||||
lastBackup: new Date().toISOString(),
|
||||
ui: true,
|
||||
uninstallAlert: 'This is A GREAT APP man, I just don\'t know',
|
||||
configuredRequirements: [
|
||||
toServiceRequirement(lightningI,
|
||||
@@ -133,7 +136,8 @@ export const cupsI: AppInstalledFull = {
|
||||
violation: { name: 'incompatible-config', ruleViolations: ['bro', 'seriously', 'fix this'] },
|
||||
}),
|
||||
],
|
||||
hasFetchedFull: true,
|
||||
lanUi: true,
|
||||
torUi: true,
|
||||
actions: [],
|
||||
}
|
||||
|
||||
@@ -296,7 +300,7 @@ export const mockApiAppAvailableFull: { [appId: string]: AppAvailableFull; } = {
|
||||
bitwarden: bitwardenA,
|
||||
}
|
||||
|
||||
export const mockApiAppInstalledFull: { [appId: string]: AppInstalledFull; } = {
|
||||
export const mockApiAppInstalledFull: { [appId: string]: ApiAppInstalledFull; } = {
|
||||
bitcoind: bitcoinI,
|
||||
cups: cupsI,
|
||||
lightning: lightningI,
|
||||
|
||||
Reference in New Issue
Block a user