mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
rework LAN display and service launchability
This commit is contained in:
committed by
Keagan McClelland
parent
daf701a76c
commit
deb0b1e561
@@ -1,4 +1,6 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { AppStatus } from '../models/app-model'
|
||||
import { ApiAppInstalledPreview } from './api/api-types'
|
||||
|
||||
const { useMocks, mockOver, skipStartupAlerts } = require('../../../use-mocks.json') as UseMocks
|
||||
|
||||
@@ -22,12 +24,25 @@ export class ConfigService {
|
||||
}
|
||||
|
||||
skipStartupAlerts = skipStartupAlerts
|
||||
isConsulateIos = window['platform'] === 'ios'
|
||||
isConsulateAndroid = window['platform'] === 'android'
|
||||
isConsulate = window['platform'] === 'ios'
|
||||
|
||||
isTor () : boolean {
|
||||
return (this.api.useMocks && mockOver === 'tor') || this.origin.endsWith('.onion')
|
||||
}
|
||||
|
||||
hasUI (app: ApiAppInstalledPreview): boolean {
|
||||
return app.lanUi || app.torUi
|
||||
}
|
||||
|
||||
isLaunchable (app: ApiAppInstalledPreview): boolean {
|
||||
return !this.isConsulate &&
|
||||
app.status === AppStatus.RUNNING &&
|
||||
(
|
||||
(app.torAddress && app.torUi && this.isTor()) ||
|
||||
(app.lanAddress && app.lanUi && !this.isTor())
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function removeProtocol (str: string): string {
|
||||
|
||||
Reference in New Issue
Block a user