From ca39ffb9eb9d0bbf92e749aaf77c1ea1dfca2969 Mon Sep 17 00:00:00 2001 From: Alex Inkin Date: Sat, 30 Aug 2025 00:37:34 +0700 Subject: [PATCH] refactor: fix multiple comments (#3013) * refactor: fix multiple comments * styling changes, add documentation to sidebar * translations for dns page * refactor: subtle colors * rearrange service page --------- Co-authored-by: Matt Hill --- .../src/pages/show/about.component.ts | 2 +- .../shared/src/i18n/dictionaries/de.ts | 10 +- .../shared/src/i18n/dictionaries/en.ts | 14 ++- .../shared/src/i18n/dictionaries/es.ts | 8 ++ .../shared/src/i18n/dictionaries/fr.ts | 8 ++ .../shared/src/i18n/dictionaries/pl.ts | 8 ++ web/projects/shared/styles/taiga.scss | 10 +- .../components/header/about.component.ts | 4 +- .../interfaces/gateways.component.ts | 21 +++- .../marketplace/components/tile.component.ts | 2 +- .../components/health-checks.component.ts | 2 +- .../components/interface-item.component.ts | 57 +++++----- .../components/interfaces.component.ts | 12 ++- .../services/components/progress.component.ts | 2 +- .../services/components/status.component.ts | 16 +-- .../services/components/task.component.ts | 42 +++----- .../services/components/tasks.component.ts | 2 +- .../services/components/uptime.component.ts | 4 +- .../services/dashboard/dashboard.component.ts | 31 ++++-- .../services/dashboard/services.service.ts | 31 ------ .../routes/services/routes/about.component.ts | 28 +++-- .../services/routes/outlet.component.ts | 100 +++++++++++++----- .../services/routes/service.component.ts | 6 +- .../routes/system/routes/dns/dns.component.ts | 51 ++++----- .../routes/password/password.component.ts | 4 +- .../routes/sessions/sessions.component.ts | 4 +- .../system/routes/wifi/wifi.component.ts | 4 +- .../src/app/services/marketplace.service.ts | 2 +- web/projects/ui/src/styles.scss | 1 + 29 files changed, 287 insertions(+), 199 deletions(-) delete mode 100644 web/projects/ui/src/app/routes/portal/routes/services/dashboard/services.service.ts diff --git a/web/projects/marketplace/src/pages/show/about.component.ts b/web/projects/marketplace/src/pages/show/about.component.ts index ecd83b62b..a5416e915 100644 --- a/web/projects/marketplace/src/pages/show/about.component.ts +++ b/web/projects/marketplace/src/pages/show/about.component.ts @@ -36,7 +36,7 @@ import { MarketplaceItemComponent } from './item.component' diff --git a/web/projects/shared/src/i18n/dictionaries/de.ts b/web/projects/shared/src/i18n/dictionaries/de.ts index 15332a47b..7a6de67a5 100644 --- a/web/projects/shared/src/i18n/dictionaries/de.ts +++ b/web/projects/shared/src/i18n/dictionaries/de.ts @@ -491,7 +491,7 @@ export default { 518: 'Verwerfen', 520: 'Update verfügbar', 521: 'Um das Problem zu beheben, siehe', - 522: 'SDK Version', + 522: 'SDK version', 523: 'Sicherungsbericht', 524: 'Ausgewählte löschen', 525: 'Keine SSH-Schlüssel', @@ -577,4 +577,12 @@ export default { 610: 'Dynamisches DNS', 611: 'Keine Service-Schnittstellen', 612: 'Grund', + 613: 'Private Gateways für die StartOS-Benutzeroberfläche können nicht deaktiviert werden', + 614: 'CA-Fingerabdruck', + 615: 'DHCP-Server', + 616: 'DHCP-Server können nicht bearbeitet werden', + 617: 'Statisch', + 618: 'Statische Server', + 619: 'Warnung. StartOS verwendet derzeit das folgende Gateway für DNS', + 620: 'Wenn Sie dieses Gateway für die Auflösung privater Domains verwenden möchten, legen Sie alternative statische DNS-Server mit dem obigen Formular fest.', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/en.ts b/web/projects/shared/src/i18n/dictionaries/en.ts index b65be89d4..1a59e80a8 100644 --- a/web/projects/shared/src/i18n/dictionaries/en.ts +++ b/web/projects/shared/src/i18n/dictionaries/en.ts @@ -254,9 +254,9 @@ export const ENGLISH = { 'unknown %': 270, 'Not provided': 271, 'Links': 272, - 'Git Hash': 273, + 'Git hash': 273, 'License': 274, - 'Installed From': 275, + 'Installed from': 275, 'Marketing': 278, 'Support': 279, 'Donations': 280, @@ -490,7 +490,7 @@ export const ENGLISH = { 'Dismiss': 518, // as in, dismiss or delete a task 'Update available': 520, 'To resolve the issue, refer to': 521, - 'SDK Version': 522, + 'SDK version': 522, 'Backup Report': 523, 'Delete selected': 524, 'No SSH keys': 525, @@ -576,4 +576,12 @@ export const ENGLISH = { 'Dynamic DNS': 610, 'No service interfaces': 611, // as in, there are no available interfaces (API, UI, etc) for this software application 'Reason': 612, // as in, an explanation for something + 'Cannot disable private gateways for StartOS UI': 613, + 'CA fingerprint': 614, // as in, the unique, fixed-length digital identifier generated from a certificate's data using a cryptographic hash function + 'DHCP Servers': 615, + 'Cannot edit DHCP servers': 616, + 'Static': 617, // as in, unchanging + 'Static Servers': 618, // as in, servers that do not change + 'Warning. StartOS is currently using the following gateway for DNS': 619, + 'If you intend to use this gateway for private domain resolution, set alternative static DNS servers using the form above.': 620, } as const diff --git a/web/projects/shared/src/i18n/dictionaries/es.ts b/web/projects/shared/src/i18n/dictionaries/es.ts index 6fb5fd5fd..87fedf2ae 100644 --- a/web/projects/shared/src/i18n/dictionaries/es.ts +++ b/web/projects/shared/src/i18n/dictionaries/es.ts @@ -577,4 +577,12 @@ export default { 610: 'DNS dinámico', 611: 'Sin interfaces de servicio', 612: 'Razón', + 613: 'No se pueden deshabilitar las puertas de enlace privadas para la interfaz de usuario de StartOS', + 614: 'Huella digital de la CA', + 615: 'Servidores DHCP', + 616: 'No se pueden editar los servidores DHCP', + 617: 'Estático', + 618: 'Servidores estáticos', + 619: 'Advertencia. StartOS está utilizando actualmente la siguiente puerta de enlace para DNS', + 620: 'Si deseas usar esta puerta de enlace para la resolución de dominios privados, configura servidores DNS estáticos alternativos usando el formulario anterior.', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/fr.ts b/web/projects/shared/src/i18n/dictionaries/fr.ts index 4cc0f4232..c0af027bb 100644 --- a/web/projects/shared/src/i18n/dictionaries/fr.ts +++ b/web/projects/shared/src/i18n/dictionaries/fr.ts @@ -577,4 +577,12 @@ export default { 610: 'DNS dynamique', 611: 'Aucune interface de service', 612: 'Raison', + 613: "Impossible de désactiver les passerelles privées pour l'interface utilisateur StartOS", + 614: 'Empreinte de l’AC', + 615: 'Serveurs DHCP', + 616: 'Impossible de modifier les serveurs DHCP', + 617: 'Statique', + 618: 'Serveurs statiques', + 619: 'Avertissement. StartOS utilise actuellement la passerelle suivante pour le DNS', + 620: 'Si vous souhaitez utiliser cette passerelle pour la résolution de domaines privés, définissez des serveurs DNS statiques alternatifs à l’aide du formulaire ci-dessus.', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/pl.ts b/web/projects/shared/src/i18n/dictionaries/pl.ts index 19dac71f7..f868b8b51 100644 --- a/web/projects/shared/src/i18n/dictionaries/pl.ts +++ b/web/projects/shared/src/i18n/dictionaries/pl.ts @@ -577,4 +577,12 @@ export default { 610: 'Dynamiczny DNS', 611: 'Brak interfejsów usług', 612: 'Powód', + 613: 'Nie można wyłączyć prywatnych bram dla interfejsu użytkownika StartOS', + 614: 'Odcisk palca CA', + 615: 'Serwery DHCP', + 616: 'Nie można edytować serwerów DHCP', + 617: 'Statyczny', + 618: 'Serwery statyczne', + 619: 'Ostrzeżenie. StartOS obecnie używa następującej bramy do DNS', + 620: 'Jeśli zamierzasz używać tej bramy do rozwiązywania domen prywatnych, ustaw alternatywne statyczne serwery DNS za pomocą powyższego formularza.', } satisfies i18n diff --git a/web/projects/shared/styles/taiga.scss b/web/projects/shared/styles/taiga.scss index cb30f47ee..cb6044a06 100644 --- a/web/projects/shared/styles/taiga.scss +++ b/web/projects/shared/styles/taiga.scss @@ -88,13 +88,6 @@ --start9-base-5: rgba(60, 62, 64, 1); } -[tuiAppearance][data-appearance^='primary']:not([tuiCheckbox]._readonly) { - @include taiga.appearance-disabled { - background: var(--tui-status-neutral); - color: #333; - } -} - [tuiAppearance][data-appearance='primary-success'] { color: var(--tui-text-primary-on-accent-1); background: var(--tui-status-positive); @@ -108,8 +101,7 @@ } @include taiga.appearance-disabled { - background: var(--tui-status-neutral); - color: #333; + opacity: var(--tui-disabled-opacity); } } diff --git a/web/projects/ui/src/app/routes/portal/components/header/about.component.ts b/web/projects/ui/src/app/routes/portal/components/header/about.component.ts index 6b244ddab..0073f42e0 100644 --- a/web/projects/ui/src/app/routes/portal/components/header/about.component.ts +++ b/web/projects/ui/src/app/routes/portal/components/header/about.component.ts @@ -21,7 +21,7 @@ import { DataModel } from 'src/app/services/patch-db/data-model'
- Git Hash + {{ 'Git hash' | i18n }}
{{ gitHash }}
+ target="_blank" + rel="noopener noreferrer" + [attr.href]="disabled ? null : href" + (click.stop)="(0)" + > } - `, styles: ` - strong { + :host { + clip-path: inset(0 round 0.75rem); + cursor: pointer; + + &:hover { + background: var(--tui-background-neutral-1); + } + } + + td:first-child { white-space: nowrap; } @@ -58,7 +58,7 @@ import { InterfaceService } from '../../../components/interfaces/interface.servi } td:last-child { - grid-area: 3 / span 4; + grid-area: 1 / 3 / span 2 / 3; white-space: nowrap; text-align: right; flex-direction: row-reverse; @@ -68,7 +68,7 @@ import { InterfaceService } from '../../../components/interfaces/interface.servi :host-context(tui-root._mobile) { display: grid; - grid-template-columns: repeat(3, min-content) 1fr; + grid-template-columns: min-content; align-items: center; padding: 1rem 0.5rem; gap: 0.5rem; @@ -80,16 +80,13 @@ import { InterfaceService } from '../../../components/interfaces/interface.servi } `, changeDetection: ChangeDetectionStrategy.OnPush, - imports: [TuiButton, TuiBadge, RouterLink], + imports: [TuiButton, TuiBadge], }) export class ServiceInterfaceItemComponent { private readonly interfaceService = inject(InterfaceService) - private readonly document = inject(DOCUMENT) @Input({ required: true }) - info!: T.ServiceInterface & { - routerLink: string - } + info!: T.ServiceInterface @Input({ required: true }) pkg!: PackageDataEntry @@ -110,11 +107,9 @@ export class ServiceInterfaceItemComponent { get href() { const host = this.pkg.hosts[this.info.addressInfo.hostId] - if (!host) return '' - return this.interfaceService.launchableAddress(this.info, host) - } - openUI() { - this.document.defaultView?.open(this.href, '_blank', 'noreferrer') + return host + ? this.interfaceService.launchableAddress(this.info, host) + : null } } diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts index a89d10d45..56cc9223b 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/interfaces.component.ts @@ -4,6 +4,7 @@ import { computed, input, } from '@angular/core' +import { RouterLink } from '@angular/router' import { TuiTable } from '@taiga-ui/addon-table' import { tuiDefaultSort } from '@taiga-ui/cdk' import { PackageDataEntry } from 'src/app/services/patch-db/data-model' @@ -27,11 +28,17 @@ import { PlaceholderComponent } from '../../../components/placeholder.component' @for (info of interfaces(); track $index) { + [routerLink]="info.routerLink" + > + + {{ info.name }} + + } @empty { {{ 'No service interfaces' | i18n }} @@ -42,7 +49,7 @@ import { PlaceholderComponent } from '../../../components/placeholder.component' `, styles: ` :host { - grid-column: span 6; + grid-column: span 7; } `, host: { class: 'g-card' }, @@ -52,6 +59,7 @@ import { PlaceholderComponent } from '../../../components/placeholder.component' TuiTable, i18nPipe, PlaceholderComponent, + RouterLink, ], }) export class ServiceInterfacesComponent { diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/progress.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/progress.component.ts index 0c3bc6a02..2e860ce9e 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/progress.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/progress.component.ts @@ -50,7 +50,7 @@ import { getManifest } from 'src/app/utils/get-package-data' size="m" [max]="100" [class.g-positive]="phase.progress === true" - [value]="isIndeterminate(phase.progress) ? undefined : percent" + [attr.value]="isIndeterminate(phase.progress) ? undefined : percent" >
} diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/status.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/status.component.ts index fbdcf30d0..499302b33 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/status.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/status.component.ts @@ -43,7 +43,7 @@ import { `, styles: ` :host { - grid-column: span 2; + grid-column: span 3; min-height: 12rem; } @@ -78,14 +78,14 @@ import { :host-context(tui-root._mobile) { :host { - min-height: 0; - } + min-height: 0; + } - div { - display: grid; - grid-template-columns: 1fr max-content; - padding: 0.5rem 0; - } + div { + display: grid; + grid-template-columns: 1fr max-content; + padding: 0.5rem 0; + } h3 { text-align: left; diff --git a/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts b/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts index d0e81b3bc..bcc58fcc1 100644 --- a/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/services/components/task.component.ts @@ -23,35 +23,26 @@ import { getManifest } from 'src/app/utils/get-package-data' @Component({ selector: 'tr[task]', template: ` - + {{ pkgTitle() }} - - {{ pkg()?.actions?.[task().actionId]?.name }} + + {{ pkg()?.actions?.[task().actionId]?.name }} - + @if (task().severity === 'critical') { - - {{ 'Required' | i18n }} - + {{ 'Required' | i18n }} } @else if (task().severity === 'important') { - - {{ 'Recommended' | i18n }} - + {{ 'Recommended' | i18n }} } @else { - - {{ 'Optional' | i18n }} - + {{ 'Optional' | i18n }} } - + {{ task().reason || ('No reason provided' | i18n) }} - + @if (task().severity !== 'critical') {