parent
bb2a63c703
commit
77d288d905
@ -0,0 +1,24 @@
|
||||
<h1 class="title" mat-dialog-title>
|
||||
About mediarepo
|
||||
</h1>
|
||||
<div class="content" mat-dialog-content>
|
||||
<app-metadata-entry attributeName="Version" display="line">
|
||||
{{version | async}}
|
||||
</app-metadata-entry>
|
||||
<app-metadata-entry attributeName="Tauri Version" display="line">
|
||||
{{tauriVersion | async}}
|
||||
</app-metadata-entry>
|
||||
<br>
|
||||
<mat-divider></mat-divider>
|
||||
<h2>Built with</h2>
|
||||
<div class="lib-list">
|
||||
<b *ngFor="let lib of usedLibs">
|
||||
<app-external-url [href]="lib[1]">{{lib[0]}}</app-external-url>
|
||||
</b>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions" mat-dialog-actions>
|
||||
<button (click)="this.dialogRef.close(true)" color="primary" mat-stroked-button>
|
||||
Close
|
||||
</button>
|
||||
</div>
|
@ -0,0 +1,20 @@
|
||||
.title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.actions {
|
||||
display: block;
|
||||
|
||||
button {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.lib-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import {ComponentFixture, TestBed} from "@angular/core/testing";
|
||||
|
||||
import {AboutDialogComponent} from "./about-dialog.component";
|
||||
|
||||
describe("AboutDialogComponent", () => {
|
||||
let component: AboutDialogComponent;
|
||||
let fixture: ComponentFixture<AboutDialogComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [AboutDialogComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(AboutDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it("should create", () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,31 @@
|
||||
import {ChangeDetectionStrategy, Component, OnInit} from "@angular/core";
|
||||
import {MatDialogRef} from "@angular/material/dialog";
|
||||
import {app} from "@tauri-apps/api";
|
||||
import {Subject} from "rxjs";
|
||||
|
||||
@Component({
|
||||
selector: "app-about-dialog",
|
||||
templateUrl: "./about-dialog.component.html",
|
||||
styleUrls: ["./about-dialog.component.scss"],
|
||||
changeDetection: ChangeDetectionStrategy.Default
|
||||
})
|
||||
export class AboutDialogComponent implements OnInit {
|
||||
|
||||
public version = new Subject<string>();
|
||||
public tauriVersion = new Subject<string>();
|
||||
public usedLibs = [
|
||||
["Tauri", "https://tauri.studio"],
|
||||
["Angular", "https://angular.io/"],
|
||||
["SeaORM", "https://www.sea-ql.org"],
|
||||
["Tokio", "https://tokio.rs/"],
|
||||
["bromine", "https://github.com/Trivernis/bromine"]
|
||||
];
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<AboutDialogComponent>) {
|
||||
}
|
||||
|
||||
public async ngOnInit() {
|
||||
this.version.next(await app.getVersion());
|
||||
this.tauriVersion.next(await app.getTauriVersion());
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
<span (click)="this.openUrl()" class="highlight">
|
||||
<ng-content></ng-content>
|
||||
</span>
|
@ -0,0 +1,15 @@
|
||||
@import "src/colors";
|
||||
|
||||
.highlight {
|
||||
cursor: pointer;
|
||||
color: $primary-lighter-20;
|
||||
text-decoration: underline;
|
||||
|
||||
&:hover {
|
||||
color: $primary-lighter-30;
|
||||
}
|
||||
|
||||
&:active {
|
||||
color: $accent;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import {ComponentFixture, TestBed} from "@angular/core/testing";
|
||||
|
||||
import {ExternalUrlComponent} from "./external-url.component";
|
||||
|
||||
describe("ExternalUrlComponent", () => {
|
||||
let component: ExternalUrlComponent;
|
||||
let fixture: ComponentFixture<ExternalUrlComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ExternalUrlComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ExternalUrlComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it("should create", () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,31 @@
|
||||
import {ChangeDetectionStrategy, Component, Input} from "@angular/core";
|
||||
import {shell} from "@tauri-apps/api";
|
||||
|
||||
@Component({
|
||||
selector: "app-external-url",
|
||||
templateUrl: "./external-url.component.html",
|
||||
styleUrls: ["./external-url.component.scss"],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ExternalUrlComponent {
|
||||
|
||||
@Input() href!: string;
|
||||
private opening = false;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
public async openUrl() {
|
||||
if (this.opening) {
|
||||
return;
|
||||
}
|
||||
this.opening = true;
|
||||
try {
|
||||
await shell.open(this.href);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
this.opening = false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue