Starting...
![Join link QR code]()
diff --git a/creator-app/src/constants.ts b/creator-app/src/constants.ts
index 14c6ed0..6f53b31 100644
--- a/creator-app/src/constants.ts
+++ b/creator-app/src/constants.ts
@@ -8,6 +8,8 @@ export const CALL_CREATOR_INJECT_DELAY_MS = 1000;
export const BOT_POLL_RETRY_DELAY_MS = 1000;
export const BOT_POLL_WAIT_SECONDS = 25;
+export const MAX_SAVED_CALLS = 50;
+
export const MAX_LOG_CHARS = 400000;
export const LOG_TRIM_KEEP_CHARS = 200000;
export const HOOK_LOG_BUFFER_LIMIT = 500;
diff --git a/creator-app/src/renderer/index.ts b/creator-app/src/renderer/index.ts
index b1383c8..f10f54c 100644
--- a/creator-app/src/renderer/index.ts
+++ b/creator-app/src/renderer/index.ts
@@ -15,8 +15,9 @@ import {
attachLoginWebview,
detachLoginWebview,
} from './dom';
+import { SavedCallsView } from './saved-calls';
import { VK_IM_URL, TELEMOST_URL } from '../constants';
-import { Platform, Bridge, BotTabData, LogPanel, TunnelMode, HeadlessMode } from '../types';
+import { Platform, Bridge, BotTabData, LogPanel, TunnelMode, HeadlessMode, SavedCall } from '../types';
declare const window: Window & { bridge: Bridge };
@@ -24,8 +25,11 @@ const tm = new RendererTabManager(() => {
renderTabs(tm);
renderContent(tm);
renderBotButton(tm);
+ renderSaveStars();
});
+const savedCalls = new SavedCallsView((call: SavedCall) => tm.startSavedCall(call));
+
function bindTabBarEvents(): void {
document.getElementById('tabBar')!.addEventListener('click', (event) => {
const target = event.target as HTMLElement;
@@ -34,6 +38,7 @@ function bindTabBarEvents(): void {
const tabId = tabEl?.dataset.tabId;
if (action === 'add-tab') {
+ savedCalls.hide();
tm.createTab();
return;
}
@@ -48,6 +53,7 @@ function bindTabBarEvents(): void {
return;
}
if (tabId) {
+ savedCalls.hide();
tm.selectTab(tabId);
}
});
@@ -178,6 +184,7 @@ function bindHeadlessEvents(): void {
const sourceEl = document.getElementById(copyTarget);
if (sourceEl) copyToClipboard(sourceEl.textContent || '');
}
+ if (target.dataset.action === 'save-call') toggleActiveCallSaved();
});
document.getElementById('btnHeadlessCreate')!.addEventListener('click', () => {
clearHeadlessJoinError();
@@ -201,6 +208,28 @@ function bindHeadlessEvents(): void {
});
}
+function toggleActiveCallSaved(): void {
+ const tab = tm.getActiveTab();
+ const joinLink = tab?.callInfo?.joinLink;
+ if (!tab || !tab.platform || !joinLink) return;
+ if (savedCalls.has(tab.platform, joinLink)) {
+ savedCalls.remove(joinLink);
+ } else {
+ savedCalls.add(tab.platform, joinLink, tm.getTabLabel(tab));
+ }
+ renderSaveStars();
+}
+
+function renderSaveStars(): void {
+ const tab = tm.getActiveTab();
+ const joinLink = tab?.callInfo?.joinLink;
+ const saved = !!tab?.platform && !!joinLink && savedCalls.has(tab.platform, joinLink);
+ document.querySelectorAll('.headless-save').forEach((star) => {
+ star.classList.toggle('saved', saved);
+ star.setAttribute('title', saved ? 'Saved, click to forget' : 'Save this call');
+ });
+}
+
function showHeadlessJoinError(msg: string): void {
const errEl = document.getElementById('headlessStartError')!;
const input = document.getElementById('headlessStartTarget') as HTMLInputElement;
@@ -253,6 +282,7 @@ function init(): void {
bindErrorPopup();
bindLogEvents();
bindHeadlessEvents();
+ savedCalls.bindEvents();
window.bridge.setUpstreamProxy(tm.upstreamProxy);
diff --git a/creator-app/src/renderer/saved-calls.ts b/creator-app/src/renderer/saved-calls.ts
new file mode 100644
index 0000000..bbd321d
--- /dev/null
+++ b/creator-app/src/renderer/saved-calls.ts
@@ -0,0 +1,135 @@
+import { Platform, SavedCall } from '../types';
+import { MAX_SAVED_CALLS } from '../constants';
+
+const STORAGE_KEY = 'savedCalls';
+const OPEN_CLASS = 'saved-calls-open';
+
+const PLATFORM_TITLES: Record
= {
+ [Platform.VK]: 'VK',
+ [Platform.Telemost]: 'Telemost',
+ [Platform.WBStream]: 'WBStream',
+ [Platform.Dion]: 'DION',
+ [Platform.Bitrix]: 'Bitrix',
+};
+
+export class SavedCallsView {
+ private calls: SavedCall[];
+ private open = false;
+
+ constructor(private onJoin: (call: SavedCall) => void) {
+ this.calls = this.load();
+ }
+
+ bindEvents(): void {
+ document.getElementById('btnSavedCalls')!.addEventListener('click', () => this.toggle());
+ document.getElementById('savedCallsList')!.addEventListener('click', (event) => {
+ const target = event.target as HTMLElement;
+ const action = target.dataset.action;
+ const row = target.closest('[data-saved-target]') as HTMLElement | null;
+ const savedTarget = row?.dataset.savedTarget;
+ if (!savedTarget) return;
+ if (action === 'join-saved') this.join(savedTarget);
+ if (action === 'remove-saved') this.remove(savedTarget);
+ });
+ }
+
+ isOpen(): boolean {
+ return this.open;
+ }
+
+ show(): void {
+ this.open = true;
+ document.body.classList.add(OPEN_CLASS);
+ this.render();
+ }
+
+ hide(): void {
+ this.open = false;
+ document.body.classList.remove(OPEN_CLASS);
+ }
+
+ has(platform: Platform, target: string): boolean {
+ const trimmed = target.trim();
+ return this.calls.some((entry) => entry.platform === platform && entry.target === trimmed);
+ }
+
+ remove(target: string): void {
+ this.calls = this.calls.filter((entry) => entry.target !== target);
+ this.persist();
+ if (this.open) this.render();
+ }
+
+ add(platform: Platform, target: string, name: string): SavedCall | null {
+ const trimmed = target.trim();
+ if (!trimmed) return null;
+ const call: SavedCall = { platform, target: trimmed, name, savedAt: Date.now() };
+ const existing = this.calls.findIndex(
+ (entry) => entry.platform === platform && entry.target === trimmed,
+ );
+ if (existing !== -1) {
+ this.calls[existing] = call;
+ } else {
+ this.calls.unshift(call);
+ if (this.calls.length > MAX_SAVED_CALLS) this.calls = this.calls.slice(0, MAX_SAVED_CALLS);
+ }
+ this.persist();
+ if (this.open) this.render();
+ return call;
+ }
+
+ private toggle(): void {
+ if (this.open) {
+ this.hide();
+ } else {
+ this.show();
+ }
+ }
+
+ private join(target: string): void {
+ const call = this.calls.find((entry) => entry.target === target);
+ if (!call) return;
+ this.hide();
+ this.onJoin(call);
+ }
+
+ private render(): void {
+ const list = document.getElementById('savedCallsList')!;
+ const empty = document.getElementById('savedCallsEmpty')!;
+ empty.style.display = this.calls.length === 0 ? 'block' : 'none';
+ list.innerHTML = this.calls
+ .map((call) => {
+ const target = escapeHtml(call.target);
+ return (
+ `` +
+ `
${escapeHtml(PLATFORM_TITLES[call.platform])}` +
+ `
` +
+ `
${escapeHtml(call.name)}
` +
+ `
${target}
` +
+ '
' +
+ `
` +
+ `
✕` +
+ '
'
+ );
+ })
+ .join('');
+ }
+
+ private load(): SavedCall[] {
+ const stored = localStorage.getItem(STORAGE_KEY);
+ if (!stored) return [];
+ try {
+ const parsed = JSON.parse(stored);
+ return Array.isArray(parsed) ? parsed : [];
+ } catch {
+ return [];
+ }
+ }
+
+ private persist(): void {
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(this.calls));
+ }
+}
+
+function escapeHtml(str: string): string {
+ return str.replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"');
+}
diff --git a/creator-app/src/renderer/tab-manager.ts b/creator-app/src/renderer/tab-manager.ts
index 699c956..91d705b 100644
--- a/creator-app/src/renderer/tab-manager.ts
+++ b/creator-app/src/renderer/tab-manager.ts
@@ -8,6 +8,7 @@ import {
Bridge,
HeadlessMode,
HeadlessStartArgs,
+ SavedCall,
} from '../types';
import { HeadlessLogMarker } from '../constants';
import { appendLogText, appendLogElement, trimLogText } from './log-buffer';
@@ -257,6 +258,17 @@ export class RendererTabManager {
window.bridge.setDebugLogging(this.debugLogging);
}
+ startSavedCall(call: SavedCall): void {
+ this.createTab();
+ this.switchToHeadless(call.platform);
+ const tab = this.getActiveTab();
+ if (!tab) return;
+ tab.name = call.name;
+ tab.headlessStartTarget = call.target;
+ tab.joinedByLink = true;
+ this.startHeadlessCall({ mode: HeadlessMode.Join, target: call.target });
+ }
+
toggleBot(): void {
if (!this.botSettings.token || !this.botSettings.groupId) return;
this.botRunning = !this.botRunning;
diff --git a/creator-app/src/types.ts b/creator-app/src/types.ts
index ee6cb67..0fc08e6 100644
--- a/creator-app/src/types.ts
+++ b/creator-app/src/types.ts
@@ -117,6 +117,13 @@ export interface CallInfo {
protocol?: string;
}
+export interface SavedCall {
+ platform: Platform;
+ target: string;
+ name: string;
+ savedAt: number;
+}
+
export enum HeadlessMode {
Create = 'create',
Join = 'join',
diff --git a/creator-app/styles/main.css b/creator-app/styles/main.css
index fb61be0..82d2f99 100644
--- a/creator-app/styles/main.css
+++ b/creator-app/styles/main.css
@@ -111,10 +111,6 @@ body {
color: #e0e0e0;
}
-.tab-action-btn.settings {
- font-size: 14px;
-}
-
.tab-action-btn.bot {
font-weight: 500;
}
@@ -667,3 +663,122 @@ body {
cursor: text;
margin: 0;
}
+
+.headless-save {
+ display: inline-block;
+ width: 16px;
+ height: 16px;
+ margin-left: 6px;
+ cursor: pointer;
+ vertical-align: middle;
+ background-color: #888;
+ -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E") center / contain no-repeat;
+ mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E") center / contain no-repeat;
+}
+
+.headless-save:hover {
+ background-color: #e0e0e0;
+}
+
+.headless-save.saved {
+ background-color: #4fc3f7;
+}
+
+.saved-calls {
+ display: none;
+ padding: 24px;
+ color: #e0e0e0;
+ font-family: monospace;
+ font-size: 14px;
+ overflow-y: auto;
+ height: 100%;
+ box-sizing: border-box;
+}
+
+.saved-calls-title {
+ font-size: 18px;
+ font-weight: bold;
+ margin-bottom: 16px;
+}
+
+.saved-calls-empty {
+ color: #888;
+ font-size: 12px;
+}
+
+.saved-calls-list {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.saved-call {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ border: 1px solid #333;
+ border-radius: 8px;
+ background: #1e1e1e;
+ padding: 12px 16px;
+}
+
+.saved-call-platform {
+ color: #888;
+ font-size: 12px;
+ width: 80px;
+ flex-shrink: 0;
+}
+
+.saved-call-body {
+ flex: 1;
+ min-width: 0;
+}
+
+.saved-call-name {
+ font-size: 14px;
+ color: #e0e0e0;
+}
+
+.saved-call-link {
+ font-size: 11px;
+ color: #4fc3f7;
+ word-break: break-all;
+}
+
+.saved-call-join {
+ padding: 6px 14px;
+ border: 1px solid #444;
+ border-radius: 6px;
+ background: #2a2a2a;
+ color: #e0e0e0;
+ font-family: inherit;
+ font-size: 12px;
+ cursor: pointer;
+ flex-shrink: 0;
+}
+
+.saved-call-join:hover {
+ background: #333;
+}
+
+.saved-call-remove {
+ color: #888;
+ cursor: pointer;
+ flex-shrink: 0;
+}
+
+.saved-call-remove:hover {
+ color: #dc3545;
+}
+
+body.saved-calls-open #savedCallsPanel {
+ display: block;
+}
+
+body.saved-calls-open #welcome,
+body.saved-calls-open #toolbar,
+body.saved-calls-open #headlessInfo,
+body.saved-calls-open #logsPanel,
+body.saved-calls-open webview {
+ display: none !important;
+}