mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-12 05:11:29 +03:00
Updated styling for settings page
Fixed issue where redirects to home occured when reloading the settings page Fixed errors that occured when loading the settings page
This commit is contained in:
@@ -44,9 +44,12 @@
|
|||||||
<a *ngIf="postsService.config && postsService.config.Advanced.multi_user_mode && !postsService.isLoggedIn" mat-list-item (click)="sidenav.close()" routerLink='/login'><ng-container i18n="Navigation menu Login Page title">Login</ng-container></a>
|
<a *ngIf="postsService.config && postsService.config.Advanced.multi_user_mode && !postsService.isLoggedIn" mat-list-item (click)="sidenav.close()" routerLink='/login'><ng-container i18n="Navigation menu Login Page title">Login</ng-container></a>
|
||||||
<a *ngIf="postsService.config && allowSubscriptions && postsService.hasPermission('subscriptions')" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/subscriptions'><ng-container i18n="Navigation menu Subscriptions Page title">Subscriptions</ng-container></a>
|
<a *ngIf="postsService.config && allowSubscriptions && postsService.hasPermission('subscriptions')" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/subscriptions'><ng-container i18n="Navigation menu Subscriptions Page title">Subscriptions</ng-container></a>
|
||||||
<a *ngIf="postsService.config && enableDownloadsManager && postsService.hasPermission('downloads_manager')" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/downloads'><ng-container i18n="Navigation menu Downloads Page title">Downloads</ng-container></a>
|
<a *ngIf="postsService.config && enableDownloadsManager && postsService.hasPermission('downloads_manager')" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/downloads'><ng-container i18n="Navigation menu Downloads Page title">Downloads</ng-container></a>
|
||||||
<a *ngIf="postsService.config && postsService.hasPermission('settings')" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/settings'><ng-container i18n="Settings menu label">Settings</ng-container></a>
|
<ng-container *ngIf="postsService.config && postsService.hasPermission('settings')">
|
||||||
<ng-container *ngIf="postsService.config && allowSubscriptions && postsService.subscriptions && postsService.hasPermission('subscriptions')">
|
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
|
<a mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" routerLink='/settings'><ng-container i18n="Settings menu label">Settings</ng-container></a>
|
||||||
|
</ng-container>
|
||||||
|
<ng-container *ngIf="postsService.config && allowSubscriptions && postsService.subscriptions && postsService.hasPermission('subscriptions')">
|
||||||
|
<mat-divider *ngIf="postsService.subscriptions.length > 0"></mat-divider>
|
||||||
<a *ngFor="let subscription of postsService.subscriptions" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" [routerLink]="['/subscription', { id: subscription.id }]"><ngx-avatar [style.margin-right]="'10px'" size="32" [name]="subscription.name"></ngx-avatar>{{subscription.name}}</a>
|
<a *ngFor="let subscription of postsService.subscriptions" mat-list-item (click)="postsService.sidepanel_mode === 'over' ? sidenav.close() : null" [routerLink]="['/subscription', { id: subscription.id }]"><ngx-avatar [style.margin-right]="'10px'" size="32" [name]="subscription.name"></ngx-avatar>{{subscription.name}}</a>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</mat-nav-list>
|
</mat-nav-list>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
import { Component, OnInit, ElementRef, ViewChild, HostBinding, AfterViewInit } from '@angular/core';
|
import { Component, OnInit, ElementRef, ViewChild, HostBinding, AfterViewInit } from '@angular/core';
|
||||||
|
import {MatDialogRef} from '@angular/material/dialog';
|
||||||
import {PostsService} from './posts.services';
|
import {PostsService} from './posts.services';
|
||||||
import {FileCardComponent} from './file-card/file-card.component';
|
|
||||||
import { Observable } from 'rxjs/Observable';
|
|
||||||
import {FormControl, Validators} from '@angular/forms';
|
|
||||||
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { MatSidenav } from '@angular/material/sidenav';
|
import { MatSidenav } from '@angular/material/sidenav';
|
||||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
@@ -16,7 +13,6 @@ import 'rxjs/add/operator/filter'
|
|||||||
import 'rxjs/add/operator/debounceTime'
|
import 'rxjs/add/operator/debounceTime'
|
||||||
import 'rxjs/add/operator/do'
|
import 'rxjs/add/operator/do'
|
||||||
import 'rxjs/add/operator/switch'
|
import 'rxjs/add/operator/switch'
|
||||||
import { YoutubeSearchService, Result } from './youtube-search.service';
|
|
||||||
import { Router, NavigationStart, NavigationEnd } from '@angular/router';
|
import { Router, NavigationStart, NavigationEnd } from '@angular/router';
|
||||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||||
import { THEMES_CONFIG } from '../themes';
|
import { THEMES_CONFIG } from '../themes';
|
||||||
@@ -28,7 +24,11 @@ import { SetDefaultAdminDialogComponent } from './dialogs/set-default-admin-dial
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.css']
|
styleUrls: ['./app.component.css'],
|
||||||
|
providers: [{
|
||||||
|
provide: MatDialogRef,
|
||||||
|
useValue: {}
|
||||||
|
}]
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit, AfterViewInit {
|
export class AppComponent implements OnInit, AfterViewInit {
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</cdk-virtual-scroll-viewport>-->
|
</cdk-virtual-scroll-viewport>-->
|
||||||
|
|
||||||
<!-- Non-virtual mode (slow, bug-free) -->
|
<!-- Non-virtual mode (slow, bug-free) -->
|
||||||
<div style="height: 274px; overflow-y: auto">
|
<div style="height: 100%; overflow-y: auto">
|
||||||
<div *ngFor="let log of logs; let i = index" class="example-item">
|
<div *ngFor="let log of logs; let i = index" class="example-item">
|
||||||
<span [ngStyle]="{'color':log.color}">{{log.text}}</span>
|
<span [ngStyle]="{'color':log.color}">{{log.text}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div *ngIf="dataSource; else loading">
|
<div *ngIf="dataSource; else loading">
|
||||||
<div style="padding: 15px">
|
<div style="padding: 15px">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="table table-responsive px-5 pb-4 pt-2">
|
<div class="table table-responsive pb-4 pt-2">
|
||||||
<div class="example-header">
|
<div class="example-header">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search" i18n-placeholder="search field description">
|
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search" i18n-placeholder="search field description">
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
.edit-role {
|
.edit-role {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -50px;
|
top: -50px;
|
||||||
left: 35px;
|
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<mat-tab-group style="height: 79vh" mat-align-tabs="center">
|
<mat-tab-group style="height: 76vh" mat-align-tabs="center">
|
||||||
<!-- Server -->
|
<!-- Server -->
|
||||||
<mat-tab label="Main" i18n-label="Main settings label">
|
<mat-tab label="Main" i18n-label="Main settings label">
|
||||||
<ng-template matTabContent style="padding: 15px;">
|
<ng-template matTabContent style="padding: 15px;">
|
||||||
@@ -400,8 +400,7 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab *ngIf="postsService.config && postsService.config.Advanced.multi_user_mode" label="Users" i18n-label="Users settings label">
|
<mat-tab *ngIf="postsService.config && postsService.config.Advanced.multi_user_mode" label="Users" i18n-label="Users settings label">
|
||||||
|
<div *ngIf="new_config" style="margin-top: 24px; margin-bottom: -25px;">
|
||||||
<div style="margin-left: 48px; margin-top: 24px; margin-bottom: -25px;">
|
|
||||||
<div>
|
<div>
|
||||||
<mat-checkbox color="accent" [(ngModel)]="new_config['Users']['allow_registration']"><ng-container i18n="Allow registration setting">Allow user registration</ng-container></mat-checkbox>
|
<mat-checkbox color="accent" [(ngModel)]="new_config['Users']['allow_registration']"><ng-container i18n="Allow registration setting">Allow user registration</ng-container></mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
@@ -445,7 +444,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<mat-divider></mat-divider>
|
<mat-divider></mat-divider>
|
||||||
</div>
|
</div>
|
||||||
<app-modify-users></app-modify-users>
|
<app-modify-users *ngIf="new_config"></app-modify-users>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab *ngIf="postsService.config" label="Logs" i18n-label="Logs settings label">
|
<mat-tab *ngIf="postsService.config" label="Logs" i18n-label="Logs settings label">
|
||||||
<ng-template matTabContent>
|
<ng-template matTabContent>
|
||||||
@@ -456,12 +455,12 @@
|
|||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
||||||
|
|
||||||
<div style="margin-top: 10px;">
|
<div class="action-buttons">
|
||||||
<button style="margin-left: 10px;" color="accent" (click)="saveSettings()" [disabled]="settingsSame()" mat-raised-button><mat-icon>done</mat-icon>
|
<button style="margin-left: 10px; height: 37.3px" color="accent" (click)="saveSettings()" [disabled]="settingsSame()" mat-raised-button><mat-icon>done</mat-icon>
|
||||||
<ng-container i18n="Settings save button">Save</ng-container>
|
<ng-container i18n="Settings save button">Save</ng-container>
|
||||||
</button>
|
</button>
|
||||||
<button style="margin-left: 10px;" mat-flat-button (click)="cancelSettings()" [disabled]="settingsSame()"><mat-icon>cancel</mat-icon>
|
<button style="margin-left: 10px;" mat-flat-button (click)="cancelSettings()" [disabled]="settingsSame()"><mat-icon>cancel</mat-icon>
|
||||||
<span i18n="Settings cancel button">Cancel</span>
|
<span i18n="Settings cancel button">Cancel</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -99,4 +99,9 @@
|
|||||||
|
|
||||||
.transfer-db-div {
|
.transfer-db-div {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-buttons {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 15px;
|
||||||
}
|
}
|
||||||
@@ -51,8 +51,17 @@ export class SettingsComponent implements OnInit {
|
|||||||
private dialog: MatDialog) { }
|
private dialog: MatDialog) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.getConfig();
|
if (this.postsService.initialized) {
|
||||||
this.getDBInfo();
|
this.getConfig();
|
||||||
|
this.getDBInfo();
|
||||||
|
} else {
|
||||||
|
this.postsService.service_initialized.subscribe(init => {
|
||||||
|
if (init) {
|
||||||
|
this.getConfig();
|
||||||
|
this.getDBInfo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.generated_bookmarklet_code = this.sanitizer.bypassSecurityTrustUrl(this.generateBookmarkletCode());
|
this.generated_bookmarklet_code = this.sanitizer.bypassSecurityTrustUrl(this.generateBookmarkletCode());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user