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

@@ -0,0 +1,28 @@
import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { IonicModule } from '@ionic/angular'
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'
const routes: Routes = [
{
path: '',
component: PrivacyPage,
},
]
@NgModule({
imports: [
CommonModule,
IonicModule,
SharingModule,
RouterModule.forChild(routes),
PwaBackComponentModule,
],
declarations: [
PrivacyPage,
],
})
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

@@ -0,0 +1,24 @@
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: 'privacy',
templateUrl: './privacy.page.html',
styleUrls: ['./privacy.page.scss'],
})
export class PrivacyPage {
subs: Subscription[] = []
constructor (
private readonly serverConfigService: ServerConfigService,
public readonly config: ConfigService,
public readonly patch: PatchDbModel,
) { }
async presentModalValueEdit (key: string, current?: string): Promise<void> {
await this.serverConfigService.presentModalValueEdit(key, current)
}
}