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