Files
openobserve/web
Sai Nikhil 7bf9770b9a fix: sorting issue in query management page (#8305)
### **User description**
This PR fixes the issue that is related to sorting doesn't work properly
for more number of records for execution duration and query range


___

### **PR Type**
Bug fix, Enhancement


___

### **Description**
- Centralize duration utilities in `zincutils`

- Fix sorting by using raw seconds

- Render durations via table slots

- Improve query range formatting


___

### Diagram Walkthrough


```mermaid
flowchart LR
  utils["zincutils.ts: add time helpers"] -- "import/use" --> runningList["RunningQueriesList.vue: slot-based render"]
  utils -- "import/use" --> summaryList["SummaryList.vue: slot-based render"]
  runningQueries["RunningQueries.vue: data shaping"] -- "use raw values" --> tables["Tables sort correctly"]
```



<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><table>
<tr>
  <td>
    <details>
<summary><strong>zincutils.ts</strong><dd><code>Add shared time/duration
utilities</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

web/src/utils/zincutils.ts

<ul><li>Add <code>localTimeToMicroseconds</code> helper.<br> <li> Add
<code>getDuration</code> returning seconds and formatted.<br> <li>
Export these utilities for reuse.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8305/files#diff-d3d59688cccdcc6c84ebe88b698c6910030abecc3125f4c0ef81b0df023699ba">+23/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>RunningQueriesList.vue</strong><dd><code>Render
durations via slots using utils</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

web/src/components/queries/RunningQueriesList.vue

<ul><li>Add table slots to format <code>duration</code> and
<code>queryRange</code>.<br> <li> Import and expose
<code>getDuration</code> and <code>durationFormatter</code>.<br> <li>
Display duration from <code>created_at</code> via util.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8305/files#diff-eb568491630bd1b80935cc0b02498d40274ede0e5be78593a0b49ca17fbbe627">+13/-0</a>&nbsp;
&nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>SummaryList.vue</strong><dd><code>Format summary
durations with table slots</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

web/src/components/queries/SummaryList.vue

<ul><li>Add slots to format <code>duration</code> and
<code>queryRange</code>.<br> <li> Import and expose
<code>durationFormatter</code>.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8305/files#diff-d844d0a406c5fe3b58bc254f838bfa51352721174666ebd43bbf008aa6db6f5f">+12/-0</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Bug fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>RunningQueries.vue</strong><dd><code>Use raw values and
shared duration util</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; </dd></summary>
<hr>

web/src/components/queries/RunningQueries.vue

<ul><li>Import <code>getDuration</code> from utils.<br> <li> Keep
<code>duration</code> and <code>queryRange</code> as raw values.<br>
<li> Remove local <code>getDuration</code> impl.<br> <li> Adjust
pagination code formatting.</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/8305/files#diff-6f0e18626a986d934c08c368ac383179c56bfcd914a27619ba748f43629c926b">+6/-14</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-09-11 23:02:12 +05:30
..
2023-02-02 09:03:11 +05:30
2023-08-06 01:29:13 +08:00
2023-02-02 09:03:11 +05:30
2023-02-02 09:03:11 +05:30
2023-02-02 09:03:11 +05:30
2024-04-03 12:49:25 +05:30
2023-02-02 09:03:11 +05:30

web

This template should help get you started developing with Vue 3 in Vite.

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:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from 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