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/*
+20 -15
View File
@@ -1,20 +1,25 @@
<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`;
path: '/ws/socket.io', const script = document.createElement('script');
query: 'id=1000_channel' script.src = `${socketBase}/ws/socket.io/socket.io.js`;
}); script.onload = () => {
socket.on('data', (arg, callback) => { const socket = io(socketBase, {
const doc = document.getElementById('test'); path: '/ws/socket.io',
const div = document.createElement('div'); query: 'id=1000_channel'
div.innerHTML = JSON.stringify(arg);
doc.append(div);
callback({
received: true
}); });
});
socket.on('data', (arg, callback) => {
const doc = document.getElementById('test');
const div = document.createElement('div');
div.innerHTML = JSON.stringify(arg);
doc.append(div);
callback({
received: true
});
});
};
document.head.appendChild(script);
</script> </script>
<pre id="test"> <pre id="test">
+9 -4
View File
@@ -74,10 +74,15 @@ class Storage {
}); });
} }
async readQueueAll() { async readQueueAll() {
const all = await fsp.readFile(this.fileName,"utf-8"); let ret = [];
return all.split("\n") try {
.filter(line => line.trim()) const all = await fsp.readFile(this.fileName,"utf-8");
.map(line => JSON.parse(line)); ret = all.split("\n")
.filter(line => line.trim())
.map(line => JSON.parse(line));
} catch (err) {}
return ret;
} }
async readConfig() { async readConfig() {