Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes made by Haidra-org before deployment #3

Merged
merged 15 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 18 additions & 13 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
<div class="wrapper" [class.dark]="darkMode()">
<div class="wrapper" [class.dark]="darkMode()" (click)="closeMobileMenu()">
<header class="fixed w-full">
<nav class="bg-white border-gray-200 py-2.5 dark:bg-gray-900">
<div class="flex flex-wrap items-center justify-between max-w-screen-xl px-4 mx-auto">
<a routerLink="/" class="flex items-center">
<img ngSrc="/assets/img/logo.png" class="h-6 mr-3 sm:h-9 w-auto" alt="{{'logo.alt' | transloco}}" height="455" width="393" priority/>
<img ngSrc="./assets/img/logo.png" class="h-6 mr-3 sm:h-9 w-auto" alt="{{'logo.alt' | transloco}}" height="455" width="393" priority/>
<span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white">{{'app_title' | transloco}}</span>
</a>
<div class="flex items-end lg:order-2">
<button data-collapse-toggle="mobile-menu-2" type="button"
class="inline-flex items-center p-2 ml-1 text-sm text-gray-500 rounded-lg lg:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
aria-controls="mobile-menu-2" aria-expanded="false">
aria-controls="mobile-menu-2" aria-expanded="false"
(click)="toggleMobileMenu(); $event.stopPropagation()"
>
<span class="sr-only">{{'open_main_menu' | transloco}}</span>
<inline-svg href="/assets/img/open-menu.svg" />
<inline-svg href="/assets/img/close-menu.svg" />
<inline-svg href="assets/img/open-menu.svg" />
<inline-svg href="assets/img/close-menu.svg" />
</button>
Comment on lines +16 to +17
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? It's throughout the whole PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mobile experience hamburger menu did not seem to work, or if it did, it was in a non obvious way. This was my effort at making it work and work with a click away function to hide it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I misunderstood. This was so the site isn't bound to /, and would work on subdirs

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the change that removes the leading / throughout the whole PR, sometimes replacing it with ./

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sorry, I realized after. I answered above

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nevermind, I haven't read the comment that came with the PR. Anyway, it would be better to either stick to ./ or no prefix, not mixing it up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair.

</div>
<div class="items-end justify-between hidden w-full lg:flex lg:w-auto lg:order-1" id="mobile-menu-2">
<ul class="flex flex-col mt-4 font-medium lg:flex-row lg:space-x-8 lg:mt-0">
<div class="items-end justify-between hidden w-full lg:flex lg:w-auto lg:order-1" id="mobile-menu-2" [class.hidden]="!showMobileMenu" (click)="$event.stopPropagation()">
<ul class="flex flex-col mt-4 font-medium border-b border-gray-300 lg:border-0 lg:flex-row lg:space-x-8 lg:mt-0 bg-gray-900">
<li>
<a routerLink="/" class="block py-2 pl-3 pr-4 text-white bg-purple-700 rounded lg:bg-transparent lg:text-purple-700 lg:p-0 dark:text-white" aria-current="page">{{'home' | transloco}}</a>
<a routerLink="/" class="block py-2 pl-3 pr-4 text-gray-500 bg-gray-400 rounded lg:bg-transparent lg:text-gray-500 lg:p-0 dark:text-white" aria-current="page">{{'home' | transloco}}</a>
</li>
<li>
<a routerLink="/register" class="block py-2 pl-3 pr-4 text-white bg-purple-700 rounded lg:bg-transparent lg:text-purple-700 lg:p-0 dark:text-white" aria-current="page">{{'register_account' | transloco}}</a>
<a href="/register" class="block py-2 pl-3 pr-4 text-gray-500 bg-gray-400 rounded lg:bg-transparent lg:text-gray-500 lg:p-0 dark:text-white" aria-current="page">{{'register_account' | transloco}}</a>
</li>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? We're not implementing registration before releasing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, we'll resolve this another time.

<li>
<a routerLink="/news" class="block py-2 pl-3 pr-4 text-white bg-purple-700 rounded lg:bg-transparent lg:text-purple-700 lg:p-0 dark:text-white" aria-current="page">{{'news' | transloco}}</a>
<a routerLink="/news" class="block py-2 pl-3 pr-4 text-gray-500 bg-gray-400 rounded lg:bg-transparent lg:text-gray-500 lg:p-0 dark:text-white" aria-current="page">{{'news' | transloco}}</a>
</li>
<li>
<a routerLink="/faq" class="block py-2 pl-3 pr-4 text-white bg-purple-700 rounded lg:bg-transparent lg:text-purple-700 lg:p-0 dark:text-white" aria-current="page">{{'faq' | transloco}}</a>
<a routerLink="/faq" class="block py-2 pl-3 pr-4 text-gray-500 bg-gray-400 rounded lg:bg-transparent lg:text-gray-500 lg:p-0 dark:text-white" aria-current="page">{{'faq' | transloco}}</a>
</li>
<li>
<a href="/api/" class="block py-2 pl-3 pr-4 text-gray-500 bg-gray-400 rounded lg:bg-transparent lg:text-gray-500 lg:p-0 dark:text-white" aria-current="page">{{'api' | transloco}}</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -91,7 +96,7 @@ <h3 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">{
<h3 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">{{'documentation' | transloco}}</h3>
<ul class="text-gray-500 dark:text-gray-400">
<li class="mb-4">
<a href="https://aihorde.net/api" class=" hover:underline" target="_blank">{{'rest_api' | transloco}}</a>
<a href="https://aihorde.net/api/" class=" hover:underline" target="_blank">{{'rest_api' | transloco}}</a>
</li>
<li class="mb-4">
<a href="https://github.com/Haidra-Org/AI-Horde/blob/main/README_StableHorde.md#joining-the-horde" class="hover:underline" target="_blank">{{'join_horde' | transloco}}</a>
Expand All @@ -105,7 +110,7 @@ <h3 class="mb-6 text-sm font-semibold text-gray-900 uppercase dark:text-white">{
<hr class="my-6 border-gray-200 sm:mx-auto dark:border-gray-700 lg:my-8">
<div class="text-center">
<a href="#" class="flex items-center justify-center mb-5 text-2xl font-semibold text-gray-900 dark:text-white">
<img ngSrc="/assets/img/logo.png" class="h-6 mr-3 sm:h-9 w-auto" [alt]="'logo.alt' | transloco" height="455" width="393"/>
<img ngSrc="./assets/img/logo.png" class="h-6 mr-3 sm:h-9 w-auto" [alt]="'logo.alt' | transloco" height="455" width="393"/>
{{'app_title' | transloco}}
</a>
<span class="block text-sm text-center text-gray-500 dark:text-gray-400 built-with">
Expand Down
3 changes: 3 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
header {
z-index: 1000;
}
9 changes: 9 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {FooterColorService} from "./services/footer-color.service";
export class AppComponent implements OnInit {
public darkMode = signal(false);
public darkFooter = this.footerColor.dark;
public showMobileMenu = false;

constructor(
private readonly footerColor: FooterColorService,
Expand All @@ -25,4 +26,12 @@ export class AppComponent implements OnInit {
public ngOnInit(): void {
this.darkMode.set(typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches);
}

public toggleMobileMenu(): void {
this.showMobileMenu = !this.showMobileMenu;
}

public closeMobileMenu(): void {
this.showMobileMenu = false;
}
}
2 changes: 1 addition & 1 deletion src/app/pages/faq/faq.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h3>
(click)="selectedFaq.set(selectedFaq() === faqItem.question ? null : faqItem.question)"
>
<span>{{faqItem.question}}</span>
<inline-svg href="/assets/img/faq-closed.svg" [class.rotate-180]="selectedFaq() === faqItem.question" />
<inline-svg href="assets/img/faq-closed.svg" [class.rotate-180]="selectedFaq() === faqItem.question" />
</button>
</h3>
<div [class.hidden]="selectedFaq() !== faqItem.question">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="max-w-2xl mb-4 text-4xl font-extrabold leading-none tracking-tight md
</p>
</div>
<div class="hidden lg:mt-0 lg:col-span-5 lg:flex">
<img ngSrc="/assets/img/front-image.png" alt="hero image" height="437" width="571" priority>
<img ngSrc="assets/img/front-image.png" alt="hero image" height="437" width="571" priority>
</div>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ <h2 class="mb-6 text-3xl font-extrabold tracking-tight text-gray-900 dark:text-w
</h2>
@for (newsItem of news(); track newsItem.title) {
<div class="mb-6">
<h3 class="mb-3 text-2xl text-gray-900 dark:text-white" [innerHTML]="newsItem.title"></h3>
<h3 class="mb-3 text-2xl text-gray-900 dark:text-white">
<span class="text-gray-500 dark:text-gray-200">{{newsItem.date_published}}</span> - <span [innerHTML]="newsItem.title"></span>
</h3>
@if (newsItem.excerpt) {
<p class="mb-2 font-light lg:text-xl" [innerHTML]="newsItem.excerpt"></p>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import {RouterLink} from "@angular/router";
import {TranslocoMarkupComponent} from "ngx-transloco-markup";
import {TranslocoPipe} from "@jsverse/transloco";


@Component({
selector: 'app-homepage-latest-news',
standalone: true,
imports: [
RouterLink,
TranslocoMarkupComponent,
TranslocoPipe
TranslocoPipe,
],
templateUrl: './homepage-latest-news.component.html',
styleUrl: './homepage-latest-news.component.scss'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ <h2 class="mb-6 text-3xl font-extrabold tracking-tight text-gray-900 dark:text-w
<transloco key="quickstart" />
</h2>

<p class="mb-4">
<transloco key="quickstart.register_account" [params]="{registerLink: {route: '/register'}}" />
<p class="mb-4" [innerHTML]="'quickstart.register_account' | transloco" >

Comment on lines +9 to +10
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better reverted and the registerLink changed from {route: '/register'} to just /register, that way it will use href instead of routerLink.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can demonstrate it works the same, that sounds fine to me

</p>
<ul class="mb-2 space-y-2">
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base">
<transloco key="quickstart.anonymous_api_key" />
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base">
<transloco key="quickstart.explanation_api_key" [params]="{kudosExplanationLink: 'https://dbzer0.com/blog/the-kudos-based-economy-for-the-koboldai-horde/'}" />
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ <h2 class="mb-6 text-2xl font-extrabold tracking-tight text-gray-900 dark:text-w
</h2>
<div class="grid grid-cols-2 gap-8 text-gray-500 sm:gap-12 sm:grid-cols-3 lg:grid-cols-6 dark:text-gray-400">
<a href="https://nlnet.nl/project/AI-Horde/" target="_blank" class="flex items-center lg:justify-center">
<inline-svg href="/assets/img/nlnet.svg" class="sponsor-svg" />
<inline-svg href="assets/img/nlnet.svg" class="sponsor-svg" />
</a>
</div>
</div>
Expand Down
32 changes: 16 additions & 16 deletions src/app/pages/homepage/parts/stats/homepage-stats.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h2 class="mb-4 text-3xl font-extrabold tracking-tight text-gray-900 dark:text-w
<h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">{{'image_stats' | transloco}}</h3>
<ul role="list" class="pt-8 space-y-5 border-t border-gray-200 my-7 dark:border-gray-700">
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.average_recent_performance_images" [params]="{
performance: (stats()!.past_minute_megapixelsteps / 60) | formatNumber:1,
Expand All @@ -19,7 +19,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.total_pixelsteps" [params]="{
amount: imageStats()!.ps | shiftDecimalsLeft:2 | formatNumber:1,
Expand All @@ -28,7 +28,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.total_images" [params]="{
amount: imageStats()!.images | shiftDecimalsLeft | formatNumber:1,
Expand All @@ -37,7 +37,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.active_workers" [params]="{
workers: stats()!.worker_count | formatNumber,
Expand All @@ -46,7 +46,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.image_queue" [params]="{
requests: stats()!.queued_requests | formatNumber,
Expand All @@ -62,7 +62,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
<h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white text-right">{{'text_stats' | transloco}}</h3>
<ul role="list" class="pt-8 space-y-5 border-t border-gray-200 my-7 dark:border-gray-700">
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.average_recent_performance_text" [params]="{
performance: (stats()!.past_minute_tokens / 60) | formatNumber:1,
Expand All @@ -71,7 +71,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.total_tokens" [params]="{
amount: textStats()!.tokens | shiftDecimalsLeft | formatNumber:1,
Expand All @@ -80,7 +80,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.total_texts" [params]="{
amount: textStats()!.requests | shiftDecimalsLeft | formatNumber:1,
Expand All @@ -89,7 +89,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.active_workers" [params]="{
workers: stats()!.text_worker_count | formatNumber,
Expand All @@ -98,7 +98,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.text_queue" [params]="{
requests: stats()!.queued_text_requests | formatNumber,
Expand All @@ -116,7 +116,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white
<h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">{{'image_alchemy' | transloco}}</h3>
<ul role="list" class="pt-8 space-y-5 border-t border-gray-200 my-7 dark:border-gray-700">
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.total_alchemy_processed" [params]="{
amount: interrogationStats()!.processed | shiftDecimalsLeft | formatNumber:1,
Expand All @@ -125,7 +125,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.active_workers" [params]="{
workers: stats()!.interrogator_count | formatNumber,
Expand All @@ -134,7 +134,7 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.interrogation_queue" [params]="{
forms: stats()!.queued_forms | formatNumber
Expand All @@ -148,18 +148,18 @@ <h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
<h3 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">{{'realtime_stats' | transloco}}</h3>
<ul role="list" class="pt-8 space-y-5 border-t border-gray-200 my-7 dark:border-gray-700 underline-links">
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" />
<inline-svg href="assets/img/li-checkbox.svg" />
<span class="text-base font-medium leading-tight text-gray-900 dark:text-white">
<transloco key="stats.realtime" [params]="{
grafanaLink: 'https://grafana.aihorde.net'
}" />
</span>
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" class="invisible" />
<inline-svg href="assets/img/li-checkbox.svg" class="invisible" />
</li>
<li class="flex space-x-3">
<inline-svg href="/assets/img/li-checkbox.svg" class="invisible" />
<inline-svg href="assets/img/li-checkbox.svg" class="invisible" />
</li>
</ul>
</div>
Expand Down
Loading
Loading