浏览代码

refactor: remove logging modules

NGPixel 3 年之前
父节点
当前提交
70a2e3ca63

+ 0 - 8
server/modules/logging/airbrake/definition.yml

@@ -1,8 +0,0 @@
-key: airbrake
-title: Airbrake
-description: Airbrake is the leading exception reporting service, currently providing error monitoring for 50,000 applications with support for 18 programming languages.
-author: requarks.io
-logo: https://static.requarks.io/logo/airbrake.svg
-website: https://airbrake.io/
-defaultLevel: warn
-props: {}

+ 0 - 9
server/modules/logging/airbrake/logger.js

@@ -1,9 +0,0 @@
-// ------------------------------------
-// Airbrake
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-
-  }
-}

+ 0 - 12
server/modules/logging/bugsnag/definition.yml

@@ -1,12 +0,0 @@
-key: bugsnag
-title: Bugsnag
-description: Bugsnag monitors apps for errors that impact customers & reports all diagnostic data.
-author: requarks.io
-logo: https://static.requarks.io/logo/bugsnag.svg
-website: https://www.bugsnag.com/
-defaultLevel: warn
-props:
-  key:
-    type: String
-    title: Key
-    hint: Bugsnag Project Notifier key

+ 0 - 29
server/modules/logging/bugsnag/logger.js

@@ -1,29 +0,0 @@
-const util = require('util')
-const winston = require('winston')
-const _ = require('lodash')
-
-// ------------------------------------
-// Bugsnag
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-    let BugsnagLogger = winston.transports.BugsnagLogger = function (options) {
-      this.name = 'bugsnagLogger'
-      this.level = options.level || 'warn'
-      this.bugsnag = require('bugsnag')
-      this.bugsnag.register(options.key)
-    }
-    util.inherits(BugsnagLogger, winston.Transport)
-
-    BugsnagLogger.prototype.log = function (level, msg, meta, callback) {
-      this.bugsnag.notify(new Error(msg), _.assignIn(meta, { severity: level }))
-      callback(null, true)
-    }
-
-    logger.add(new BugsnagLogger({
-      level: 'warn',
-      key: conf.key
-    }))
-  }
-}

+ 0 - 8
server/modules/logging/disk/definition.yml

@@ -1,8 +0,0 @@
-key: disk
-title: Log Files
-description: Outputs log files on local disk.
-author: requarks.io
-logo: https://static.requarks.io/logo/local-fs.svg
-website: https://wiki.js.org
-defaultLevel: info
-props: {}

+ 0 - 9
server/modules/logging/disk/logger.js

@@ -1,9 +0,0 @@
-// ------------------------------------
-// Disk
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-
-  }
-}

+ 0 - 8
server/modules/logging/eventlog/definition.yml

@@ -1,8 +0,0 @@
-key: eventlog
-title: Windows Event Log
-description: Report logs to the Windows Event Log
-author: requarks.io
-logo: https://static.requarks.io/logo/windows-server.svg
-website: https://wiki.js.org
-defaultLevel: warn
-props: {}

+ 0 - 9
server/modules/logging/eventlog/logger.js

@@ -1,9 +0,0 @@
-// ------------------------------------
-// Windows Event Log
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-
-  }
-}

+ 0 - 16
server/modules/logging/loggly/definition.yml

@@ -1,16 +0,0 @@
-key: loggly
-title: Loggly
-description: Log Analysis / Log Management by Loggly, the world's most popular log analysis & monitoring in the cloud.
-author: requarks.io
-logo: https://static.requarks.io/logo/loggly.svg
-website: https://www.loggly.com/
-defaultLevel: warn
-props:
-  token:
-    type: String
-    title: Token
-    hint: Loggly Token
-  subdomain:
-    type: String
-    title: Subdomain
-    hint: Loggly Subdomain

+ 0 - 18
server/modules/logging/loggly/logger.js

@@ -1,18 +0,0 @@
-const winston = require('winston')
-
-// ------------------------------------
-// Loggly
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-    require('winston-loggly-bulk')
-    logger.add(new winston.transports.Loggly({
-      token: conf.token,
-      subdomain: conf.subdomain,
-      tags: ['wiki-js'],
-      level: 'warn',
-      json: true
-    }))
-  }
-}

+ 0 - 8
server/modules/logging/logstash/definition.yml

@@ -1,8 +0,0 @@
-key: logstash
-title: Logstash
-description: Logstash is an open source tool for collecting, parsing, and storing logs for future use.
-author: requarks.io
-logo: https://static.requarks.io/logo/logstash.svg
-website: https://www.elastic.co/products/logstash
-defaultLevel: warn
-props: {}

+ 0 - 9
server/modules/logging/logstash/logger.js

@@ -1,9 +0,0 @@
-// ------------------------------------
-// Logstash
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-
-  }
-}

+ 0 - 8
server/modules/logging/newrelic/definition.yml

@@ -1,8 +0,0 @@
-key: newrelic
-title: New Relic
-description: New Relic's digital intelligence platform lets developers, ops, and tech teams measure and monitor the performance of their applications and infrastructure.
-author: requarks.io
-logo: https://static.requarks.io/logo/newrelic.svg
-website: https://newrelic.com/
-defaultLevel: warn
-props: {}

+ 0 - 9
server/modules/logging/newrelic/logger.js

@@ -1,9 +0,0 @@
-// ------------------------------------
-// New Relic
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-
-  }
-}

+ 0 - 14
server/modules/logging/papertrail/definition.yml

@@ -1,14 +0,0 @@
-key: papertrail
-title: Papertrail
-description: Frustration-free log management.
-author: requarks.io
-logo: https://static.requarks.io/logo/papertrail.svg
-website: https://papertrailapp.com/
-defaultLevel: warn
-props:
-  host:
-    type: String
-    title: Host
-  port:
-    type: Number
-    title: Port

+ 0 - 18
server/modules/logging/papertrail/logger.js

@@ -1,18 +0,0 @@
-const winston = require('winston')
-
-// ------------------------------------
-// Papertrail
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-    // eslint-disable-next-line no-unused-expressions
-    require('winston-papertrail').Papertrail // NOSONAR
-    logger.add(new winston.transports.Papertrail({
-      host: conf.host,
-      port: conf.port,
-      level: 'warn',
-      program: 'wiki.js'
-    }))
-  }
-}

+ 0 - 8
server/modules/logging/raygun/definition.yml

@@ -1,8 +0,0 @@
-key: raygun
-title: Raygun
-description: Error, crash and performance monitoring for software teams.
-author: requarks.io
-logo: https://static.requarks.io/logo/raygun.svg
-website: https://raygun.com/
-defaultLevel: warn
-props: {}

+ 0 - 9
server/modules/logging/raygun/logger.js

@@ -1,9 +0,0 @@
-// ------------------------------------
-// Raygun
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-
-  }
-}

+ 0 - 11
server/modules/logging/rollbar/definition.yml

@@ -1,11 +0,0 @@
-key: rollbar
-title: Rollbar
-description: Rollbar provides real-time error alerting & debugging tools for developers.
-author: requarks.io
-logo: https://static.requarks.io/logo/rollbar.svg
-website: https://rollbar.com/
-defaultLevel: warn
-props:
-  key:
-    type: String
-    title: Key

+ 0 - 29
server/modules/logging/rollbar/logger.js

@@ -1,29 +0,0 @@
-const util = require('util')
-const winston = require('winston')
-const _ = require('lodash')
-
-// ------------------------------------
-// Rollbar
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-    let RollbarLogger = winston.transports.RollbarLogger = function (options) {
-      this.name = 'rollbarLogger'
-      this.level = options.level || 'warn'
-      this.rollbar = require('rollbar')
-      this.rollbar.init(options.key)
-    }
-    util.inherits(RollbarLogger, winston.Transport)
-
-    RollbarLogger.prototype.log = function (level, msg, meta, callback) {
-      this.rollbar.handleErrorWithPayloadData(new Error(msg), _.assignIn(meta, { level }))
-      callback(null, true)
-    }
-
-    logger.add(new RollbarLogger({
-      level: 'warn',
-      key: conf.key
-    }))
-  }
-}

+ 0 - 11
server/modules/logging/sentry/definition.yml

@@ -1,11 +0,0 @@
-key: sentry
-title: Sentry
-description: Open-source error tracking that helps developers monitor and fix crashes in real time.
-author: requarks.io
-logo: https://static.requarks.io/logo/sentry.svg
-website: https://sentry.io/
-defaultLevel: warn
-props:
-  key:
-    type: String
-    title: Key

+ 0 - 29
server/modules/logging/sentry/logger.js

@@ -1,29 +0,0 @@
-const util = require('util')
-const winston = require('winston')
-
-// ------------------------------------
-// Sentry
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-    let SentryLogger = winston.transports.SentryLogger = function (options) {
-      this.name = 'sentryLogger'
-      this.level = options.level || 'warn'
-      this.raven = require('raven')
-      this.raven.config(options.key).install()
-    }
-    util.inherits(SentryLogger, winston.Transport)
-
-    SentryLogger.prototype.log = function (level, msg, meta, callback) {
-      level = (level === 'warn') ? 'warning' : level
-      this.raven.captureMessage(msg, { level, extra: meta })
-      callback(null, true)
-    }
-
-    logger.add(new SentryLogger({
-      level: 'warn',
-      key: conf.key
-    }))
-  }
-}

+ 0 - 8
server/modules/logging/syslog/definition.yml

@@ -1,8 +0,0 @@
-key: syslog
-title: Syslog
-description: Syslog is a way for network devices to send event messages to a logging server.
-author: requarks.io
-logo: https://static.requarks.io/logo/syslog.svg
-website: https://wiki.js.org
-defaultLevel: warn
-props: {}

+ 0 - 9
server/modules/logging/syslog/logger.js

@@ -1,9 +0,0 @@
-// ------------------------------------
-// Syslog
-// ------------------------------------
-
-module.exports = {
-  init (logger, conf) {
-
-  }
-}

+ 1 - 1
ux/src/router/routes.js

@@ -29,7 +29,7 @@ const routes = [
     children: [
     children: [
       { path: '', redirect: '/_admin/dashboard' },
       { path: '', redirect: '/_admin/dashboard' },
       { path: 'dashboard', component: () => import('../pages/AdminDashboard.vue') },
       { path: 'dashboard', component: () => import('../pages/AdminDashboard.vue') },
-      // { path: 'sites', component: () => import('../pages/AdminSites.vue') },
+      { path: 'sites', component: () => import('../pages/AdminSites.vue') },
       // // -> Site
       // // -> Site
       // { path: ':siteid/general', component: () => import('../pages/AdminGeneral.vue') },
       // { path: ':siteid/general', component: () => import('../pages/AdminGeneral.vue') },
       { path: ':siteid/editors', component: () => import('../pages/AdminEditors.vue') },
       { path: ':siteid/editors', component: () => import('../pages/AdminEditors.vue') },

+ 3 - 0
ux/src/stores/admin.js

@@ -38,6 +38,9 @@ export const useAdminStore = defineStore('admin', {
         fetchPolicy: 'network-only'
         fetchPolicy: 'network-only'
       })
       })
       this.sites = cloneDeep(resp?.data?.sites ?? [])
       this.sites = cloneDeep(resp?.data?.sites ?? [])
+      if (!this.currentSiteId) {
+        this.currentSiteId = this.sites[0].id
+      }
     }
     }
   }
   }
 })
 })