Create vue models without args

This commit is contained in:
Johannes Zellner
2025-01-31 21:02:48 +01:00
parent dfba9d3650
commit 71e9caef9c
52 changed files with 150 additions and 151 deletions
+6 -8
View File
@@ -1,19 +1,17 @@
<script>
import { Button, ButtonGroup, Dropdown, Icon, TableView, TextInput } from 'pankow';
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
import { Button, ButtonGroup, Dropdown, Icon, TableView, TextInput } from 'pankow';
import { APP_TYPES, HSTATES, ISTATES, RSTATES } from '../constants.js';
import AppsModel from '../models/AppsModel.js';
import ApplinksModel from '../models/ApplinksModel.js';
import DomainsModel from '../models/DomainsModel.js';
import ApplinkDialog from '../components/ApplinkDialog.vue';
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
const accessToken = localStorage.token;
const appsModel = AppsModel.create(API_ORIGIN, accessToken);
const domainsModel = DomainsModel.create(API_ORIGIN, accessToken);
const applinksModel = ApplinksModel.create(API_ORIGIN, accessToken);
const appsModel = AppsModel.create();
const domainsModel = DomainsModel.create();
const applinksModel = ApplinksModel.create();
const VIEW_TYPE = {
LIST: 'list',
@@ -161,7 +159,7 @@ export default {
applink.installationState = ISTATES.INSTALLED;
applink.runState = RSTATES.RUNNING;
applink.health = HSTATES.HEALTHY;
applink.iconUrl = `/api/v1/applinks/${applink.id}/icon?access_token=${accessToken}&ts=${applink.ts}`;
applink.iconUrl = `/api/v1/applinks/${applink.id}/icon?access_token=${localStorage.token}&ts=${applink.ts}`;
applink.accessLevel = this.$root.profile.isAtLeastAdmin ? 'admin' : 'user';
apps.push(applink);