mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
chore: comments (#3093)
* chore: comments * revert some sizing --------- Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { ChangeDetectionStrategy, Component, inject } from '@angular/core'
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core'
|
||||
import { toSignal } from '@angular/core/rxjs-interop'
|
||||
import { ActivatedRoute } from '@angular/router'
|
||||
import { TuiDialogContext, TuiLoader, TuiNotification } from '@taiga-ui/core'
|
||||
import { TuiLoader, TuiNotification } from '@taiga-ui/core'
|
||||
import { NgDompurifyPipe } from '@taiga-ui/dompurify'
|
||||
import { injectContext, PolymorpheusComponent } from '@taiga-ui/polymorpheus'
|
||||
import { catchError, ignoreElements, Observable, of } from 'rxjs'
|
||||
import { catchError, ignoreElements, Observable, of, share } from 'rxjs'
|
||||
import { SafeLinksDirective } from '../directives/safe-links.directive'
|
||||
import { MarkdownPipe } from '../pipes/markdown.pipe'
|
||||
import { getErrorMessage } from '../services/error.service'
|
||||
@@ -34,7 +33,10 @@ import { getErrorMessage } from '../services/error.service'
|
||||
],
|
||||
})
|
||||
export class MarkdownComponent {
|
||||
protected readonly data = injectContext<{ data: Observable<string> }>().data
|
||||
private readonly data = injectContext<{
|
||||
data: Observable<string>
|
||||
}>().data.pipe(share())
|
||||
|
||||
protected readonly content = toSignal<string>(this.data)
|
||||
protected readonly error = toSignal(
|
||||
this.data.pipe(
|
||||
|
||||
@@ -5,11 +5,14 @@ import {
|
||||
InjectionToken,
|
||||
input,
|
||||
} from '@angular/core'
|
||||
import { TuiHintDirective } from '@taiga-ui/core'
|
||||
import { i18nPipe } from '../i18n/i18n.pipe'
|
||||
|
||||
export const VERSION = new InjectionToken<string>('VERSION')
|
||||
|
||||
@Directive({
|
||||
selector: '[docsLink]',
|
||||
hostDirectives: [TuiHintDirective],
|
||||
host: {
|
||||
target: '_blank',
|
||||
rel: 'noreferrer',
|
||||
@@ -20,12 +23,18 @@ export class DocsLinkDirective {
|
||||
private readonly version = inject(VERSION)
|
||||
|
||||
readonly path = input.required<string>()
|
||||
|
||||
readonly fragment = input<string>('')
|
||||
|
||||
protected readonly url = computed(() => {
|
||||
const path = this.path()
|
||||
const relative = path.startsWith('/') ? path : `/${path}`
|
||||
|
||||
return `https://docs.start9.com${relative}?os=${this.version}${this.fragment()}`
|
||||
})
|
||||
|
||||
constructor() {
|
||||
inject(TuiHintDirective).content.set(
|
||||
inject(i18nPipe).transform('Documentation'),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import { tuiObfuscateOptionsProvider } from '@taiga-ui/cdk'
|
||||
import {
|
||||
TUI_DATE_FORMAT,
|
||||
TUI_DIALOGS_CLOSE,
|
||||
TUI_MEDIA,
|
||||
tuiAlertOptionsProvider,
|
||||
tuiButtonOptionsProvider,
|
||||
tuiDropdownOptionsProvider,
|
||||
@@ -140,4 +141,12 @@ export const APP_PROVIDERS = [
|
||||
none: identity,
|
||||
},
|
||||
}),
|
||||
{
|
||||
provide: TUI_MEDIA,
|
||||
useValue: {
|
||||
mobile: 1000,
|
||||
desktopSmall: 1280,
|
||||
desktopLarge: Infinity,
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
@@ -111,11 +111,11 @@ import { ConfigService } from 'src/app/services/config.service'
|
||||
&-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, minmax(0, 1fr));
|
||||
gap: 4rem 3rem;
|
||||
gap: 3.5rem 2.5rem;
|
||||
padding: 1.5rem;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding: 2rem;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from '@start9labs/shared'
|
||||
import { TuiCell } from '@taiga-ui/layout'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
import { from, map } from 'rxjs'
|
||||
import { defer, map } from 'rxjs'
|
||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||
import { DataModel } from 'src/app/services/patch-db/data-model'
|
||||
import { getManifest } from 'src/app/utils/get-package-data'
|
||||
@@ -54,15 +54,13 @@ import {
|
||||
})
|
||||
export default class ServiceAboutRoute {
|
||||
private readonly pkgId = getPkgId()
|
||||
private readonly api = inject(ApiService)
|
||||
private readonly copyService = inject(CopyService)
|
||||
private readonly markdown = inject(DialogService).openComponent(MARKDOWN, {
|
||||
label: 'License',
|
||||
size: 'l',
|
||||
data: from(
|
||||
inject(ApiService).getStatic(
|
||||
[`/s9pk/installed/${this.pkgId}.s9pk/LICENSE.md`],
|
||||
{},
|
||||
),
|
||||
data: defer(() =>
|
||||
this.api.getStatic([`/s9pk/installed/${this.pkgId}.s9pk/LICENSE.md`], {}),
|
||||
),
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user