fix: base64 encode should be only in logs page (#6543)

encoding of sql to base64 from UI when specified only in logs page not
in alerts or pipelines page
This commit is contained in:
Sai Nikhil
2025-04-15 10:38:40 +05:30
committed by GitHub
parent 9b8b75c5c7
commit e271f2ea19
3 changed files with 10 additions and 1 deletions
+4
View File
@@ -1217,6 +1217,10 @@ export default defineComponent({
query.query.start_time = query.query.start_time + 780000000;
query.query.sql = formData.value.query_condition.sql;
//removed the encoding as it is not required for the alert queries
if(store.state.zoConfig.sql_base64_enabled && query?.encoding){
delete query.encoding;
}
if (formData.value.query_condition.vrl_function)
query.query.query_fn = b64EncodeUnicode(
@@ -479,6 +479,11 @@ const validateSqlQuery = () => {
query.query.sql = streamRoute.value.query_condition.sql;
//removed the encoding as it is not required for the pipeline queries
if(store.state.zoConfig.sql_base64_enabled && query?.encoding){
delete query.encoding;
}
validateSqlQueryPromise.value = new Promise((resolve, reject) => {
searchService
.search({
+1 -1
View File
@@ -1099,8 +1099,8 @@ const useLogs = () => {
if (store.state.zoConfig.sql_base64_enabled) {
req["encoding"] = "base64";
req.query.sql = b64EncodeUnicode(req.query.sql);
//encode the histogram only if the current page is 1
if (
!searchObj.meta.sqlMode &&
searchObj.data.resultGrid.currentPage == 1
) {
req.aggs.histogram = b64EncodeUnicode(req.aggs.histogram);