This commit is contained in:
ManeraKai 2024-08-07 18:32:57 +03:00
parent ed67e70552
commit e3517b1076
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337

View File

@ -27,6 +27,8 @@
$: serviceConf = _config.services[selectedService] $: serviceConf = _config.services[selectedService]
$: serviceOptions = _options[selectedService] $: serviceOptions = _options[selectedService]
$: frontendWebsite = serviceConf.frontends[serviceOptions.frontend].url $: frontendWebsite = serviceConf.frontends[serviceOptions.frontend].url
$: servicesEntries = Object.entries(_config.services)
$: frontendEntries = Object.entries(serviceConf.frontends)
</script> </script>
<div> <div>
@ -41,9 +43,10 @@
clearable={false} clearable={false}
class="svelte_select" class="svelte_select"
value={selectedService} value={selectedService}
on:hoverItem={e => (selectedService = servicesEntries[e.detail][0])}
on:change={e => (selectedService = e.detail.value)} on:change={e => (selectedService = e.detail.value)}
items={[ items={[
...Object.entries(_config.services).map(([serviceKey, service]) => { ...servicesEntries.map(([serviceKey, service]) => {
return { value: serviceKey, label: service.name } return { value: serviceKey, label: service.name }
}), }),
]} ]}
@ -102,12 +105,16 @@
dir="ltr" dir="ltr"
class="svelte_select" class="svelte_select"
value={serviceOptions.frontend} value={serviceOptions.frontend}
on:hoverItem={e => {
serviceOptions.frontend = frontendEntries[e.detail][0]
options.set(_options)
}}
on:change={e => { on:change={e => {
serviceOptions.frontend = e.detail.value serviceOptions.frontend = e.detail.value
options.set(_options) options.set(_options)
}} }}
items={[ items={[
...Object.entries(serviceConf.frontends).map(([frontendId, frontend]) => ({ ...frontendEntries.map(([frontendId, frontend]) => ({
value: frontendId, value: frontendId,
label: frontend.name, label: frontend.name,
})), })),