### **User description** This PR helps to highlight text in logs page and also adds a left border for each depending upon the status of the logs ___ ### **PR Type** Enhancement ___ ### **Description** Add LogsHighLighting component for semantic highlighting Highlight query terms across logs and JSON Visual status indicators via colored borders/lines FTS-aware coloring for selected columns ___ ### Diagram Walkthrough ```mermaid flowchart LR Highlighter["LogsHighLighting.vue (new)"] -- "used by" --> Detail["DetailTable.vue"] Highlighter -- "used by" --> JsonPrev["JsonPreview.vue"] Highlighter -- "used by" --> Table["TenstackTable.vue"] Status["statusParser.ts (new)"] -- "row/log status color" --> Detail Status -- "row status stripe" --> Table Colors["keyValueParser.ts (new)"] -- "theme colors" --> Highlighter Composable["useTextHighlighter.ts (new)"] -- "highlight + semantic color" --> Highlighter Search["SearchResult.vue"] -- "pass highlight + FTS keys" --> Table ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8 files</summary><table> <tr> <td><strong>LogsHighLighting.vue</strong><dd><code>New component for semantic JSON/log highlighting</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-4ef4ac0444004add270de4da30fa39bafd95bd7f1c408d28cf6737655fc152eb">+324/-0</a> </td> </tr> <tr> <td><strong>DetailTable.vue</strong><dd><code>Add status top border and inline highlighting</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-80552b5d25fa6cef9fbbe430b1865d761c4b132284c2d2175afceea8cbabc8c7">+21/-6</a> </td> </tr> <tr> <td><strong>JsonPreview.vue</strong><dd><code>Use highlighter for key/value rendering</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-3985073134d35ff074742944b114d0905524038b42e6d2ac887fef2c8436fb16">+8/-14</a> </td> </tr> <tr> <td><strong>SearchResult.vue</strong><dd><code>Provide highlight query and FTS keys downstream</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-5e65533aa4754bb6d0074fda18ffc1ecacded3b9ca6bc28a161c3f6b12f20195">+16/-0</a> </td> </tr> <tr> <td><strong>TenstackTable.vue</strong><dd><code>Integrate highlighter and add status stripe</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-bc3c669f5ab65a42ae378df1f7d6b35014c9c220790bdcc72b47f55d1385dc22">+34/-6</a> </td> </tr> <tr> <td><strong>useTextHighlighter.ts</strong><dd><code>New composable for text highlighting logic</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-b18d6e5b667ce7b485a0592cddcaf47cf68b10b6a1b75bd006f21917c4343147">+486/-0</a> </td> </tr> <tr> <td><strong>keyValueParser.ts</strong><dd><code>Theme-aware color palette utilities</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-efcf08bdfe13eeac90f7dadbdb5892ae614d49b16f4f75bfc6225700d0ba7b73">+53/-0</a> </td> </tr> <tr> <td><strong>statusParser.ts</strong><dd><code>Derive log severity and colors</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-c189f5de10234dccf5f5e5b332dbb41f54c21a366ed4817c963bbf2e954d620a">+246/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Bug fix</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>Index.vue</strong><dd><code>Fix column update timeout scoping</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-0323c3da69b369843c5d72bf4df5b00ca6b5147192a213baf331659ecf92af62">+3/-3</a> </td> </tr> <tr> <td><strong>useLogs.ts</strong><dd><code>Correct FTS key detection logic</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/8059/files#diff-1040f61354f92711e0e77ed4e9bfa15586d45a94c7e2ab06cc37372068030e7b">+1/-1</a> </td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___
web
This template should help get you started developing with Vue 3 in Vite.
Recommended IDE Setup
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Type Support for .vue Imports in TS
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensionsfrom VSCode's command palette - Find
TypeScript and JavaScript Language Features, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Windowfrom the command palette.
Customize configuration
See Vite Configuration Reference.
Project Setup
npm install
Compile and Hot-Reload for Development
For stand-alone UI development environment, create .env file and which contains below environment variable
VITE_OPENOBSERVE_ENDPOINT=http://localhost:5080/
npm run dev
Type-Check, Compile and Minify for Production
npm run build
Run Unit Tests with Vitest
npm run test:unit
Run End-to-End Tests with Cypress
npm run test:e2e:dev
This runs the end-to-end tests against the Vite development server. It is much faster than the production build.
But it's still recommended to test the production build with test:e2e before deploying (e.g. in CI environments):
npm run build
npm run test:e2e
Lint with ESLint
npm run lint