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
+4 -1
View File
@@ -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() {
+4 -1
View File
@@ -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() {
+4 -1
View File
@@ -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 {
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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() {
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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() {
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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() {
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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() {
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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;
+4 -1
View File
@@ -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() {
+5 -2
View File
@@ -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
};