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({
selector: 'app-root',
template: '<router-outlet></router-outlet>',
styles: []
styles: [],
})
export class AppComponent {}

View file

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

View file

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

View file

@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-main-layout',
templateUrl: './main-layout.component.html',
styleUrls: ['./main-layout.component.scss']
styleUrls: ['./main-layout.component.scss'],
})
export class MainLayoutComponent implements OnInit {
constructor() {}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -10,4 +10,4 @@ if (environment.production) {
platformBrowserDynamic()
.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 { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.