Промежуточный комит для отдачи задания брату
This commit is contained in:
parent
c0fba4af94
commit
78e62997d1
50
build.gradle
50
build.gradle
@ -113,8 +113,36 @@ tasks.named('test') {
|
|||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register('itCleanRun', JavaExec) {
|
tasks.register('cleanServerLogs') {
|
||||||
group = "build"
|
group = "!!test"
|
||||||
|
description = "Clear server logs/app.log and remove rolled log files"
|
||||||
|
|
||||||
|
doLast {
|
||||||
|
File logsDir = file('logs')
|
||||||
|
if (!logsDir.exists()) {
|
||||||
|
logsDir.mkdirs()
|
||||||
|
}
|
||||||
|
|
||||||
|
File appLog = new File(logsDir, 'app.log')
|
||||||
|
if (!appLog.exists()) {
|
||||||
|
appLog.createNewFile()
|
||||||
|
}
|
||||||
|
appLog.text = ''
|
||||||
|
|
||||||
|
fileTree(logsDir) {
|
||||||
|
include 'app.*.log'
|
||||||
|
}.files.each { File f ->
|
||||||
|
if (!f.delete()) {
|
||||||
|
throw new GradleException("Failed to delete log file: ${f.absolutePath}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println "Server logs cleared: ${logsDir.absolutePath}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('integrationTest', JavaExec) {
|
||||||
|
group = "!!test"
|
||||||
description = "Clean data → kill 7070 → start WS → run all IT tests"
|
description = "Clean data → kill 7070 → start WS → run all IT tests"
|
||||||
|
|
||||||
classpath = sourceSets.test.runtimeClasspath
|
classpath = sourceSets.test.runtimeClasspath
|
||||||
@ -127,15 +155,19 @@ tasks.register('itCleanRun', JavaExec) {
|
|||||||
dependsOn testClasses
|
dependsOn testClasses
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register('itDeployServer', JavaExec) {
|
tasks.named('build') {
|
||||||
group = "build"
|
finalizedBy tasks.named('integrationTest')
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('deployServer', JavaExec) {
|
||||||
|
group = "!!deployment"
|
||||||
description = "Build → upload to server → clean remote data → restart service → run IT against server"
|
description = "Build → upload to server → clean remote data → restart service → run IT against server"
|
||||||
|
|
||||||
classpath = sourceSets.test.runtimeClasspath
|
classpath = sourceSets.test.runtimeClasspath
|
||||||
mainClass = "test.it.IT_DeployRestartAndRunRemoteMain"
|
mainClass = "test.it.IT_DeployRestartAndRunRemoteMain"
|
||||||
|
|
||||||
// можно переопределить при запуске:
|
// можно переопределить при запуске:
|
||||||
// ./gradlew itDeployServer -Dit.remoteHost=... -Dit.wsUri=...
|
// ./gradlew deployServer -Dit.remoteHost=... -Dit.wsUri=...
|
||||||
dependsOn shadowJar
|
dependsOn shadowJar
|
||||||
systemProperty "it.remoteHost", System.getProperty("it.remoteHost", "10.147.20.7")
|
systemProperty "it.remoteHost", System.getProperty("it.remoteHost", "10.147.20.7")
|
||||||
systemProperty "it.remoteUser", System.getProperty("it.remoteUser", "user")
|
systemProperty "it.remoteUser", System.getProperty("it.remoteUser", "user")
|
||||||
@ -149,3 +181,11 @@ tasks.register('itDeployServer', JavaExec) {
|
|||||||
|
|
||||||
dependsOn testClasses
|
dependsOn testClasses
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.register('deployPWA', Exec) {
|
||||||
|
group = "!!deployment"
|
||||||
|
description = "Deploy PWA via deploy_shine-PWA.sh"
|
||||||
|
|
||||||
|
workingDir = rootDir
|
||||||
|
commandLine 'bash', file('deploy_shine-PWA.sh').absolutePath
|
||||||
|
}
|
||||||
|
|||||||
@ -4,9 +4,9 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||||
<title>Shine UI Demo</title>
|
<title>Shine UI Demo</title>
|
||||||
<link rel="stylesheet" href="./styles/main.css?v=20260330001044" />
|
<link rel="stylesheet" href="./styles/main.css?v=20260330210201" />
|
||||||
<link rel="stylesheet" href="./styles/layout.css?v=20260330001044" />
|
<link rel="stylesheet" href="./styles/layout.css?v=20260330210201" />
|
||||||
<link rel="stylesheet" href="./styles/components.css?v=20260330001044" />
|
<link rel="stylesheet" href="./styles/components.css?v=20260330210201" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="app-shell">
|
<div class="app-shell">
|
||||||
@ -15,6 +15,6 @@
|
|||||||
<div id="toolbar-slot" class="toolbar-slot"></div>
|
<div id="toolbar-slot" class="toolbar-slot"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="modal-root"></div>
|
<div id="modal-root"></div>
|
||||||
<script type="module" src="./js/app.js?v=20260330001044"></script>
|
<script type="module" src="./js/app.js?v=20260330210201"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { navigate, getRoute, PRE_AUTH_PAGES } from './router.js?v=20260330001044';
|
import { navigate, getRoute, PRE_AUTH_PAGES } from './router.js?v=20260330210201';
|
||||||
import { renderToolbar } from './components/toolbar.js?v=20260330001044';
|
import { renderToolbar } from './components/toolbar.js?v=20260330210201';
|
||||||
import { renderPageLabel } from './components/page-label.js?v=20260330001044';
|
import { renderPageLabel } from './components/page-label.js?v=20260330210201';
|
||||||
|
import { captureClientError, setClientErrorTransport } from './services/client-error-reporter.js?v=20260331000100';
|
||||||
import {
|
import {
|
||||||
authService,
|
authService,
|
||||||
authorizeSession,
|
authorizeSession,
|
||||||
@ -10,38 +11,38 @@ import {
|
|||||||
state,
|
state,
|
||||||
terminateCurrentSession,
|
terminateCurrentSession,
|
||||||
togglePageLabel,
|
togglePageLabel,
|
||||||
} from './state.js?v=20260330001044';
|
} from './state.js?v=20260330210201';
|
||||||
|
|
||||||
import * as startView from './pages/start-view.js?v=20260330001044';
|
import * as startView from './pages/start-view.js?v=20260330210201';
|
||||||
import * as entrySettingsView from './pages/entry-settings-view.js?v=20260330001044';
|
import * as entrySettingsView from './pages/entry-settings-view.js?v=20260330210201';
|
||||||
import * as registerView from './pages/register-view.js?v=20260330001044';
|
import * as registerView from './pages/register-view.js?v=20260330210201';
|
||||||
import * as registrationPaymentView from './pages/registration-payment-view.js?v=20260330001044';
|
import * as registrationPaymentView from './pages/registration-payment-view.js?v=20260330210201';
|
||||||
import * as registrationKeysView from './pages/registration-keys-view.js?v=20260330001044';
|
import * as registrationKeysView from './pages/registration-keys-view.js?v=20260330210201';
|
||||||
import * as topupView from './pages/topup-view.js?v=20260330001044';
|
import * as topupView from './pages/topup-view.js?v=20260330210201';
|
||||||
import * as loginView from './pages/login-view.js?v=20260330001044';
|
import * as loginView from './pages/login-view.js?v=20260330210201';
|
||||||
import * as loginCameraView from './pages/login-camera-view.js?v=20260330001044';
|
import * as loginCameraView from './pages/login-camera-view.js?v=20260330210201';
|
||||||
import * as loginPasswordView from './pages/login-password-view.js?v=20260330001044';
|
import * as loginPasswordView from './pages/login-password-view.js?v=20260330210201';
|
||||||
import * as keyStorageView from './pages/key-storage-view.js?v=20260330001044';
|
import * as keyStorageView from './pages/key-storage-view.js?v=20260330210201';
|
||||||
|
|
||||||
import * as profileView from './pages/profile-view.js?v=20260330001044';
|
import * as profileView from './pages/profile-view.js?v=20260330210201';
|
||||||
import * as walletView from './pages/wallet-view.js?v=20260330001044';
|
import * as walletView from './pages/wallet-view.js?v=20260330210201';
|
||||||
import * as settingsView from './pages/settings-view.js?v=20260330001044';
|
import * as settingsView from './pages/settings-view.js?v=20260330210201';
|
||||||
import * as serverSettingsView from './pages/server-settings-view.js?v=20260330001044';
|
import * as serverSettingsView from './pages/server-settings-view.js?v=20260330210201';
|
||||||
import * as deviceView from './pages/device-view.js?v=20260330001044';
|
import * as deviceView from './pages/device-view.js?v=20260330210201';
|
||||||
import * as connectDeviceView from './pages/connect-device-view.js?v=20260330001044';
|
import * as connectDeviceView from './pages/connect-device-view.js?v=20260330210201';
|
||||||
import * as deviceQrView from './pages/device-qr-view.js?v=20260330001044';
|
import * as deviceQrView from './pages/device-qr-view.js?v=20260330210201';
|
||||||
import * as deviceCameraView from './pages/device-camera-view.js?v=20260330001044';
|
import * as deviceCameraView from './pages/device-camera-view.js?v=20260330210201';
|
||||||
import * as showKeysView from './pages/show-keys-view.js?v=20260330001044';
|
import * as showKeysView from './pages/show-keys-view.js?v=20260330210201';
|
||||||
import * as deviceSessionView from './pages/device-session-view.js?v=20260330001044';
|
import * as deviceSessionView from './pages/device-session-view.js?v=20260330210201';
|
||||||
import * as languageView from './pages/language-view.js?v=20260330001044';
|
import * as languageView from './pages/language-view.js?v=20260330210201';
|
||||||
import * as messagesList from './pages/messages-list.js?v=20260330001044';
|
import * as messagesList from './pages/messages-list.js?v=20260330210201';
|
||||||
import * as contactSearchView from './pages/contact-search-view.js?v=20260330001044';
|
import * as contactSearchView from './pages/contact-search-view.js?v=20260330210201';
|
||||||
import * as chatView from './pages/chat-view.js?v=20260330001044';
|
import * as chatView from './pages/chat-view.js?v=20260330210201';
|
||||||
import * as channelsList from './pages/channels-list.js?v=20260330001044';
|
import * as channelsList from './pages/channels-list.js?v=20260330210201';
|
||||||
import * as channelView from './pages/channel-view.js?v=20260330001044';
|
import * as channelView from './pages/channel-view.js?v=20260330210201';
|
||||||
import * as addChannelView from './pages/add-channel-view.js?v=20260330001044';
|
import * as addChannelView from './pages/add-channel-view.js?v=20260330210201';
|
||||||
import * as networkView from './pages/network-view.js?v=20260330001044';
|
import * as networkView from './pages/network-view.js?v=20260330210201';
|
||||||
import * as notificationsView from './pages/notifications-view.js?v=20260330001044';
|
import * as notificationsView from './pages/notifications-view.js?v=20260330210201';
|
||||||
|
|
||||||
const routes = {
|
const routes = {
|
||||||
'start-view': startView,
|
'start-view': startView,
|
||||||
@ -81,6 +82,35 @@ const toolbarEl = document.getElementById('toolbar-slot');
|
|||||||
|
|
||||||
let currentCleanup = null;
|
let currentCleanup = null;
|
||||||
|
|
||||||
|
setClientErrorTransport((payload) => authService.reportClientError(payload));
|
||||||
|
|
||||||
|
window.addEventListener('error', (event) => {
|
||||||
|
captureClientError({
|
||||||
|
kind: 'global_error',
|
||||||
|
message: event.message || 'Global JS error',
|
||||||
|
stack: event.error?.stack || '',
|
||||||
|
sourceUrl: event.filename || '',
|
||||||
|
lineNumber: event.lineno,
|
||||||
|
columnNumber: event.colno,
|
||||||
|
context: {
|
||||||
|
pageId: getRoute().pageId || '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener('unhandledrejection', (event) => {
|
||||||
|
const reason = event.reason;
|
||||||
|
captureClientError({
|
||||||
|
kind: 'unhandled_rejection',
|
||||||
|
message: reason?.message || String(reason || 'Unhandled promise rejection'),
|
||||||
|
stack: reason?.stack || '',
|
||||||
|
context: {
|
||||||
|
pageId: getRoute().pageId || '',
|
||||||
|
reasonType: reason?.constructor?.name || typeof reason,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
function renderApp() {
|
function renderApp() {
|
||||||
const route = getRoute();
|
const route = getRoute();
|
||||||
const pageId = route.pageId || (state.session.isAuthorized ? 'profile-view' : 'start-view');
|
const pageId = route.pageId || (state.session.isAuthorized ? 'profile-view' : 'start-view');
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { resolveToolbarActive } from '../router.js?v=20260330001044';
|
import { resolveToolbarActive } from '../router.js?v=20260330210201';
|
||||||
|
|
||||||
const ITEMS = [
|
const ITEMS = [
|
||||||
{ pageId: 'messages-list', label: 'Личные сообщения', icon: '💬' },
|
{ pageId: 'messages-list', label: 'Личные сообщения', icon: '💬' },
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'add-channel-view', title: 'Добавить канал' };
|
export const pageMeta = { id: 'add-channel-view', title: 'Добавить канал' };
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { channelPosts, channels } from '../mock-data.js?v=20260330001044';
|
import { channelPosts, channels } from '../mock-data.js?v=20260330210201';
|
||||||
import { authService, state } from '../state.js?v=20260330001044';
|
import { addLocalChannelPost, authService, getLocalChannelPosts, state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'channel-view', title: 'Канал' };
|
export const pageMeta = { id: 'channel-view', title: 'Канал' };
|
||||||
|
|
||||||
@ -8,7 +8,10 @@ function findMockChannel(channelId) {
|
|||||||
const channel = channels.find((c) => c.id === channelId) || channels[0];
|
const channel = channels.find((c) => c.id === channelId) || channels[0];
|
||||||
return {
|
return {
|
||||||
channel,
|
channel,
|
||||||
posts: (channelPosts[channel.id] || []).map((post) => ({ title: post.title, body: post.body })),
|
posts: [
|
||||||
|
...(channelPosts[channel.id] || []).map((post) => ({ title: post.title, body: post.body })),
|
||||||
|
...getLocalChannelPosts(channelId),
|
||||||
|
],
|
||||||
isOwnChannel: channel.ownerLogin === '@shine.alex',
|
isOwnChannel: channel.ownerLogin === '@shine.alex',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -20,7 +23,55 @@ function mapApiMessageToPost(message) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderBody(screen, navigate, channelData) {
|
function renderPostCard(post) {
|
||||||
|
const card = document.createElement('article');
|
||||||
|
card.className = 'card stack';
|
||||||
|
card.innerHTML = `<strong>${post.title}</strong><p class="meta-muted">${post.body}</p>`;
|
||||||
|
return card;
|
||||||
|
}
|
||||||
|
|
||||||
|
function openAddMessageModal({ channelId, channelName, onSubmit }) {
|
||||||
|
const root = document.getElementById('modal-root');
|
||||||
|
root.innerHTML = `
|
||||||
|
<div class="modal" id="channel-message-modal">
|
||||||
|
<div class="modal-card stack">
|
||||||
|
<h3 style="font-size:18px;">Новое сообщение в канал</h3>
|
||||||
|
<p class="meta-muted"># ${channelName}</p>
|
||||||
|
<textarea id="channel-message-text" class="input" rows="6" maxlength="2000" placeholder="Введите текст сообщения"></textarea>
|
||||||
|
<div class="meta-muted" id="channel-message-error" style="min-height:18px;"></div>
|
||||||
|
<div style="display:grid; grid-template-columns:1fr 1fr; gap:10px;">
|
||||||
|
<button class="secondary-btn" id="channel-message-cancel" type="button">Отмена</button>
|
||||||
|
<button class="primary-btn" id="channel-message-submit" type="button">Отправить</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
const textEl = root.querySelector('#channel-message-text');
|
||||||
|
const errorEl = root.querySelector('#channel-message-error');
|
||||||
|
const close = () => {
|
||||||
|
root.innerHTML = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
root.querySelector('#channel-message-cancel').addEventListener('click', close);
|
||||||
|
root.querySelector('#channel-message-submit').addEventListener('click', () => {
|
||||||
|
const body = textEl.value.trim();
|
||||||
|
if (!body) {
|
||||||
|
errorEl.textContent = 'Введите текст сообщения.';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit({
|
||||||
|
title: `${state.session.login || 'Вы'} • сейчас`,
|
||||||
|
body,
|
||||||
|
});
|
||||||
|
close();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (textEl) textEl.focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderBody(screen, navigate, channelId, channelData) {
|
||||||
const head = document.createElement('div');
|
const head = document.createElement('div');
|
||||||
head.className = 'card';
|
head.className = 'card';
|
||||||
head.innerHTML = `
|
head.innerHTML = `
|
||||||
@ -37,12 +88,23 @@ function renderBody(screen, navigate, channelData) {
|
|||||||
feed.className = 'stack';
|
feed.className = 'stack';
|
||||||
|
|
||||||
channelData.posts.forEach((post) => {
|
channelData.posts.forEach((post) => {
|
||||||
const card = document.createElement('article');
|
feed.append(renderPostCard(post));
|
||||||
card.className = 'card stack';
|
|
||||||
card.innerHTML = `<strong>${post.title}</strong><p class="meta-muted">${post.body}</p>`;
|
|
||||||
feed.append(card);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (channelData.isOwnChannel) {
|
||||||
|
actionButton.addEventListener('click', () => {
|
||||||
|
openAddMessageModal({
|
||||||
|
channelId,
|
||||||
|
channelName: channelData.channel.name,
|
||||||
|
onSubmit: (post) => {
|
||||||
|
addLocalChannelPost(channelId, post);
|
||||||
|
channelData.posts.push(post);
|
||||||
|
feed.append(renderPostCard(post));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const backButton = document.createElement('button');
|
const backButton = document.createElement('button');
|
||||||
backButton.className = 'secondary-btn';
|
backButton.className = 'secondary-btn';
|
||||||
backButton.textContent = 'Назад к списку';
|
backButton.textContent = 'Назад к списку';
|
||||||
@ -64,7 +126,10 @@ async function loadFromApi(channelId) {
|
|||||||
if (!selector.ownerBlockchainName || selector.channelRootBlockNumber == null) return null;
|
if (!selector.ownerBlockchainName || selector.channelRootBlockNumber == null) return null;
|
||||||
|
|
||||||
const payload = await authService.getChannelMessages(selector, 200, 'asc');
|
const payload = await authService.getChannelMessages(selector, 200, 'asc');
|
||||||
const posts = (payload.messages || []).map(mapApiMessageToPost);
|
const posts = [
|
||||||
|
...(payload.messages || []).map(mapApiMessageToPost),
|
||||||
|
...getLocalChannelPosts(channelId),
|
||||||
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
channel: {
|
channel: {
|
||||||
@ -104,7 +169,7 @@ export function render({ navigate, route }) {
|
|||||||
const apiData = await loadFromApi(channelId);
|
const apiData = await loadFromApi(channelId);
|
||||||
loading.remove();
|
loading.remove();
|
||||||
if (apiData) {
|
if (apiData) {
|
||||||
renderBody(screen, navigate, apiData);
|
renderBody(screen, navigate, channelId, apiData);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
@ -112,7 +177,7 @@ export function render({ navigate, route }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
loading.remove();
|
loading.remove();
|
||||||
renderBody(screen, navigate, findMockChannel(channelId));
|
renderBody(screen, navigate, channelId, findMockChannel(channelId));
|
||||||
})();
|
})();
|
||||||
|
|
||||||
return screen;
|
return screen;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { channels as mockChannels } from '../mock-data.js?v=20260330001044';
|
import { channels as mockChannels } from '../mock-data.js?v=20260330210201';
|
||||||
import { authService, setChannelsFeed, state } from '../state.js?v=20260330001044';
|
import { authService, setChannelsFeed, state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'channels-list', title: 'Каналы' };
|
export const pageMeta = { id: 'channels-list', title: 'Каналы' };
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { directMessages } from '../mock-data.js?v=20260330001044';
|
import { directMessages } from '../mock-data.js?v=20260330210201';
|
||||||
import { addChatMessage, getChatMessages } from '../state.js?v=20260330001044';
|
import { addChatMessage, getChatMessages } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'chat-view', title: 'Чат' };
|
export const pageMeta = { id: 'chat-view', title: 'Чат' };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { state } from '../state.js?v=20260330001044';
|
import { state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'connect-device-view', title: 'Подключить устройство' };
|
export const pageMeta = { id: 'connect-device-view', title: 'Подключить устройство' };
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { contactDirectory, directMessages } from '../mock-data.js?v=20260330001044';
|
import { contactDirectory, directMessages } from '../mock-data.js?v=20260330210201';
|
||||||
import { ensureChat } from '../state.js?v=20260330001044';
|
import { ensureChat } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'contact-search-view', title: 'Поиск контактов' };
|
export const pageMeta = { id: 'contact-search-view', title: 'Поиск контактов' };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'device-camera-view', title: 'Подключить через камеру' };
|
export const pageMeta = { id: 'device-camera-view', title: 'Подключить через камеру' };
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { profile } from '../mock-data.js?v=20260330001044';
|
import { profile } from '../mock-data.js?v=20260330210201';
|
||||||
import { state } from '../state.js?v=20260330001044';
|
import { state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'device-qr-view', title: 'Показать QR-код' };
|
export const pageMeta = { id: 'device-qr-view', title: 'Показать QR-код' };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import {
|
import {
|
||||||
authService,
|
authService,
|
||||||
isSessionInvalidError,
|
isSessionInvalidError,
|
||||||
@ -6,7 +6,7 @@ import {
|
|||||||
setAuthError,
|
setAuthError,
|
||||||
state,
|
state,
|
||||||
terminateCurrentSession,
|
terminateCurrentSession,
|
||||||
} from '../state.js?v=20260330001044';
|
} from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'device-session-view', title: 'Сеанс устройства' };
|
export const pageMeta = { id: 'device-session-view', title: 'Сеанс устройства' };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import {
|
import {
|
||||||
authService,
|
authService,
|
||||||
isSessionInvalidError,
|
isSessionInvalidError,
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
setAuthInfo,
|
setAuthInfo,
|
||||||
state,
|
state,
|
||||||
terminateCurrentSession,
|
terminateCurrentSession,
|
||||||
} from '../state.js?v=20260330001044';
|
} from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'device-view', title: 'Устройства' };
|
export const pageMeta = { id: 'device-view', title: 'Устройства' };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { checkServerAvailability, saveEntrySettings, state } from '../state.js?v=20260330001044';
|
import { checkServerAvailability, saveEntrySettings, state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'entry-settings-view', title: 'Настройки входа', showAppChrome: false };
|
export const pageMeta = { id: 'entry-settings-view', title: 'Настройки входа', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { authorizeSession, state } from '../state.js?v=20260330001044';
|
import { authorizeSession, state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'key-storage-view', title: 'Какие ключи сохранить', showAppChrome: false };
|
export const pageMeta = { id: 'key-storage-view', title: 'Какие ключи сохранить', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { state } from '../state.js?v=20260330001044';
|
import { state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'language-view', title: 'Язык' };
|
export const pageMeta = { id: 'language-view', title: 'Язык' };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'login-camera-view', title: 'Войти по камере', showAppChrome: false };
|
export const pageMeta = { id: 'login-camera-view', title: 'Войти по камере', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import {
|
import {
|
||||||
authService,
|
authService,
|
||||||
clearAuthMessages,
|
clearAuthMessages,
|
||||||
setAuthBusy,
|
setAuthBusy,
|
||||||
setAuthError,
|
setAuthError,
|
||||||
state,
|
state,
|
||||||
} from '../state.js?v=20260330001044';
|
} from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'login-password-view', title: 'Войти по логину', showAppChrome: false };
|
export const pageMeta = { id: 'login-password-view', title: 'Войти по логину', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'login-view', title: 'Войти', showAppChrome: false };
|
export const pageMeta = { id: 'login-view', title: 'Войти', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { directMessages } from '../mock-data.js?v=20260330001044';
|
import { directMessages } from '../mock-data.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'messages-list', title: 'Личные сообщения' };
|
export const pageMeta = { id: 'messages-list', title: 'Личные сообщения' };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { networkGraph } from '../mock-data.js?v=20260330001044';
|
import { networkGraph } from '../mock-data.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'network-view', title: 'Связи' };
|
export const pageMeta = { id: 'network-view', title: 'Связи' };
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { notifications } from '../mock-data.js?v=20260330001044';
|
import { notifications } from '../mock-data.js?v=20260330210201';
|
||||||
import { state } from '../state.js?v=20260330001044';
|
import { state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'notifications-view', title: 'Уведомления' };
|
export const pageMeta = { id: 'notifications-view', title: 'Уведомления' };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { profile } from '../mock-data.js?v=20260330001044';
|
import { profile } from '../mock-data.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'profile-view', title: 'Профиль' };
|
export const pageMeta = { id: 'profile-view', title: 'Профиль' };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { authService, clearAuthMessages, state } from '../state.js?v=20260330001044';
|
import { authService, clearAuthMessages, state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'register-view', title: 'Зарегистрироваться', showAppChrome: false };
|
export const pageMeta = { id: 'register-view', title: 'Зарегистрироваться', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import {
|
import {
|
||||||
authService,
|
authService,
|
||||||
authorizeSession,
|
authorizeSession,
|
||||||
@ -6,7 +6,7 @@ import {
|
|||||||
setAuthError,
|
setAuthError,
|
||||||
setAuthInfo,
|
setAuthInfo,
|
||||||
state,
|
state,
|
||||||
} from '../state.js?v=20260330001044';
|
} from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'registration-keys-view', title: 'Сохранение ключей', showAppChrome: false };
|
export const pageMeta = { id: 'registration-keys-view', title: 'Сохранение ключей', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import {
|
import {
|
||||||
authService,
|
authService,
|
||||||
refreshRegistrationBalance,
|
refreshRegistrationBalance,
|
||||||
setAuthError,
|
setAuthError,
|
||||||
setAuthInfo,
|
setAuthInfo,
|
||||||
state,
|
state,
|
||||||
} from '../state.js?v=20260330001044';
|
} from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'registration-payment-view', title: 'Оплата регистрации', showAppChrome: false };
|
export const pageMeta = { id: 'registration-payment-view', title: 'Оплата регистрации', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { checkServerAvailability, saveEntrySettings, state } from '../state.js?v=20260330001044';
|
import { checkServerAvailability, saveEntrySettings, state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'server-settings-view', title: 'Настройки серверов' };
|
export const pageMeta = { id: 'server-settings-view', title: 'Настройки серверов' };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'settings-view', title: 'Настройки' };
|
export const pageMeta = { id: 'settings-view', title: 'Настройки' };
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { state } from '../state.js?v=20260330001044';
|
import { state } from '../state.js?v=20260330210201';
|
||||||
import { loadEncryptedUserSecrets } from '../services/key-vault.js?v=20260330001044';
|
import { loadEncryptedUserSecrets } from '../services/key-vault.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'show-keys-view', title: 'Показать ключи' };
|
export const pageMeta = { id: 'show-keys-view', title: 'Показать ключи' };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { clearStartHint, state } from '../state.js?v=20260330001044';
|
import { clearStartHint, state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'start-view', title: 'Старт', showAppChrome: false };
|
export const pageMeta = { id: 'start-view', title: 'Старт', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { state } from '../state.js?v=20260330001044';
|
import { state } from '../state.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'topup-view', title: 'Пополнение счета', showAppChrome: false };
|
export const pageMeta = { id: 'topup-view', title: 'Пополнение счета', showAppChrome: false };
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { renderHeader } from '../components/header.js?v=20260330001044';
|
import { renderHeader } from '../components/header.js?v=20260330210201';
|
||||||
import { wallet } from '../mock-data.js?v=20260330001044';
|
import { wallet } from '../mock-data.js?v=20260330210201';
|
||||||
|
|
||||||
export const pageMeta = { id: 'wallet-view', title: 'Кошелёк' };
|
export const pageMeta = { id: 'wallet-view', title: 'Кошелёк' };
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { WsJsonClient } from './ws-client.js?v=20260330001044';
|
import { WsJsonClient } from './ws-client.js?v=20260330210201';
|
||||||
import {
|
import {
|
||||||
deriveEd25519FromPassword,
|
deriveEd25519FromPassword,
|
||||||
exportEd25519PublicKeyB64,
|
exportEd25519PublicKeyB64,
|
||||||
@ -7,8 +7,8 @@ import {
|
|||||||
importPkcs8Ed25519,
|
importPkcs8Ed25519,
|
||||||
randomBase64,
|
randomBase64,
|
||||||
signBase64,
|
signBase64,
|
||||||
} from './crypto-utils.js?v=20260330001044';
|
} from './crypto-utils.js?v=20260330210201';
|
||||||
import { loadSessionMaterial, saveEncryptedUserSecrets, saveSessionMaterial } from './key-vault.js?v=20260330001044';
|
import { loadSessionMaterial, saveEncryptedUserSecrets, saveSessionMaterial } from './key-vault.js?v=20260330210201';
|
||||||
|
|
||||||
const BCH_SUFFIX = '001';
|
const BCH_SUFFIX = '001';
|
||||||
|
|
||||||
@ -235,6 +235,15 @@ export class AuthService {
|
|||||||
return response.payload || {};
|
return response.payload || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async reportClientError(details) {
|
||||||
|
try {
|
||||||
|
const response = await this.ws.request('ClientErrorLog', details || {}, 3000);
|
||||||
|
return response?.status === 200;
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
this.ws.close();
|
this.ws.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
decryptJsonWithStoragePwd,
|
decryptJsonWithStoragePwd,
|
||||||
encryptJsonWithStoragePwd,
|
encryptJsonWithStoragePwd,
|
||||||
} from './crypto-utils.js?v=20260330001044';
|
} from './crypto-utils.js?v=20260330210201';
|
||||||
|
|
||||||
const DB_NAME = 'shine-ui-auth';
|
const DB_NAME = 'shine-ui-auth';
|
||||||
const DB_VERSION = 1;
|
const DB_VERSION = 1;
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { captureClientError } from './client-error-reporter.js?v=20260331000100';
|
||||||
|
|
||||||
const DEFAULT_TIMEOUT_MS = 12000;
|
const DEFAULT_TIMEOUT_MS = 12000;
|
||||||
|
|
||||||
function buildWsUrl(raw) {
|
function buildWsUrl(raw) {
|
||||||
@ -34,6 +36,11 @@ export class WsJsonClient {
|
|||||||
}, { once: true });
|
}, { once: true });
|
||||||
|
|
||||||
ws.addEventListener('error', () => {
|
ws.addEventListener('error', () => {
|
||||||
|
captureClientError({
|
||||||
|
kind: 'ws_open_error',
|
||||||
|
message: `Failed to connect WebSocket ${this.url}`,
|
||||||
|
context: { url: this.url },
|
||||||
|
});
|
||||||
reject(new Error(`Не удалось подключиться к ${this.url}`));
|
reject(new Error(`Не удалось подключиться к ${this.url}`));
|
||||||
}, { once: true });
|
}, { once: true });
|
||||||
|
|
||||||
@ -59,10 +66,20 @@ export class WsJsonClient {
|
|||||||
const responsePromise = new Promise((resolve, reject) => {
|
const responsePromise = new Promise((resolve, reject) => {
|
||||||
const timer = window.setTimeout(() => {
|
const timer = window.setTimeout(() => {
|
||||||
this.pending.delete(requestId);
|
this.pending.delete(requestId);
|
||||||
|
if (op !== 'ClientErrorLog') {
|
||||||
|
captureClientError({
|
||||||
|
kind: 'ws_timeout',
|
||||||
|
message: `Timeout waiting for ${op}`,
|
||||||
|
requestOp: op,
|
||||||
|
requestIdRef: requestId,
|
||||||
|
context: { url: this.url, timeoutMs },
|
||||||
|
});
|
||||||
|
}
|
||||||
reject(new Error(`Таймаут ответа для операции ${op}`));
|
reject(new Error(`Таймаут ответа для операции ${op}`));
|
||||||
}, timeoutMs);
|
}, timeoutMs);
|
||||||
|
|
||||||
this.pending.set(requestId, {
|
this.pending.set(requestId, {
|
||||||
|
op,
|
||||||
resolve: (value) => {
|
resolve: (value) => {
|
||||||
window.clearTimeout(timer);
|
window.clearTimeout(timer);
|
||||||
resolve(value);
|
resolve(value);
|
||||||
@ -90,6 +107,11 @@ export class WsJsonClient {
|
|||||||
try {
|
try {
|
||||||
data = JSON.parse(raw);
|
data = JSON.parse(raw);
|
||||||
} catch {
|
} catch {
|
||||||
|
captureClientError({
|
||||||
|
kind: 'ws_bad_json',
|
||||||
|
message: 'Received non-JSON message from server',
|
||||||
|
context: { raw: String(raw).slice(0, 1000) },
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,6 +125,17 @@ export class WsJsonClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
failPending(message) {
|
failPending(message) {
|
||||||
|
const pendingOps = [...this.pending.values()]
|
||||||
|
.map((slot) => slot.op)
|
||||||
|
.filter((op) => op && op !== 'ClientErrorLog');
|
||||||
|
if (pendingOps.length > 0) {
|
||||||
|
captureClientError({
|
||||||
|
kind: 'ws_closed',
|
||||||
|
message,
|
||||||
|
context: { url: this.url, pendingOps },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const error = new Error(message);
|
const error = new Error(message);
|
||||||
for (const [, slot] of this.pending.entries()) {
|
for (const [, slot] of this.pending.entries()) {
|
||||||
slot.reject(error);
|
slot.reject(error);
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { chatMessages, wallet } from './mock-data.js?v=20260330001044';
|
import { chatMessages, wallet } from './mock-data.js?v=20260330210201';
|
||||||
import { AuthService } from './services/auth-service.js?v=20260330001044';
|
import { AuthService } from './services/auth-service.js?v=20260330210201';
|
||||||
import { clearClientAuthData } from './services/key-vault.js?v=20260330001044';
|
import { clearClientAuthData } from './services/key-vault.js?v=20260330210201';
|
||||||
|
|
||||||
const clone = (value) => JSON.parse(JSON.stringify(value));
|
const clone = (value) => JSON.parse(JSON.stringify(value));
|
||||||
const SESSION_STORAGE_KEY = 'shine-ui-current-session-v1';
|
const SESSION_STORAGE_KEY = 'shine-ui-current-session-v1';
|
||||||
@ -99,6 +99,7 @@ function createInitialState({ withStoredSession = true } = {}) {
|
|||||||
sessions: [],
|
sessions: [],
|
||||||
channelsFeed: null,
|
channelsFeed: null,
|
||||||
channelsIndex: {},
|
channelsIndex: {},
|
||||||
|
localChannelPosts: {},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,3 +240,22 @@ export function setChannelsFeed(feed, index) {
|
|||||||
state.channelsFeed = feed || null;
|
state.channelsFeed = feed || null;
|
||||||
state.channelsIndex = index || {};
|
state.channelsIndex = index || {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getLocalChannelPosts(channelId) {
|
||||||
|
if (!channelId) return [];
|
||||||
|
if (!state.localChannelPosts[channelId]) {
|
||||||
|
state.localChannelPosts[channelId] = [];
|
||||||
|
}
|
||||||
|
return state.localChannelPosts[channelId];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addLocalChannelPost(channelId, post) {
|
||||||
|
if (!channelId) return;
|
||||||
|
const text = post?.body?.trim();
|
||||||
|
if (!text) return;
|
||||||
|
|
||||||
|
getLocalChannelPosts(channelId).push({
|
||||||
|
title: post.title || `${state.session.login || 'Вы'} • сейчас`,
|
||||||
|
body: text,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@ -54,7 +54,9 @@ import server.logic.ws_protocol.JSON.handlers.channels.entyties.Net_ListSubscrip
|
|||||||
|
|
||||||
// --- NEW: Ping ---
|
// --- NEW: Ping ---
|
||||||
import server.logic.ws_protocol.JSON.handlers.system.Net_GetServerInfo_Handler;
|
import server.logic.ws_protocol.JSON.handlers.system.Net_GetServerInfo_Handler;
|
||||||
|
import server.logic.ws_protocol.JSON.handlers.system.Net_ClientErrorLog_Handler;
|
||||||
import server.logic.ws_protocol.JSON.handlers.system.Net_Ping_Handler;
|
import server.logic.ws_protocol.JSON.handlers.system.Net_Ping_Handler;
|
||||||
|
import server.logic.ws_protocol.JSON.handlers.system.entyties.Net_ClientErrorLog_Request;
|
||||||
import server.logic.ws_protocol.JSON.handlers.system.entyties.Net_GetServerInfo_Request;
|
import server.logic.ws_protocol.JSON.handlers.system.entyties.Net_GetServerInfo_Request;
|
||||||
import server.logic.ws_protocol.JSON.handlers.system.entyties.Net_Ping_Request;
|
import server.logic.ws_protocol.JSON.handlers.system.entyties.Net_Ping_Request;
|
||||||
|
|
||||||
@ -97,7 +99,8 @@ public final class JsonHandlerRegistry {
|
|||||||
|
|
||||||
// --- system ---
|
// --- system ---
|
||||||
Map.entry("Ping", new Net_Ping_Handler()),
|
Map.entry("Ping", new Net_Ping_Handler()),
|
||||||
Map.entry("GetServerInfo", new Net_GetServerInfo_Handler())
|
Map.entry("GetServerInfo", new Net_GetServerInfo_Handler()),
|
||||||
|
Map.entry("ClientErrorLog", new Net_ClientErrorLog_Handler())
|
||||||
|
|
||||||
// --- subscriptions ---
|
// --- subscriptions ---
|
||||||
// Map.entry("ListSubscribedChannels", new Net_GetSubscribedChannels_Handler())
|
// Map.entry("ListSubscribedChannels", new Net_GetSubscribedChannels_Handler())
|
||||||
@ -134,7 +137,8 @@ public final class JsonHandlerRegistry {
|
|||||||
|
|
||||||
// --- system ---
|
// --- system ---
|
||||||
Map.entry("Ping", Net_Ping_Request.class),
|
Map.entry("Ping", Net_Ping_Request.class),
|
||||||
Map.entry("GetServerInfo", Net_GetServerInfo_Request.class)
|
Map.entry("GetServerInfo", Net_GetServerInfo_Request.class),
|
||||||
|
Map.entry("ClientErrorLog", Net_ClientErrorLog_Request.class)
|
||||||
);
|
);
|
||||||
|
|
||||||
private JsonHandlerRegistry() { }
|
private JsonHandlerRegistry() { }
|
||||||
|
|||||||
@ -121,7 +121,7 @@ final class ChannelsReadSupport {
|
|||||||
try {
|
try {
|
||||||
BchBlockEntry e = new BchBlockEntry(blockBytes);
|
BchBlockEntry e = new BchBlockEntry(blockBytes);
|
||||||
TextInfo ti = new TextInfo();
|
TextInfo ti = new TextInfo();
|
||||||
ti.createdAtMs = e.timeMs;
|
ti.createdAtMs = e.timestamp * 1000L;
|
||||||
if (e.body instanceof TextBody tb) {
|
if (e.body instanceof TextBody tb) {
|
||||||
ti.text = tb.message;
|
ti.text = tb.message;
|
||||||
}
|
}
|
||||||
@ -137,7 +137,8 @@ final class ChannelsReadSupport {
|
|||||||
SELECT login,bch_name,block_number,block_hash,block_bytes
|
SELECT login,bch_name,block_number,block_hash,block_bytes
|
||||||
FROM blocks
|
FROM blocks
|
||||||
WHERE bch_name=? AND msg_type=? AND msg_sub_type=? AND line_code=?
|
WHERE bch_name=? AND msg_type=? AND msg_sub_type=? AND line_code=?
|
||||||
ORDER BY block_number """ + order + " LIMIT ?";
|
ORDER BY block_number
|
||||||
|
""" + order + " LIMIT ?";
|
||||||
try (PreparedStatement ps = c.prepareStatement(sql)) {
|
try (PreparedStatement ps = c.prepareStatement(sql)) {
|
||||||
ps.setString(1, ownerBch);
|
ps.setString(1, ownerBch);
|
||||||
ps.setInt(2, MSG_TYPE_TEXT);
|
ps.setInt(2, MSG_TYPE_TEXT);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user