From 9734830a7428f431ecfb1d1a8105bd2f9d83fa8c Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Sat, 13 Feb 2021 12:14:14 +0100 Subject: [PATCH] web demo fixes --- terminus-core/src/components/appRoot.component.scss | 1 + terminus-core/src/index.ts | 7 +++++-- terminus-core/src/services/log.service.ts | 10 ++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/terminus-core/src/components/appRoot.component.scss b/terminus-core/src/components/appRoot.component.scss index fd0fb27d..095d8003 100644 --- a/terminus-core/src/components/appRoot.component.scss +++ b/terminus-core/src/components/appRoot.component.scss @@ -85,6 +85,7 @@ $side-tab-width: 200px; cursor: pointer; display: flex; + align-items: center; padding: 0 15px; flex: 0 0 auto; border-bottom: 2px solid transparent; diff --git a/terminus-core/src/index.ts b/terminus-core/src/index.ts index 409b0f4e..5bd1613d 100644 --- a/terminus-core/src/index.ts +++ b/terminus-core/src/index.ts @@ -44,8 +44,11 @@ import 'ng2-dnd/bundles/style.css' // PerfectScrollbar fix import { fromEvent } from 'rxjs/internal/observable/fromEvent' import { merge } from 'rxjs/internal/observable/merge' -require('rxjs').fromEvent = fromEvent -require('rxjs').merge = merge + +try { + require('rxjs').fromEvent = fromEvent + require('rxjs').merge = merge +} catch {} const PROVIDERS = [ { provide: HotkeyProvider, useClass: AppHotkeyProvider, multi: true }, diff --git a/terminus-core/src/services/log.service.ts b/terminus-core/src/services/log.service.ts index cb8faec2..25ad3cd1 100644 --- a/terminus-core/src/services/log.service.ts +++ b/terminus-core/src/services/log.service.ts @@ -1,11 +1,13 @@ import { Injectable } from '@angular/core' import { ElectronService } from './electron.service' -import * as winston from 'winston' +import type * as winston from 'winston' import * as fs from 'fs' import * as path from 'path' const initializeWinston = (electron: ElectronService) => { const logDirectory = electron.app.getPath('userData') + // eslint-disable-next-line + const winston = require('winston') if (!fs.existsSync(logDirectory)) { fs.mkdirSync(logDirectory) @@ -64,7 +66,11 @@ export class LogService { /** @hidden */ private constructor (electron: ElectronService) { - this.log = initializeWinston(electron) + if (!process.env.XWEB) { + this.log = initializeWinston(electron) + } else { + this.log = console as any + } } create (name: string): Logger {