mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 00:08:55 +00:00
## 📦 Weekly NPM Dependencies Update This automated PR updates `web/` npm packages to their latest versions and regenerates `package-lock.json`. ### Updated Packages - **@rudderstack/analytics-js**: 3.6.0 → 3.31.6 - **@tanstack/vue-form**: ^1.29.1 → ^1.33.3 - **@tanstack/vue-table**: ^8.21.3 → ^9.0.0 - **@tanstack/vue-virtual**: ^3.13.16 → ^3.13.35 - **@vue-flow/core**: ^1.48.1 → ^1.48.2 - **acorn**: ^8.15.0 → ^8.18.0 - **acorn-walk**: ^8.3.4 → ^8.3.5 - **cron-parser**: ^5.4.0 → ^5.7.0 - **date-fns**: ^4.1.0 → ^4.4.0 - **dompurify**: ^3.4.12 → ^3.4.13 - **gridstack**: ^12.4.2 → ^13.0.2 - **js-beautify**: ^1.15.4 → ^2.0.3 - **js-cookie**: ^3.0.7 → ^3.0.8 - **js-yaml**: ^4.3.0 → ^5.2.3 - **lucide-vue-next**: ^0.562.0 → ^1.0.0 - **marked**: ^17.0.1 → ^18.0.9 - **moment-timezone**: ^0.6.0 → ^0.6.3 - **monaco-editor**: ^0.52.2 → ^0.56.0 - **node-polyfill-webpack-plugin**: ^4.0.0 → ^4.1.0 - **reka-ui**: ^2.9.6 → ^2.10.1 - **reodotdev**: ^1.0.0 → ^1.1.0 - **sql-formatter**: ^15.6.12 → ^15.8.2 - **uuid**: ^14.0.0 → ^14.0.1 - **vue**: ^3.5.26 → ^3.5.41 - **vue-i18n**: ^11.2.8 → ^11.4.8 - **vue-router**: ^4.6.4 → ^5.2.0 - **@cypress/vue**: ^6.0.2 → ^6.0.3 - **@cypress/webpack-dev-server**: ^5.4.1 → ^5.6.2 - **@iconify-json/majesticons**: ^1.2.4 → ^1.2.5 - **@iconify-json/material-symbols**: ^1.2.72 → ^1.2.88 - **@iconify-json/octicon**: ^1.2.25 → ^1.2.31 - **@intlify/core-base**: ^11.2.8 → ^11.4.8 - **@rushstack/eslint-patch**: ^1.15.0 → ^1.16.1 - **@tailwindcss/postcss**: ^4.1.18 → ^4.3.3 - **@tailwindcss/typography**: ^0.5.19 → ^0.5.20 - **@tailwindcss/vite**: ^4.1.18 → ^4.3.3 - **@types/jsdom**: ^27.0.0 → ^28.0.3 - **@types/leaflet**: ^1.9.21 → ^1.9.22 - **@types/luxon**: ^3.7.1 → ^3.7.3 - **@types/node**: ^25.0.3 → ^26.1.2 - **@vitejs/plugin-vue**: ^6.0.3 → ^6.0.8 - **@vitejs/plugin-vue-jsx**: ^5.1.3 → ^5.1.6 - **@vitest/coverage-v8**: ^4.0.16 → ^4.1.10 - **@vitest/ui**: ^4.0.16 → ^4.1.10 - **@vue/eslint-config-typescript**: ^14.6.0 → ^14.9.0 - **@vue/test-utils**: ^2.4.6 → ^2.4.11 - **@vue/tsconfig**: ^0.8.1 → ^0.9.1 - **autoprefixer**: ^10.4.23 → ^10.5.4 - **c8**: ^10.1.3 → ^12.0.0 - **cypress**: ^15.19.0 → ^15.20.0 - **cypress-localstorage-commands**: ^2.2.8 → ^2.3.0 - **dotenv**: ^17.2.3 → ^17.4.2 - **eslint**: ^9.39.2 → ^10.8.0 - **eslint-plugin-cypress**: ^5.2.0 → ^7.0.0 - **eslint-plugin-vue**: ^10.6.2 → ^10.10.0 - **fs-extra**: ^11.3.3 → ^11.4.0 - **happy-dom**: ^20.8.9 → ^20.11.1 - **jsdom**: ^27.4.0 → ^30.0.1 - **msw**: ^2.12.7 → ^2.15.0 - **postcss**: ^8.5.10 → ^8.5.26 - **postcss-html**: ^1.8.1 → ^2.0.0 - **prettier**: ^3.7.4 → ^3.9.6 - **rollup-plugin-visualizer**: ^6.0.5 → ^7.0.1 - **sass**: ^1.97.1 → ^1.102.0 - **sass-loader**: ^16.0.6 → ^17.0.0 - **start-server-and-test**: ^2.1.3 → ^3.0.12 - **stylelint**: ^17.14.0 → ^17.14.1 - **vite**: ^7.3.2 → ^8.2.0 - **vite-plugin-istanbul**: ^7.2.1 → ^9.0.1 - **vitest-canvas-mock**: ^1.1.3 → ^1.1.4 - **vue-tsc**: ^3.2.1 → ^3.3.9 - **typescript**: ~5.9.3 → ~7.0.2 - **vitest**: ^4.0.16 → ^4.1.10 ### Validation This workflow does **not** run any checks — type check, unit tests and build all run as normal PR checks below. Review the results there before merging; a red check usually means one of the upgrades above needs to be pinned back or accompanied by a code change. --- 🤖 This PR was automatically created by the Weekly NPM Update workflow --------- Co-authored-by: Bhargav <551527+bjp232004@users.noreply.github.com> Co-authored-by: Bhargav <BJP232004@GMAIL.COM> Co-authored-by: ktx-abhay <abhay.padamani@kiara.tech> Co-authored-by: Abhay Padamani <141122205+ktx-abhay@users.noreply.github.com>
168 lines
5.1 KiB
Vue
168 lines
5.1 KiB
Vue
<template>
|
|
<OPageLayout
|
|
class="h-[calc(100vh-50px)]!"
|
|
data-test="promql-query-builder"
|
|
:title="t('metrics.queryBuilder.title')"
|
|
:subtitle="t('metrics.queryBuilder.subtitle')"
|
|
icon="query-stats"
|
|
scroll
|
|
>
|
|
<div class="mx-auto max-w-350 py-2.5">
|
|
<OCard>
|
|
<OCardSection role="body">
|
|
<!-- Query Builder Section -->
|
|
<div class="flex flex-col gap-5">
|
|
<!-- Metric Selector -->
|
|
<MetricSelector v-model:metric="visualQuery.metric" :datasource="datasourceOptions" />
|
|
|
|
<!-- Label Filters -->
|
|
<LabelFilterEditor v-model:labels="visualQuery.labels" :metric="visualQuery.metric" />
|
|
|
|
<!-- Operations List -->
|
|
<OperationsList v-model:operations="visualQuery.operations" />
|
|
</div>
|
|
</OCardSection>
|
|
|
|
<OSeparator />
|
|
|
|
<!-- Generated Query Display -->
|
|
<OCardSection>
|
|
<div class="mb-2 text-base font-medium">
|
|
{{ t("metrics.queryBuilder.generatedQuery") }}
|
|
</div>
|
|
<OCard class="bg-surface-panel">
|
|
<OCardSection>
|
|
<pre
|
|
class="text-text-link m-0 p-3 font-mono text-sm leading-relaxed font-medium wrap-break-word whitespace-pre-wrap"
|
|
>{{ generatedQuery || t("metrics.queryBuilder.noQueryBuilt") }}</pre>
|
|
</OCardSection>
|
|
</OCard>
|
|
|
|
<div class="mt-3 flex gap-2">
|
|
<OButton
|
|
variant="primary"
|
|
size="sm-action"
|
|
@click="copyQuery"
|
|
:disabled="!generatedQuery"
|
|
>
|
|
<OIcon name="content-copy" size="xs" class="mr-1" />
|
|
{{ t("metrics.queryBuilder.copyQuery") }}
|
|
</OButton>
|
|
<OButton variant="outline" size="sm-action" @click="clearQuery">
|
|
<OIcon name="close" size="xs" class="mr-1" />
|
|
{{ t("metrics.queryBuilder.clearAll") }}
|
|
</OButton>
|
|
<OButton
|
|
variant="outline"
|
|
size="sm-action"
|
|
@click="testQuery"
|
|
:disabled="!generatedQuery"
|
|
>
|
|
<OIcon name="play-arrow" size="xs" class="mr-1" />
|
|
{{ t("metrics.queryBuilder.testQuery") }}
|
|
</OButton>
|
|
</div>
|
|
</OCardSection>
|
|
|
|
<!-- Query Result Preview -->
|
|
<OCardSection v-if="queryResult">
|
|
<div class="mb-2 text-base font-medium">
|
|
{{ t("metrics.queryBuilder.queryResultPreview") }}
|
|
</div>
|
|
<OCard class="bg-surface-panel">
|
|
<OCardSection>
|
|
<pre
|
|
class="text-text-body m-0 max-h-100 overflow-y-auto p-3 font-mono text-sm leading-relaxed wrap-break-word whitespace-pre-wrap"
|
|
>{{ queryResult }}</pre>
|
|
</OCardSection>
|
|
</OCard>
|
|
</OCardSection>
|
|
</OCard>
|
|
</div>
|
|
</OPageLayout>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, computed, watch } from "vue";
|
|
import { useI18nTyped } from "@/types/i18n";
|
|
import { PromqlBuilderQuery } from "@/components/promql/types";
|
|
import { promqlRenderer } from "@/components/promql/operations/queryModeller";
|
|
import MetricSelector from "@/components/promql/components/MetricSelector.vue";
|
|
import LabelFilterEditor from "@/components/promql/components/LabelFilterEditor.vue";
|
|
import OperationsList from "@/components/promql/components/OperationsList.vue";
|
|
import OButton from "@/lib/core/Button/OButton.vue";
|
|
import OIcon from "@/lib/core/Icon/OIcon.vue";
|
|
import OSeparator from "@/lib/core/Separator/OSeparator.vue";
|
|
import OCard from "@/lib/core/Card/OCard.vue";
|
|
import OPageLayout from "@/lib/core/PageLayout/OPageLayout.vue";
|
|
import OCardSection from "@/lib/core/Card/OCardSection.vue";
|
|
import { toast } from "@/lib/feedback/Toast/useToast";
|
|
import { copyToClipboard } from "@/utils/clipboard";
|
|
|
|
const { t } = useI18nTyped();
|
|
|
|
// State
|
|
const visualQuery = ref<PromqlBuilderQuery>({
|
|
metric: "",
|
|
labels: [],
|
|
operations: [],
|
|
});
|
|
|
|
const queryResult = ref<string | null>(null);
|
|
const showDocumentation = ref(true);
|
|
|
|
// Datasource options (you can connect this to actual datasource later)
|
|
const datasourceOptions = ref({
|
|
type: "prometheus",
|
|
url: "",
|
|
});
|
|
|
|
// Computed
|
|
const generatedQuery = computed(() => {
|
|
if (!visualQuery.value.metric && visualQuery.value.labels.length === 0) {
|
|
return "";
|
|
}
|
|
return promqlRenderer.renderQuery(visualQuery.value);
|
|
});
|
|
|
|
// Methods
|
|
const copyQuery = () => {
|
|
if (generatedQuery.value) {
|
|
copyToClipboard(generatedQuery.value, t, {
|
|
successMessage: t("metrics.queryBuilder.queryCopied"),
|
|
});
|
|
}
|
|
};
|
|
|
|
const clearQuery = () => {
|
|
visualQuery.value = {
|
|
metric: "",
|
|
labels: [],
|
|
operations: [],
|
|
};
|
|
queryResult.value = null;
|
|
toast({
|
|
variant: "info",
|
|
message: t("metrics.queryBuilder.queryCleared"),
|
|
});
|
|
};
|
|
|
|
const testQuery = () => {
|
|
// TODO: Implement actual query execution
|
|
toast({
|
|
variant: "info",
|
|
message: t("metrics.queryBuilder.testingSoon"),
|
|
});
|
|
|
|
// Mock result for now
|
|
queryResult.value = JSON.stringify(
|
|
{
|
|
status: "success",
|
|
message: t("metrics.queryBuilder.executionSoon"),
|
|
},
|
|
null,
|
|
2,
|
|
);
|
|
};
|
|
</script>
|