diff --git a/web/src/components/logstream/schema.vue b/web/src/components/logstream/schema.vue index de9113be05..e5221c5f49 100644 --- a/web/src/components/logstream/schema.vue +++ b/web/src/components/logstream/schema.vue @@ -227,6 +227,7 @@ along with this program. If not, see . > .
-
- -
- - + +
+ - Other fields show only the schema fields that existed before the stream was configured to use a user-defined schema. - - + + Other fields show only the schema fields that existed + before the stream was configured to use a user-defined + schema. + + +
+
+ +
+ + + + + Add Field(s) +
- -
- - - - - Add Field(s) - -
-
@@ -561,7 +567,11 @@ along with this program. If not, see .
[ - { + { value: "schemaFields", label: `User Defined Schema (${indexData.value.defined_schema_fields.length})`, disabled: !hasUserDefinedSchema.value, @@ -811,8 +822,7 @@ export default defineComponent({ label: `${computedSchemaFieldsName.value} (${indexData.value.schema.length})`, disabled: false, hide: false, - } - + }, ]); const mainTabs = computed(() => [ { @@ -826,15 +836,15 @@ export default defineComponent({ disabled: false, }, ]); - //here we are making the schema field name dynamic based on the user defined schema - //1. if there is UDS the it should be other fields + //here we are making the schema field name dynamic based on the user defined schema + //1. if there is UDS the it should be other fields //2. if there is no UDS then it should be all fields - const computedSchemaFieldsName = computed(()=>{ - if(!hasUserDefinedSchema.value){ - return 'All Fields' + const computedSchemaFieldsName = computed(() => { + if (!hasUserDefinedSchema.value) { + return "All Fields"; } - return 'Other Fields' - }) + return "Other Fields"; + }); const streamIndexType = [ { label: "Full text search", value: "fullTextSearchKey" }, @@ -857,13 +867,17 @@ export default defineComponent({ storeOriginalData.value = false; approxPartition.value = false; }); - //here we added a watcher to + + const showStoreOriginalDataToggle = computed(() => { + return modelValue.stream_type !== "traces"; + }); + //here we added a watcher to //1. if user defined schema is enabled then we need to show the schema fields tab and also need to make sure that it would be the active tab //2. if user defined schema is disabled then we need to show the all fields tab and also need to make sure that it would be the active tab watch(hasUserDefinedSchema, (newVal) => { - if(newVal){ + if (newVal) { activeTab.value = "schemaFields"; - }else{ + } else { activeTab.value = "allFields"; } }); @@ -1242,10 +1256,14 @@ export default defineComponent({ modifiedSettings, ) .then(async (res) => { - if(store.state.logs.logs.data.stream.selectedStream.includes(indexData.value.name)) { + if ( + store.state.logs.logs.data.stream.selectedStream.includes( + indexData.value.name, + ) + ) { store.dispatch("logs/setIsInitialized", false); } - + await getStream( indexData.value.name, indexData.value.stream_type, @@ -1686,6 +1704,7 @@ export default defineComponent({ redDaysList, deleteDates, IsdeleteBtnVisible, + showStoreOriginalDataToggle, }; }, created() { diff --git a/web/src/plugins/traces/Index.vue b/web/src/plugins/traces/Index.vue index 3a73cb3d09..7a669d08a1 100644 --- a/web/src/plugins/traces/Index.vue +++ b/web/src/plugins/traces/Index.vue @@ -528,9 +528,6 @@ function buildSearch() { "[INDEX_NAME]", searchObj.data.stream.selectedStream.value, ); - // const parsedSQL = parser.astify(req.query.sql); - // const unparsedSQL = parser.sqlify(parsedSQL); - // console.log(unparsedSQL); req.query.sql = b64EncodeUnicode(req.query.sql); @@ -774,7 +771,8 @@ async function extractFields() { ); searchObj.data.datetime.queryRangeRestrictionInHour = -1; if ( - (stream.settings.max_query_range > 0 || store.state.zoConfig.max_query_range > 0) && + (stream.settings.max_query_range > 0 || + store.state.zoConfig.max_query_range > 0) && (searchObj.data.datetime.queryRangeRestrictionInHour > stream.settings.max_query_range || stream.settings.max_query_range == 0 || @@ -782,7 +780,9 @@ async function extractFields() { searchObj.data.datetime.queryRangeRestrictionInHour != 0 ) { searchObj.data.datetime.queryRangeRestrictionInHour = - stream.settings.max_query_range > 0 ? stream.settings.max_query_range : store.state.zoConfig.max_query_range; + stream.settings.max_query_range > 0 + ? stream.settings.max_query_range + : store.state.zoConfig.max_query_range; searchObj.data.datetime.queryRangeRestrictionMsg = t( "search.queryRangeRestrictionMsg", { @@ -957,7 +957,7 @@ function generateHistogramData() { autosize: true, }; - if (searchObj.data.queryResults.hits) { + if (searchObj.data?.queryResults?.hits?.length) { searchObj.data.queryResults.hits.forEach( (bucket: { zo_sql_timestamp: string | number | Date; @@ -976,10 +976,7 @@ function generateHistogramData() { layout: layout, }; - if ( - searchObj.meta.showHistogram == true && - searchResultRef.value?.reDrawChart - ) { + if (searchResultRef.value?.reDrawChart) { searchResultRef.value.reDrawChart(); } } @@ -1036,10 +1033,7 @@ onActivated(() => { loadPageData(); } - if ( - searchObj.meta.showHistogram == true && - router.currentRoute.value.path.indexOf("/traces") > -1 - ) { + if (router.currentRoute.value.path.indexOf("/traces") > -1) { setTimeout(() => { if (searchResultRef.value) searchResultRef.value.reDrawChart(); }, 300); diff --git a/web/src/plugins/traces/SearchResult.vue b/web/src/plugins/traces/SearchResult.vue index 6f935891c5..9fe1f5ecbc 100644 --- a/web/src/plugins/traces/SearchResult.vue +++ b/web/src/plugins/traces/SearchResult.vue @@ -23,7 +23,6 @@ along with this program. If not, see . data-test="logs-search-result-bar-chart" id="traces_scatter_chart" :data="plotChart" - v-show="searchObj.meta.showHistogram" style="height: 150px" @updated:dataZoom="onChartUpdate" @click="onChartClick" @@ -59,7 +58,13 @@ along with this program. If not, see .