Skip to content

Commit

Permalink
Test4 (#35)
Browse files Browse the repository at this point in the history
* Compiled main.go and pushed changes

* test

* 适配了频道私聊,用bolt数据库取代ini

* 适配了nonebot2

* add license

* add a lot

* trss support

* add action

* add action

* add action

* fixbug

* add wss

* bugfix

* fix action

* fix action again

* fa

* fix

* add a lot

* add ws server token

* bugifx

* fixat

* bugfix

* bugfix

* test

* test2

* add url service

* add url service

* bugfix

* fix

* fix

* fix

* bug fix

* fix

* test

* add webui

* add image_compress

* bug fix

* fix cq code

* fixbug
  • Loading branch information
Hoshinonyaruko authored Nov 3, 2023
1 parent 47d71aa commit b94be62
Show file tree
Hide file tree
Showing 23 changed files with 52 additions and 7 deletions.
33 changes: 29 additions & 4 deletions frontend/src/pages/AccountDetailView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -195,21 +195,46 @@ async function sendStdin() {
}
}
let lastConnectionTime = 0;
const connectionCooldown = 2000; // 1秒间隔
async function processLog() {
const currentTime = Date.now();
// 如果当前时间与上次连接时间小于1秒,则不再次连接
if (currentTime - lastConnectionTime < connectionCooldown) {
return;
}
// 更新上次连接时间
lastConnectionTime = currentTime;
// 获取日志数据
const { data } = await api.processLogsHistoryApiUinProcessLogsGet(props.uin);
logs.value = data;
// 如果WebSocket连接已经打开,直接返回不再重新连接
if (logConnection.value && logConnection.value.readyState === WebSocket.OPEN) {
return;
}
// 关闭现有的WebSocket连接
logConnection.value?.close();
// 建立新的WebSocket连接
const wsUrl = new URL(`api/${props.uin}/process/logs`, location.href);
wsUrl.protocol = wsUrl.protocol === 'https:' ? 'wss:' : 'ws:';
wsUrl.protocol = wsUrl.protocol.replace('http', 'ws');
logConnection.value = new WebSocket(wsUrl.href);
logConnection.value.onmessage = ({ data }) =>
logs.value.push(JSON.parse(data as string) as ProcessLog);
logConnection.value.onclose = () => (logConnection.value = undefined);
logConnection.value.onmessage = ({ data }) => {
logs.value.push(JSON.parse(data as string) as ProcessLog);
};
logConnection.value.onclose = () => {
logConnection.value = undefined;
};
}
const updateTimer = window.setInterval(() => void updateStatus(), 3000);
watch(
Expand Down
1 change: 1 addition & 0 deletions webui/dist/css/25.30b9583b.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/css/749.30b9583b.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webui/dist/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><title>Gensokyo</title><meta charset=utf-8><meta name=description content=""><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=icons/favicon-16x16.png><link rel=icon type=image/ico href=favicon.ico><script defer src=js/291.7e5d13e6.js></script><script defer src=js/361.44b62bc2.js></script><script defer src=js/957.faa3bf0b.js></script><script defer src=js/app.09ce8a25.js></script><link href=css/app.3ba06184.css rel=stylesheet></head><body><div id=q-app></div></body></html>
<!DOCTYPE html><html><head><title>Gensokyo</title><meta charset=utf-8><meta name=description content=""><meta name=format-detection content="telephone=no"><meta name=msapplication-tap-highlight content=no><meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width"><link rel=icon type=image/png sizes=128x128 href=icons/favicon-128x128.png><link rel=icon type=image/png sizes=96x96 href=icons/favicon-96x96.png><link rel=icon type=image/png sizes=32x32 href=icons/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=icons/favicon-16x16.png><link rel=icon type=image/ico href=favicon.ico><script defer src=js/291.7e5d13e6.js></script><script defer src=js/361.44b62bc2.js></script><script defer src=js/957.faa3bf0b.js></script><script defer src=js/app.a007a4bb.js></script><link href=css/app.3ba06184.css rel=stylesheet></head><body><div id=q-app></div></body></html>
1 change: 1 addition & 0 deletions webui/dist/js/25.ef2ddf24.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions webui/dist/js/394.0e7479e4.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/394.1e234b3c.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/394.4d38b32c.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/394.5c244a12.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/394.6b6a7a00.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/394.d672535a.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/394.e0b366bd.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/394.ed6d6710.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/749.b909c063.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions webui/dist/js/app.17d42611.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/app.31e8dad0.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/app.3cb8a4b8.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/app.4e5da4f8.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/app.a007a4bb.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/app.b026a97a.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/app.c71c8fea.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/dist/js/app.f911c142.js

Large diffs are not rendered by default.

Loading

0 comments on commit b94be62

Please sign in to comment.