Give base url to image assets in filemanager

This commit is contained in:
Johannes Zellner
2023-04-16 18:39:18 +02:00
parent d8e9807d6d
commit 05065fca0e
2 changed files with 10 additions and 9 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ import { TextEditor, ImageViewer } from 'pankow';
import { createDirectoryModel } from '../models/DirectoryModel.js';
import { sanitize } from 'pankow/utils';
const BASE_URL = import.meta.env.VITE_API_ORIGIN ? 'https://' + import.meta.env.VITE_API_ORIGIN : '';
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? 'https://' + import.meta.env.VITE_API_ORIGIN : '';
export default {
name: 'Viewer',
@@ -47,7 +47,7 @@ export default {
const fileName = this.$route.params.filePath[this.$route.params.filePath.length-1];
const parentDirectoryPath = sanitize(this.filePath.split('/').slice(0, -1).join('/'));
this.directoryModel = createDirectoryModel(BASE_URL, localStorage.accessToken, (this.resourceType === 'volume' ? 'volumes/' : 'apps/') + this.resourceId);
this.directoryModel = createDirectoryModel(API_ORIGIN, localStorage.token, (this.resourceType === 'volume' ? 'volumes/' : 'apps/') + this.resourceId);
const files = await this.directoryModel.listFiles(parentDirectoryPath);
this.item = files.find(i => i.fileName === fileName);