run ng generate @angular:core/standalone --mode "convert-to-standalone"
This commit is contained in:
parent
070d80a6fa
commit
4fb9e972f5
16 changed files with 120 additions and 87 deletions
|
|
@ -4,12 +4,14 @@ import { TorrentService } from 'src/app/torrent.service';
|
||||||
import { Torrent, TorrentFileAvailability } from '../models/torrent.model';
|
import { Torrent, TorrentFileAvailability } from '../models/torrent.model';
|
||||||
import { SettingsService } from '../settings.service';
|
import { SettingsService } from '../settings.service';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { NgClass } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-add-new-torrent',
|
selector: 'app-add-new-torrent',
|
||||||
templateUrl: './add-new-torrent.component.html',
|
templateUrl: './add-new-torrent.component.html',
|
||||||
styleUrls: ['./add-new-torrent.component.scss'],
|
styleUrls: ['./add-new-torrent.component.scss'],
|
||||||
standalone: false,
|
imports: [FormsModule, NgClass],
|
||||||
})
|
})
|
||||||
export class AddNewTorrentComponent implements OnInit {
|
export class AddNewTorrentComponent implements OnInit {
|
||||||
public fileName: string;
|
public fileName: string;
|
||||||
|
|
|
||||||
|
|
@ -24,31 +24,28 @@ import { SortPipe } from './sort.pipe';
|
||||||
import { FileSizePipe } from './filesize.pipe';
|
import { FileSizePipe } from './filesize.pipe';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [AppComponent],
|
||||||
AppComponent,
|
bootstrap: [AppComponent],
|
||||||
MainLayoutComponent,
|
imports: [BrowserModule, AppRoutingModule, FormsModule, ClipboardModule, MainLayoutComponent,
|
||||||
NavbarComponent,
|
NavbarComponent,
|
||||||
AddNewTorrentComponent,
|
AddNewTorrentComponent,
|
||||||
TorrentTableComponent,
|
TorrentTableComponent,
|
||||||
SettingsComponent,
|
SettingsComponent,
|
||||||
TorrentStatusPipe,
|
TorrentStatusPipe,
|
||||||
DownloadStatusPipe,
|
DownloadStatusPipe,
|
||||||
LoginComponent,
|
LoginComponent,
|
||||||
SetupComponent,
|
SetupComponent,
|
||||||
TorrentComponent,
|
TorrentComponent,
|
||||||
DecodeURIPipe,
|
DecodeURIPipe,
|
||||||
ProfileComponent,
|
ProfileComponent,
|
||||||
Nl2BrPipe,
|
Nl2BrPipe,
|
||||||
SortPipe,
|
SortPipe,
|
||||||
FileSizePipe,
|
FileSizePipe],
|
||||||
],
|
providers: [
|
||||||
bootstrap: [AppComponent],
|
FileSizePipe,
|
||||||
imports: [BrowserModule, AppRoutingModule, FormsModule, ClipboardModule],
|
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
|
||||||
providers: [
|
{ provide: APP_BASE_HREF, useValue: (window as any)['_app_base'] || '/' },
|
||||||
FileSizePipe,
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
|
],
|
||||||
{ provide: APP_BASE_HREF, useValue: (window as any)['_app_base'] || '/' },
|
|
||||||
provideHttpClient(withInterceptorsFromDi()),
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
import { Pipe, PipeTransform } from '@angular/core';
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({ name: 'decodeURI', })
|
||||||
name: 'decodeURI',
|
|
||||||
standalone: false,
|
|
||||||
})
|
|
||||||
export class DecodeURIPipe implements PipeTransform {
|
export class DecodeURIPipe implements PipeTransform {
|
||||||
transform(input: any) {
|
transform(input: any) {
|
||||||
return decodeURI(input);
|
return decodeURI(input);
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,7 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||||
import { Download } from './models/download.model';
|
import { Download } from './models/download.model';
|
||||||
import { FileSizePipe } from './filesize.pipe';
|
import { FileSizePipe } from './filesize.pipe';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({ name: 'downloadStatus', })
|
||||||
name: 'downloadStatus',
|
|
||||||
standalone: false,
|
|
||||||
})
|
|
||||||
export class DownloadStatusPipe implements PipeTransform {
|
export class DownloadStatusPipe implements PipeTransform {
|
||||||
constructor(private pipe: FileSizePipe) {}
|
constructor(private pipe: FileSizePipe) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
import { Pipe, PipeTransform } from '@angular/core';
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
import { filesize } from 'filesize';
|
import { filesize } from 'filesize';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({ name: 'filesize', })
|
||||||
name: 'filesize',
|
|
||||||
standalone: false,
|
|
||||||
})
|
|
||||||
export class FileSizePipe implements PipeTransform {
|
export class FileSizePipe implements PipeTransform {
|
||||||
private static transformOne(value: number, options?: any): string {
|
private static transformOne(value: number, options?: any): string {
|
||||||
return filesize(value, options).toString();
|
return filesize(value, options).toString();
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { AuthService } from '../auth.service';
|
import { AuthService } from '../auth.service';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { NgClass } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
templateUrl: './login.component.html',
|
templateUrl: './login.component.html',
|
||||||
styleUrls: ['./login.component.scss'],
|
styleUrls: ['./login.component.scss'],
|
||||||
standalone: false,
|
imports: [FormsModule, NgClass],
|
||||||
})
|
})
|
||||||
export class LoginComponent {
|
export class LoginComponent {
|
||||||
public userName: string;
|
public userName: string;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
|
import { NavbarComponent } from '../navbar/navbar.component';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-main-layout',
|
selector: 'app-main-layout',
|
||||||
templateUrl: './main-layout.component.html',
|
templateUrl: './main-layout.component.html',
|
||||||
styleUrls: ['./main-layout.component.scss'],
|
styleUrls: ['./main-layout.component.scss'],
|
||||||
standalone: false,
|
imports: [NavbarComponent, RouterOutlet],
|
||||||
})
|
})
|
||||||
export class MainLayoutComponent {
|
export class MainLayoutComponent {
|
||||||
constructor() {}
|
constructor() {}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,19 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { NavigationEnd, Router } from '@angular/router';
|
import { NavigationEnd, Router, RouterLink } from '@angular/router';
|
||||||
import { AuthService } from '../auth.service';
|
import { AuthService } from '../auth.service';
|
||||||
import { Profile } from '../models/profile.model';
|
import { Profile } from '../models/profile.model';
|
||||||
import { SettingsService } from '../settings.service';
|
import { SettingsService } from '../settings.service';
|
||||||
|
import { NgClass, DatePipe } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-navbar',
|
selector: 'app-navbar',
|
||||||
templateUrl: './navbar.component.html',
|
templateUrl: './navbar.component.html',
|
||||||
styleUrls: ['./navbar.component.scss'],
|
styleUrls: ['./navbar.component.scss'],
|
||||||
standalone: false,
|
imports: [
|
||||||
|
RouterLink,
|
||||||
|
NgClass,
|
||||||
|
DatePipe,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class NavbarComponent implements OnInit {
|
export class NavbarComponent implements OnInit {
|
||||||
public showMobileMenu = false;
|
public showMobileMenu = false;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
import { Pipe, PipeTransform, SecurityContext, VERSION } from '@angular/core';
|
import { Pipe, PipeTransform, SecurityContext, VERSION } from '@angular/core';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({ name: 'nl2br', })
|
||||||
name: 'nl2br',
|
|
||||||
standalone: false,
|
|
||||||
})
|
|
||||||
export class Nl2BrPipe implements PipeTransform {
|
export class Nl2BrPipe implements PipeTransform {
|
||||||
constructor(private sanitizer: DomSanitizer) {}
|
constructor(private sanitizer: DomSanitizer) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { AuthService } from '../auth.service';
|
import { AuthService } from '../auth.service';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { NgClass } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-profile',
|
selector: 'app-profile',
|
||||||
templateUrl: './profile.component.html',
|
templateUrl: './profile.component.html',
|
||||||
styleUrls: ['./profile.component.scss'],
|
styleUrls: ['./profile.component.scss'],
|
||||||
standalone: false,
|
imports: [FormsModule, NgClass],
|
||||||
})
|
})
|
||||||
export class ProfileComponent {
|
export class ProfileComponent {
|
||||||
constructor(private authService: AuthService) {}
|
constructor(private authService: AuthService) {}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,22 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { SettingsService } from 'src/app/settings.service';
|
import { SettingsService } from 'src/app/settings.service';
|
||||||
import { Setting } from '../models/setting.model';
|
import { Setting } from '../models/setting.model';
|
||||||
|
import { NgClass, KeyValuePipe } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { Nl2BrPipe } from '../nl2br.pipe';
|
||||||
|
import { FileSizePipe } from '../filesize.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-settings',
|
selector: 'app-settings',
|
||||||
templateUrl: './settings.component.html',
|
templateUrl: './settings.component.html',
|
||||||
styleUrls: ['./settings.component.scss'],
|
styleUrls: ['./settings.component.scss'],
|
||||||
standalone: false,
|
imports: [
|
||||||
|
NgClass,
|
||||||
|
FormsModule,
|
||||||
|
KeyValuePipe,
|
||||||
|
Nl2BrPipe,
|
||||||
|
FileSizePipe,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class SettingsComponent implements OnInit {
|
export class SettingsComponent implements OnInit {
|
||||||
public activeTab = 0;
|
public activeTab = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { AuthService } from '../auth.service';
|
import { AuthService } from '../auth.service';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { NgClass } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-setup',
|
selector: 'app-setup',
|
||||||
templateUrl: './setup.component.html',
|
templateUrl: './setup.component.html',
|
||||||
styleUrls: ['./setup.component.scss'],
|
styleUrls: ['./setup.component.scss'],
|
||||||
standalone: false,
|
imports: [FormsModule, NgClass],
|
||||||
})
|
})
|
||||||
export class SetupComponent {
|
export class SetupComponent {
|
||||||
public userName: string;
|
public userName: string;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
import { Pipe, PipeTransform } from '@angular/core';
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({ name: 'sort', })
|
||||||
name: 'sort',
|
|
||||||
standalone: false,
|
|
||||||
})
|
|
||||||
export class SortPipe implements PipeTransform {
|
export class SortPipe implements PipeTransform {
|
||||||
transform(array: any[], field: string, order: 'asc' | 'desc' = 'asc'): any[] {
|
transform(array: any[], field: string, order: 'asc' | 'desc' = 'asc'): any[] {
|
||||||
if (!Array.isArray(array)) {
|
if (!Array.isArray(array)) {
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,7 @@ import { Pipe, PipeTransform } from '@angular/core';
|
||||||
import { RealDebridStatus, Torrent } from './models/torrent.model';
|
import { RealDebridStatus, Torrent } from './models/torrent.model';
|
||||||
import { FileSizePipe } from './filesize.pipe';
|
import { FileSizePipe } from './filesize.pipe';
|
||||||
|
|
||||||
@Pipe({
|
@Pipe({ name: 'status', })
|
||||||
name: 'status',
|
|
||||||
standalone: false,
|
|
||||||
})
|
|
||||||
export class TorrentStatusPipe implements PipeTransform {
|
export class TorrentStatusPipe implements PipeTransform {
|
||||||
constructor(private pipe: FileSizePipe) {}
|
constructor(private pipe: FileSizePipe) {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,25 @@ import { Router } from '@angular/router';
|
||||||
import { Torrent } from '../models/torrent.model';
|
import { Torrent } from '../models/torrent.model';
|
||||||
import { TorrentService } from '../torrent.service';
|
import { TorrentService } from '../torrent.service';
|
||||||
import { forkJoin, Observable } from 'rxjs';
|
import { forkJoin, Observable } from 'rxjs';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { NgClass, DecimalPipe, DatePipe } from '@angular/common';
|
||||||
|
import { TorrentStatusPipe } from '../torrent-status.pipe';
|
||||||
|
import { SortPipe } from '../sort.pipe';
|
||||||
|
import { FileSizePipe } from '../filesize.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-torrent-table',
|
selector: 'app-torrent-table',
|
||||||
templateUrl: './torrent-table.component.html',
|
templateUrl: './torrent-table.component.html',
|
||||||
styleUrls: ['./torrent-table.component.scss'],
|
styleUrls: ['./torrent-table.component.scss'],
|
||||||
standalone: false,
|
imports: [
|
||||||
|
FormsModule,
|
||||||
|
NgClass,
|
||||||
|
DecimalPipe,
|
||||||
|
DatePipe,
|
||||||
|
TorrentStatusPipe,
|
||||||
|
SortPipe,
|
||||||
|
FileSizePipe,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class TorrentTableComponent implements OnInit {
|
export class TorrentTableComponent implements OnInit {
|
||||||
public torrents: Torrent[] = [];
|
public torrents: Torrent[] = [];
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,28 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { saveAs } from 'file-saver-es';
|
import { saveAs } from 'file-saver-es';
|
||||||
import { Torrent } from '../models/torrent.model';
|
import { Torrent } from '../models/torrent.model';
|
||||||
import { TorrentService } from '../torrent.service';
|
import { TorrentService } from '../torrent.service';
|
||||||
|
import { NgClass, DatePipe } from '@angular/common';
|
||||||
|
import { CdkCopyToClipboard } from '@angular/cdk/clipboard';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { TorrentStatusPipe } from '../torrent-status.pipe';
|
||||||
|
import { DownloadStatusPipe } from '../download-status.pipe';
|
||||||
|
import { DecodeURIPipe } from '../decode-uri.pipe';
|
||||||
|
import { FileSizePipe } from '../filesize.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-torrent',
|
selector: 'app-torrent',
|
||||||
templateUrl: './torrent.component.html',
|
templateUrl: './torrent.component.html',
|
||||||
styleUrls: ['./torrent.component.scss'],
|
styleUrls: ['./torrent.component.scss'],
|
||||||
standalone: false,
|
imports: [
|
||||||
|
NgClass,
|
||||||
|
CdkCopyToClipboard,
|
||||||
|
FormsModule,
|
||||||
|
DatePipe,
|
||||||
|
TorrentStatusPipe,
|
||||||
|
DownloadStatusPipe,
|
||||||
|
DecodeURIPipe,
|
||||||
|
FileSizePipe,
|
||||||
|
],
|
||||||
})
|
})
|
||||||
export class TorrentComponent implements OnInit {
|
export class TorrentComponent implements OnInit {
|
||||||
public torrent: Torrent;
|
public torrent: Torrent;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue