All config values are now reloaded on config set

Added 4 new settings: user files folder, enable registration, enable downloads manager, and logging level selection
This commit is contained in:
Tzahi12345
2020-05-02 17:09:46 -04:00
parent 661b96cfe5
commit e5db376914
15 changed files with 167 additions and 88 deletions

View File

@@ -1,6 +1,7 @@
import { Component, OnInit, ViewChildren, QueryList, ElementRef } from '@angular/core';
import { PostsService } from 'app/posts.services';
import { trigger, transition, animateChild, stagger, query, style, animate } from '@angular/animations';
import { Router } from '@angular/router';
@Component({
selector: 'app-downloads',
@@ -40,13 +41,21 @@ export class DownloadsComponent implements OnInit {
valid_sessions_length = 0;
constructor(public postsService: PostsService) { }
constructor(public postsService: PostsService, private router: Router) { }
ngOnInit(): void {
this.getCurrentDownloads();
setInterval(() => {
this.getCurrentDownloads();
}, this.downloads_check_interval);
this.postsService.service_initialized.subscribe(init => {
if (init) {
if (!this.postsService.config['Extra']['enable_downloads_manager']) {
this.router.navigate(['/home']);
}
}
});
}
getCurrentDownloads() {

View File

@@ -18,7 +18,7 @@ export class LoginComponent implements OnInit {
loggingIn = false;
// registration
registrationEnabled = true;
registrationEnabled = false;
registrationUsernameInput = '';
registrationPasswordInput = '';
registrationPasswordConfirmationInput = '';
@@ -35,6 +35,7 @@ export class LoginComponent implements OnInit {
if (!this.postsService.config['Advanced']['multi_user_mode']) {
this.router.navigate(['/home']);
}
this.registrationEnabled = this.postsService.config['Users'] && this.postsService.config['Users']['allow_registration'];
}
});
}

View File

@@ -1,7 +1,7 @@
<div *ngIf="dataSource; else loading">
<div style="padding: 15px">
<div class="row">
<div class="table table-responsive p-5">
<div class="table table-responsive px-5 pb-4 pt-2">
<div class="example-header">
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search">

View File

@@ -1,5 +1,5 @@
.edit-role {
position: relative;
top: -80px;
top: -50px;
left: 35px;
}