Frontend created and rewritten a few times, with some backend fixes #1

Merged
leo merged 110 commits from plaintable into main 2023-11-08 20:38:40 +00:00
6 changed files with 14 additions and 11 deletions
Showing only changes of commit 4bc9cf4534 - Show all commits

View File

@ -28,9 +28,12 @@ import { watchEffect, ref } from 'vue'
import Router from '@/router/index'; import Router from '@/router/index';
import { url_document_get } from '@/repositories/Document'; import { url_document_get } from '@/repositories/Document';
const dataURL = ref('') const dataURL = ref<string>('')
watchEffect(()=>{ watchEffect(()=>{
dataURL.value = url_document_get + Router.currentRoute.value.path dataURL.value = new URL(
url_document_get + Router.currentRoute.value.path,
location.origin.replace( /^http/, 'ws')
).toString();
}) })
const emit = defineEmits({ const emit = defineEmits({
visibleImg(value: boolean){ visibleImg(value: boolean){

View File

@ -1,7 +1,7 @@
import axios from 'axios' import axios from 'axios'
/* Base domain for all request */ /* Base domain for all request */
export const baseURL = import.meta.env.VITE_URL_DOCUMENT_GET export const baseURL = import.meta.env.VITE_URL_DOCUMENT
/* Config Client*/ /* Config Client*/
const Client = axios.create({ const Client = axios.create({

View File

@ -24,9 +24,9 @@ export type FileDocument = BaseDocument & {
export type Document = FolderDocument | FileDocument; export type Document = FolderDocument | FileDocument;
export const url_document_watch_ws = import.meta.env.VITE_URL_DOCUMENT_WATCH_WS export const url_document_watch_ws = '/api/watch'
export const url_document_upload_ws = import.meta.env.VITE_URL_DOCUMENT_UPLOAD_WS export const url_document_upload_ws = '/api/upload'
export const url_document_get = import.meta.env.VITE_URL_DOCUMENT_GET export const url_document_get ='/files'
export class DocumentHandler { export class DocumentHandler {
constructor( private store: DocumentStore = useDocumentStore() ) { constructor( private store: DocumentStore = useDocumentStore() ) {

View File

@ -1,5 +1,5 @@
function createWebSocket(url: string, eventHandler: (event: MessageEvent) => void) { function createWebSocket(url: string, eventHandler: (event: MessageEvent) => void) {
const urlObject = new URL(url); const urlObject = new URL(url, location.origin.replace( /^http/, 'ws'));
const webSocket = new WebSocket(urlObject); const webSocket = new WebSocket(urlObject);
webSocket.onmessage = eventHandler; webSocket.onmessage = eventHandler;
return webSocket; return webSocket;

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Vite Vasanko</title> <title>Vite Vasanko</title>
<script type="module" crossorigin src="/assets/index-5620eb6e.js"></script> <script type="module" crossorigin src="/assets/index-5b9f340c.js"></script>
<link rel="stylesheet" href="/assets/index-fe1bb208.css"> <link rel="stylesheet" href="/assets/index-fe1bb208.css">
</head> </head>
<body> <body>