add blink to creator app
This commit is contained in:
1 parent
38fff05bb3
commit
e0e82f5212
25 files changed
+317
-111
No files matched your search
@@ -58,6 +58,7 @@ export function renderContent(tm: RendererTabManager): void {
|
||||
else if (activeTab.platform === Platform.WBStream) title = 'WBStream';
|
||||
else if (activeTab.platform === Platform.Dion) title = 'DION';
|
||||
else if (activeTab.platform === Platform.Bitrix) title = 'Bitrix';
|
||||
else if (activeTab.platform === Platform.Blink) title = 'Blink';
|
||||
document.getElementById('headlessTitle')!.textContent = title;
|
||||
const startEl = document.getElementById('headlessStart')!;
|
||||
const statusEl = document.getElementById('headlessStatus')!;
|
||||
@@ -83,6 +84,9 @@ export function renderContent(tm: RendererTabManager): void {
|
||||
} else if (activeTab.platform === Platform.Bitrix) {
|
||||
targetLabel.textContent = 'Paste a portal /video/ link, or leave empty to create a new room.';
|
||||
targetInput.placeholder = 'https://your-portal.bitrix24.ru/video/CODE';
|
||||
} else if (activeTab.platform === Platform.Blink) {
|
||||
targetLabel.textContent = 'Paste a chat id, blink:// link or group invite link.';
|
||||
targetInput.placeholder = 'https://blinkmap.com/join/<key>';
|
||||
} else if (activeTab.platform === Platform.Telemost) {
|
||||
targetLabel.textContent = 'Paste a Telemost conference link.';
|
||||
targetInput.placeholder = 'https://telemost.yandex.ru/j/...';
|
||||
@@ -101,12 +105,20 @@ export function renderContent(tm: RendererTabManager): void {
|
||||
const callInfoWB = document.getElementById('headlessCallInfoWB')!;
|
||||
const callInfoDion = document.getElementById('headlessCallInfoDion')!;
|
||||
const callInfoBitrix = document.getElementById('headlessCallInfoBitrix')!;
|
||||
const callInfoBlink = document.getElementById('headlessCallInfoBlink')!;
|
||||
const loginInfo = document.getElementById('headlessLoginInfo')!;
|
||||
callInfoVK.style.display = 'none';
|
||||
callInfoTM.style.display = 'none';
|
||||
callInfoWB.style.display = 'none';
|
||||
callInfoDion.style.display = 'none';
|
||||
callInfoBitrix.style.display = 'none';
|
||||
if (callInfo) {
|
||||
callInfoBlink.style.display = 'none';
|
||||
loginInfo.style.display = 'none';
|
||||
if (activeTab.loginLink) {
|
||||
loginInfo.style.display = 'block';
|
||||
document.getElementById('headlessLoginLink')!.textContent = activeTab.loginLink;
|
||||
renderHeadlessQr(activeTab.loginLink, `Scan with the ${title} app`);
|
||||
} else if (callInfo) {
|
||||
if (activeTab.platform === Platform.WBStream) {
|
||||
callInfoWB.style.display = 'block';
|
||||
document.getElementById('headlessWBJoinLink')!.textContent = callInfo.joinLink || '';
|
||||
@@ -120,20 +132,23 @@ export function renderContent(tm: RendererTabManager): void {
|
||||
} else if (activeTab.platform === Platform.Bitrix) {
|
||||
callInfoBitrix.style.display = 'block';
|
||||
document.getElementById('headlessBitrixJoinLink')!.textContent = callInfo.joinLink || '';
|
||||
} else if (activeTab.platform === Platform.Blink) {
|
||||
callInfoBlink.style.display = 'block';
|
||||
document.getElementById('headlessBlinkJoinLink')!.textContent = callInfo.joinLink || '';
|
||||
} else {
|
||||
callInfoVK.style.display = 'block';
|
||||
document.getElementById('headlessJoinLink')!.textContent = callInfo.joinLink || '';
|
||||
document.getElementById('headlessTurn')!.textContent = callInfo.turn || '';
|
||||
document.getElementById('headlessProtocol')!.textContent = callInfo.protocol || '';
|
||||
}
|
||||
renderJoinQr(callInfo.joinLink || '');
|
||||
renderHeadlessQr(callInfo.joinLink || '', 'Scan in the Android app');
|
||||
} else {
|
||||
renderJoinQr('');
|
||||
renderHeadlessQr('', '');
|
||||
}
|
||||
} else {
|
||||
toolbar.style.display = 'flex';
|
||||
headlessInfo.style.display = 'none';
|
||||
renderJoinQr('');
|
||||
renderHeadlessQr('', '');
|
||||
const isVK = activeTab.platform === Platform.VK && activeTab.url.includes('vk.ru');
|
||||
const modeSelect = document.getElementById('modeSelect') as HTMLSelectElement;
|
||||
const tunnelLabel = document.getElementById('tunnelLabel') as HTMLElement;
|
||||
@@ -310,7 +325,7 @@ export function exportCookiesZip(): void {
|
||||
|
||||
let renderedQrText = '';
|
||||
|
||||
function renderJoinQr(link: string): void {
|
||||
function renderHeadlessQr(link: string, hint: string): void {
|
||||
const wrap = document.getElementById('headlessQrWrap') as HTMLElement | null;
|
||||
const image = document.getElementById('headlessQr') as HTMLImageElement | null;
|
||||
if (!wrap || !image) return;
|
||||
@@ -320,6 +335,7 @@ function renderJoinQr(link: string): void {
|
||||
image.removeAttribute('src');
|
||||
return;
|
||||
}
|
||||
document.getElementById('headlessQrHint')!.textContent = hint;
|
||||
if (link === renderedQrText) {
|
||||
wrap.style.display = 'block';
|
||||
return;
|
||||
|
||||
@@ -67,6 +67,7 @@ function bindToolbarEvents(): void {
|
||||
document.getElementById('btnHeadlessWB')!.addEventListener('click', () => tm.switchToHeadless(Platform.WBStream));
|
||||
document.getElementById('btnHeadlessDion')!.addEventListener('click', () => tm.switchToHeadless(Platform.Dion));
|
||||
document.getElementById('btnHeadlessBitrix')!.addEventListener('click', () => tm.switchToHeadless(Platform.Bitrix));
|
||||
document.getElementById('btnHeadlessBlink')!.addEventListener('click', () => tm.switchToHeadless(Platform.Blink));
|
||||
document.getElementById('modeSelect')!.addEventListener('change', (event) => {
|
||||
tm.setTunnelMode((event.target as HTMLSelectElement).value);
|
||||
});
|
||||
@@ -318,6 +319,8 @@ function init(): void {
|
||||
tm.switchToHeadless(Platform.Dion, data.joinTarget);
|
||||
} else if (data.mode === TunnelMode.HeadlessBitrix) {
|
||||
tm.switchToHeadless(Platform.Bitrix, data.joinTarget);
|
||||
} else if (data.mode === TunnelMode.HeadlessBlink) {
|
||||
tm.switchToHeadless(Platform.Blink, data.joinTarget);
|
||||
} else {
|
||||
const url = data.platform === Platform.Telemost ? TELEMOST_URL : VK_IM_URL;
|
||||
loadURL(tm, url);
|
||||
@@ -343,6 +346,7 @@ function init(): void {
|
||||
const tab = tm.tabs[tabId];
|
||||
if (!tab) return;
|
||||
detachLoginWebview(tm, tabId);
|
||||
tab.loginLink = undefined;
|
||||
tab.headlessStatus = 'Starting...';
|
||||
if (tabId === tm.activeTabId) renderContent(tm);
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@ const PLATFORM_TITLES: Record<Platform, string> = {
|
||||
[Platform.WBStream]: 'WBStream',
|
||||
[Platform.Dion]: 'DION',
|
||||
[Platform.Bitrix]: 'Bitrix',
|
||||
[Platform.Blink]: 'Blink',
|
||||
};
|
||||
|
||||
export class SavedCallsView {
|
||||
|
||||
@@ -80,6 +80,10 @@ export class RendererTabManager {
|
||||
tab.mode = TunnelMode.HeadlessBitrix;
|
||||
if (!tab.isBot) tab.name = 'Bitrix';
|
||||
break;
|
||||
case Platform.Blink:
|
||||
tab.mode = TunnelMode.HeadlessBlink;
|
||||
if (!tab.isBot) tab.name = 'Blink';
|
||||
break;
|
||||
default:
|
||||
tab.mode = TunnelMode.HeadlessVK;
|
||||
if (!tab.isBot) tab.name = 'VK';
|
||||
@@ -88,6 +92,7 @@ export class RendererTabManager {
|
||||
tab.headlessStarted = false;
|
||||
tab.platform = platform;
|
||||
tab.callInfo = undefined;
|
||||
tab.loginLink = undefined;
|
||||
tab.headlessStatus = undefined;
|
||||
tab.tunnelConnected = false;
|
||||
tab.relayLogs = '';
|
||||
@@ -109,6 +114,7 @@ export class RendererTabManager {
|
||||
tab.headlessStarted = true;
|
||||
tab.headlessStatus = 'Starting...';
|
||||
tab.callInfo = undefined;
|
||||
tab.loginLink = undefined;
|
||||
window.bridge.startHeadless(this.activeTabId, tab.platform, args);
|
||||
this.onRender();
|
||||
}
|
||||
@@ -120,12 +126,14 @@ export class RendererTabManager {
|
||||
data.mode === TunnelMode.HeadlessTelemost ||
|
||||
data.mode === TunnelMode.HeadlessWBStream ||
|
||||
data.mode === TunnelMode.HeadlessDion ||
|
||||
data.mode === TunnelMode.HeadlessBitrix;
|
||||
data.mode === TunnelMode.HeadlessBitrix ||
|
||||
data.mode === TunnelMode.HeadlessBlink;
|
||||
let platformName = 'VK';
|
||||
if (data.platform === Platform.Telemost) platformName = 'Telemost';
|
||||
else if (data.platform === Platform.WBStream) platformName = 'WBStream';
|
||||
else if (data.platform === Platform.Dion) platformName = 'DION';
|
||||
else if (data.platform === Platform.Bitrix) platformName = 'Bitrix';
|
||||
else if (data.platform === Platform.Blink) platformName = 'Blink';
|
||||
const botName = isHeadless ? `Bot-${platformName}` : `Bot-${platformName} (legacy)`;
|
||||
this.tabs[data.tabId] = {
|
||||
wv: null,
|
||||
@@ -225,6 +233,11 @@ export class RendererTabManager {
|
||||
tab.callInfo.protocol = trimmed.split(HeadlessLogMarker.PROTOCOL)[1].trim();
|
||||
changed = true;
|
||||
}
|
||||
if (trimmed.includes(HeadlessLogMarker.LOGIN_LINK)) {
|
||||
tab.loginLink = trimmed.split(HeadlessLogMarker.LOGIN_LINK)[1].trim();
|
||||
tab.headlessStatus = 'Waiting for login...';
|
||||
changed = true;
|
||||
}
|
||||
if (trimmed.includes('[FATAL]')) {
|
||||
const fatalMessage = trimmed.split('[FATAL]')[1]?.trim() || 'fatal error';
|
||||
tab.headlessStatus = 'Disconnected: ' + fatalMessage;
|
||||
|
||||
Reference in new issue
Block a user