rewrite connections, messages system, add dm message history, fix multiple bugs, update machine-client

This commit is contained in:
2026-04-11 13:40:13 +02:00
parent 9804a700ce
commit 47c0bcbb0a
8 changed files with 346 additions and 57 deletions
+14 -14
View File
@@ -115,10 +115,10 @@
'new-connection': {
title: 'POST /new/connection — send connection request',
fields: [
{ id: 'nconn-token', label: 'token', ph: '' },
{ id: 'nconn-recipientid', label: 'recipientid', ph: 'uint32' },
{ id: 'nconn-token', label: 'token', ph: '' },
{ id: 'nconn-recipient', label: 'recipient', ph: 'uint32' },
],
submit: () => httpPost('/new/connection', { token:'nconn-token', recipientid:'nconn-recipientid' })
submit: () => httpPost('/new/connection', { token:'nconn-token', recipient:'nconn-recipient' })
},
'new-token': {
title: 'POST /new/token — login / get token',
@@ -157,18 +157,18 @@
'accept-connection': {
title: 'POST /mod/connection/accept — accept connection request',
fields: [
{ id: 'ca-token', label: 'token', ph: '' },
{ id: 'ca-connectedid', label: 'connectedid', ph: 'uint32' },
{ id: 'ca-token', label: 'token', ph: '' },
{ id: 'ca-connectionid', label: 'connectionid', ph: 'UUID' },
],
submit: () => httpPost('/mod/connection/accept', { token:'ca-token', connectedid:'ca-connectedid' })
submit: () => httpPost('/mod/connection/accept', { token:'ca-token', connectionid:'ca-connectionid' })
},
'delete-connection': {
title: 'POST /mod/connection/delete — delete connection',
fields: [
{ id: 'cd-token', label: 'token', ph: '' },
{ id: 'cd-connectedid', label: 'connectedid', ph: 'uint32' },
{ id: 'cd-token', label: 'token', ph: '' },
{ id: 'cd-connectionid', label: 'connectionid', ph: 'UUID' },
],
submit: () => httpPost('/mod/connection/delete', { token:'cd-token', connectedid:'cd-connectedid' })
submit: () => httpPost('/mod/connection/delete', { token:'cd-token', connectionid:'cd-connectionid' })
},
'add-users': {
title: 'POST /mod/group/addusers — add users (owner only)',
@@ -239,11 +239,11 @@
'msg-user': {
title: 'POST /msg/user — send direct message to user',
fields: [
{ id: 'mu-token', label: 'token', ph: '' },
{ id: 'mu-recipientid', label: 'recipientid', ph: 'uint32' },
{ id: 'mu-message', label: 'message', ph: 'message text' },
{ id: 'mu-token', label: 'token', ph: '' },
{ id: 'mu-connectionid', label: 'connectionid', ph: 'UUID' },
{ id: 'mu-msgContent', label: 'msgContent', ph: 'message text' },
],
submit: () => httpPost('/msg/user', { token:'mu-token', recipientid:'mu-recipientid', message:'mu-message' })
submit: () => httpPost('/msg/user', { token:'mu-token', connectionid:'mu-connectionid', msgContent:'mu-msgContent' })
},
'msg-group': {
title: 'POST /msg/group — send message to group',
@@ -351,7 +351,7 @@
const text = await resp.text();
log(`HTTP ${resp.status}`, text, resp.ok ? 'log-http' : 'log-err');
if (path === '/new/token' && resp.ok) {
currentToken = text.trim();
try { currentToken = JSON.parse(text).token; } catch(e) {}
autofillTokens();
wsConnectAndAuth();
}