add network

This commit is contained in:
xds
2025-10-31 15:22:44 +03:00
parent 6ab7a490c9
commit 5b56eb17fd
33 changed files with 1435 additions and 342 deletions

View File

@@ -6,23 +6,20 @@ import {Divider} from "primevue";
const toolbar = useToolbarStore()
const keyOf = (b: { id?: string; text?: string }) => b.id ?? b.text ?? crypto.randomUUID()
</script>
<template>
<nav class="h-12 w-fit flex flex-row items-center gap-2 p-2 bg-white rounded-full sticky top-10 justify-items-end justify-end">
<nav class="h-12 w-fit flex flex-row items-center gap-2 p-2 bg-white rounded-full sticky top-10 justify-end">
<component
v-for="btnKey in toolbar.current.keys()"
:is="toolbar.current[btnKey].to ? RouterLink : 'button'"
:key="btnKey"
class="flex flex-row gap-2 items-center "
:title="toolbar.current[btnKey].title || toolbar.current[btnKey].text"
v-bind="toolbar.current[btnKey].to ? { to: toolbar.current[btnKey].to } : { type: 'button', disabled: toolbar.current[btnKey].disabled }"
@click="!toolbar.current[btnKey].to && toolbar.invoke(toolbar.current[btnKey].onClickId)"
v-for="(btn, idx) in toolbar.current"
:key="btn.id || btn.text || idx"
:is="btn.to ? RouterLink : 'button'"
class="flex flex-row gap-2 items-center"
:title="btn.title || btn.text"
v-bind="btn.to ? { to: btn.to } : { type: 'button', disabled: btn.disabled }"
@click="!btn.to && toolbar.invoke(btn.onClickId)"
>
<i v-if="toolbar.current[btnKey].icon" :class="toolbar.current[btnKey].icon" class="!p-2"/>
<span v-if="toolbar.current[btnKey].text">{{ toolbar.current[btnKey].text }}</span>
<Divider v-if="btnKey+1 != toolbar.current.length" class="!m-0" layout="vertical"/>
<i v-if="btn.icon" :class="btn.icon" class="!p-2" />
<span v-if="btn.text">{{ btn.text }}</span>
<Divider v-if="idx + 1 !== toolbar.current.length" class="!m-0" layout="vertical" />
</component>
</nav>
</template>