mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
Fix/fe 6 (#2965)
* fix backup reports modal * chore: fix comments * chore: fix controls status * chore: fix stale marketplace data * slightly better registry switching --------- Co-authored-by: Matt Hill <mattnine@protonmail.com>
This commit is contained in:
@@ -35,6 +35,11 @@
|
||||
>
|
||||
<nav class="nav-mobile-sidebar divide-bar">
|
||||
<div class="nav-mobile-sidebar-top">
|
||||
<store-icon
|
||||
[tuiSkeleton]="!registry"
|
||||
size="32px"
|
||||
[url]="registry?.url || ''"
|
||||
/>
|
||||
<h1 [style.margin]="0" [tuiSkeleton]="!registry">
|
||||
{{ registry?.info?.name }}
|
||||
</h1>
|
||||
|
||||
@@ -158,6 +158,12 @@ header {
|
||||
button {
|
||||
place-self: end;
|
||||
}
|
||||
|
||||
store-icon {
|
||||
border-radius: 100%;
|
||||
display: flex;
|
||||
margin-right: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
&-bottom {
|
||||
|
||||
@@ -147,7 +147,6 @@ export default {
|
||||
144: 'Wechseln',
|
||||
145: 'Installieren',
|
||||
146: 'Installation wird gestartet',
|
||||
147: 'Register wechseln',
|
||||
148: 'Dienste in diesem Register werden vom Start9-Team gepackt und gepflegt. Bei Problemen oder Fragen hilft Ihnen unser Support-Team gerne weiter.',
|
||||
149: 'Dienste in diesem Register werden von der Start9-Community gepflegt. Die Installation erfolgt auf eigenes Risiko. Bei Problemen wenden Sie sich bitte an den Paketentwickler.',
|
||||
150: 'Dienste in diesem Register befinden sich in der Betaphase und können Fehler enthalten. Die Installation erfolgt auf eigenes Risiko.',
|
||||
|
||||
@@ -146,7 +146,6 @@ export const ENGLISH = {
|
||||
'Switch': 144,
|
||||
'Install': 145,
|
||||
'Beginning install': 146,
|
||||
'Change Registry': 147,
|
||||
'Services from this registry are packaged and maintained by the Start9 team. If you experience an issue or have questions related to a service from this registry, one of our dedicated support staff will be happy to assist you.': 148,
|
||||
'Services from this registry are packaged and maintained by members of the Start9 community. Install at your own risk. If you experience an issue or have a question related to a service in this marketplace, please reach out to the package developer for assistance.': 149,
|
||||
'Services from this registry are undergoing beta testing and may contain bugs. Install at your own risk.': 150,
|
||||
|
||||
@@ -147,7 +147,6 @@ export default {
|
||||
144: 'Cambiar',
|
||||
145: 'Instalar',
|
||||
146: 'Iniciando instalación',
|
||||
147: 'Cambiar registro',
|
||||
148: 'Los servicios de este registro están empaquetados y mantenidos por el equipo de Start9. Si experimentas un problema o tienes preguntas relacionadas con un servicio de este registro, nuestro equipo de soporte estará encantado de ayudarte.',
|
||||
149: 'Los servicios de este registro están empaquetados y mantenidos por miembros de la comunidad Start9. Instálalos bajo tu propio riesgo. Si experimentas un problema o tienes una pregunta sobre un servicio en este mercado, comunícate con el desarrollador del paquete.',
|
||||
150: 'Los servicios de este registro están en fase de prueba beta y pueden contener errores. Instálalos bajo tu propio riesgo.',
|
||||
|
||||
@@ -147,7 +147,6 @@ export default {
|
||||
144: 'Changer',
|
||||
145: 'Installer',
|
||||
146: 'Installation initiée',
|
||||
147: 'Changer de bibliothèque',
|
||||
148: 'Les services de cette bibliothèque sont maintenus par l’équipe de Start9. Si vous rencontrez un problème ou avez des questions, notre équipe de support dédiée sera ravie de vous aider.',
|
||||
149: 'Les services de cette bibliothèque sont maintenus par la communauté Start9. Installez-les à vos risques et périls. En cas de problème ou de question, veuillez contacter le développeur en charge du paquet.',
|
||||
150: 'Les services de cette bibliothèque sont en phase de test bêta et peuvent contenir des bugs. Installez-les à vos risques et périls.',
|
||||
|
||||
@@ -147,7 +147,6 @@ export default {
|
||||
144: 'Przełącz',
|
||||
145: 'Zainstaluj',
|
||||
146: 'Rozpoczynanie instalacji',
|
||||
147: 'Zmień katalog',
|
||||
148: 'Serwisy z tego katalogu są pakowane i utrzymywane przez zespół Start9. Jeśli napotkasz problem lub masz pytania dotyczące serwisu z tego katalogu, nasz zespół wsparcia z przyjemnością Ci pomoże.',
|
||||
149: 'Serwisy z tego katalogu są tworzone i utrzymywane przez członków społeczności Start9. Instalujesz je na własne ryzyko. W przypadku problemów lub pytań skontaktuj się z twórcą pakietu.',
|
||||
150: 'Serwisy z tego katalogu są w fazie testów beta i mogą zawierać błędy. Instalujesz je na własne ryzyko.',
|
||||
|
||||
@@ -12,17 +12,17 @@ import { DialogService, i18nPipe } from '@start9labs/shared'
|
||||
<menu [registry]="registry$ | async">
|
||||
<button
|
||||
slot="desktop"
|
||||
tuiIconButton
|
||||
tuiButton
|
||||
type="button"
|
||||
appearance="icon"
|
||||
iconStart="@tui.repeat"
|
||||
(click)="changeRegistry()"
|
||||
>
|
||||
{{ 'Change Registry' | i18n }}
|
||||
{{ 'Switch' | i18n }}
|
||||
</button>
|
||||
<button slot="mobile" class="mobile-button" (click)="changeRegistry()">
|
||||
<tui-icon tuiAppearance="icon" icon="@tui.repeat" />
|
||||
{{ 'Change Registry' | i18n }}
|
||||
{{ 'Switch' | i18n }}
|
||||
</button>
|
||||
</menu>
|
||||
`,
|
||||
@@ -30,7 +30,7 @@ import { DialogService, i18nPipe } from '@start9labs/shared'
|
||||
.mobile-button {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
padding: 1.25rem;
|
||||
padding: 1.25rem 0 1.25rem 1.45rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5rem;
|
||||
background-color: transparent;
|
||||
@@ -53,10 +53,6 @@ export class MarketplaceMenuComponent {
|
||||
readonly registry$ = inject(MarketplaceService).currentRegistry$
|
||||
|
||||
changeRegistry() {
|
||||
this.dialog
|
||||
.openComponent(MARKETPLACE_REGISTRY, {
|
||||
label: 'Change Registry',
|
||||
})
|
||||
.subscribe()
|
||||
this.dialog.openComponent(MARKETPLACE_REGISTRY).subscribe()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
Component,
|
||||
computed,
|
||||
inject,
|
||||
Input,
|
||||
input,
|
||||
} from '@angular/core'
|
||||
import { i18nPipe } from '@start9labs/shared'
|
||||
import { TuiLet } from '@taiga-ui/cdk'
|
||||
@@ -19,7 +19,7 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
||||
@Component({
|
||||
selector: 'service-controls',
|
||||
template: `
|
||||
@if (status && ['running', 'starting', 'restarting'].includes(status)) {
|
||||
@if (['running', 'starting', 'restarting'].includes(status()!)) {
|
||||
<button
|
||||
tuiButton
|
||||
appearance="primary-destructive"
|
||||
@@ -30,7 +30,7 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
||||
</button>
|
||||
}
|
||||
|
||||
@if (status === 'running') {
|
||||
@if (status() === 'running') {
|
||||
<button
|
||||
tuiButton
|
||||
iconStart="@tui.rotate-cw"
|
||||
@@ -40,7 +40,7 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
||||
</button>
|
||||
}
|
||||
|
||||
@if (status === 'stopped') {
|
||||
@if (status() === 'stopped') {
|
||||
<button
|
||||
*tuiLet="hasUnmet() | async as hasUnmet"
|
||||
tuiButton
|
||||
@@ -88,20 +88,15 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
||||
export class ServiceControlsComponent {
|
||||
private readonly errors = inject(DepErrorService)
|
||||
|
||||
@Input({ required: true })
|
||||
pkg!: PackageDataEntry
|
||||
|
||||
@Input({ required: true })
|
||||
status?: PrimaryStatus
|
||||
|
||||
readonly manifest = computed(() => getManifest(this.pkg))
|
||||
|
||||
readonly pkg = input.required<PackageDataEntry>()
|
||||
readonly status = input<PrimaryStatus>()
|
||||
readonly manifest = computed(() => getManifest(this.pkg()))
|
||||
readonly controls = inject(ControlsService)
|
||||
|
||||
readonly hasUnmet = computed(() =>
|
||||
this.errors.getPkgDepErrors$(this.manifest().id).pipe(
|
||||
map(errors =>
|
||||
Object.keys(this.pkg.currentDependencies)
|
||||
Object.keys(this.pkg().currentDependencies)
|
||||
.map(id => errors[id])
|
||||
.some(Boolean),
|
||||
),
|
||||
|
||||
@@ -49,38 +49,49 @@ export class MarketplaceService {
|
||||
toStoreIdentity(start9, registries[start9]),
|
||||
toStoreIdentity(community, registries[community]),
|
||||
...Object.entries(registries)
|
||||
.filter(([url, _]) => ![start9, community].includes(url as any))
|
||||
.filter(([u, _]) => !sameUrl(start9, u) && !sameUrl(community, u))
|
||||
.map(([url, name]) => toStoreIdentity(url, name)),
|
||||
]),
|
||||
)
|
||||
|
||||
readonly newRegistry$ = this.registries$.pipe(
|
||||
startWith<StoreIdentity[]>([]),
|
||||
pairwise(),
|
||||
mergeMap(([p, c]) => c.filter(a => !p.find(b => sameUrl(a.url, b.url)))),
|
||||
)
|
||||
|
||||
readonly currentRegistryUrl$ = new ReplaySubject<string>(1)
|
||||
|
||||
readonly requestErrors$ = new BehaviorSubject<string[]>([])
|
||||
|
||||
readonly marketplace$: Observable<Marketplace> = this.registries$.pipe(
|
||||
startWith<StoreIdentity[]>([]),
|
||||
pairwise(),
|
||||
mergeMap(([prev, curr]) =>
|
||||
curr.filter(c => !prev.find(p => sameUrl(c.url, p.url))),
|
||||
),
|
||||
mergeMap(({ url, name }) =>
|
||||
this.fetchRegistry$(url).pipe(
|
||||
tap(data => {
|
||||
if (data?.info.name)
|
||||
this.updateRegistryName(url, name, data.info.name)
|
||||
readonly marketplace$: Observable<Marketplace> = combineLatest([
|
||||
this.newRegistry$.pipe(
|
||||
mergeMap(({ url, name }) =>
|
||||
this.fetchRegistry$(url).pipe(
|
||||
tap(data => {
|
||||
if (data?.info.name)
|
||||
this.updateRegistryName(url, name, data.info.name)
|
||||
}),
|
||||
map(data => [url, data] satisfies [string, StoreDataWithUrl | null]),
|
||||
startWith<[string, StoreDataWithUrl | null]>([url, null]),
|
||||
),
|
||||
),
|
||||
scan<[string, StoreDataWithUrl | null], Marketplace>(
|
||||
(requests, [url, store]) => ({
|
||||
...requests,
|
||||
[url]: store,
|
||||
}),
|
||||
map(data => [url, data] satisfies [string, StoreDataWithUrl | null]),
|
||||
startWith<[string, StoreDataWithUrl | null]>([url, null]),
|
||||
{},
|
||||
),
|
||||
),
|
||||
scan<[string, StoreDataWithUrl | null], Marketplace>(
|
||||
(requests, [url, store]) => {
|
||||
requests[url] = store
|
||||
|
||||
return requests
|
||||
},
|
||||
{},
|
||||
this.registries$,
|
||||
]).pipe(
|
||||
map(([marketplace, registries]) =>
|
||||
Object.fromEntries(
|
||||
Object.entries(marketplace).filter(([url]) =>
|
||||
registries.find(store => sameUrl(store.url, url)),
|
||||
),
|
||||
),
|
||||
),
|
||||
shareReplay(1),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user