hermes testgs
This commit is contained in:
@@ -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
|
||||||
@@ -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
@@ -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
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user