Create vue models without args
This commit is contained in:
@@ -5,16 +5,14 @@ import { FormGroup, Radiobutton, MultiSelect } from 'pankow';
|
||||
import UsersModel from '../models/UsersModel.js';
|
||||
import GroupsModel from '../models/GroupsModel.js';
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
const OPTIONS = Object.freeze({
|
||||
ANY: 'any',
|
||||
RESTRICTED: 'restricted',
|
||||
NOSSO: 'nosso',
|
||||
});
|
||||
|
||||
const usersModel = UsersModel.create(API_ORIGIN, localStorage.token);
|
||||
const groupsModel = GroupsModel.create(API_ORIGIN, localStorage.token);
|
||||
const usersModel = UsersModel.create();
|
||||
const groupsModel = GroupsModel.create();
|
||||
|
||||
const props = defineProps([ 'manifest', 'error' ]);
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -14,7 +12,7 @@ import { TOKEN_TYPES } from '../constants.js';
|
||||
import Section from './Section.vue';
|
||||
import TokensModel from '../models/TokensModel.js';
|
||||
|
||||
const tokensModel = TokensModel.create(API_ORIGIN, localStorage.token);
|
||||
const tokensModel = TokensModel.create();
|
||||
|
||||
const apiTokens = ref([]);
|
||||
const inputDialog = useTemplateRef('inputDialog');
|
||||
|
||||
@@ -11,16 +11,14 @@ import AppsModel from '../models/AppsModel.js';
|
||||
import DashboardModel from '../models/DashboardModel.js';
|
||||
import { PROXY_APP_ID } from '../constants.js';
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
const STEP = Object.freeze({
|
||||
DETAILS: Symbol('details'),
|
||||
INSTALL: Symbol('install'),
|
||||
});
|
||||
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const appsModel = AppsModel.create(API_ORIGIN, localStorage.token);
|
||||
const dashboardModel = DashboardModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create();
|
||||
const appsModel = AppsModel.create();
|
||||
const dashboardModel = DashboardModel.create();
|
||||
|
||||
// reactive
|
||||
const busy = ref(false);
|
||||
|
||||
@@ -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;
|
||||
@@ -14,8 +12,8 @@ import Section from './Section.vue';
|
||||
import AppPasswordsModel from '../models/AppPasswordsModel.js';
|
||||
import AppsModel from '../models/AppsModel.js';
|
||||
|
||||
const appPasswordsModel = AppPasswordsModel.create(API_ORIGIN, localStorage.token);
|
||||
const appsModel = AppsModel.create(API_ORIGIN, localStorage.token);
|
||||
const appPasswordsModel = AppPasswordsModel.create();
|
||||
const appsModel = AppsModel.create();
|
||||
|
||||
const newDialog = useTemplateRef('newDialog');
|
||||
const inputDialog = useTemplateRef('inputDialog');
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
<script>
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
import { Dialog, FormGroup, InputDialog, MultiSelect, Radiobutton, TagInput, TextInput } from 'pankow';
|
||||
|
||||
import ApplinksModel from '../models/ApplinksModel.js';
|
||||
import UsersModel from '../models/UsersModel.js';
|
||||
import GroupsModel from '../models/GroupsModel.js';
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
const accessToken = localStorage.token;
|
||||
|
||||
const applinksModel = ApplinksModel.create(API_ORIGIN, accessToken);
|
||||
const usersModel = UsersModel.create(API_ORIGIN, accessToken);
|
||||
const groupsModel = GroupsModel.create(API_ORIGIN, accessToken);
|
||||
const applinksModel = ApplinksModel.create();
|
||||
const usersModel = UsersModel.create();
|
||||
const groupsModel = GroupsModel.create();
|
||||
|
||||
export default {
|
||||
name: 'ApplinkDialog',
|
||||
|
||||
@@ -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 { ref, onMounted } from 'vue';
|
||||
import { Button, ProgressBar } from 'pankow';
|
||||
import { prettyLongDate } from 'pankow/utils';
|
||||
@@ -10,8 +8,8 @@ import Section from '../components/Section.vue';
|
||||
import TasksModel from '../models/TasksModel.js';
|
||||
import DomainsModel from '../models/DomainsModel.js';
|
||||
|
||||
const taskModel = TasksModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const taskModel = TasksModel.create();
|
||||
const domainsModel = DomainsModel.create();
|
||||
|
||||
const lastTask = ref({});
|
||||
const taskLogsMenu = ref([]);
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<script setup>
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Button } from 'pankow';
|
||||
import { prettyDate } from 'pankow/utils';
|
||||
import Section from '../components/Section.vue';
|
||||
import AppstoreModel from '../models/AppstoreModel.js';
|
||||
|
||||
const appstoreModel = AppstoreModel.create(API_ORIGIN, localStorage.token);
|
||||
const appstoreModel = AppstoreModel.create();
|
||||
|
||||
// TODO maybe support dev.console.cloudron.io
|
||||
const consoleServerOrigin = 'https://console.cloudron.io';
|
||||
|
||||
@@ -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 { ref, onMounted } from 'vue';
|
||||
import { Button, ProgressBar, Dropdown } from 'pankow';
|
||||
import { prettyLongDate } from 'pankow/utils';
|
||||
@@ -11,9 +9,9 @@ import TasksModel from '../models/TasksModel.js';
|
||||
import DomainsModel from '../models/DomainsModel.js';
|
||||
import DashboardModel from '../models/DashboardModel.js';
|
||||
|
||||
const taskModel = TasksModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const dashboardModel = DashboardModel.create(API_ORIGIN, localStorage.token);
|
||||
const taskModel = TasksModel.create();
|
||||
const domainsModel = DomainsModel.create();
|
||||
const dashboardModel = DashboardModel.create();
|
||||
|
||||
const domains = ref([]);
|
||||
const newDomain = ref('');
|
||||
|
||||
@@ -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 { ref, useTemplateRef } from 'vue';
|
||||
import { Dialog, TextInput, FormGroup, Checkbox } from 'pankow';
|
||||
import { ENDPOINTS_OVH } from '../constants.js';
|
||||
@@ -9,7 +7,7 @@ import DomainsModel from '../models/DomainsModel.js';
|
||||
|
||||
const emit = defineEmits([ 'success' ]);
|
||||
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create();
|
||||
|
||||
// currently, validation of wildcard with various provider is done server side
|
||||
const tlsProviders = [
|
||||
|
||||
@@ -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 { ref, onMounted, computed } from 'vue';
|
||||
import { Button, FormGroup, Checkbox, PasswordInput, TextInput } from 'pankow';
|
||||
import { copyToClipboard } from 'pankow/utils';
|
||||
@@ -10,9 +8,9 @@ import DomainsModel from '../models/DomainsModel.js';
|
||||
import DashboardModel from '../models/DashboardModel.js';
|
||||
import UserDirectoryModel from '../models/UserDirectoryModel.js';
|
||||
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const dashboardModel = DashboardModel.create(API_ORIGIN, localStorage.token);
|
||||
const userDirectoryModel = UserDirectoryModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create();
|
||||
const dashboardModel = DashboardModel.create();
|
||||
const userDirectoryModel = UserDirectoryModel.create();
|
||||
|
||||
const adminDomain = ref({});
|
||||
|
||||
|
||||
@@ -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 { ref, useTemplateRef, onMounted, computed } from 'vue';
|
||||
import { Dialog, Button, Icon, FormGroup, Dropdown, Checkbox, TextInput, ProgressBar } from 'pankow';
|
||||
import { prettyLongDate } from 'pankow/utils';
|
||||
@@ -10,8 +8,8 @@ import UserDirectoryModel from '../models/UserDirectoryModel.js';
|
||||
import TasksModel from '../models/TasksModel.js';
|
||||
import { TASK_TYPES } from '../constants.js';
|
||||
|
||||
const userDirectoryModel = UserDirectoryModel.create(API_ORIGIN, localStorage.token);
|
||||
const tasksModel = TasksModel.create(API_ORIGIN, localStorage.token);
|
||||
const userDirectoryModel = UserDirectoryModel.create();
|
||||
const tasksModel = TasksModel.create();
|
||||
|
||||
const availableProviders = [
|
||||
{ name: 'Active Directory', value: 'ad' },
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
import { ref, onMounted, useTemplateRef, computed } from 'vue';
|
||||
import { Dialog, FormGroup } from 'pankow';
|
||||
import Section from '../components/Section.vue';
|
||||
import NetworkModel from '../models/NetworkModel.js';
|
||||
|
||||
const networkModel = NetworkModel.create(API_ORIGIN, localStorage.token);
|
||||
const networkModel = NetworkModel.create();
|
||||
|
||||
const blocklistLength = ref(0);
|
||||
const blocklist = ref('');
|
||||
|
||||
@@ -28,7 +28,6 @@ export default {
|
||||
FileUploader,
|
||||
InputDialog,
|
||||
MainLayout,
|
||||
Menu,
|
||||
Notification,
|
||||
Breadcrumb,
|
||||
PreviewPanel,
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
import { ref, onMounted, useTemplateRef, computed } from 'vue';
|
||||
import { Button, Dialog, Dropdown, FormGroup, TextInput } from 'pankow';
|
||||
import Section from '../components/Section.vue';
|
||||
import NetworkModel from '../models/NetworkModel.js';
|
||||
|
||||
const networkModel = NetworkModel.create(API_ORIGIN, localStorage.token);
|
||||
const networkModel = NetworkModel.create();
|
||||
|
||||
// keep in sync with sysinfo.js
|
||||
const providers = [
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<script setup>
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
import { ref, onMounted, useTemplateRef, computed } from 'vue';
|
||||
import { Button, Dialog, Dropdown, FormGroup, TextInput } from 'pankow';
|
||||
import Section from '../components/Section.vue';
|
||||
import NetworkModel from '../models/NetworkModel.js';
|
||||
|
||||
const networkModel = NetworkModel.create(API_ORIGIN, localStorage.token);
|
||||
const networkModel = NetworkModel.create();
|
||||
|
||||
// keep in sync with sysinfo.js
|
||||
const providers = [
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
<script>
|
||||
|
||||
import { Button, InputDialog, TopBar, MainLayout } from 'pankow';
|
||||
|
||||
import LogsModel from '../models/LogsModel.js';
|
||||
import AppsModel from '../models/AppsModel.js';
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
export default {
|
||||
name: 'LogsViewer',
|
||||
components: {
|
||||
@@ -96,10 +93,10 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
this.logsModel = LogsModel.create(API_ORIGIN, this.accessToken, this.type, this.id);
|
||||
this.logsModel = LogsModel.create(this.type, this.id);
|
||||
|
||||
if (this.type === 'app') {
|
||||
this.appsModel = AppsModel.create(API_ORIGIN, this.accessToken, this.id);
|
||||
this.appsModel = AppsModel.create();
|
||||
|
||||
try {
|
||||
const app = await this.appsModel.get();
|
||||
|
||||
@@ -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;
|
||||
@@ -13,8 +11,8 @@ import Section from './Section.vue';
|
||||
import DashboardModel from '../models/DashboardModel.js';
|
||||
import UserDirectoryModel from '../models/UserDirectoryModel.js';
|
||||
|
||||
const dashboardModel = DashboardModel.create(API_ORIGIN, localStorage.token);
|
||||
const userDirectoryModel = UserDirectoryModel.create(API_ORIGIN, localStorage.token);
|
||||
const dashboardModel = DashboardModel.create();
|
||||
const userDirectoryModel = UserDirectoryModel.create();
|
||||
|
||||
const columns = {
|
||||
name: { label: 'Name', sort: true },
|
||||
|
||||
@@ -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;
|
||||
@@ -12,7 +10,7 @@ import { isValidDomainOrURL } from 'pankow/utils';
|
||||
import Section from '../components/Section.vue';
|
||||
import CloudronModel from '../models/CloudronModel.js';
|
||||
|
||||
const cloudronModel = CloudronModel.create(API_ORIGIN, localStorage.token);
|
||||
const cloudronModel = CloudronModel.create();
|
||||
|
||||
const providers = [
|
||||
{ name: 'AWS', value: 'aws' },
|
||||
|
||||
@@ -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 { ref, onMounted } from 'vue';
|
||||
import { Button, ProgressBar } from 'pankow';
|
||||
import { prettyLongDate } from 'pankow/utils';
|
||||
@@ -10,8 +8,8 @@ import Section from '../components/Section.vue';
|
||||
import TasksModel from '../models/TasksModel.js';
|
||||
import DomainsModel from '../models/DomainsModel.js';
|
||||
|
||||
const taskModel = TasksModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const taskModel = TasksModel.create();
|
||||
const domainsModel = DomainsModel.create();
|
||||
|
||||
const lastTask = ref({});
|
||||
const taskLogsMenu = ref([]);
|
||||
|
||||
@@ -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 { ref, onMounted, useTemplateRef } from 'vue';
|
||||
import { Button, Dialog, ProgressBar, Radiobutton, MultiSelect } from 'pankow';
|
||||
import { prettyLongDate } from 'pankow/utils';
|
||||
@@ -11,9 +9,9 @@ import UpdaterModel from '../models/UpdaterModel.js';
|
||||
import TasksModel from '../models/TasksModel.js';
|
||||
import DashboardModel from '../models/DashboardModel.js';
|
||||
|
||||
const tasksModel = TasksModel.create(API_ORIGIN, localStorage.token);
|
||||
const updaterModel = UpdaterModel.create(API_ORIGIN, localStorage.token);
|
||||
const dashboardModel = DashboardModel.create(API_ORIGIN, localStorage.token);
|
||||
const tasksModel = TasksModel.create();
|
||||
const updaterModel = UpdaterModel.create();
|
||||
const dashboardModel = DashboardModel.create();
|
||||
|
||||
// values correspond to cron days
|
||||
const cronDays = [
|
||||
|
||||
@@ -221,7 +221,7 @@ export default {
|
||||
this.id = id;
|
||||
this.name = id;
|
||||
|
||||
this.appsModel = AppsModel.create(API_ORIGIN, this.accessToken);
|
||||
this.appsModel = AppsModel.create();
|
||||
this.directoryModel = createDirectoryModel(API_ORIGIN, this.accessToken, `apps/${id}`);
|
||||
|
||||
const [error, app] = await this.appsModel.get(this.id);
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<script setup>
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
import { ref, useTemplateRef } from 'vue';
|
||||
import { Dialog, TextInput, FormGroup } from 'pankow';
|
||||
import DomainsModel from '../models/DomainsModel.js';
|
||||
|
||||
const emit = defineEmits([ 'success' ]);
|
||||
|
||||
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
|
||||
const domainsModel = DomainsModel.create();
|
||||
|
||||
const dialog = useTemplateRef('dialog');
|
||||
const busy = ref(false);
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'AppPasswordsModel',
|
||||
async list() {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'ApplinksModel',
|
||||
async list() {
|
||||
|
||||
@@ -64,7 +64,10 @@ function appProgressMessage(app) {
|
||||
return app.message || (app.error ? app.error.message : '');
|
||||
}
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
async function getTask(appId) {
|
||||
let error, result;
|
||||
try {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async list() {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'CloudronModel',
|
||||
async languages() {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async getConfig() {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async list() {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async search(actions, search, page, per_page) {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'GroupsModel',
|
||||
async list() {
|
||||
|
||||
@@ -24,7 +24,10 @@ function ab2str(buf) {
|
||||
return String.fromCharCode.apply(null, new Uint16Array(buf));
|
||||
}
|
||||
|
||||
export function create(origin, accessToken, type, id) {
|
||||
export function create(type, id) {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
const INITIAL_STREAM_LINES = 100;
|
||||
|
||||
let eventSource = null;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async getIpv4Config() {
|
||||
let error, result;
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
import { ROLES } from '../constants.js';
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'ProfileModel',
|
||||
async logout() {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async list() {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async memory() {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async getLatestByType(type) {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'TokensModel',
|
||||
async list() {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async info() {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
async getGlobalProfileConfig() {
|
||||
let error, result;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
function create(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'UsersModel',
|
||||
async list() {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
|
||||
import { fetcher } from 'pankow';
|
||||
|
||||
export function createVolumesModel(origin, accessToken) {
|
||||
function create() {
|
||||
const accessToken = localStorage.token;
|
||||
const origin = import.meta.env.VITE_API_ORIGIN || window.location.origin;
|
||||
|
||||
return {
|
||||
name: 'VolumesModel',
|
||||
async list() {
|
||||
@@ -93,5 +96,5 @@ export function createVolumesModel(origin, accessToken) {
|
||||
}
|
||||
|
||||
export default {
|
||||
createVolumesModel
|
||||
create
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -7,9 +7,7 @@ import AppInstallDialog from '../components/AppInstallDialog.vue';
|
||||
import ApplinkDialog from '../components/ApplinkDialog.vue';
|
||||
import { PROXY_APP_ID } from '../constants.js';
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
|
||||
const appstoreModel = AppstoreModel.create(API_ORIGIN, localStorage.token);
|
||||
const appstoreModel = AppstoreModel.create();
|
||||
|
||||
const ready = ref(false);
|
||||
const proxyApp = ref();
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
@@ -12,8 +10,8 @@ import { useDebouncedRef, prettyDate, prettyLongDate, prettyBinarySize } from 'p
|
||||
import AppsModel from '../models/AppsModel.js';
|
||||
import EventlogsModel from '../models/EventlogsModel.js';
|
||||
|
||||
const appsModel = AppsModel.create(API_ORIGIN, localStorage.token);
|
||||
const eventlogsModel = EventlogsModel.create(API_ORIGIN, localStorage.token);
|
||||
const appsModel = AppsModel.create();
|
||||
const eventlogsModel = EventlogsModel.create();
|
||||
|
||||
function getApp(id) {
|
||||
return apps.value.find(a => a.id === id);
|
||||
|
||||
@@ -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 { ref, onMounted, watch } from 'vue';
|
||||
import { Switch } from 'pankow';
|
||||
import Section from '../components/Section.vue';
|
||||
@@ -10,7 +8,7 @@ import Ipv6Config from '../components/Ipv6Config.vue';
|
||||
import Firewall from '../components/Firewall.vue';
|
||||
import NetworkModel from '../models/NetworkModel.js';
|
||||
|
||||
const networkModel = NetworkModel.create(API_ORIGIN, localStorage.token);
|
||||
const networkModel = NetworkModel.create();
|
||||
|
||||
const dynDnsIsEnabled = ref(false);
|
||||
watch(dynDnsIsEnabled, async (newValue) => {
|
||||
|
||||
@@ -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,9 @@ import ProfileModel from '../models/ProfileModel.js';
|
||||
import CloudronModel from '../models/CloudronModel.js';
|
||||
import TokensModel from '../models/TokensModel.js';
|
||||
|
||||
const profileModel = ProfileModel.create(API_ORIGIN, localStorage.token);
|
||||
const cloudronModel = CloudronModel.create(API_ORIGIN, localStorage.token);
|
||||
const tokensModel = TokensModel.create(API_ORIGIN, localStorage.token);
|
||||
const profileModel = ProfileModel.create();
|
||||
const cloudronModel = CloudronModel.create();
|
||||
const tokensModel = TokensModel.create();
|
||||
|
||||
const config = ref({}); // TODO what is this?
|
||||
const user = ref({});
|
||||
|
||||
@@ -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;
|
||||
@@ -15,9 +13,9 @@ import ServicesModel from '../models/ServicesModel.js';
|
||||
import SystemModel from '../models/SystemModel.js';
|
||||
import AppsModel from '../models/AppsModel.js';
|
||||
|
||||
const appsModel = AppsModel.create(API_ORIGIN, localStorage.token);
|
||||
const servicesModel = ServicesModel.create(API_ORIGIN, localStorage.token);
|
||||
const systemModel = SystemModel.create(API_ORIGIN, localStorage.token);
|
||||
const appsModel = AppsModel.create();
|
||||
const servicesModel = ServicesModel.create();
|
||||
const systemModel = SystemModel.create();
|
||||
|
||||
const columns = {
|
||||
status: {},
|
||||
|
||||
@@ -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;
|
||||
@@ -14,7 +12,7 @@ import SystemUpdate from '../components/SystemUpdate.vue';
|
||||
import PrivateRegistry from '../components/PrivateRegistry.vue';
|
||||
import CloudronModel from '../models/CloudronModel.js';
|
||||
|
||||
const cloudronModel = CloudronModel.create(API_ORIGIN, localStorage.token);
|
||||
const cloudronModel = CloudronModel.create();
|
||||
|
||||
// Timezone
|
||||
const allTimezones = window.timezones;
|
||||
|
||||
@@ -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 { ref, onMounted } from 'vue';
|
||||
import { Button, Checkbox } from 'pankow';
|
||||
import Section from '../components/Section.vue';
|
||||
@@ -10,7 +8,7 @@ import ExposedLdap from '../components/ExposedLdap.vue';
|
||||
import OpenIdClients from '../components/OpenIdClients.vue';
|
||||
import UserDirectoryModel from '../models/UserDirectoryModel.js';
|
||||
|
||||
const userDirectoryModel = UserDirectoryModel.create(API_ORIGIN, localStorage.token);
|
||||
const userDirectoryModel = UserDirectoryModel.create();
|
||||
|
||||
const editableUserProfiles = ref(false);
|
||||
const mandatory2FA = ref(false);
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
<script>
|
||||
|
||||
import { Button, ButtonGroup, Checkbox, Dialog, Dropdown, FormGroup, InputDialog, NumberInput, PasswordInput, TableView, TextInput } from 'pankow';
|
||||
|
||||
import Section from '../components/Section.vue';
|
||||
import VolumesModel from '../models/VolumesModel.js';
|
||||
|
||||
import { createVolumesModel } from '../models/VolumesModel.js';
|
||||
|
||||
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
|
||||
const accessToken = localStorage.token;
|
||||
|
||||
const volumesModel = createVolumesModel(API_ORIGIN, accessToken);
|
||||
const volumesModel = VolumesModel.create();
|
||||
|
||||
export default {
|
||||
name: 'VolumesView',
|
||||
|
||||
Reference in New Issue
Block a user