Create vue models without args
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
<script setup>
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
@@ -17,9 +15,10 @@ import Section from '../components/Section.vue';
|
||||
import DashboardModel from '../models/DashboardModel.js';
|
||||
import DomainsModel from '../models/DomainsModel.js';
|
||||
|
||||
const dashboardModel = DashboardModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const dashboardModel = DashboardModel.create();
|
||||
const domainsModel = DomainsModel.create();
|
||||
|
||||
const busy = ref(false);
|
||||
const domains = ref([]);
|
||||
const search = ref('');
|
||||
const dashboardDomain = ref('');
|
||||
@@ -113,12 +112,14 @@ async function refreshDomains() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
busy.value = true;
|
||||
await refreshDomains();
|
||||
|
||||
const [error, result] = await dashboardModel.getConfig();
|
||||
if (error) return console.error(error);
|
||||
|
||||
dashboardDomain.value = result.adminDomain;
|
||||
busy.value = false;
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -137,17 +138,17 @@ onMounted(async () => {
|
||||
|
||||
<p>{{ $t('domains.domainDialog.addDescription') }}</p>
|
||||
|
||||
<TableView :model="filteredDomains" :columns="columns" style="max-height: 200px;" @row-click="onEdit" :hover="false">
|
||||
<TableView :model="filteredDomains" :columns="columns" :busy="busy" style="max-height: 200px;" @row-click="onEdit">
|
||||
<template #provider="domain">
|
||||
{{ prettyProviderName(domain) }}
|
||||
</template>
|
||||
<template #actions="domain">
|
||||
<div class="table-actions">
|
||||
<ButtonGroup>
|
||||
<Button tool outline small secondary @click.stop="wellKnownDialog.open(domain)" v-tooltip="$t('domains.tooltipWellKnown')" icon="fa-solid fa-atlas" />
|
||||
<Button tool outline small secondary @click.stop="onEdit(domain)" v-tooltip="$t('domains.tooltipEdit')" icon="fa-solid fa-pencil-alt" />
|
||||
<Button tool small secondary @click.stop="wellKnownDialog.open(domain)" v-tooltip="$t('domains.tooltipWellKnown')" icon="fa-solid fa-atlas" />
|
||||
<Button tool small secondary @click.stop="onEdit(domain)" v-tooltip="$t('domains.tooltipEdit')" icon="fa-solid fa-pencil-alt" />
|
||||
</ButtonGroup>
|
||||
<Button tool outline small danger @click.stop="onRemove(domain)" v-tooltip="$t('domains.tooltipRemove')" :disabled="domain.domain === dashboardDomain" icon="fa-solid fa-trash-alt" />
|
||||
<Button tool small danger @click.stop="onRemove(domain)" v-tooltip="$t('domains.tooltipRemove')" :disabled="domain.domain === dashboardDomain" icon="fa-solid fa-trash-alt" />
|
||||
</div>
|
||||
</template>
|
||||
</TableView>
|
||||
|
||||
Reference in New Issue
Block a user