Add daemon download prompt when it's not installed
TG-43 ready-for-test TG-38 ready-for-test Signed-off-by: trivernis <trivernis@protonmail.com>pull/4/head
parent
0ddc50d2a0
commit
481114052e
@ -0,0 +1,12 @@
|
||||
<h1 mat-dialog-title>
|
||||
Download daemon
|
||||
</h1>
|
||||
<div mat-dialog-content>
|
||||
No daemon could be found on the system. Please download and install a daemon executable.
|
||||
<br>
|
||||
<button class="download-button" mat-flat-button color="primary" (click)="this.onClickDownloadDaemon()">Download</button>
|
||||
</div>
|
||||
<div class="download-dialog-actions" mat-dialog-actions>
|
||||
<button (click)="closeDialog(false)" color="accent" mat-stroked-button>Cancel</button>
|
||||
<button (click)="closeDialog(true)" color="primary" mat-flat-button>Ok</button>
|
||||
</div>
|
@ -0,0 +1,15 @@
|
||||
.download-dialog-actions {
|
||||
display: block;
|
||||
|
||||
button {
|
||||
float: right;
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
button.download-button {
|
||||
margin: 2em auto auto;
|
||||
align-self: center;
|
||||
display: flex;
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { DownloadDaemonDialogComponent } from './download-daemon-dialog.component';
|
||||
|
||||
describe('DownloadDaemonDialogComponent', () => {
|
||||
let component: DownloadDaemonDialogComponent;
|
||||
let fixture: ComponentFixture<DownloadDaemonDialogComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ DownloadDaemonDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(DownloadDaemonDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,25 @@
|
||||
import {Component, Inject} from "@angular/core";
|
||||
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
|
||||
import {shell} from "@tauri-apps/api";
|
||||
|
||||
@Component({
|
||||
selector: "app-download-daemon-dialog",
|
||||
templateUrl: "./download-daemon-dialog.component.html",
|
||||
styleUrls: ["./download-daemon-dialog.component.scss"]
|
||||
})
|
||||
export class DownloadDaemonDialogComponent {
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<DownloadDaemonDialogComponent>,
|
||||
@Inject(
|
||||
MAT_DIALOG_DATA) data: any) {
|
||||
}
|
||||
|
||||
|
||||
public async onClickDownloadDaemon() {
|
||||
await shell.open("https://github.com/Trivernis/mediarepo-daemon");
|
||||
}
|
||||
|
||||
closeDialog(result: boolean) {
|
||||
this.dialogRef.close(result)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue