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>
const socket = io("http://localhost:8201", {
path: '/ws/socket.io',
query: 'id=1000_channel'
});
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
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',
query: 'id=1000_channel'
});
});
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>
<pre id="test">
+9 -4
View File
@@ -74,10 +74,15 @@ class Storage {
});
}
async readQueueAll() {
const all = await fsp.readFile(this.fileName,"utf-8");
return all.split("\n")
.filter(line => line.trim())
.map(line => JSON.parse(line));
let ret = [];
try {
const all = await fsp.readFile(this.fileName,"utf-8");
ret = all.split("\n")
.filter(line => line.trim())
.map(line => JSON.parse(line));
} catch (err) {}
return ret;
}
async readConfig() {