Start server-side channel read RPC handlers and simplify API spec

This commit is contained in:
ai5590
2026-03-30 14:32:15 +03:00
parent eb5593c7be
commit 9723696b2c
20 changed files with 1604 additions and 45 deletions
+7 -2
View File
@@ -7,6 +7,7 @@ export function render({ navigate, route }) {
const channelId = route.params.channelId || 'ch1';
const channel = channels.find((c) => c.id === channelId) || channels[0];
const posts = channelPosts[channelId] || [];
const isOwnChannel = channel.ownerLogin === '@shine.alex';
const screen = document.createElement('section');
screen.className = 'stack';
@@ -23,9 +24,13 @@ export function render({ navigate, route }) {
head.innerHTML = `
<strong># ${channel.name}</strong>
<p class="meta-muted" style="margin-top:4px;">${channel.description}</p>
<p class="meta-muted" style="margin-top:8px;">Публичный канал, режим только чтение</p>
<p class="meta-muted" style="margin-top:8px;">Владелец: ${channel.ownerName}</p>
`;
const actionButton = document.createElement('button');
actionButton.className = isOwnChannel ? 'primary-btn' : 'secondary-btn';
actionButton.textContent = isOwnChannel ? 'Добавить сообщение в канал' : 'Отписаться от канала';
const feed = document.createElement('div');
feed.className = 'stack';
@@ -36,6 +41,6 @@ export function render({ navigate, route }) {
feed.append(card);
});
screen.append(head, feed);
screen.append(head, actionButton, feed);
return screen;
}