Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca7294c3f7 | |||
| d109ba8974 | |||
| 8f6193b846 |
@@ -1,19 +1,12 @@
|
|||||||
@if (serviceWorkerEnabled) {
|
|
||||||
@if (hasUpdate) {
|
|
||||||
<h1>Update available</h1>
|
|
||||||
<button (click)="update()">Update</button>
|
|
||||||
} @else {
|
|
||||||
<h1>Update not available</h1>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
<div class="md:h-12 h-16"></div>
|
<div class="md:h-12 h-16"></div>
|
||||||
<div
|
<div
|
||||||
class="content overflow-y-auto md:h-[calc(100vh-3rem)] h-[calc(100vh-4rem)] flex flex-col justify-between flex-shrink-0"
|
class="content overflow-y-auto md:h-[calc(100vh-3rem)] h-[calc(100vh-4rem)] flex flex-col justify-between"
|
||||||
>
|
>
|
||||||
<router-outlet></router-outlet>
|
<div class="h-max">
|
||||||
<app-footer></app-footer>
|
<router-outlet></router-outlet>
|
||||||
<div class="md:min-h-0 min-h-16"></div>
|
</div>
|
||||||
|
<app-footer class="md:mb-0 mb-16 flex-shrink-0"></app-footer>
|
||||||
</div>
|
</div>
|
||||||
<app-tab-bar></app-tab-bar>
|
<app-tab-bar></app-tab-bar>
|
||||||
<app-notification></app-notification>
|
<app-notification></app-notification>
|
||||||
|
|||||||
@@ -23,17 +23,4 @@ import { TabBarComponent } from "./components/tab-bar/tab-bar.component";
|
|||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
title = "NwaifuAnime";
|
title = "NwaifuAnime";
|
||||||
constructor(private sw: AppService) {}
|
|
||||||
|
|
||||||
get hasUpdate() {
|
|
||||||
return this.sw.isUpdateAvailable;
|
|
||||||
}
|
|
||||||
|
|
||||||
update() {
|
|
||||||
this.sw.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
get serviceWorkerEnabled() {
|
|
||||||
return this.sw.serviceWorkerEnabled;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { AuthComponent } from "./components/auth/auth.component";
|
|||||||
import { DetailComponent } from "./components/detail/detail.component";
|
import { DetailComponent } from "./components/detail/detail.component";
|
||||||
import { HomeComponent } from "./components/home/home.component";
|
import { HomeComponent } from "./components/home/home.component";
|
||||||
import { ReaderComponent } from "./components/reader/reader.component";
|
import { ReaderComponent } from "./components/reader/reader.component";
|
||||||
|
import { DmcaComponent } from "./components/dmca/dmca.component";
|
||||||
|
|
||||||
export const appRoutes: Route[] = [
|
export const appRoutes: Route[] = [
|
||||||
{
|
{
|
||||||
@@ -15,4 +16,5 @@ export const appRoutes: Route[] = [
|
|||||||
path: "auth",
|
path: "auth",
|
||||||
component: AuthComponent,
|
component: AuthComponent,
|
||||||
},
|
},
|
||||||
|
{ path: "dmca", component: DmcaComponent },
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -18,6 +18,13 @@
|
|||||||
>
|
>
|
||||||
Сохранить
|
Сохранить
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
(click)="clearToken()"
|
||||||
|
class="hover:bg-slate-600 bg-slate-400 p-3 rounded-md text-white"
|
||||||
|
>
|
||||||
|
Очистить
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@@ -67,6 +67,12 @@ export class AuthComponent implements AfterViewInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearToken() {
|
||||||
|
this.rulibAuthService.deleteToken();
|
||||||
|
if (this.libSocialToken) this.libSocialToken.nativeElement.value = "";
|
||||||
|
this.notificationService.info("Токен успешно удален!", "Вход");
|
||||||
|
}
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
this.route.queryParams.pipe(takeUntil(this.destroy$)).subscribe((params) => {
|
this.route.queryParams.pipe(takeUntil(this.destroy$)).subscribe((params) => {
|
||||||
const { token, service } = params;
|
const { token, service } = params;
|
||||||
|
|||||||
17
apps/NwaifuAnime/src/app/components/dmca/dmca.component.html
Normal file
17
apps/NwaifuAnime/src/app/components/dmca/dmca.component.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<p class="text-3xl ps-[3rem] mt-3">DMCA Disclaimer</p>
|
||||||
|
<div class="h-full px-[3rem] flex flex-col gap-3">
|
||||||
|
<div class="block">
|
||||||
|
<p>На русском:</p>
|
||||||
|
<p>
|
||||||
|
Разработчики этого приложения не имеют никакого отношения к контенту, доступному в приложении.
|
||||||
|
Оно собрано из источников, свободно доступных через любой веб-браузер.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="block">
|
||||||
|
<p>English:</p>
|
||||||
|
<p>
|
||||||
|
The developers of this application does not have any affiliation with the content available in
|
||||||
|
the app. It is collecting from the sources freely available through any web browser.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "app-dmca",
|
||||||
|
standalone: true,
|
||||||
|
templateUrl: "./dmca.component.html",
|
||||||
|
styleUrl: "./dmca.component.less",
|
||||||
|
})
|
||||||
|
export class DmcaComponent {}
|
||||||
@@ -1,19 +1,14 @@
|
|||||||
<div class="footer w-full border-t border-black bg-gray-300 pt-3 min-h-[15rem] mt-3">
|
<div
|
||||||
<p class="text-3xl ps-[5rem]">DMCA Disclaimer</p>
|
class="footer w-full border-t border-black bg-gray-300 min-h-[3rem] mt-3 px-12 flex flex-row justify-between items-center"
|
||||||
<div class="footer-content h-full px-[5rem] flex flex-col gap-3">
|
>
|
||||||
<div class="block">
|
<div class="links flex flex-row flex-start gap-3 items-center">
|
||||||
<p>На русском:</p>
|
<a routerLink="/dmca" title="DMCA Disclaimer" class="underline">DMCA</a>
|
||||||
<p>
|
|
||||||
Разработчики этого приложения не имеют никакого отношения к контенту, доступному в
|
|
||||||
приложении. Оно собрано из источников, свободно доступных через любой веб-браузер.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="block">
|
|
||||||
<p>English:</p>
|
|
||||||
<p>
|
|
||||||
The developers of this application does not have any affiliation with the content available
|
|
||||||
in the app. It is collecting from the sources freely available through any web browser.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<a
|
||||||
|
class="underline flex flex-row items-center gap-1"
|
||||||
|
target="_blank"
|
||||||
|
title="Source code"
|
||||||
|
href="https://git.nwaifu.su/neuro_llc/NwaifuWeb/src/branch/dev/apps/NwaifuAnime"
|
||||||
|
>Исходный код <i class="lni lni-git"></i
|
||||||
|
></a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import { Component } from "@angular/core";
|
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
||||||
|
import { RouterLink } from "@angular/router";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: "app-footer",
|
selector: "app-footer",
|
||||||
templateUrl: "./footer.component.html",
|
templateUrl: "./footer.component.html",
|
||||||
styleUrls: ["./footer.component.less"],
|
styleUrls: ["./footer.component.less"],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
|
imports: [RouterLink],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class FooterComponent {}
|
export class FooterComponent {}
|
||||||
|
|||||||
@@ -8,6 +8,15 @@
|
|||||||
<img src="pic/Blank-profile.png" alt="Profile pic" class="w-full h-full" />
|
<img src="pic/Blank-profile.png" alt="Profile pic" class="w-full h-full" />
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
@if (this.swEnabled && this.swHasUpdate) {
|
||||||
|
<button title="Update" (click)="swUpdate()" class="md:w-fit w-full">
|
||||||
|
<div
|
||||||
|
class="h-8 md:w-8 w-full rounded-md bg-green-300 flex flex-col justify-center items-center md:ms-1 ms-0 md:mt-0 mt-2"
|
||||||
|
>
|
||||||
|
<i class="lni lni-download text-gray-700"></i>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
[class]="
|
[class]="
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
import { RouterLink } from "@angular/router";
|
import { RouterLink } from "@angular/router";
|
||||||
import { Subject } from "rxjs";
|
import { Subject } from "rxjs";
|
||||||
|
import { AppService } from "../../app.service";
|
||||||
import { SearchFieldComponent } from "../search-field/search-field.component";
|
import { SearchFieldComponent } from "../search-field/search-field.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -24,6 +25,20 @@ export class HeaderComponent implements AfterViewInit, OnDestroy {
|
|||||||
@ViewChild("profileMenu") profileMenu: ElementRef<HTMLDivElement> | null = null;
|
@ViewChild("profileMenu") profileMenu: ElementRef<HTMLDivElement> | null = null;
|
||||||
private destroy$ = new Subject<void>();
|
private destroy$ = new Subject<void>();
|
||||||
|
|
||||||
|
constructor(private swService: AppService) {}
|
||||||
|
|
||||||
|
get swEnabled() {
|
||||||
|
return this.swService.serviceWorkerEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
swUpdate() {
|
||||||
|
this.swService.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
get swHasUpdate() {
|
||||||
|
return this.swService.isUpdateAvailable;
|
||||||
|
}
|
||||||
|
|
||||||
@HostListener("window:click", ["$event"])
|
@HostListener("window:click", ["$event"])
|
||||||
toggleProfileMenu(event: MouseEvent) {
|
toggleProfileMenu(event: MouseEvent) {
|
||||||
if (this.profileBtn && this.profileBtn.nativeElement.contains(event.target as Node)) {
|
if (this.profileBtn && this.profileBtn.nativeElement.contains(event.target as Node)) {
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
:host {
|
|
||||||
height: max-content;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { CommonModule } from "@angular/common";
|
|||||||
import { Component, Input, OnDestroy, OnInit } from "@angular/core";
|
import { Component, Input, OnDestroy, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute, RouterLink } from "@angular/router";
|
import { ActivatedRoute, RouterLink } from "@angular/router";
|
||||||
import { map, Subject, Subscription, takeUntil } from "rxjs";
|
import { map, Subject, Subscription, takeUntil } from "rxjs";
|
||||||
|
import { RulibAuthService } from "../../services/parsers/rulib/rulib.auth.service";
|
||||||
import { IRuLIBPopular } from "../../services/parsers/rulib/rulib.popular.dto";
|
import { IRuLIBPopular } from "../../services/parsers/rulib/rulib.popular.dto";
|
||||||
import { Datum } from "../../services/parsers/rulib/rulib.search.dto";
|
import { Datum } from "../../services/parsers/rulib/rulib.search.dto";
|
||||||
import { SearchService } from "../../services/search.service";
|
import { SearchService } from "../../services/search.service";
|
||||||
@@ -26,6 +27,7 @@ export class HomeComponent implements OnDestroy, OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
private searchService: SearchService,
|
private searchService: SearchService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
private ruLibAuthService: RulibAuthService,
|
||||||
) {
|
) {
|
||||||
this.searchService.setMangalibParser();
|
this.searchService.setMangalibParser();
|
||||||
}
|
}
|
||||||
@@ -60,8 +62,14 @@ export class HomeComponent implements OnDestroy, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getPopularSlashlib() {
|
private getPopularSlashlib() {
|
||||||
this.searchService.setSlashlibParser();
|
this.ruLibAuthService
|
||||||
this.getPopular(this.searchService.getRuLibName());
|
.checkToken(this.ruLibAuthService.getToken())
|
||||||
|
.pipe(takeUntil(this.destroy$))
|
||||||
|
.subscribe((loggedIn) => {
|
||||||
|
if (!loggedIn) return;
|
||||||
|
this.searchService.setSlashlibParser();
|
||||||
|
this.getPopular(this.searchService.getRuLibName());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get popularItems() {
|
get popularItems() {
|
||||||
|
|||||||
@@ -28,6 +28,12 @@ export class RulibAuthService implements OnDestroy {
|
|||||||
return token_data.rulib_token ?? "";
|
return token_data.rulib_token ?? "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deleteToken(): void {
|
||||||
|
const token_data: IToken = JSON.parse(localStorage.getItem("token") ?? "{}");
|
||||||
|
token_data.rulib_token = "";
|
||||||
|
localStorage.setItem("token", JSON.stringify(token_data));
|
||||||
|
}
|
||||||
|
|
||||||
checkToken(token: string): Observable<boolean> {
|
checkToken(token: string): Observable<boolean> {
|
||||||
return this.http
|
return this.http
|
||||||
.get(this.api_url + "/api/auth/me", {
|
.get(this.api_url + "/api/auth/me", {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nwaifu-web",
|
"name": "nwaifu-web",
|
||||||
"version": "0.3.0",
|
"version": "0.3.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "nx serve NwaifuWeb",
|
"start": "nx serve NwaifuWeb",
|
||||||
|
|||||||
Reference in New Issue
Block a user