ui: Prefer links over buttons with goto
This commit is contained in:
parent
f126ada97c
commit
711354967c
|
@ -44,10 +44,6 @@
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
function showDomain(event: CustomEvent<DomainInList>) {
|
||||
goto('/domains/' + encodeURIComponent(event.detail.domain));
|
||||
}
|
||||
</script>
|
||||
|
||||
<Container class="flex-fill pt-4 pb-5">
|
||||
|
@ -61,7 +57,7 @@
|
|||
button
|
||||
display_by_groups
|
||||
domains={filteredDomains}
|
||||
on:click={showDomain}
|
||||
links
|
||||
>
|
||||
<Badge slot="badges" color="success">
|
||||
OK
|
||||
|
@ -91,10 +87,9 @@
|
|||
<div class="card-header d-flex justify-content-between">
|
||||
{$t("provider.title")}
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
color="light"
|
||||
on:click={() => goto('/providers/new')}
|
||||
href="/providers/new"
|
||||
>
|
||||
<Icon name="plus" />
|
||||
</Button>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
export let isLoading = false;
|
||||
export let button = false;
|
||||
export let isActive: (item: any) => boolean = () => false;
|
||||
export let links = false;
|
||||
</script>
|
||||
|
||||
<ListGroup {...$$restProps}>
|
||||
|
@ -29,6 +30,7 @@
|
|||
active={isActive(item)}
|
||||
tag={button?"button":undefined}
|
||||
class="d-flex justify-content-between align-items-center"
|
||||
href={links ? item.href : undefined}
|
||||
on:click={() => dispatch("click", item)}
|
||||
>
|
||||
<slot {item} />
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
export let button = false;
|
||||
export let flush = false;
|
||||
export let links = false;
|
||||
export let display_by_groups = false;
|
||||
export let domains: Array<ZoneListDomain> = [];
|
||||
|
||||
|
@ -28,6 +29,7 @@
|
|||
|
||||
for (const domain of domains) {
|
||||
if (!domain.group) domain.group = "";
|
||||
if (links && !domain.href) domain.href = '/domains/' + encodeURIComponent(domain.domain);
|
||||
|
||||
if (tmp[domain.group] === undefined) {
|
||||
tmp[domain.group] = [];
|
||||
|
@ -65,6 +67,7 @@
|
|||
{button}
|
||||
{flush}
|
||||
items={gdomains}
|
||||
{links}
|
||||
on:click={(event) => dispatch("click", event.detail)}
|
||||
let:item={item}
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue