mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
add qr code to insights->about->tor (#2379)
* add qr code to insights->about->tor * fix address PR feedback from @elvece; inject modelCtrl in ctor
This commit is contained in:
@@ -5,6 +5,7 @@ import { IonicModule } from '@ionic/angular'
|
|||||||
import { ServerSpecsPage } from './server-specs.page'
|
import { ServerSpecsPage } from './server-specs.page'
|
||||||
import { EmverPipesModule } from '@start9labs/shared'
|
import { EmverPipesModule } from '@start9labs/shared'
|
||||||
import { TuiLetModule } from '@taiga-ui/cdk'
|
import { TuiLetModule } from '@taiga-ui/cdk'
|
||||||
|
import { QRComponentModule } from 'src/app/components/qr/qr.component.module'
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
@@ -18,6 +19,7 @@ const routes: Routes = [
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
IonicModule,
|
IonicModule,
|
||||||
RouterModule.forChild(routes),
|
RouterModule.forChild(routes),
|
||||||
|
QRComponentModule,
|
||||||
EmverPipesModule,
|
EmverPipesModule,
|
||||||
TuiLetModule,
|
TuiLetModule,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -32,9 +32,27 @@
|
|||||||
<h2>Tor</h2>
|
<h2>Tor</h2>
|
||||||
<p>{{ server['tor-address'] }}</p>
|
<p>{{ server['tor-address'] }}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-button slot="end" fill="clear" (click)="copy(server['tor-address'])">
|
<div slot="end">
|
||||||
<ion-icon slot="icon-only" name="copy-outline"></ion-icon>
|
<ion-button
|
||||||
|
fill="clear"
|
||||||
|
(click)="showQR(server['tor-address'])"
|
||||||
|
>
|
||||||
|
<ion-icon
|
||||||
|
slot="icon-only"
|
||||||
|
name="qr-code-outline"
|
||||||
|
size="small"
|
||||||
|
></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
<ion-button
|
||||||
|
fill="clear"
|
||||||
|
(click)="copy(server['tor-address'])">
|
||||||
|
<ion-icon
|
||||||
|
slot="icon-only"
|
||||||
|
name="copy-outline"
|
||||||
|
size="small"
|
||||||
|
></ion-icon>
|
||||||
|
</ion-button>
|
||||||
|
</div>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label class="break-all">
|
<ion-label class="break-all">
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
||||||
import { ToastController } from '@ionic/angular'
|
import { ModalController, ToastController } from '@ionic/angular'
|
||||||
import { PatchDB } from 'patch-db-client'
|
import { PatchDB } from 'patch-db-client'
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
|
import { QRComponent } from 'src/app/components/qr/qr.component'
|
||||||
import { copyToClipboard } from '@start9labs/shared'
|
import { copyToClipboard } from '@start9labs/shared'
|
||||||
import { DataModel } from 'src/app/services/patch-db/data-model'
|
import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ export class ServerSpecsPage {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly toastCtrl: ToastController,
|
private readonly toastCtrl: ToastController,
|
||||||
|
private readonly modalCtrl: ModalController,
|
||||||
private readonly patch: PatchDB<DataModel>,
|
private readonly patch: PatchDB<DataModel>,
|
||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
) {}
|
) {}
|
||||||
@@ -40,6 +42,17 @@ export class ServerSpecsPage {
|
|||||||
await toast.present()
|
await toast.present()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async showQR(text: string): Promise<void> {
|
||||||
|
const modal = await this.modalCtrl.create({
|
||||||
|
component: QRComponent,
|
||||||
|
componentProps: {
|
||||||
|
text,
|
||||||
|
},
|
||||||
|
cssClass: 'qr-modal',
|
||||||
|
})
|
||||||
|
await modal.present()
|
||||||
|
}
|
||||||
|
|
||||||
asIsOrder(a: any, b: any) {
|
asIsOrder(a: any, b: any) {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user