Archived
2
0

fixed video not showing after reconnect

This commit is contained in:
Craig
2020-02-04 15:37:56 +00:00
parent 2680a1f702
commit ce319ce334
9 changed files with 59 additions and 15 deletions

37
client/src/plugins/log.ts Normal file
View File

@ -0,0 +1,37 @@
import { PluginObject } from 'vue'
interface Logger {
error(error: Error): void
warn(...log: any[]): void
info(...log: any[]): void
debug(...log: any[]): void
}
declare global {
const $log: Logger
interface Window {
$log: Logger
}
}
declare module 'vue/types/vue' {
interface Vue {
$log: Logger
}
}
const plugin: PluginObject<undefined> = {
install(Vue) {
window.$log = {
error: (error: Error) => console.error('[%cNEKO%c] %cERR', 'color: #498ad8;', '', 'color: #d84949;', error),
warn: (...log: any[]) => console.warn('[%cNEKO%c] %cWRN', 'color: #498ad8;', '', 'color: #eae364;', ...log),
info: (...log: any[]) => console.info('[%cNEKO%c] %cINF', 'color: #498ad8;', '', 'color: #4ac94c;', ...log),
debug: (...log: any[]) => console.log('[%cNEKO%c] %cDBG', 'color: #498ad8;', '', 'color: #eae364;', ...log),
}
Vue.prototype.$log = window.$log
},
}
export default plugin

View File

@ -18,10 +18,10 @@ declare module 'vue/types/vue' {
const plugin: PluginObject<undefined> = {
install(Vue) {
window.$client = new NekoClient()
.on('error', error => console.error('[%cNEKO%c] %cERR', 'color: #498ad8;', '', 'color: #d84949;', error))
.on('warn', (...log) => console.warn('[%cNEKO%c] %cWRN', 'color: #498ad8;', '', 'color: #eae364;', ...log))
.on('info', (...log) => console.info('[%cNEKO%c] %cINF', 'color: #498ad8;', '', 'color: #4ac94c;', ...log))
.on('debug', (...log) => console.log('[%cNEKO%c] %cDBG', 'color: #498ad8;', '', 'color: #eae364;', ...log))
.on('error', window.$log.error)
.on('warn', window.$log.warn)
.on('info', window.$log.info)
.on('debug', window.$log.debug)
Vue.prototype.$client = window.$client
},