### **User description** This PR fixes 1. if user clicks on ai shortcut to add a log line and user removes that and again tries to add same line it should add 2. if user have filtered columns then user should get only those columns in the input ai when clicks on shortcut ___ ### **PR Type** Enhancement ___ ### **Description** - Reset AI chat input before setting context - Include timestamp and all fields for UDS schemas - Deep copy schemas to prevent mutation - Filter rows by selected columns when sending ___ ### **Changes diagram** ```mermaid flowchart LR A["User clicks AI chat"] --> B["Reset aiChatInputContext"] B --> C["nextTick callback"] C --> D["Set aiChatInputContext"] D --> E["Dispatch enable AI chat"] ``` ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>AddFunction.vue</strong><dd><code>Reset aiChatInputContext to trigger watcher</code> </dd></summary> <hr> web/src/components/functions/AddFunction.vue <li>Imported <code>nextTick</code> for async updates<br> <li> Reset <code>aiChatInputContext</code> before setting<br> <li> Used <code>nextTick</code> to trigger watcher on same value </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7520/files#diff-ebfd6c538f3cd3ecb9ab17550fd76e2e89e7a1abccc83a7505077e4af3eee110">+7/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>ScheduledPipeline.vue</strong><dd><code>Add UDS timestamp and all_fields to schema</code> </dd></summary> <hr> web/src/components/pipeline/NodeForm/ScheduledPipeline.vue <li>Typed <code>userDefinedFields</code> as <code>any[]</code><br> <li> Annotated <code>payload</code> as <code>any</code><br> <li> Added UDS logic: push timestamp and all_fields </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7520/files#diff-63d8f838bb880356e7804b4a57fd9223d4f2c189de7aadc7cf33cba723b29aaf">+14/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>MainLayout.vue</strong><dd><code>Reset chat context for watcher trigger</code> </dd></summary> <hr> web/src/layouts/MainLayout.vue <li>Reset <code>aiChatInputContext</code> before setting<br> <li> Wrapped setting in <code>nextTick</code> callback </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7520/files#diff-91e4134141264c4624d4eb4cfa987b33ed31eb6f551e089c0b26f2610dd54362">+6/-1</a> </td> </tr> <tr> <td> <details> <summary><strong>Index.vue</strong><dd><code>Deep copy and extend UDS schema</code> </dd></summary> <hr> web/src/plugins/logs/Index.vue <li>Imported <code>deepCopy</code> utility<br> <li> Deep-copied schema to avoid mutations<br> <li> Added timestamp and all_fields only if UDS enabled </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7520/files#diff-0323c3da69b369843c5d72bf4df5b00ca6b5147192a213baf331659ecf92af62">+20/-3</a> </td> </tr> <tr> <td> <details> <summary><strong>JsonPreview.vue</strong><dd><code>Simplify sendToAiChat parameters</code> </dd></summary> <hr> web/src/plugins/logs/JsonPreview.vue <li>Simplified <code>sendToAiChat</code> signature<br> <li> Removed unused <code>key</code> argument<br> <li> Emit only <code>value</code> to parent </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7520/files#diff-3985073134d35ff074742944b114d0905524038b42e6d2ac887fef2c8436fb16">+2/-2</a> </td> </tr> <tr> <td> <details> <summary><strong>TenstackTable.vue</strong><dd><code>Filter table row before AI chat send</code> </dd></summary> <hr> web/src/plugins/logs/TenstackTable.vue <li>Enhanced <code>sendToAiChat</code> to handle full row flag<br> <li> Filtered row based on selected columns<br> <li> Added helper functions for filtering </details> </td> <td><a href="https://github.com/openobserve/openobserve/pull/7520/files#diff-bc3c669f5ab65a42ae378df1f7d6b35014c9c220790bdcc72b47f55d1385dc22">+38/-3</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about PR-Agent usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></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