SDA-3554 - Add accelerator to export logs (#1336)

This commit is contained in:
Kiran Niranjan 2022-02-02 09:54:47 +05:30 committed by GitHub
parent 64c87ad8c5
commit 5fbe4fbca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View File

@ -594,6 +594,7 @@ export class AppMenu {
submenu: [
{
click: async () => exportLogs(),
accelerator: 'Ctrl+Shift+D',
label: showLogsLabel,
},
{

View File

@ -15,6 +15,7 @@ import { logger } from '../common/logger';
* @param source {String} source path
* @param destination {String} destination path
* @param fileExtensions {Array} array of file ext
* @param retrievedLogs {Array} array of client logs
* @return {Promise<void>}
*/
const generateArchiveForDirectory = (

View File

@ -46,6 +46,7 @@ import {
} from './config-handler';
import crashHandler from './crash-handler';
import { mainEvents } from './main-event-handler';
import { exportLogs } from './reports-handler';
import { SpellChecker } from './spell-check-handler';
import { checkIfBuildExpired } from './ttl-handler';
import { versionHandler } from './version-handler';
@ -2004,6 +2005,9 @@ export class WindowHandler {
globalShortcut.register('Ctrl+numsub', zoomOut);
globalShortcut.register('Ctrl+num0', resetZoomLevel);
}
// Register export log shortcut
globalShortcut.register('Ctrl+Shift+D', () => this.onExportLogs());
}
/**
@ -2029,6 +2033,9 @@ export class WindowHandler {
globalShortcut.unregister(isMac ? 'Cmd+Alt+2' : 'Ctrl+Shift+2');
globalShortcut.unregister(isMac ? 'Cmd+Alt+3' : 'Ctrl+Shift+3');
}
// Unregister export log shortcut
globalShortcut.unregister('Ctrl+Shift+D');
}
/**
@ -2072,6 +2079,14 @@ export class WindowHandler {
reloadWindow(focusedWindow as ICustomBrowserWindow);
}
/**
* Exports all logs
*/
private onExportLogs(): void {
logger.info('window-handler: Exporting logs');
exportLogs();
}
/**
* Switch between clients 1.5, 2.0 and 2.0 daily
* @param clientSwitch client switch you want to switch to.