mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
implement base ui for LAN services
This commit is contained in:
committed by
Aiden McClelland
parent
0d7b087665
commit
50a2be243a
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<ion-card class="installed-card" [class.installed-card-on]="vars.status === 'RUNNING'" style="position:relative" [routerLink]="['/services', 'installed', app.id]">
|
<ion-card class="installed-card" [class.installed-card-on]="vars.status === 'RUNNING'" style="position:relative" [routerLink]="['/services', 'installed', app.id]">
|
||||||
<div class="launch-container" *ngIf="vars.ui && !isConsulate">
|
<div class="launch-container" *ngIf="vars.ui && !isConsulate">
|
||||||
<div class="launch-button-triangle" (click)="launchUiTab(vars.tor, $event)" [class.disabled]="vars.status !== AppStatus.RUNNING || !isTor">
|
<div class="launch-button-triangle" (click)="launchUiTab(vars.tor, app.id, $event)" [class.disabled]="vars.status !== AppStatus.RUNNING || !isTor">
|
||||||
<ion-icon class="launch-button-triangle-icon" name="globe-outline"></ion-icon>
|
<ion-icon class="launch-button-triangle-icon" name="globe-outline"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -99,11 +99,17 @@ export class AppInstalledListPage extends Cleanup {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async launchUiTab (address: string, event: Event) {
|
async launchUiTab (torAddress: string, id: string, event: Event) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
address = address.startsWith('http') ? address : `http://${address}`
|
|
||||||
return window.open(address, '_blank')
|
let uiAddress: string
|
||||||
|
if (this.isTor) {
|
||||||
|
uiAddress = torAddress.startsWith('http') ? torAddress : `http://${torAddress}`
|
||||||
|
} else {
|
||||||
|
uiAddress = `https://${id}.${this.serverModel.peek().serverId}.local`
|
||||||
|
}
|
||||||
|
return window.open(uiAddress, '_blank')
|
||||||
}
|
}
|
||||||
|
|
||||||
async doRefresh (event: any) {
|
async doRefresh (event: any) {
|
||||||
|
|||||||
@@ -93,14 +93,24 @@
|
|||||||
|
|
||||||
<ng-container *ngIf="app && app.id && vars.status !== 'INSTALLING'">
|
<ng-container *ngIf="app && app.id && vars.status !== 'INSTALLING'">
|
||||||
<ion-item-group class="ion-padding-bottom">
|
<ion-item-group class="ion-padding-bottom">
|
||||||
<ion-item-divider>Tor Address</ion-item-divider>
|
<ion-item-divider>Addresses</ion-item-divider>
|
||||||
<ion-item lines="none">
|
<ion-item>
|
||||||
<ion-label style="display: flex; justify-content: space-between; align-items: center;" class="ion-text-wrap">
|
<ion-label class="ion-text-wrap">
|
||||||
<p style="color: var(--ion-color-dark)">{{ vars.torAddress }}</p>
|
<h2>Tor Address</h2>
|
||||||
<ion-button slot="end" fill="clear" (click)="copyTor()">
|
<p>{{ vars.torAddress }}</p>
|
||||||
<ion-icon slot="icon-only" name="copy-outline" color="primary"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
<ion-button slot="end" fill="clear" (click)="copyTor()">
|
||||||
|
<ion-icon slot="icon-only" name="copy-outline" color="primary"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item lines="none">
|
||||||
|
<ion-label class="ion-text-wrap">
|
||||||
|
<h2>LAN Address</h2>
|
||||||
|
<p>{{ lanAddress }}</p>
|
||||||
|
</ion-label>
|
||||||
|
<ion-button slot="end" fill="clear" (click)="copyTor()">
|
||||||
|
<ion-icon slot="icon-only" name="copy-outline" color="primary"></ion-icon>
|
||||||
|
</ion-button>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<ion-item-divider>Backups</ion-item-divider>
|
<ion-item-divider>Backups</ion-item-divider>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { InformationPopoverComponent } from 'src/app/components/information-popo
|
|||||||
import { Emver } from 'src/app/services/emver.service'
|
import { Emver } from 'src/app/services/emver.service'
|
||||||
import { displayEmver } from 'src/app/pipes/emver.pipe'
|
import { displayEmver } from 'src/app/pipes/emver.pipe'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
|
import { ServerModel } from 'src/app/models/server-model'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-installed-show',
|
selector: 'app-installed-show',
|
||||||
@@ -31,6 +32,7 @@ export class AppInstalledShowPage extends Cleanup {
|
|||||||
|
|
||||||
$error$ = new BehaviorSubject<string>('')
|
$error$ = new BehaviorSubject<string>('')
|
||||||
app: PropertySubject<AppInstalledFull> = { } as any
|
app: PropertySubject<AppInstalledFull> = { } as any
|
||||||
|
lanAddress = ''
|
||||||
appId: string
|
appId: string
|
||||||
AppStatus = AppStatus
|
AppStatus = AppStatus
|
||||||
showInstructions = false
|
showInstructions = false
|
||||||
@@ -57,6 +59,7 @@ export class AppInstalledShowPage extends Cleanup {
|
|||||||
private readonly appModel: AppModel,
|
private readonly appModel: AppModel,
|
||||||
private readonly popoverController: PopoverController,
|
private readonly popoverController: PopoverController,
|
||||||
private readonly emver: Emver,
|
private readonly emver: Emver,
|
||||||
|
private readonly serverModel: ServerModel,
|
||||||
config: ConfigService,
|
config: ConfigService,
|
||||||
) {
|
) {
|
||||||
super()
|
super()
|
||||||
@@ -66,6 +69,8 @@ export class AppInstalledShowPage extends Cleanup {
|
|||||||
|
|
||||||
async ngOnInit () {
|
async ngOnInit () {
|
||||||
this.appId = this.route.snapshot.paramMap.get('appId') as string
|
this.appId = this.route.snapshot.paramMap.get('appId') as string
|
||||||
|
const server = this.serverModel.peek()
|
||||||
|
this.lanAddress = `https://${this.appId}.${server.serverId}.local`
|
||||||
|
|
||||||
this.cleanup(
|
this.cleanup(
|
||||||
markAsLoadingDuring$(this.$loading$, this.preload.appFull(this.appId))
|
markAsLoadingDuring$(this.$loading$, this.preload.appFull(this.appId))
|
||||||
@@ -103,8 +108,13 @@ export class AppInstalledShowPage extends Cleanup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async launchUiTab () {
|
async launchUiTab () {
|
||||||
let uiAddress = this.app.torAddress.getValue()
|
let uiAddress: string
|
||||||
uiAddress = uiAddress.startsWith('http') ? uiAddress : `http://${uiAddress}`
|
if (this.isTor) {
|
||||||
|
const torAddress = this.app.torAddress.getValue()
|
||||||
|
uiAddress = torAddress.startsWith('http') ? torAddress : `http://${torAddress}`
|
||||||
|
} else {
|
||||||
|
uiAddress = this.lanAddress
|
||||||
|
}
|
||||||
return window.open(uiAddress, '_blank')
|
return window.open(uiAddress, '_blank')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user