Admin panel updated with shadcn-vue components

This commit is contained in:
Simon Pocrnjič
2026-01-05 18:27:35 +01:00
parent 70a5d015e0
commit c4d9ecb39e
37 changed files with 5407 additions and 3740 deletions
+9 -7
View File
@@ -751,14 +751,16 @@ async function fetchColumns() {
async function applyTemplateToImport() {
if (!importId.value || !form.value.import_template_id) return;
// Find the selected template to get its UUID
const template = (props.templates || []).find((t) => t.id === form.value.import_template_id);
const template = (props.templates || []).find(
(t) => t.id === form.value.import_template_id
);
if (!template?.uuid) {
console.error('Template UUID not found');
console.error("Template UUID not found");
return;
}
try {
if (templateApplied.value) {
const ok = window.confirm(
@@ -1137,12 +1139,12 @@ async function fetchSimulation() {
// V2 format
paymentSimRows.value = Array.isArray(data?.rows) ? data.rows : [];
paymentSimSummary.value = data?.summaries || null;
// Extract unique entity types from rows for SimulationModal
const entitySet = new Set();
for (const row of data?.rows || []) {
if (row.entities && typeof row.entities === 'object') {
Object.keys(row.entities).forEach(key => entitySet.add(key));
if (row.entities && typeof row.entities === "object") {
Object.keys(row.entities).forEach((key) => entitySet.add(key));
}
}
paymentSimEntities.value = Array.from(entitySet);
@@ -2,7 +2,13 @@
import { Card, CardContent, CardHeader, CardTitle } from "@/Components/ui/card";
import { Label } from "@/Components/ui/label";
import { Input } from "@/Components/ui/input";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/Components/ui/select";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/Components/ui/select";
import { Checkbox } from "@/Components/ui/checkbox";
import { Button } from "@/Components/ui/button";
import AppMultiSelect from "@/Components/app/ui/AppMultiSelect.vue";
@@ -30,7 +36,7 @@ const emit = defineEmits(["save"]);
<Label for="name">Ime predloge</Label>
<Input id="name" v-model="form.name" type="text" />
</div>
<div class="space-y-2">
<Label for="source_type">Vir</Label>
<Select v-model="form.source_type">
@@ -82,7 +88,6 @@ const emit = defineEmits(["save"]);
<SelectValue placeholder="(Auto-detect)" />
</SelectTrigger>
<SelectContent>
<SelectItem value=",">Vejica ,</SelectItem>
<SelectItem value=";">Podpičje ;</SelectItem>
<SelectItem value="\t">Tab \t</SelectItem>
@@ -146,19 +151,11 @@ const emit = defineEmits(["save"]);
<div class="flex items-center gap-6">
<div class="flex items-center gap-2">
<Checkbox
id="is_active"
:checked="form.is_active"
@update:checked="form.is_active = $event"
/>
<Checkbox id="is_active" v-model="form.is_active" />
<Label for="is_active" class="cursor-pointer">Aktivna</Label>
</div>
<div class="flex items-center gap-2">
<Checkbox
id="reactivate"
:checked="form.reactivate"
@update:checked="form.reactivate = $event"
/>
<Checkbox id="reactivate" v-model="form.reactivate" />
<Label for="reactivate" class="cursor-pointer">Reaktivacija</Label>
</div>
<Button @click="emit('save')" class="ml-auto">Shrani</Button>