hermes testgs

This commit is contained in:
2026-07-02 11:48:00 +02:00
parent c99602eb53
commit 4b9c13e1fd
4 changed files with 62 additions and 19 deletions
+27
View File
@@ -0,0 +1,27 @@
services:
push:
build:
context: .
dockerfile: ./Dockerfile
restart: unless-stopped
environment:
PORT: 8080
DEV: "1"
ports:
- "8201:8080"
volumes:
- ./src:/srv/app
- ./storage:/storage
- ./database:/database
php:
build:
context: .
dockerfile: ./php-test/Dockerfile
restart: unless-stopped
depends_on:
- push
ports:
- "8123:80"
volumes:
- ./public/:/var/www/html
+6
View File
@@ -0,0 +1,6 @@
FROM php:8.2-apache
RUN apt-get update \
&& apt-get install -y --no-install-recommends libcurl4-openssl-dev \
&& docker-php-ext-install curl \
&& rm -rf /var/lib/apt/lists/*
+8 -3
View File
@@ -1,10 +1,13 @@
<script src="http://localhost:8201/ws/socket.io/socket.io.js"></script>
<!-- <script src="/ws/socket.io/socket.io.min.js"></script>-->
<script> <script>
const socket = io("http://localhost:8201", { const socketBase = `${window.location.protocol}//${window.location.hostname}:8201`;
const script = document.createElement('script');
script.src = `${socketBase}/ws/socket.io/socket.io.js`;
script.onload = () => {
const socket = io(socketBase, {
path: '/ws/socket.io', path: '/ws/socket.io',
query: 'id=1000_channel' query: 'id=1000_channel'
}); });
socket.on('data', (arg, callback) => { socket.on('data', (arg, callback) => {
const doc = document.getElementById('test'); const doc = document.getElementById('test');
const div = document.createElement('div'); const div = document.createElement('div');
@@ -15,6 +18,8 @@
received: true received: true
}); });
}); });
};
document.head.appendChild(script);
</script> </script>
<pre id="test"> <pre id="test">
+6 -1
View File
@@ -74,10 +74,15 @@ class Storage {
}); });
} }
async readQueueAll() { async readQueueAll() {
let ret = [];
try {
const all = await fsp.readFile(this.fileName,"utf-8"); const all = await fsp.readFile(this.fileName,"utf-8");
return all.split("\n") ret = all.split("\n")
.filter(line => line.trim()) .filter(line => line.trim())
.map(line => JSON.parse(line)); .map(line => JSON.parse(line));
} catch (err) {}
return ret;
} }
async readConfig() { async readConfig() {