diff --git a/shell/initialize/index.js b/shell/initialize/index.js index b819f51139..fdc7b2998b 100644 --- a/shell/initialize/index.js +++ b/shell/initialize/index.js @@ -36,7 +36,6 @@ import '../plugins/global-formatters'; import '../plugins/trim-whitespace'; import '../plugins/extend-router'; -import consolePlugin from '../plugins/console'; import intNumber from '../plugins/int-number'; import nuxtClientInit from '../plugins/nuxt-client-init'; import replaceAll from '../plugins/replaceall'; @@ -274,10 +273,6 @@ async function createApp(ssrContext, config = {}) { await axiosShell(app.context, inject); } - if (process.client && typeof consolePlugin === 'function') { - await consolePlugin(app.context, inject); - } - if (process.client && typeof intNumber === 'function') { await intNumber(app.context, inject); } diff --git a/shell/pages/diagnostic.vue b/shell/pages/diagnostic.vue index af7edb0767..f3c618dd33 100644 --- a/shell/pages/diagnostic.vue +++ b/shell/pages/diagnostic.vue @@ -120,9 +120,6 @@ export default { systemInformation.jsMemory.value += `, ${ this.t('about.diagnostic.systemInformation.memUsedJsHeapSize', { usedJSHeapSize: window?.performance?.memory?.usedJSHeapSize }) }`; } - // scroll logs container to the bottom - this.scrollLogsToBottom(); - return { systemInformation, topFifteenForResponseTime: null, @@ -130,16 +127,9 @@ export default { finalCounts: null, includeResponseTimes: true, storeMapping: this.$store?._modules?.root?.state, - latestLogs: console.logs // eslint-disable-line no-console }; }, - watch: { - latestLogs() { - this.scrollLogsToBottom(); - } - }, - computed: { clusterCount() { return this.finalCounts?.length; @@ -147,14 +137,6 @@ export default { }, methods: { - scrollLogsToBottom() { - this.$nextTick(() => { - const logsContainer = document.querySelector('.logs-container'); - - logsContainer.scrollTop = logsContainer.scrollHeight; - }); - }, - generateKey(data) { const randomize = Math.random() * 10000; @@ -166,7 +148,6 @@ export default { const fileName = 'rancher-diagnostic-data.json'; const data = { systemInformation: this.systemInformation, - logs: this.latestLogs, storeMapping: this.parseStoreData(this.storeMapping), resourceCounts: this.finalCounts, responseTimes: this.responseTimes @@ -411,26 +392,6 @@ export default { - -
-

- {{ t('about.diagnostic.logs.subtitle') }} -

- -
- diff --git a/shell/plugins/console.js b/shell/plugins/console.js deleted file mode 100644 index 19da392b7f..0000000000 --- a/shell/plugins/console.js +++ /dev/null @@ -1,34 +0,0 @@ -/* eslint-disable no-console */ -export default () => { - const logTypes = ['warn', 'error']; - const MAX_LOGS_STORED = 400; - - if (!process.env.dev) { - console.logLog = console.log.bind(console); - console.infoLog = console.info.bind(console); - logTypes.push('log'); - logTypes.push('info'); - } - - console.warnLog = console.warn.bind(console); - console.errorLog = console.error.bind(console); - console.logs = []; - - logTypes.forEach((type) => { - console[type] = function() { - const dataLogged = { - type, - dateTimeUtc: new Date().toUTCString(), - timestamp: Date.now(), - data: Array.from(arguments) - }; - - if (console.logs.length >= MAX_LOGS_STORED) { - console.logs.shift(); - } - - console.logs.push(dataLogged); - console[`${ type }Log`].apply(console, arguments); - }; - }); -};