rework endpoints and enable setting custom marketplace urls

This commit is contained in:
Matt Hill
2021-07-14 16:43:25 -06:00
committed by Aiden McClelland
parent 16f5764f74
commit 6d92c195e9
24 changed files with 397 additions and 439 deletions

View File

@@ -13,10 +13,6 @@
<ion-item detail="true" button [routerLink]="['ssh-keys']">
<ion-label>SSH Keys</ion-label>
</ion-item>
<ion-item button (click)="presentModalValueEdit('registry', server.registry)">
<ion-label>Marketplace URL</ion-label>
<ion-note slot="end">{{ server.registry }}</ion-note>
</ion-item>
</ion-item-group>
</ion-content>

View File

@@ -1,8 +1,6 @@
import { Component } from '@angular/core'
import { ServerConfigService } from 'src/app/services/server-config.service'
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
import { ServerInfo } from 'src/app/services/patch-db/data-model'
import { Subscription } from 'rxjs'
@Component({
selector: 'dev-options',
@@ -10,7 +8,6 @@ import { Subscription } from 'rxjs'
styleUrls: ['./dev-options.page.scss'],
})
export class DevOptionsPage {
subs: Subscription[] = []
constructor (
private readonly serverConfigService: ServerConfigService,

View File

@@ -1,19 +0,0 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<pwa-back-button></pwa-back-button>
</ion-buttons>
<ion-title>Preferences</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding-top">
<ion-item-group>
<ion-item button (click)="presentModalValueEdit('autoCheckUpdates', patch.data.ui['auto-check-updates'])">
<ion-label>Auto Check for Updates</ion-label>
<ion-note slot="end">{{ patch.data.ui['auto-check-updates'] }}</ion-note>
</ion-item>
</ion-item-group>
</ion-content>

View File

@@ -1,7 +1,7 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { IonicModule } from '@ionic/angular'
import { PreferencesPage } from './preferences.page'
import { PrivacyPage } from './privacy.page'
import { Routes, RouterModule } from '@angular/router'
import { SharingModule } from 'src/app/modules/sharing.module'
import { PwaBackComponentModule } from 'src/app/components/pwa-back-button/pwa-back.component.module'
@@ -9,7 +9,7 @@ import { PwaBackComponentModule } from 'src/app/components/pwa-back-button/pwa-b
const routes: Routes = [
{
path: '',
component: PreferencesPage,
component: PrivacyPage,
},
]
@@ -22,7 +22,7 @@ const routes: Routes = [
PwaBackComponentModule,
],
declarations: [
PreferencesPage,
PrivacyPage,
],
})
export class PreferencesPageModule { }
export class PrivacyPageModule { }

View File

@@ -0,0 +1,34 @@
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<pwa-back-button></pwa-back-button>
</ion-buttons>
<ion-title>Privacy and Security</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding-top">
<ion-item-group>
<ion-item-divider>Marketplace Settings</ion-item-divider>
<ion-item button (click)="presentModalValueEdit('eosMarketplace', patch.data['server-info']['eos-marketplace'])">
<ion-label>Use Tor</ion-label>
<ion-note slot="end">{{ patch.data['server-info']['eos-marketplace'] === config.start9Marketplace.tor }}</ion-note>
</ion-item>
<ion-item button (click)="presentModalValueEdit('packageMarketplace', patch.data['server-info']['package-marketplace'])">
<ion-label>Package Marketplace</ion-label>
<ion-note slot="end">{{ patch.data['server-info']['package-marketplace'] }}</ion-note>
</ion-item>
<ion-item button (click)="presentModalValueEdit('autoCheckUpdates', patch.data.ui['auto-check-updates'])">
<ion-label>Auto Check for Updates</ion-label>
<ion-note slot="end">{{ patch.data.ui['auto-check-updates'] }}</ion-note>
</ion-item>
<ion-item-divider></ion-item-divider>
<ion-item button (click)="presentModalValueEdit('password')">
<ion-label>Change Password</ion-label>
<ion-note slot="end">********</ion-note>
</ion-item>
</ion-item-group>
</ion-content>

View File

@@ -2,17 +2,19 @@ import { Component } from '@angular/core'
import { ServerConfigService } from 'src/app/services/server-config.service'
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
import { Subscription } from 'rxjs'
import { ConfigService } from 'src/app/services/config.service'
@Component({
selector: 'preferences',
templateUrl: './preferences.page.html',
styleUrls: ['./preferences.page.scss'],
selector: 'privacy',
templateUrl: './privacy.page.html',
styleUrls: ['./privacy.page.scss'],
})
export class PreferencesPage {
export class PrivacyPage {
subs: Subscription[] = []
constructor (
private readonly serverConfigService: ServerConfigService,
public readonly config: ConfigService,
public readonly patch: PatchDbModel,
) { }

View File

@@ -23,12 +23,8 @@ const routes: Routes = [
loadChildren: () => import('./server-logs/server-logs.module').then(m => m.ServerLogsPageModule),
},
{
path: 'preferences',
loadChildren: () => import('./preferences/preferences.module').then(m => m.PreferencesPageModule),
},
{
path: 'preferences/edit',
loadChildren: () => import('./preferences/preferences.module').then(m => m.PreferencesPageModule),
path: 'privacy',
loadChildren: () => import('./privacy/privacy.module').then(m => m.PrivacyPageModule),
},
{
path: 'wifi',