mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +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">
|
<nav class="nav-mobile-sidebar divide-bar">
|
||||||
<div class="nav-mobile-sidebar-top">
|
<div class="nav-mobile-sidebar-top">
|
||||||
|
<store-icon
|
||||||
|
[tuiSkeleton]="!registry"
|
||||||
|
size="32px"
|
||||||
|
[url]="registry?.url || ''"
|
||||||
|
/>
|
||||||
<h1 [style.margin]="0" [tuiSkeleton]="!registry">
|
<h1 [style.margin]="0" [tuiSkeleton]="!registry">
|
||||||
{{ registry?.info?.name }}
|
{{ registry?.info?.name }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@@ -158,6 +158,12 @@ header {
|
|||||||
button {
|
button {
|
||||||
place-self: end;
|
place-self: end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
store-icon {
|
||||||
|
border-radius: 100%;
|
||||||
|
display: flex;
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-bottom {
|
&-bottom {
|
||||||
|
|||||||
@@ -147,7 +147,6 @@ export default {
|
|||||||
144: 'Wechseln',
|
144: 'Wechseln',
|
||||||
145: 'Installieren',
|
145: 'Installieren',
|
||||||
146: 'Installation wird gestartet',
|
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.',
|
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.',
|
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.',
|
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,
|
'Switch': 144,
|
||||||
'Install': 145,
|
'Install': 145,
|
||||||
'Beginning install': 146,
|
'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 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 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,
|
'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',
|
144: 'Cambiar',
|
||||||
145: 'Instalar',
|
145: 'Instalar',
|
||||||
146: 'Iniciando instalación',
|
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.',
|
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.',
|
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.',
|
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',
|
144: 'Changer',
|
||||||
145: 'Installer',
|
145: 'Installer',
|
||||||
146: 'Installation initiée',
|
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.',
|
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.',
|
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.',
|
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',
|
144: 'Przełącz',
|
||||||
145: 'Zainstaluj',
|
145: 'Zainstaluj',
|
||||||
146: 'Rozpoczynanie instalacji',
|
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.',
|
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.',
|
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.',
|
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">
|
<menu [registry]="registry$ | async">
|
||||||
<button
|
<button
|
||||||
slot="desktop"
|
slot="desktop"
|
||||||
tuiIconButton
|
tuiButton
|
||||||
type="button"
|
type="button"
|
||||||
appearance="icon"
|
appearance="icon"
|
||||||
iconStart="@tui.repeat"
|
iconStart="@tui.repeat"
|
||||||
(click)="changeRegistry()"
|
(click)="changeRegistry()"
|
||||||
>
|
>
|
||||||
{{ 'Change Registry' | i18n }}
|
{{ 'Switch' | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<button slot="mobile" class="mobile-button" (click)="changeRegistry()">
|
<button slot="mobile" class="mobile-button" (click)="changeRegistry()">
|
||||||
<tui-icon tuiAppearance="icon" icon="@tui.repeat" />
|
<tui-icon tuiAppearance="icon" icon="@tui.repeat" />
|
||||||
{{ 'Change Registry' | i18n }}
|
{{ 'Switch' | i18n }}
|
||||||
</button>
|
</button>
|
||||||
</menu>
|
</menu>
|
||||||
`,
|
`,
|
||||||
@@ -30,7 +30,7 @@ import { DialogService, i18nPipe } from '@start9labs/shared'
|
|||||||
.mobile-button {
|
.mobile-button {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
padding: 1.25rem;
|
padding: 1.25rem 0 1.25rem 1.45rem;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
line-height: 1.5rem;
|
line-height: 1.5rem;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
@@ -53,10 +53,6 @@ export class MarketplaceMenuComponent {
|
|||||||
readonly registry$ = inject(MarketplaceService).currentRegistry$
|
readonly registry$ = inject(MarketplaceService).currentRegistry$
|
||||||
|
|
||||||
changeRegistry() {
|
changeRegistry() {
|
||||||
this.dialog
|
this.dialog.openComponent(MARKETPLACE_REGISTRY).subscribe()
|
||||||
.openComponent(MARKETPLACE_REGISTRY, {
|
|
||||||
label: 'Change Registry',
|
|
||||||
})
|
|
||||||
.subscribe()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
Component,
|
Component,
|
||||||
computed,
|
computed,
|
||||||
inject,
|
inject,
|
||||||
Input,
|
input,
|
||||||
} from '@angular/core'
|
} from '@angular/core'
|
||||||
import { i18nPipe } from '@start9labs/shared'
|
import { i18nPipe } from '@start9labs/shared'
|
||||||
import { TuiLet } from '@taiga-ui/cdk'
|
import { TuiLet } from '@taiga-ui/cdk'
|
||||||
@@ -19,7 +19,7 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'service-controls',
|
selector: 'service-controls',
|
||||||
template: `
|
template: `
|
||||||
@if (status && ['running', 'starting', 'restarting'].includes(status)) {
|
@if (['running', 'starting', 'restarting'].includes(status()!)) {
|
||||||
<button
|
<button
|
||||||
tuiButton
|
tuiButton
|
||||||
appearance="primary-destructive"
|
appearance="primary-destructive"
|
||||||
@@ -30,7 +30,7 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (status === 'running') {
|
@if (status() === 'running') {
|
||||||
<button
|
<button
|
||||||
tuiButton
|
tuiButton
|
||||||
iconStart="@tui.rotate-cw"
|
iconStart="@tui.rotate-cw"
|
||||||
@@ -40,7 +40,7 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (status === 'stopped') {
|
@if (status() === 'stopped') {
|
||||||
<button
|
<button
|
||||||
*tuiLet="hasUnmet() | async as hasUnmet"
|
*tuiLet="hasUnmet() | async as hasUnmet"
|
||||||
tuiButton
|
tuiButton
|
||||||
@@ -88,20 +88,15 @@ import { getManifest } from 'src/app/utils/get-package-data'
|
|||||||
export class ServiceControlsComponent {
|
export class ServiceControlsComponent {
|
||||||
private readonly errors = inject(DepErrorService)
|
private readonly errors = inject(DepErrorService)
|
||||||
|
|
||||||
@Input({ required: true })
|
readonly pkg = input.required<PackageDataEntry>()
|
||||||
pkg!: PackageDataEntry
|
readonly status = input<PrimaryStatus>()
|
||||||
|
readonly manifest = computed(() => getManifest(this.pkg()))
|
||||||
@Input({ required: true })
|
|
||||||
status?: PrimaryStatus
|
|
||||||
|
|
||||||
readonly manifest = computed(() => getManifest(this.pkg))
|
|
||||||
|
|
||||||
readonly controls = inject(ControlsService)
|
readonly controls = inject(ControlsService)
|
||||||
|
|
||||||
readonly hasUnmet = computed(() =>
|
readonly hasUnmet = computed(() =>
|
||||||
this.errors.getPkgDepErrors$(this.manifest().id).pipe(
|
this.errors.getPkgDepErrors$(this.manifest().id).pipe(
|
||||||
map(errors =>
|
map(errors =>
|
||||||
Object.keys(this.pkg.currentDependencies)
|
Object.keys(this.pkg().currentDependencies)
|
||||||
.map(id => errors[id])
|
.map(id => errors[id])
|
||||||
.some(Boolean),
|
.some(Boolean),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -49,38 +49,49 @@ export class MarketplaceService {
|
|||||||
toStoreIdentity(start9, registries[start9]),
|
toStoreIdentity(start9, registries[start9]),
|
||||||
toStoreIdentity(community, registries[community]),
|
toStoreIdentity(community, registries[community]),
|
||||||
...Object.entries(registries)
|
...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)),
|
.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 currentRegistryUrl$ = new ReplaySubject<string>(1)
|
||||||
|
|
||||||
readonly requestErrors$ = new BehaviorSubject<string[]>([])
|
readonly requestErrors$ = new BehaviorSubject<string[]>([])
|
||||||
|
|
||||||
readonly marketplace$: Observable<Marketplace> = this.registries$.pipe(
|
readonly marketplace$: Observable<Marketplace> = combineLatest([
|
||||||
startWith<StoreIdentity[]>([]),
|
this.newRegistry$.pipe(
|
||||||
pairwise(),
|
mergeMap(({ url, name }) =>
|
||||||
mergeMap(([prev, curr]) =>
|
this.fetchRegistry$(url).pipe(
|
||||||
curr.filter(c => !prev.find(p => sameUrl(c.url, p.url))),
|
tap(data => {
|
||||||
),
|
if (data?.info.name)
|
||||||
mergeMap(({ url, name }) =>
|
this.updateRegistryName(url, name, data.info.name)
|
||||||
this.fetchRegistry$(url).pipe(
|
}),
|
||||||
tap(data => {
|
map(data => [url, data] satisfies [string, StoreDataWithUrl | null]),
|
||||||
if (data?.info.name)
|
startWith<[string, StoreDataWithUrl | null]>([url, null]),
|
||||||
this.updateRegistryName(url, name, data.info.name)
|
),
|
||||||
|
),
|
||||||
|
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>(
|
this.registries$,
|
||||||
(requests, [url, store]) => {
|
]).pipe(
|
||||||
requests[url] = store
|
map(([marketplace, registries]) =>
|
||||||
|
Object.fromEntries(
|
||||||
return requests
|
Object.entries(marketplace).filter(([url]) =>
|
||||||
},
|
registries.find(store => sameUrl(store.url, url)),
|
||||||
{},
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
shareReplay(1),
|
shareReplay(1),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user