ask auth for headless if there is no cookies, add download logs button for headless
This commit is contained in:
1 parent
08bfbdaed7
commit
870118d5ab
9 files changed
+179
-24
No files matched your search
@@ -39,7 +39,6 @@
|
|||||||
<div class="headless-status" id="headlessStatus">Starting...</div>
|
<div class="headless-status" id="headlessStatus">Starting...</div>
|
||||||
<div class="headless-call-info" id="headlessCallInfo">
|
<div class="headless-call-info" id="headlessCallInfo">
|
||||||
<div class="headless-row"><span class="headless-label">Join link:</span> <a id="headlessJoinLink" href="#" class="headless-link"></a><img class="headless-copy" src="resources/icons8-copy-50.png" data-copy="headlessJoinLink" title="Copy"></div>
|
<div class="headless-row"><span class="headless-label">Join link:</span> <a id="headlessJoinLink" href="#" class="headless-link"></a><img class="headless-copy" src="resources/icons8-copy-50.png" data-copy="headlessJoinLink" title="Copy"></div>
|
||||||
<div class="headless-row"><span class="headless-label">Short:</span> <a id="headlessShortLink" href="#" class="headless-link"></a><img class="headless-copy" src="resources/icons8-copy-50.png" data-copy="headlessShortLink" title="Copy"></div>
|
|
||||||
<div class="headless-row"><span class="headless-label">TURN:</span> <span id="headlessTurn"></span></div>
|
<div class="headless-row"><span class="headless-label">TURN:</span> <span id="headlessTurn"></span></div>
|
||||||
<div class="headless-row"><span class="headless-label">Protocol:</span> <span id="headlessProtocol"></span></div>
|
<div class="headless-row"><span class="headless-label">Protocol:</span> <span id="headlessProtocol"></span></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -54,10 +53,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="logs" id="logsPanel" style="display:none">
|
<div class="logs" id="logsPanel" style="display:none">
|
||||||
<div class="log-panel">
|
<div class="log-panel">
|
||||||
<div class="log-title">Relay <span class="log-clear-btn" id="btnClearRelay" title="Clear">✕</span></div>
|
<div class="log-title">Relay <span class="log-clear-btn" id="btnClearRelay" title="Clear">✕</span><img class="log-download-btn" id="btnSaveLogsHeadless" src="resources/icons8-download-64.png" title="Save logs"></div>
|
||||||
<div class="log-content relay" id="relayLog"></div>
|
<div class="log-content relay" id="relayLog"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="log-panel">
|
<div class="log-panel" id="hookPanel">
|
||||||
<div class="log-title">Hook <span class="log-clear-btn" id="btnClearHook" title="Clear">✕</span></div>
|
<div class="log-title">Hook <span class="log-clear-btn" id="btnClearHook" title="Clear">✕</span></div>
|
||||||
<div class="log-content hook" id="hookLog"></div>
|
<div class="log-content hook" id="hookLog"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ export const VK_API_BASE_URL = 'https://api.vk.com/method';
|
|||||||
export const VK_IM_URL = 'https://vk.com/im';
|
export const VK_IM_URL = 'https://vk.com/im';
|
||||||
export const TELEMOST_URL = 'https://telemost.yandex.ru/';
|
export const TELEMOST_URL = 'https://telemost.yandex.ru/';
|
||||||
|
|
||||||
|
export const VK_LOGIN_URL = 'https://vk.com/';
|
||||||
|
export const YANDEX_LOGIN_URL = 'https://passport.yandex.ru/auth?retpath=https%3A%2F%2Ftelemost.yandex.ru%2F';
|
||||||
|
export const VK_AUTH_COOKIE = 'remixsid';
|
||||||
|
export const YANDEX_AUTH_COOKIE = 'Session_id';
|
||||||
|
|
||||||
export const SESSION_PARTITION = 'persist:creator';
|
export const SESSION_PARTITION = 'persist:creator';
|
||||||
export const WINDOW_WIDTH = 1200;
|
export const WINDOW_WIDTH = 1200;
|
||||||
export const WINDOW_HEIGHT = 800;
|
export const WINDOW_HEIGHT = 800;
|
||||||
@@ -52,6 +57,8 @@ export enum IPC {
|
|||||||
CLOSE_BOT_TAB = 'close-bot-tab',
|
CLOSE_BOT_TAB = 'close-bot-tab',
|
||||||
BOT_ERROR = 'bot-error',
|
BOT_ERROR = 'bot-error',
|
||||||
SEND_BOT_CALL_LINK = 'send-bot-call-link',
|
SEND_BOT_CALL_LINK = 'send-bot-call-link',
|
||||||
|
LOGIN_REQUIRED = 'login-required',
|
||||||
|
LOGIN_DONE = 'login-done',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const LOG_CAPTURE_SNIPPET = [
|
export const LOG_CAPTURE_SNIPPET = [
|
||||||
@@ -69,7 +76,6 @@ export const LOG_CAPTURE_SNIPPET = [
|
|||||||
export enum HeadlessLogMarker {
|
export enum HeadlessLogMarker {
|
||||||
CALL_CREATED = 'CALL CREATED',
|
CALL_CREATED = 'CALL CREATED',
|
||||||
JOIN_LINK = 'join_link:',
|
JOIN_LINK = 'join_link:',
|
||||||
SHORT_LINK = 'short:',
|
|
||||||
TURN = 'TURN:',
|
TURN = 'TURN:',
|
||||||
PROTOCOL = 'protocol:',
|
PROTOCOL = 'protocol:',
|
||||||
TUNNEL_CONNECTED = 'TUNNEL CONNECTED',
|
TUNNEL_CONNECTED = 'TUNNEL CONNECTED',
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ import {
|
|||||||
SESSION_PARTITION,
|
SESSION_PARTITION,
|
||||||
VK_COOKIE_DOMAINS,
|
VK_COOKIE_DOMAINS,
|
||||||
YANDEX_COOKIE_DOMAINS,
|
YANDEX_COOKIE_DOMAINS,
|
||||||
|
VK_LOGIN_URL,
|
||||||
|
YANDEX_LOGIN_URL,
|
||||||
|
VK_AUTH_COOKIE,
|
||||||
|
YANDEX_AUTH_COOKIE,
|
||||||
LOG_CAPTURE_SNIPPET,
|
LOG_CAPTURE_SNIPPET,
|
||||||
} from '../constants';
|
} from '../constants';
|
||||||
import { BotManager } from '../bot/bot-manager';
|
import { BotManager } from '../bot/bot-manager';
|
||||||
@@ -177,7 +181,11 @@ export class TabManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private attachProcessOutput(proc: ChildProcess, tabId: string): void {
|
private attachProcessOutput(
|
||||||
|
proc: ChildProcess,
|
||||||
|
tabId: string,
|
||||||
|
inspect?: (msg: string) => void,
|
||||||
|
): void {
|
||||||
const onData = (data: Buffer) => {
|
const onData = (data: Buffer) => {
|
||||||
data
|
data
|
||||||
.toString()
|
.toString()
|
||||||
@@ -187,6 +195,7 @@ export class TabManager {
|
|||||||
if (!msg) return;
|
if (!msg) return;
|
||||||
console.log(`[relay:${tabId}]`, msg);
|
console.log(`[relay:${tabId}]`, msg);
|
||||||
this.sendLog(tabId, msg);
|
this.sendLog(tabId, msg);
|
||||||
|
if (inspect) inspect(msg);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
proc.stdout?.on('data', onData);
|
proc.stdout?.on('data', onData);
|
||||||
@@ -240,14 +249,24 @@ export class TabManager {
|
|||||||
|
|
||||||
const isTelemost = platform === Platform.Telemost;
|
const isTelemost = platform === Platform.Telemost;
|
||||||
tab.tunnelMode = isTelemost ? TunnelMode.HeadlessTelemost : TunnelMode.HeadlessVK;
|
tab.tunnelMode = isTelemost ? TunnelMode.HeadlessTelemost : TunnelMode.HeadlessVK;
|
||||||
const cookies = isTelemost
|
const authCookie = isTelemost ? YANDEX_AUTH_COOKIE : VK_AUTH_COOKIE;
|
||||||
? await this.getYandexCookies()
|
const loginUrl = isTelemost ? YANDEX_LOGIN_URL : VK_LOGIN_URL;
|
||||||
: await this.getVKCookies();
|
const cookieDomains = isTelemost ? YANDEX_COOKIE_DOMAINS : VK_COOKIE_DOMAINS;
|
||||||
if (cookies.length === 0) {
|
const platformName = isTelemost ? 'Yandex' : 'VK';
|
||||||
const name = isTelemost ? 'Yandex' : 'VK';
|
let cookies = isTelemost ? await this.getYandexCookies() : await this.getVKCookies();
|
||||||
this.sendLog(tabId, `No ${name} cookies found. Please log into ${name} first.`);
|
if (!cookies.some((c) => c.name === authCookie)) {
|
||||||
return;
|
this.sendLog(tabId, `No ${platformName} session found, opening login.`);
|
||||||
|
if (this._mainWindow && !this._mainWindow.isDestroyed()) {
|
||||||
|
this._mainWindow.webContents.send(IPC.LOGIN_REQUIRED, { tabId, url: loginUrl });
|
||||||
}
|
}
|
||||||
|
await this.waitForLogin(cookieDomains, authCookie);
|
||||||
|
if (this._mainWindow && !this._mainWindow.isDestroyed()) {
|
||||||
|
this._mainWindow.webContents.send(IPC.LOGIN_DONE, { tabId });
|
||||||
|
}
|
||||||
|
this.sendLog(tabId, `${platformName} login captured.`);
|
||||||
|
cookies = isTelemost ? await this.getYandexCookies() : await this.getVKCookies();
|
||||||
|
}
|
||||||
|
this.sendLog(tabId, `${platformName} cookies (${cookies.length}): ${cookies.map((c) => c.name).join(', ')}`);
|
||||||
this.killRelay(tabId, tab);
|
this.killRelay(tabId, tab);
|
||||||
const cookiesPath = path.join(app.getPath('userData'), `cookies-${platform}.json`);
|
const cookiesPath = path.join(app.getPath('userData'), `cookies-${platform}.json`);
|
||||||
await fs.writeFile(cookiesPath, JSON.stringify(cookies));
|
await fs.writeFile(cookiesPath, JSON.stringify(cookies));
|
||||||
@@ -256,9 +275,63 @@ export class TabManager {
|
|||||||
stdio: ['ignore', 'pipe', 'pipe'],
|
stdio: ['ignore', 'pipe', 'pipe'],
|
||||||
});
|
});
|
||||||
tab.relay = proc;
|
tab.relay = proc;
|
||||||
this.attachProcessOutput(proc, tabId);
|
let sawAuthFailure = false;
|
||||||
proc.on('close', (code) => {
|
this.attachProcessOutput(proc, tabId, (msg) => {
|
||||||
|
if (msg.includes('status 401') || msg.includes('"UnauthorizedError"')) {
|
||||||
|
sawAuthFailure = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
proc.on('close', async (code) => {
|
||||||
this.sendLog(tabId, `Headless exited with code ${code}`);
|
this.sendLog(tabId, `Headless exited with code ${code}`);
|
||||||
|
if (sawAuthFailure) {
|
||||||
|
this.sendLog(tabId, `${platformName} session rejected (401), clearing and re-prompting login.`);
|
||||||
|
await this.clearAuthCookies(cookieDomains, authCookie);
|
||||||
|
if (this.tabs.get(tabId) === tab) {
|
||||||
|
this.startHeadless(tabId, platform);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async clearAuthCookies(cookieDomains: string[], authCookieName: string): Promise<void> {
|
||||||
|
const ses = session.fromPartition(SESSION_PARTITION);
|
||||||
|
const matches = await ses.cookies.get({ name: authCookieName });
|
||||||
|
for (const cookie of matches) {
|
||||||
|
if (!cookie.domain || !cookieDomains.some((d) => cookie.domain!.includes(d))) continue;
|
||||||
|
const host = cookie.domain.startsWith('.') ? cookie.domain.slice(1) : cookie.domain;
|
||||||
|
const url = `https://${host}${cookie.path || '/'}`;
|
||||||
|
try {
|
||||||
|
await ses.cookies.remove(url, cookie.name);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(`[COOKIES] failed to remove ${cookie.name} on ${url}:`, err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private waitForLogin(cookieDomains: string[], authCookieName: string): Promise<void> {
|
||||||
|
return new Promise((resolve) => {
|
||||||
|
const ses = session.fromPartition(SESSION_PARTITION);
|
||||||
|
const finish = () => {
|
||||||
|
ses.cookies.removeListener('changed', onChanged);
|
||||||
|
resolve();
|
||||||
|
};
|
||||||
|
const onChanged = (
|
||||||
|
_e: Electron.Event,
|
||||||
|
cookie: Electron.Cookie,
|
||||||
|
_cause: string,
|
||||||
|
removed: boolean,
|
||||||
|
) => {
|
||||||
|
if (removed) return;
|
||||||
|
if (cookie.name !== authCookieName) return;
|
||||||
|
if (!cookie.domain || !cookieDomains.some((d) => cookie.domain!.includes(d))) return;
|
||||||
|
finish();
|
||||||
|
};
|
||||||
|
ses.cookies.on('changed', onChanged);
|
||||||
|
ses.cookies.get({ name: authCookieName }).then((found) => {
|
||||||
|
if (found.some((c) => c.domain && cookieDomains.some((d) => c.domain!.includes(d)))) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,4 +44,10 @@ import { IPC } from '../constants';
|
|||||||
onCloseBotTab(cb: (data: any) => void) {
|
onCloseBotTab(cb: (data: any) => void) {
|
||||||
ipcRenderer.on(IPC.CLOSE_BOT_TAB, (_e, data) => cb(data));
|
ipcRenderer.on(IPC.CLOSE_BOT_TAB, (_e, data) => cb(data));
|
||||||
},
|
},
|
||||||
|
onLoginRequired(cb: (tabId: string, url: string) => void) {
|
||||||
|
ipcRenderer.on(IPC.LOGIN_REQUIRED, (_e, data) => cb(data.tabId, data.url));
|
||||||
|
},
|
||||||
|
onLoginDone(cb: (tabId: string) => void) {
|
||||||
|
ipcRenderer.on(IPC.LOGIN_DONE, (_e, data) => cb(data.tabId));
|
||||||
|
},
|
||||||
};
|
};
|
||||||
@@ -27,6 +27,7 @@ export function renderContent(tm: RendererTabManager): void {
|
|||||||
const toolbar = document.getElementById('toolbar')!;
|
const toolbar = document.getElementById('toolbar')!;
|
||||||
const logsPanel = document.getElementById('logsPanel')!;
|
const logsPanel = document.getElementById('logsPanel')!;
|
||||||
const headlessInfo = document.getElementById('headlessInfo')!;
|
const headlessInfo = document.getElementById('headlessInfo')!;
|
||||||
|
const hookPanel = document.getElementById('hookPanel')!;
|
||||||
|
|
||||||
const webviews = content.querySelectorAll('webview');
|
const webviews = content.querySelectorAll('webview');
|
||||||
webviews.forEach((wv) => wv.classList.add('hidden'));
|
webviews.forEach((wv) => wv.classList.add('hidden'));
|
||||||
@@ -42,7 +43,13 @@ export function renderContent(tm: RendererTabManager): void {
|
|||||||
logsPanel.style.display = 'flex';
|
logsPanel.style.display = 'flex';
|
||||||
|
|
||||||
const activeTab = tm.tabs[tm.activeTabId];
|
const activeTab = tm.tabs[tm.activeTabId];
|
||||||
if (activeTab.headless) {
|
hookPanel.style.display = activeTab.headless ? 'none' : 'flex';
|
||||||
|
logsPanel.classList.toggle('relay-only', activeTab.headless === true);
|
||||||
|
if (activeTab.loginWebview) {
|
||||||
|
toolbar.style.display = 'none';
|
||||||
|
headlessInfo.style.display = 'none';
|
||||||
|
activeTab.loginWebview.classList.remove('hidden');
|
||||||
|
} else if (activeTab.headless) {
|
||||||
toolbar.style.display = 'none';
|
toolbar.style.display = 'none';
|
||||||
headlessInfo.style.display = 'block';
|
headlessInfo.style.display = 'block';
|
||||||
let title = 'Headless VK';
|
let title = 'Headless VK';
|
||||||
@@ -68,7 +75,6 @@ export function renderContent(tm: RendererTabManager): void {
|
|||||||
} else {
|
} else {
|
||||||
callInfoVK.style.display = 'block';
|
callInfoVK.style.display = 'block';
|
||||||
document.getElementById('headlessJoinLink')!.textContent = callInfo.joinLink || '';
|
document.getElementById('headlessJoinLink')!.textContent = callInfo.joinLink || '';
|
||||||
document.getElementById('headlessShortLink')!.textContent = callInfo.shortLink || '';
|
|
||||||
document.getElementById('headlessTurn')!.textContent = callInfo.turn || '';
|
document.getElementById('headlessTurn')!.textContent = callInfo.turn || '';
|
||||||
document.getElementById('headlessProtocol')!.textContent = callInfo.protocol || '';
|
document.getElementById('headlessProtocol')!.textContent = callInfo.protocol || '';
|
||||||
}
|
}
|
||||||
@@ -105,6 +111,29 @@ export function scrollLogs(): void {
|
|||||||
if (hookEl) hookEl.scrollTop = hookEl.scrollHeight;
|
if (hookEl) hookEl.scrollTop = hookEl.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function attachLoginWebview(tm: RendererTabManager, tabId: string, url: string): void {
|
||||||
|
const tab = tm.tabs[tabId];
|
||||||
|
if (!tab) return;
|
||||||
|
if (tab.loginWebview) tab.loginWebview.remove();
|
||||||
|
const webview = document.createElement('webview') as unknown as Webview;
|
||||||
|
webview.setAttribute('src', url);
|
||||||
|
webview.setAttribute('partition', SESSION_PARTITION);
|
||||||
|
webview.setAttribute('useragent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36');
|
||||||
|
webview.classList.add('webview-full');
|
||||||
|
webview.dataset.tabId = tabId;
|
||||||
|
document.getElementById('content')!.appendChild(webview);
|
||||||
|
tab.loginWebview = webview;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function detachLoginWebview(tm: RendererTabManager, tabId: string): void {
|
||||||
|
const tab = tm.tabs[tabId];
|
||||||
|
if (!tab) return;
|
||||||
|
if (tab.loginWebview) {
|
||||||
|
tab.loginWebview.remove();
|
||||||
|
tab.loginWebview = undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function loadURL(tm: RendererTabManager, url: string): void {
|
export function loadURL(tm: RendererTabManager, url: string): void {
|
||||||
if (!tm.activeTabId) return;
|
if (!tm.activeTabId) return;
|
||||||
const activeTab = tm.tabs[tm.activeTabId];
|
const activeTab = tm.tabs[tm.activeTabId];
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import {
|
|||||||
exportCookies,
|
exportCookies,
|
||||||
copyToClipboard,
|
copyToClipboard,
|
||||||
renameTab,
|
renameTab,
|
||||||
|
attachLoginWebview,
|
||||||
|
detachLoginWebview,
|
||||||
} from './dom';
|
} from './dom';
|
||||||
import { VK_IM_URL, TELEMOST_URL } from '../constants';
|
import { VK_IM_URL, TELEMOST_URL } from '../constants';
|
||||||
import { Platform, Bridge, BotTabData, LogPanel, TunnelMode } from '../types';
|
import { Platform, Bridge, BotTabData, LogPanel, TunnelMode } from '../types';
|
||||||
@@ -103,15 +105,13 @@ function bindErrorPopup(): void {
|
|||||||
function bindLogEvents(): void {
|
function bindLogEvents(): void {
|
||||||
document.getElementById('btnClearRelay')!.addEventListener('click', () => clearLog(LogPanel.Relay));
|
document.getElementById('btnClearRelay')!.addEventListener('click', () => clearLog(LogPanel.Relay));
|
||||||
document.getElementById('btnClearHook')!.addEventListener('click', () => clearLog(LogPanel.Hook));
|
document.getElementById('btnClearHook')!.addEventListener('click', () => clearLog(LogPanel.Hook));
|
||||||
|
document.getElementById('btnSaveLogsHeadless')!.addEventListener('click', saveLogs);
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindHeadlessEvents(): void {
|
function bindHeadlessEvents(): void {
|
||||||
document.getElementById('headlessJoinLink')!.addEventListener('click', (event) => {
|
document.getElementById('headlessJoinLink')!.addEventListener('click', (event) => {
|
||||||
copyToClipboard((event.target as HTMLElement).textContent || '');
|
copyToClipboard((event.target as HTMLElement).textContent || '');
|
||||||
});
|
});
|
||||||
document.getElementById('headlessShortLink')!.addEventListener('click', (event) => {
|
|
||||||
copyToClipboard((event.target as HTMLElement).textContent || '');
|
|
||||||
});
|
|
||||||
document.getElementById('headlessInfo')!.addEventListener('click', (event) => {
|
document.getElementById('headlessInfo')!.addEventListener('click', (event) => {
|
||||||
const target = event.target as HTMLElement;
|
const target = event.target as HTMLElement;
|
||||||
const copyTarget = target.dataset.copy;
|
const copyTarget = target.dataset.copy;
|
||||||
@@ -172,6 +172,25 @@ function init(): void {
|
|||||||
tm.closeTab(data.tabId);
|
tm.closeTab(data.tabId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.bridge.onLoginRequired((tabId: string, url: string) => {
|
||||||
|
const tab = tm.tabs[tabId];
|
||||||
|
if (!tab) return;
|
||||||
|
tab.headlessStatus = 'Waiting for login...';
|
||||||
|
attachLoginWebview(tm, tabId, url);
|
||||||
|
if (tabId === tm.activeTabId) {
|
||||||
|
renderTabs(tm);
|
||||||
|
renderContent(tm);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.bridge.onLoginDone((tabId: string) => {
|
||||||
|
const tab = tm.tabs[tabId];
|
||||||
|
if (!tab) return;
|
||||||
|
detachLoginWebview(tm, tabId);
|
||||||
|
tab.headlessStatus = 'Starting...';
|
||||||
|
if (tabId === tm.activeTabId) renderContent(tm);
|
||||||
|
});
|
||||||
|
|
||||||
startHookLogPoller(tm);
|
startHookLogPoller(tm);
|
||||||
tm.autoStartBot();
|
tm.autoStartBot();
|
||||||
renderBotButton(tm);
|
renderBotButton(tm);
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ export class RendererTabManager {
|
|||||||
closeTab(tabId: string): void {
|
closeTab(tabId: string): void {
|
||||||
const tab = this.tabs[tabId];
|
const tab = this.tabs[tabId];
|
||||||
if (tab?.wv) tab.wv.remove();
|
if (tab?.wv) tab.wv.remove();
|
||||||
|
if (tab?.loginWebview) tab.loginWebview.remove();
|
||||||
window.bridge.closeTab(tabId);
|
window.bridge.closeTab(tabId);
|
||||||
delete this.tabs[tabId];
|
delete this.tabs[tabId];
|
||||||
if (this.activeTabId === tabId) {
|
if (this.activeTabId === tabId) {
|
||||||
@@ -159,10 +160,6 @@ export class RendererTabManager {
|
|||||||
}
|
}
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
if (trimmed.includes(HeadlessLogMarker.SHORT_LINK) && tab.callInfo) {
|
|
||||||
tab.callInfo.shortLink = trimmed.split(HeadlessLogMarker.SHORT_LINK)[1].trim();
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
if (trimmed.includes(HeadlessLogMarker.TURN) && tab.callInfo) {
|
if (trimmed.includes(HeadlessLogMarker.TURN) && tab.callInfo) {
|
||||||
tab.callInfo.turn = trimmed.split(HeadlessLogMarker.TURN)[1].trim();
|
tab.callInfo.turn = trimmed.split(HeadlessLogMarker.TURN)[1].trim();
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ export interface TabListEntry {
|
|||||||
|
|
||||||
export interface CallInfo {
|
export interface CallInfo {
|
||||||
joinLink?: string;
|
joinLink?: string;
|
||||||
shortLink?: string;
|
|
||||||
turn?: string;
|
turn?: string;
|
||||||
protocol?: string;
|
protocol?: string;
|
||||||
}
|
}
|
||||||
@@ -102,6 +101,7 @@ export interface RendererTab {
|
|||||||
headlessStatus?: string;
|
headlessStatus?: string;
|
||||||
callInfo?: CallInfo;
|
callInfo?: CallInfo;
|
||||||
tunnelConnected?: boolean;
|
tunnelConnected?: boolean;
|
||||||
|
loginWebview?: Webview;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BotTabData {
|
export interface BotTabData {
|
||||||
@@ -131,4 +131,6 @@ export interface Bridge {
|
|||||||
startHeadless(tabId: string, platform: string): Promise<void>;
|
startHeadless(tabId: string, platform: string): Promise<void>;
|
||||||
sendBotCallLink(tabId: string, link: string): Promise<void>;
|
sendBotCallLink(tabId: string, link: string): Promise<void>;
|
||||||
onCloseBotTab(cb: (data: { tabId: string }) => void): void;
|
onCloseBotTab(cb: (data: { tabId: string }) => void): void;
|
||||||
|
onLoginRequired(cb: (tabId: string, url: string) => void): void;
|
||||||
|
onLoginDone(cb: (tabId: string) => void): void;
|
||||||
}
|
}
|
||||||
@@ -334,6 +334,10 @@ body {
|
|||||||
border-right: 1px solid #333;
|
border-right: 1px solid #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logs.relay-only .log-panel:first-child {
|
||||||
|
border-right: none;
|
||||||
|
}
|
||||||
|
|
||||||
.log-title {
|
.log-title {
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -350,6 +354,26 @@ body {
|
|||||||
line-height: 13px;
|
line-height: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.log-download-btn {
|
||||||
|
display: none;
|
||||||
|
float: right;
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-top: -2px;
|
||||||
|
cursor: pointer;
|
||||||
|
filter: invert(0.55);
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-download-btn:hover {
|
||||||
|
filter: invert(0.88);
|
||||||
|
}
|
||||||
|
|
||||||
|
.logs.relay-only .log-download-btn {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.log-content {
|
.log-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|||||||
Reference in new issue
Block a user