From 98758ef18e77f1508ed95cf7e26cae2bc2d62493 Mon Sep 17 00:00:00 2001 From: jackyin Date: Tue, 20 Aug 2024 20:50:37 +0800 Subject: [PATCH] vmui: fix not found index.js in VictoriaLogs (#6770) fix #6764 the index.js file is for [this feature](https://github.com/VictoriaMetrics/VictoriaMetrics/tree/master/app/vmui#predefined-dashboards), the feature is just for victoriametrics. so the index.js is deleted in victorialogs. i just add an empty index.js to fix it. --------- Co-authored-by: hagen1778 (cherry picked from commit 3ebdd3bcb89a325b9740f2f1af65df80c1962c16) --- app/vmui/packages/vmui/config-overrides.js | 16 ++++++ app/vmui/packages/vmui/public/index.html | 56 ------------------- .../packages/vmui/public/victorialogs.html | 55 ++++++++++++++++++ .../packages/vmui/public/victoriametrics.html | 56 +++++++++++++++++++ app/vmui/packages/vmui/public/vmanomaly.html | 56 +++++++++++++++++++ docs/CHANGELOG.md | 1 + 6 files changed, 184 insertions(+), 56 deletions(-) delete mode 100644 app/vmui/packages/vmui/public/index.html create mode 100644 app/vmui/packages/vmui/public/victorialogs.html create mode 100644 app/vmui/packages/vmui/public/victoriametrics.html create mode 100644 app/vmui/packages/vmui/public/vmanomaly.html diff --git a/app/vmui/packages/vmui/config-overrides.js b/app/vmui/packages/vmui/config-overrides.js index 663e569e34..39c4c0d7e5 100644 --- a/app/vmui/packages/vmui/config-overrides.js +++ b/app/vmui/packages/vmui/config-overrides.js @@ -1,6 +1,22 @@ /* eslint-disable */ const { override, addExternalBabelPlugin, addWebpackAlias, addWebpackPlugin } = require("customize-cra"); const webpack = require("webpack"); +const fs = require('fs'); +const path = require('path'); + +// This will replace the default check +const pathIndexHTML = (() => { + switch (process.env.REACT_APP_TYPE) { + case 'logs': + return 'public/victorialogs.html'; + case 'anomaly': + return 'public/vmanomaly.html'; + default: + return 'public/victoriametrics.html'; + } +})(); +const fileContent = fs.readFileSync(path.resolve(__dirname, pathIndexHTML), 'utf8'); +fs.writeFileSync(path.resolve(__dirname, 'public/index.html'), fileContent); module.exports = override( addExternalBabelPlugin("@babel/plugin-proposal-nullish-coalescing-operator"), diff --git a/app/vmui/packages/vmui/public/index.html b/app/vmui/packages/vmui/public/index.html deleted file mode 100644 index 92cd53f081..0000000000 --- a/app/vmui/packages/vmui/public/index.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - VM UI - - - - - - - - - - - - - - - -
- - - diff --git a/app/vmui/packages/vmui/public/victorialogs.html b/app/vmui/packages/vmui/public/victorialogs.html new file mode 100644 index 0000000000..37a3d9cc3e --- /dev/null +++ b/app/vmui/packages/vmui/public/victorialogs.html @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + VM UI + + + + + + + + + + + + + + +
+ + + diff --git a/app/vmui/packages/vmui/public/victoriametrics.html b/app/vmui/packages/vmui/public/victoriametrics.html new file mode 100644 index 0000000000..a124935409 --- /dev/null +++ b/app/vmui/packages/vmui/public/victoriametrics.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + VM UI + + + + + + + + + + + + + + + +
+ + + diff --git a/app/vmui/packages/vmui/public/vmanomaly.html b/app/vmui/packages/vmui/public/vmanomaly.html new file mode 100644 index 0000000000..a124935409 --- /dev/null +++ b/app/vmui/packages/vmui/public/vmanomaly.html @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + VM UI + + + + + + + + + + + + + + + +
+ + + diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b5810e82f7..4aa873ddf8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -53,6 +53,7 @@ The value of `instance` label for those scrape targets will be changed from `