Force prettier to 120 width.

This commit is contained in:
Roger Far 2021-01-12 20:46:07 -07:00
parent 67532645aa
commit 2300b51ede
15 changed files with 62 additions and 185 deletions

View file

@ -3,6 +3,6 @@ import { Component } from '@angular/core';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
template: '<router-outlet></router-outlet>', template: '<router-outlet></router-outlet>',
styles: [] styles: [],
}) })
export class AppComponent {} export class AppComponent {}

View file

@ -1,10 +1,4 @@
import { import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
HttpErrorResponse,
HttpEvent,
HttpHandler,
HttpInterceptor,
HttpRequest
} from '@angular/common/http';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { Observable, throwError } from 'rxjs'; import { Observable, throwError } from 'rxjs';
@ -14,10 +8,7 @@ import { catchError } from 'rxjs/operators';
export class AuthInterceptor implements HttpInterceptor { export class AuthInterceptor implements HttpInterceptor {
constructor(private router: Router) {} constructor(private router: Router) {}
intercept( intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
req: HttpRequest<any>,
next: HttpHandler
): Observable<HttpEvent<any>> {
return next.handle(req).pipe( return next.handle(req).pipe(
catchError((error: HttpErrorResponse) => { catchError((error: HttpErrorResponse) => {
if (error && error.status === 402) { if (error && error.status === 402) {

View file

@ -8,14 +8,7 @@
<div class="field"> <div class="field">
<label for="" class="label">Username</label> <label for="" class="label">Username</label>
<div class="control has-icons-left"> <div class="control has-icons-left">
<input <input type="text" placeholder="" class="input" name="userName" [(ngModel)]="userName" required />
type="text"
placeholder=""
class="input"
name="userName"
[(ngModel)]="userName"
required
/>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fa fa-envelope"></i> <i class="fa fa-envelope"></i>
</span> </span>
@ -24,13 +17,7 @@
<div class="field"> <div class="field">
<label for="" class="label" name="password">Password</label> <label for="" class="label" name="password">Password</label>
<div class="control has-icons-left"> <div class="control has-icons-left">
<input <input type="password" class="input" required name="password" [(ngModel)]="password" />
type="password"
class="input"
required
name="password"
[(ngModel)]="password"
/>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fa fa-lock"></i> <i class="fa fa-lock"></i>
</span> </span>
@ -40,16 +27,13 @@
<button <button
class="button is-success" class="button is-success"
(click)="login()" (click)="login()"
[ngClass]="{ 'is-loading': loggingIn }" [ngClass]="{ 'is-loading': loggingIn }"
[disabled]="loggingIn" [disabled]="loggingIn"
> >
Login Login
</button> </button>
</div> </div>
<div <div class="notification is-danger is-light" *ngIf="error?.length > 0">
class="notification is-danger is-light"
*ngIf="error?.length > 0"
>
{{ error }} {{ error }}
</div> </div>
</div> </div>

View file

@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core';
@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'],
}) })
export class MainLayoutComponent implements OnInit { export class MainLayoutComponent implements OnInit {
constructor() {} constructor() {}

View file

@ -22,13 +22,7 @@
<label class="label">Torrent file</label> <label class="label">Torrent file</label>
<div class="file has-name"> <div class="file has-name">
<label class="file-label"> <label class="file-label">
<input <input class="file-input" type="file" name="resume" (change)="pickFile($event)" [disabled]="saving" />
class="file-input"
type="file"
name="resume"
(change)="pickFile($event)"
[disabled]="saving"
/>
<span class="file-cta"> <span class="file-cta">
<span class="file-icon"> <span class="file-icon">
<i class="fas fa-upload"></i> <i class="fas fa-upload"></i>
@ -56,22 +50,13 @@
Remove torrent when finished downloading on host Remove torrent when finished downloading on host
</label> </label>
</div> </div>
<div class="notification is-danger is-light" *ngIf="error"> <div class="notification is-danger is-light" *ngIf="error">Cannot add torrent: {{ error | json }}</div>
Cannot add torrent: {{ error | json }}
</div>
</section> </section>
<footer class="modal-card-foot"> <footer class="modal-card-foot">
<button <button class="button is-success" [disabled]="saving" [ngClass]="{ 'is-loading': saving }" (click)="ok()">
class="button is-success"
[disabled]="saving"
[ngClass]="{ 'is-loading': saving }"
(click)="ok()"
>
<span>Add Torrent</span> <span>Add Torrent</span>
</button> </button>
<button class="button" (click)="cancel()" [disabled]="saving"> <button class="button" (click)="cancel()" [disabled]="saving">Cancel</button>
Cancel
</button>
</footer> </footer>
</div> </div>
</div> </div>

View file

@ -67,39 +67,25 @@ export class AddNewTorrentComponent implements OnInit {
this.error = null; this.error = null;
if (this.magnetLink) { if (this.magnetLink) {
this.torrentService this.torrentService.uploadMagnet(this.magnetLink, this.autoDownload, this.autoUnpack, this.autoDelete).subscribe(
.uploadMagnet( () => {
this.magnetLink, this.cancel();
this.autoDownload, },
this.autoUnpack, (err) => {
this.autoDelete this.error = err.error;
) this.saving = false;
.subscribe( }
() => { );
this.cancel();
},
(err) => {
this.error = err.error;
this.saving = false;
}
);
} else if (this.selectedFile) { } else if (this.selectedFile) {
this.torrentService this.torrentService.uploadFile(this.selectedFile, this.autoDownload, this.autoUnpack, this.autoDelete).subscribe(
.uploadFile( () => {
this.selectedFile, this.cancel();
this.autoDownload, },
this.autoUnpack, (err) => {
this.autoDelete this.error = err.error;
) this.saving = false;
.subscribe( }
() => { );
this.cancel();
},
(err) => {
this.error = err.error;
this.saving = false;
}
);
} else { } else {
this.cancel(); this.cancel();
} }

View file

@ -1,8 +1,4 @@
<nav <nav class="navbar is-dark is-fixed-top" role="navigation" aria-label="main navigation">
class="navbar is-dark is-fixed-top"
role="navigation"
aria-label="main navigation"
>
<div class="navbar-brand"> <div class="navbar-brand">
<a class="navbar-item"> <a class="navbar-item">
<img src="../../assets/logo.png" /> <img src="../../assets/logo.png" />
@ -36,13 +32,7 @@
</span> </span>
<span>Settings</span> <span>Settings</span>
</a> </a>
<a <a class="navbar-item" *ngIf="profile" href="https://real-debrid.com/?id=1348683" target="_blank" rel="noopener">
class="navbar-item"
*ngIf="profile"
href="https://real-debrid.com/?id=1348683"
target="_blank"
rel="noopener"
>
<span class="icon"> <span class="icon">
<i class="fas fa-euro-sign" aria-hidden="true"></i> <i class="fas fa-euro-sign" aria-hidden="true"></i>
</span> </span>
@ -53,21 +43,13 @@
<div class="navbar-end"> <div class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable"> <div class="navbar-item has-dropdown is-hoverable">
<span class="navbar-link"> <span class="navbar-link"> Account </span>
Account
</span>
<div class="navbar-dropdown is-right"> <div class="navbar-dropdown is-right">
<a class="navbar-item"> <a class="navbar-item"> Profile </a>
Profile <a class="navbar-item" (click)="logout()"> Logout </a>
</a>
<a class="navbar-item" (click)="logout()">
Logout
</a>
<hr class="navbar-divider" /> <hr class="navbar-divider" />
<div class="navbar-item"> <div class="navbar-item">Version 0.8.0</div>
Version 0.8.0
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -18,11 +18,7 @@ export class NavbarComponent implements OnInit {
public profile: Profile; public profile: Profile;
constructor( constructor(private settingsService: SettingsService, private authService: AuthService, private router: Router) {}
private settingsService: SettingsService,
private authService: AuthService,
private router: Router
) {}
ngOnInit(): void { ngOnInit(): void {
this.settingsService.getProfile().subscribe((result) => { this.settingsService.getProfile().subscribe((result) => {

View file

@ -6,20 +6,12 @@
<img src="../../assets/logo.png" /> <img src="../../assets/logo.png" />
<div class="box" *ngIf="step === 1"> <div class="box" *ngIf="step === 1">
<div class="notification is-primary"> <div class="notification is-primary">
Welcome to RealDebrid Client. Please create your account by Welcome to RealDebrid Client. Please create your account by entering a username and password.
entering a username and password.
</div> </div>
<div class="field"> <div class="field">
<label for="" class="label">Username</label> <label for="" class="label">Username</label>
<div class="control has-icons-left"> <div class="control has-icons-left">
<input <input type="text" placeholder="" class="input" name="userName" [(ngModel)]="userName" required />
type="text"
placeholder=""
class="input"
name="userName"
[(ngModel)]="userName"
required
/>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fa fa-envelope"></i> <i class="fa fa-envelope"></i>
</span> </span>
@ -28,13 +20,7 @@
<div class="field"> <div class="field">
<label for="" class="label" name="password">Password</label> <label for="" class="label" name="password">Password</label>
<div class="control has-icons-left"> <div class="control has-icons-left">
<input <input type="password" class="input" required name="password" [(ngModel)]="password" />
type="password"
class="input"
required
name="password"
[(ngModel)]="password"
/>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fa fa-lock"></i> <i class="fa fa-lock"></i>
</span> </span>
@ -50,47 +36,29 @@
Setup Setup
</button> </button>
</div> </div>
<div <div class="notification is-danger is-light" *ngIf="error?.length > 0">
class="notification is-danger is-light"
*ngIf="error?.length > 0"
>
{{ error }} {{ error }}
</div> </div>
</div> </div>
<div class="box" *ngIf="step === 2"> <div class="box" *ngIf="step === 2">
<div class="notification is-primary"> <div class="notification is-primary">
To be able to use the RealDebrid Client you need a premium To be able to use the RealDebrid Client you need a premium subscription to download torrents.
subscription to download torrents.
<br /><br /> <br /><br />
Not premium yet? Not premium yet?
<a <a href="https://real-debrid.com/?id=1348683" target="_blank" rel="noopener"
href="https://real-debrid.com/?id=1348683"
target="_blank"
rel="noopener"
>Use this link to sign up to RealDebrid.</a >Use this link to sign up to RealDebrid.</a
> >
<br /><br /> <br /><br />
To connect to RealDebrid please enter your Personal Prive API To connect to RealDebrid please enter your Personal Prive API Token found here:
Token found here: <a href="https://real-debrid.com/apitoken" target="_blank" rel="noopener"
<a
href="https://real-debrid.com/apitoken"
target="_blank"
rel="noopener"
>https://real-debrid.com/apitoken</a >https://real-debrid.com/apitoken</a
>. >.
</div> </div>
<div class="field"> <div class="field">
<label for="" class="label">API Private Token</label> <label for="" class="label">API Private Token</label>
<div class="control has-icons-left"> <div class="control has-icons-left">
<input <input type="text" placeholder="" class="input" name="token" [(ngModel)]="token" required />
type="text"
placeholder=""
class="input"
name="token"
[(ngModel)]="token"
required
/>
<span class="icon is-small is-left"> <span class="icon is-small is-left">
<i class="fa fa-envelope"></i> <i class="fa fa-envelope"></i>
</span> </span>
@ -106,22 +74,15 @@
Setup Setup
</button> </button>
</div> </div>
<div <div class="notification is-danger is-light" *ngIf="error?.length > 0">
class="notification is-danger is-light"
*ngIf="error?.length > 0"
>
{{ error }} {{ error }}
</div> </div>
</div> </div>
<div class="box" *ngIf="step === 3"> <div class="box" *ngIf="step === 3">
<div class="notification is-primary"> <div class="notification is-primary">
You are now connected to RealDebrid! To setup Radarr or Sonarr, You are now connected to RealDebrid! To setup Radarr or Sonarr, please following the instructions here:
please following the instructions here: <a href="https://github.com/rogerfar/rdt-client/" target="_blank" rel="noopener"
<a
href="https://github.com/rogerfar/rdt-client/"
target="_blank"
rel="noopener"
>https://github.com/rogerfar/rdt-client/</a >https://github.com/rogerfar/rdt-client/</a
>. >.
</div> </div>

View file

@ -19,11 +19,7 @@ export class SetupComponent implements OnInit {
public step: number = 1; public step: number = 1;
constructor( constructor(private authService: AuthService, private settingsService: SettingsService, private router: Router) {}
private authService: AuthService,
private settingsService: SettingsService,
private router: Router
) {}
ngOnInit(): void {} ngOnInit(): void {}

View file

@ -12,7 +12,5 @@ export class TorrentDownloadComponent implements OnInit {
constructor() {} constructor() {}
ngOnInit(): void { ngOnInit(): void {}
}
} }

View file

@ -1,3 +1,3 @@
export const environment = { export const environment = {
production: true production: true,
}; };

View file

@ -3,7 +3,7 @@
// The list of file replacements can be found in `angular.json`. // The list of file replacements can be found in `angular.json`.
export const environment = { export const environment = {
production: false production: false,
}; };
/* /*

View file

@ -10,4 +10,4 @@ if (environment.production) {
platformBrowserDynamic() platformBrowserDynamic()
.bootstrapModule(AppModule) .bootstrapModule(AppModule)
.catch(err => console.error(err)); .catch((err) => console.error(err));

View file

@ -2,23 +2,21 @@
import 'zone.js/dist/zone-testing'; import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing'; import { getTestBed } from '@angular/core/testing';
import { import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: { declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): { context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[]; keys(): string[];
<T>(id: string): T; <T>(id: string): T;
}; };
}; };
// First, initialize the Angular testing environment. // First, initialize the Angular testing environment.
getTestBed().initTestEnvironment( getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests. // Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/); const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules. // And load the modules.