aboutsummaryrefslogtreecommitdiff
path: root/ui/src
diff options
context:
space:
mode:
authorAlex Shnitman <alexta69@gmail.com>2022-06-23 23:30:09 +0300
committerAlex Shnitman <alexta69@gmail.com>2022-06-23 23:30:09 +0300
commitad0eab880c4a893f174141050d4d53e9f5f35868 (patch)
tree3fa981dfa0394b1d7dd76e9254286db238f4e7c3 /ui/src
parentrefactor of the entrypoint feature (diff)
downloadmetube-ad0eab880c4a893f174141050d4d53e9f5f35868.tar.gz
metube-ad0eab880c4a893f174141050d4d53e9f5f35868.tar.bz2
metube-ad0eab880c4a893f174141050d4d53e9f5f35868.zip
angular 13 and bootstrap 5
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/app/app.component.html56
-rw-r--r--ui/src/app/app.component.sass1
-rw-r--r--ui/src/app/downloads.service.ts14
-rw-r--r--ui/src/app/master-checkbox.component.ts12
4 files changed, 40 insertions, 43 deletions
diff --git a/ui/src/app/app.component.html b/ui/src/app/app.component.html
index 9317b85..74425aa 100644
--- a/ui/src/app/app.component.html
+++ b/ui/src/app/app.component.html
@@ -1,25 +1,27 @@
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
- <a class="navbar-brand" href="#">MeTube</a>
- <!--
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsDefault" aria-controls="navbarsDefault" aria-expanded="false" aria-label="Toggle navigation">
- <span class="navbar-toggler-icon"></span>
- </button>
- <div class="collapse navbar-collapse" id="navbarsDefault">
- <ul class="navbar-nav mr-auto">
- <li class="nav-item active">
- <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
- </li>
- </ul>
- </div>
- -->
- <div class="ml-auto">
- <button class="btn btn-outline-light button-toggle-theme" aria-label="Toggle theme" (click)="themeChanged()">
- <fa-icon [icon]="darkMode ? faSun : faMoon"></fa-icon>
+ <div class="container-fluid">
+ <a class="navbar-brand" href="#">MeTube</a>
+ <!--
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsDefault" aria-controls="navbarsDefault" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
</button>
+ <div class="collapse navbar-collapse" id="navbarsDefault">
+ <ul class="navbar-nav mr-auto">
+ <li class="nav-item active">
+ <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
+ </li>
+ </ul>
+ </div>
+ -->
+ <div class="ms-auto">
+ <button class="btn btn-outline-light button-toggle-theme" aria-label="Toggle theme" (click)="themeChanged()">
+ <fa-icon [icon]="darkMode ? faSun : faMoon"></fa-icon>
+ </button>
+ </div>
</div>
</nav>
-<main role="main" class="container">
+<main role="main" class="container container-xl">
<form #f="ngForm">
<div class="container add-url-box">
<div class="row">
@@ -30,20 +32,16 @@
<div class="row">
<div class="col-md-5 add-url-component">
<div class="input-group">
- <div class="input-group-prepend">
- <span class="input-group-text">Quality</span>
- </div>
- <select class="custom-select" name="quality" [(ngModel)]="quality" (change)="qualityChanged()" [disabled]="addInProgress || downloads.loading">
+ <span class="input-group-text">Quality</span>
+ <select class="form-select" name="quality" [(ngModel)]="quality" (change)="qualityChanged()" [disabled]="addInProgress || downloads.loading">
<option *ngFor="let q of qualities" [ngValue]="q.id">{{ q.text }}</option>
</select>
</div>
</div>
<div class="col-md-4 add-url-component">
<div class="input-group">
- <div class="input-group-prepend">
- <span class="input-group-text">Format</span>
- </div>
- <select class="custom-select" name="format" [(ngModel)]="format" (change)="formatChanged()" [disabled]="addInProgress || downloads.loading">
+ <span class="input-group-text">Format</span>
+ <select class="form-select" name="format" [(ngModel)]="format" (change)="formatChanged()" [disabled]="addInProgress || downloads.loading">
<option *ngFor="let f of formats" [ngValue]="f.id">{{ f.text }}</option>
</select>
</div>
@@ -69,7 +67,7 @@
<app-master-checkbox #queueMasterCheckbox [id]="'queue'" [list]="downloads.queue" (changed)="queueSelectionChanged($event)"></app-master-checkbox>
</th>
<th scope="col">
- <button type="button" class="btn btn-link px-0 mr-4" disabled #queueDelSelected (click)="delSelectedDownloads('queue')"><fa-icon [icon]="faTrashAlt"></fa-icon>&nbsp; Cancel selected</button>
+ <button type="button" class="btn btn-link text-decoration-none px-0 me-4" disabled #queueDelSelected (click)="delSelectedDownloads('queue')"><fa-icon [icon]="faTrashAlt"></fa-icon>&nbsp; Cancel selected</button>
</th>
<th scope="col" style="width: 14rem;"></th>
<th scope="col" style="width: 8rem;">Speed</th>
@@ -101,9 +99,9 @@
<app-master-checkbox #doneMasterCheckbox [id]="'done'" [list]="downloads.done" (changed)="doneSelectionChanged($event)"></app-master-checkbox>
</th>
<th scope="col">
- <button type="button" class="btn btn-link px-0 mr-4" disabled #doneDelSelected (click)="delSelectedDownloads('done')"><fa-icon [icon]="faTrashAlt"></fa-icon>&nbsp; Clear selected</button>
- <button type="button" class="btn btn-link px-0 mr-4" disabled #doneClearCompleted (click)="clearCompletedDownloads()"><fa-icon [icon]="faCheckCircle"></fa-icon>&nbsp; Clear completed</button>
- <button type="button" class="btn btn-link px-0 mr-4" disabled #doneClearFailed (click)="clearFailedDownloads()"><fa-icon [icon]="faTimesCircle"></fa-icon>&nbsp; Clear failed</button>
+ <button type="button" class="btn btn-link text-decoration-none px-0 me-4" disabled #doneDelSelected (click)="delSelectedDownloads('done')"><fa-icon [icon]="faTrashAlt"></fa-icon>&nbsp; Clear selected</button>
+ <button type="button" class="btn btn-link text-decoration-none px-0 me-4" disabled #doneClearCompleted (click)="clearCompletedDownloads()"><fa-icon [icon]="faCheckCircle"></fa-icon>&nbsp; Clear completed</button>
+ <button type="button" class="btn btn-link text-decoration-none px-0 me-4" disabled #doneClearFailed (click)="clearFailedDownloads()"><fa-icon [icon]="faTimesCircle"></fa-icon>&nbsp; Clear failed</button>
</th>
<th scope="col" style="width: 2rem;"></th>
<th scope="col" style="width: 2rem;"></th>
diff --git a/ui/src/app/app.component.sass b/ui/src/app/app.component.sass
index a084286..517af03 100644
--- a/ui/src/app/app.component.sass
+++ b/ui/src/app/app.component.sass
@@ -10,7 +10,6 @@
margin: 0.5rem auto
button.add-url
- zmin-width: 7rem
width: 100%
$metube-section-color-bg: rgba(0,0,0,.07)
diff --git a/ui/src/app/downloads.service.ts b/ui/src/app/downloads.service.ts
index 25bcccc..8580a70 100644
--- a/ui/src/app/downloads.service.ts
+++ b/ui/src/app/downloads.service.ts
@@ -42,13 +42,13 @@ export class DownloadsService {
data[0].forEach(entry => this.queue.set(...entry));
this.done.clear();
data[1].forEach(entry => this.done.set(...entry));
- this.queueChanged.next();
- this.doneChanged.next();
+ this.queueChanged.next(null);
+ this.doneChanged.next(null);
});
socket.fromEvent('added').subscribe((strdata: string) => {
let data: Download = JSON.parse(strdata);
this.queue.set(data.id, data);
- this.queueChanged.next();
+ this.queueChanged.next(null);
});
socket.fromEvent('updated').subscribe((strdata: string) => {
let data: Download = JSON.parse(strdata);
@@ -61,18 +61,18 @@ export class DownloadsService {
let data: Download = JSON.parse(strdata);
this.queue.delete(data.id);
this.done.set(data.id, data);
- this.queueChanged.next();
- this.doneChanged.next();
+ this.queueChanged.next(null);
+ this.doneChanged.next(null);
});
socket.fromEvent('canceled').subscribe((strdata: string) => {
let data: string = JSON.parse(strdata);
this.queue.delete(data);
- this.queueChanged.next();
+ this.queueChanged.next(null);
});
socket.fromEvent('cleared').subscribe((strdata: string) => {
let data: string = JSON.parse(strdata);
this.done.delete(data);
- this.doneChanged.next();
+ this.doneChanged.next(null);
});
}
diff --git a/ui/src/app/master-checkbox.component.ts b/ui/src/app/master-checkbox.component.ts
index 8c8208a..a8358fc 100644
--- a/ui/src/app/master-checkbox.component.ts
+++ b/ui/src/app/master-checkbox.component.ts
@@ -7,9 +7,9 @@ interface Checkable {
@Component({
selector: 'app-master-checkbox',
template: `
- <div class="custom-control custom-checkbox">
- <input type="checkbox" class="custom-control-input" id="{{id}}-select-all" #masterCheckbox [(ngModel)]="selected" (change)="clicked()">
- <label class="custom-control-label" for="{{id}}-select-all"></label>
+ <div class="form-check">
+ <input type="checkbox" class="form-check-input" id="{{id}}-select-all" #masterCheckbox [(ngModel)]="selected" (change)="clicked()">
+ <label class="form-check-label" for="{{id}}-select-all"></label>
</div>
`
})
@@ -40,9 +40,9 @@ export class MasterCheckboxComponent {
@Component({
selector: 'app-slave-checkbox',
template: `
- <div class="custom-control custom-checkbox">
- <input type="checkbox" class="custom-control-input" id="{{master.id}}-{{id}}-select" [(ngModel)]="checkable.checked" (change)="master.selectionChanged()">
- <label class="custom-control-label" for="{{master.id}}-{{id}}-select"></label>
+ <div class="form-check">
+ <input type="checkbox" class="form-check-input" id="{{master.id}}-{{id}}-select" [(ngModel)]="checkable.checked" (change)="master.selectionChanged()">
+ <label class="form-check-label" for="{{master.id}}-{{id}}-select"></label>
</div>
`
})
bgstack15