@blueking/monitor-trace-log 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.js CHANGED
@@ -17402,6 +17402,7 @@ __webpack_require__.r(retrieve_namespaceObject);
17402
17402
  __webpack_require__.d(retrieve_namespaceObject, {
17403
17403
  createClusteringConfig: () => (createClusteringConfig),
17404
17404
  createFieldsConfig: () => (createFieldsConfig),
17405
+ createOrUpdateToken: () => (createOrUpdateToken),
17405
17406
  deleteClusteringInfo: () => (deleteClusteringInfo),
17406
17407
  deleteFieldsConfig: () => (deleteFieldsConfig),
17407
17408
  deleteRetrieveFavorite: () => (deleteRetrieveFavorite),
@@ -17433,6 +17434,7 @@ __webpack_require__.d(retrieve_namespaceObject, {
17433
17434
  getRealTimeLog: () => (getRealTimeLog),
17434
17435
  getRetrieveFavorite: () => (getRetrieveFavorite),
17435
17436
  getSearchHistory: () => (getSearchHistory),
17437
+ getShareParams: () => (getShareParams),
17436
17438
  getWebConsoleUrl: () => (getWebConsoleUrl),
17437
17439
  newClsStrategy: () => (newClsStrategy),
17438
17440
  normalStrategy: () => (normalStrategy),
@@ -21967,7 +21969,21 @@ const updateTimezone = tz => {
21967
21969
  仅查看当前索引集: 'View only current index set',
21968
21970
  我的: 'My',
21969
21971
  设置筛选: 'Set filter',
21970
- 未编组: 'Unorganized'
21972
+ 未编组: 'Unorganized',
21973
+ 大小写匹配: 'Case sensitive matching',
21974
+ 精确匹配: 'Exact match',
21975
+ Grep模式: 'Grep Mode',
21976
+ 我的收藏: 'My favorites',
21977
+ 时间设置: 'Time Settings',
21978
+ 静态时间: 'Static Time',
21979
+ 动态时间: 'Dynamic Time',
21980
+ 时间示例: 'Time Example',
21981
+ 链接有效期: 'Link Validity Period',
21982
+ 生成并复制链接: 'Generate And Copy Link',
21983
+ '会将时间转换为时间戳,按照访问人的时间进行载入': "It will convert the time to a timestamp and load it according to the visitor's time",
21984
+ '会将近 xxx 这种时间保留,按照访问人的近 xxx 时间进行载入': 'It will keep the time like "last xxx" and load it according to the visitor\'s last xxx time',
21985
+ 临时分享: 'Temporary Share',
21986
+ 分享: 'Share'
21971
21987
  });
21972
21988
  ;// ./src/language/lang/en/route.ts
21973
21989
  /*
@@ -22156,6 +22172,7 @@ const i18n = new vue_i18n_esm({
22156
22172
  }
22157
22173
  });
22158
22174
  bk_magic_vue_min.locale.i18n((key, value) => i18n.t(key, value));
22175
+ window.$t = i18n.t.bind(i18n);
22159
22176
  /* harmony default export */ const language_i18n = (i18n);
22160
22177
  ;// ./node_modules/thread-loader/dist/cjs.js??clonedRuleSet-3.use[0]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-3.use[1]!./node_modules/ifdef-loader/ifdef-loader.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/global/json-format-wrapper.vue?vue&type=template&id=7c213b72
22161
22178
  var render = function render() {
@@ -32762,6 +32779,7 @@ var BK_LOG_STORAGE;
32762
32779
  BK_LOG_STORAGE["LAST_INDEX_SET_ID"] = "_15";
32763
32780
  })(BK_LOG_STORAGE || (BK_LOG_STORAGE = {}));
32764
32781
 
32782
+ const SEARCH_MODE_DIC = ['ui', 'sql'];
32765
32783
  ;// ./src/store/url-resolver.ts
32766
32784
  /*
32767
32785
  * Tencent is pleased to support the open source community by making
@@ -33217,7 +33235,7 @@ const IndexsetItemParams = {
33217
33235
  ...DEFAULT_RETRIEVE_PARAMS
33218
33236
  };
33219
33237
  const IndexItem = {
33220
- ids: URL_ARGS.unionList?.length ? [...URL_ARGS.unionList] : [URL_ARGS.index_id],
33238
+ ids: (URL_ARGS.unionList?.length ? [...URL_ARGS.unionList] : [URL_ARGS.index_id]).filter(t => t !== '' && t !== undefined && t !== null),
33221
33239
  isUnionIndex: URL_ARGS.unionList?.length ?? false,
33222
33240
  items: [],
33223
33241
  catchUnionBeginList: [],
@@ -36506,6 +36524,14 @@ var requestGrepResult = {
36506
36524
  url: '/search/index_set/$index_set_id/grep_query/',
36507
36525
  method: 'post'
36508
36526
  };
36527
+ var createOrUpdateToken = {
36528
+ url: '/share/create_or_update_token/',
36529
+ method: 'post'
36530
+ };
36531
+ var getShareParams = {
36532
+ url: 'share/get_share_params/',
36533
+ method: 'get'
36534
+ };
36509
36535
 
36510
36536
  ;// ./src/services/source.js
36511
36537
  /*
@@ -38138,7 +38164,6 @@ function store_unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeo
38138
38164
  function store_arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
38139
38165
  function store_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
38140
38166
  function store_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? store_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : store_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
38141
- /* eslint-disable @typescript-eslint/no-unused-vars */
38142
38167
  /* eslint-disable @typescript-eslint/naming-convention */
38143
38168
  /* eslint-disable @typescript-eslint/no-misused-promises */
38144
38169
  /*
@@ -38412,6 +38437,7 @@ var store_store = new vuex_esm.Store({
38412
38437
  },
38413
38438
  // @ts-ignore
38414
38439
  retrieveParams: function retrieveParams(state) {
38440
+ var _SEARCH_MODE_DIC$stat;
38415
38441
  var _state$indexItem = state.indexItem,
38416
38442
  start_time = _state$indexItem.start_time,
38417
38443
  end_time = _state$indexItem.end_time,
@@ -38423,9 +38449,9 @@ var store_store = new vuex_esm.Store({
38423
38449
  ip_chooser = _state$indexItem.ip_chooser,
38424
38450
  host_scopes = _state$indexItem.host_scopes,
38425
38451
  interval = _state$indexItem.interval,
38426
- search_mode = _state$indexItem.search_mode,
38427
38452
  sort_list = _state$indexItem.sort_list,
38428
38453
  format = _state$indexItem.format;
38454
+ var search_mode = (_SEARCH_MODE_DIC$stat = SEARCH_MODE_DIC[state.storage[BK_LOG_STORAGE.SEARCH_TYPE]]) !== null && _SEARCH_MODE_DIC$stat !== void 0 ? _SEARCH_MODE_DIC$stat : 'ui';
38429
38455
  var filterAddition = addition.filter(function (item) {
38430
38456
  return !item.disabled && item.field !== '_ip-select_';
38431
38457
  }).map(function (_ref2) {
@@ -38552,7 +38578,7 @@ var store_store = new vuex_esm.Store({
38552
38578
  if (Array.isArray(state.indexItem[key]) && Array.isArray((_payload$key = payload === null || payload === void 0 ? void 0 : payload[key]) !== null && _payload$key !== void 0 ? _payload$key : false)) {
38553
38579
  var _state$indexItem$key, _payload$key2;
38554
38580
  (_state$indexItem$key = state.indexItem[key]).splice.apply(_state$indexItem$key, [0, state.indexItem[key].length].concat(toConsumableArray_toConsumableArray(((_payload$key2 = payload === null || payload === void 0 ? void 0 : payload[key]) !== null && _payload$key2 !== void 0 ? _payload$key2 : []).filter(function (v) {
38555
- return v !== null && v !== undefined;
38581
+ return v !== '' && v !== null && v !== undefined;
38556
38582
  }))));
38557
38583
  } else {
38558
38584
  if (Object.prototype.hasOwnProperty.call(state.indexItem, key)) {
@@ -38628,7 +38654,23 @@ var store_store = new vuex_esm.Store({
38628
38654
  Object.assign(state.indexSetQueryResult, IndexSetQueryResult, payload !== null && payload !== void 0 ? payload : {});
38629
38655
  },
38630
38656
  updateIndexSetQueryResult: function updateIndexSetQueryResult(state, payload) {
38631
- Object.assign(state.indexSetQueryResult, payload !== null && payload !== void 0 ? payload : {});
38657
+ Object.keys(payload !== null && payload !== void 0 ? payload : {}).forEach(function (key) {
38658
+ if (Array.isArray(payload[key]) && Array.isArray(state.indexSetQueryResult[key])) {
38659
+ var _state$indexSetQueryR, _payload$key4;
38660
+ if (Object.isFrozen(state.indexSetQueryResult[key])) {
38661
+ state.indexSetQueryResult[key] = undefined;
38662
+ (0,vue_esm.set)(state.indexSetQueryResult, key, []);
38663
+ } else {
38664
+ state.indexSetQueryResult[key].length = 0;
38665
+ state.indexSetQueryResult[key] = [];
38666
+ }
38667
+ (_state$indexSetQueryR = state.indexSetQueryResult[key]).push.apply(_state$indexSetQueryR, toConsumableArray_toConsumableArray(((_payload$key4 = payload[key]) !== null && _payload$key4 !== void 0 ? _payload$key4 : []).filter(function (v) {
38668
+ return v !== null && v !== undefined;
38669
+ })));
38670
+ } else {
38671
+ (0,vue_esm.set)(state.indexSetQueryResult, key, payload[key]);
38672
+ }
38673
+ });
38632
38674
  },
38633
38675
  updateIndexItemParams: function updateIndexItemParams(state, payload) {
38634
38676
  var _payload$addition2;
@@ -39829,12 +39871,12 @@ var store_store = new vuex_esm.Store({
39829
39871
  * @returns
39830
39872
  */
39831
39873
  setQueryCondition: function setQueryCondition(_ref25, payload) {
39832
- var _newQueryList$, _payload$depth, _payload$isNestedFiel;
39874
+ var _newQueryList$, _SEARCH_MODE_DIC$stat2, _payload$depth, _payload$isNestedFiel;
39833
39875
  var state = _ref25.state,
39834
39876
  dispatch = _ref25.dispatch;
39835
39877
  var newQueryList = Array.isArray(payload) ? payload : [payload];
39836
39878
  var isLink = (_newQueryList$ = newQueryList[0]) === null || _newQueryList$ === void 0 ? void 0 : _newQueryList$.isLink;
39837
- var searchMode = state.indexItem.search_mode;
39879
+ var searchMode = (_SEARCH_MODE_DIC$stat2 = SEARCH_MODE_DIC[state.storage[BK_LOG_STORAGE.SEARCH_TYPE]]) !== null && _SEARCH_MODE_DIC$stat2 !== void 0 ? _SEARCH_MODE_DIC$stat2 : 'ui';
39838
39880
  var depth = Number((_payload$depth = payload.depth) !== null && _payload$depth !== void 0 ? _payload$depth : '0');
39839
39881
  var isNestedField = (_payload$isNestedFiel = payload === null || payload === void 0 ? void 0 : payload.isNestedField) !== null && _payload$isNestedFiel !== void 0 ? _payload$isNestedFiel : 'false';
39840
39882
  var isNewSearchPage = newQueryList[0].operator === 'new-search-page-is';
@@ -40584,6 +40626,39 @@ const setPointerCellClickTargetHandler = (e, _ref) => {
40584
40626
  virtualTarget.style.setProperty('top', `${y + offsetY}px`);
40585
40627
  return virtualTarget;
40586
40628
  };
40629
+ ;// ./src/views/retrieve-core/static.util.ts
40630
+ class StaticUtil {
40631
+ static getRegExp(reg) {
40632
+ let defaultFlags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
40633
+ // 如果已经是 RegExp 对象,直接返回
40634
+ if (reg instanceof RegExp) return reg;
40635
+ const regString = String(reg).trim();
40636
+ // 判定是否为标准正则表达式字符串 /pattern/flags
40637
+ if (regString.startsWith('/') && regString.lastIndexOf('/') > 0) {
40638
+ const lastSlashIndex = regString.lastIndexOf('/');
40639
+ const pattern = regString.slice(1, lastSlashIndex); // 提取正则表达式的主体部分
40640
+ let flags = regString.slice(lastSlashIndex + 1); // 提取正则表达式的 flags(可能为空)
40641
+ flags = Array.from(new Set(...flags.split(''), ...(defaultFlags ?? '').split(''))).join('');
40642
+ // 如果 flags 中包含非法字符,直接将整个字符串作为普通字符串处理
40643
+ if (!/^[gimsuy]*$/.test(flags)) {
40644
+ return new RegExp(regString.replace(/([.*+?^${}()|[\]\\])/g, '\\$1'), defaultFlags); // 转义特殊字符
40645
+ }
40646
+ try {
40647
+ return new RegExp(pattern, flags); // 创建 RegExp 对象
40648
+ } catch (error) {
40649
+ console.error(`Invalid regular expression: ${regString}`, error);
40650
+ throw error; // 如果正则表达式无效,抛出错误
40651
+ }
40652
+ }
40653
+ // 如果不是标准正则表达式字符串,将字符串作为整体处理
40654
+ try {
40655
+ return new RegExp(regString.replace(/([.*+?^${}()|[\]\\])/g, '\\$1'), defaultFlags); // 转义特殊字符
40656
+ } catch (error) {
40657
+ console.error(`Invalid regular expression: ${regString}`, error);
40658
+ throw error; // 如果正则表达式无效,抛出错误
40659
+ }
40660
+ }
40661
+ }
40587
40662
  ;// ./src/views/retrieve-core/optimized-highlighter.ts
40588
40663
  /*
40589
40664
  * Tencent is pleased to support the open source community by making
@@ -40612,6 +40687,7 @@ const setPointerCellClickTargetHandler = (e, _ref) => {
40612
40687
  */
40613
40688
 
40614
40689
 
40690
+
40615
40691
  const DEFAULT_CONFIG = {
40616
40692
  target: document.body,
40617
40693
  chunkStrategy: 'auto',
@@ -40646,6 +40722,12 @@ class OptimizedHighlighter {
40646
40722
  currentKeywords = [];
40647
40723
  markKeywords = [];
40648
40724
  rootElement;
40725
+ // 是否区分大小写
40726
+ caseSensitive = false;
40727
+ afterMarkFn;
40728
+ // 正则表达式标记
40729
+ regExpMark = false;
40730
+ accuracy = 'partially';
40649
40731
  constructor() {
40650
40732
  let userConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
40651
40733
  target: document.body
@@ -40654,6 +40736,44 @@ class OptimizedHighlighter {
40654
40736
  this.rootElement = getTargetElement(this.config.target);
40655
40737
  this.observer = this.createObserver();
40656
40738
  }
40739
+ /**
40740
+ * 获取当前标记选项
40741
+ * @description 获取当前标记选项,包括大小写敏感、正则表达式标记和精确度
40742
+ * @returns
40743
+ */
40744
+ getMarkOptions() {
40745
+ return {
40746
+ caseSensitive: this.caseSensitive,
40747
+ regExpMark: this.regExpMark,
40748
+ accuracy: this.accuracy
40749
+ };
40750
+ }
40751
+ /**
40752
+ * 设置是否区分大小写
40753
+ * @param caseSensitive - 是否区分大小写
40754
+ * @param caseSensitive
40755
+ */
40756
+ setCaseSensitive(caseSensitive) {
40757
+ if (this.caseSensitive !== caseSensitive) {
40758
+ // 如果大小写敏感状态发生变化,重置当前关键词
40759
+ this.caseSensitive = caseSensitive;
40760
+ this.highlight(this.currentKeywords, true, this.afterMarkFn);
40761
+ }
40762
+ }
40763
+ setRegExpMode(regExpMark) {
40764
+ if (this.regExpMark !== regExpMark) {
40765
+ // 如果正则表达式标记状态没有变化,则不需要重新标记
40766
+ this.regExpMark = regExpMark;
40767
+ this.highlight(this.currentKeywords, true, this.afterMarkFn);
40768
+ }
40769
+ }
40770
+ setAccuracy(accuracy) {
40771
+ if (this.accuracy !== accuracy) {
40772
+ // 如果精确度状态没有变化,则不需要重新标记
40773
+ this.accuracy = accuracy;
40774
+ this.highlight(this.currentKeywords, true, this.afterMarkFn);
40775
+ }
40776
+ }
40657
40777
  setObserverConfig(observerConfig) {
40658
40778
  Object.assign(this.config.observer, observerConfig);
40659
40779
  }
@@ -40686,6 +40806,7 @@ class OptimizedHighlighter {
40686
40806
  async highlight(keywords) {
40687
40807
  let reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
40688
40808
  let afterMarkFn = arguments.length > 2 ? arguments[2] : undefined;
40809
+ this.afterMarkFn = afterMarkFn;
40689
40810
  if (reset) {
40690
40811
  this.resetState();
40691
40812
  if (keywords.length === 0) {
@@ -40703,7 +40824,7 @@ class OptimizedHighlighter {
40703
40824
  const chunk = this.chunkMap.get(element);
40704
40825
  if (chunk && !chunk.highlighted && chunk.isIntersecting) {
40705
40826
  this.instanceExecMark(chunk.instance);
40706
- afterMarkFn?.();
40827
+ this.afterMarkFn?.();
40707
40828
  }
40708
40829
  });
40709
40830
  }
@@ -40718,6 +40839,9 @@ class OptimizedHighlighter {
40718
40839
  this.observer.disconnect();
40719
40840
  this.unmarkChunks();
40720
40841
  this.resetState();
40842
+ this.caseSensitive = false;
40843
+ this.regExpMark = false;
40844
+ this.accuracy = 'partially';
40721
40845
  }
40722
40846
  unmark() {
40723
40847
  // 完整清理
@@ -40810,14 +40934,31 @@ class OptimizedHighlighter {
40810
40934
  this.isProcessing = false;
40811
40935
  }
40812
40936
  instanceExecMark(instance, resolve) {
40937
+ if (this.regExpMark) {
40938
+ const regList = this.markKeywords.map(keyword => StaticUtil.getRegExp(keyword, this.caseSensitive ? 'g' : 'gi'));
40939
+ instance.markRegExp(regList[0], {
40940
+ element: 'mark',
40941
+ exclude: ['mark'],
40942
+ done: resolve ?? (() => {}),
40943
+ each: element => {
40944
+ if (element.parentElement?.classList.contains('valid-text')) {
40945
+ element.classList.add('valid-text');
40946
+ }
40947
+ const backgroundColor = this.getBackgroundColor(element.textContent);
40948
+ if (backgroundColor) {
40949
+ element.style.backgroundColor = backgroundColor;
40950
+ }
40951
+ }
40952
+ });
40953
+ return;
40954
+ }
40813
40955
  instance.mark(this.markKeywords, {
40814
40956
  element: 'mark',
40815
40957
  exclude: ['mark'],
40958
+ caseSensitive: this.caseSensitive ?? false,
40959
+ accuracy: this.accuracy ?? 'partially',
40816
40960
  done: resolve ?? (() => {}),
40817
40961
  each: element => {
40818
- if (!element.hasAttribute('data-filter-item')) {
40819
- element.classList.add('data-filter-item');
40820
- }
40821
40962
  if (element.parentElement?.classList.contains('valid-text')) {
40822
40963
  element.classList.add('valid-text');
40823
40964
  }
@@ -40891,74 +41032,74 @@ var RetrieveEvent;
40891
41032
  * 收藏栏是否展示
40892
41033
  */
40893
41034
  RetrieveEvent["FAVORITE_SHOWN_CHANGE"] = "favorite-shown-change";
40894
- /**
40895
- * 收藏栏宽度变化
40896
- */
40897
- RetrieveEvent["FAVORITE_WIDTH_CHANGE"] = "favorite-width-change";
40898
41035
  /**
40899
41036
  * 收藏栏是否仅查看当前索引集
40900
41037
  */
40901
41038
  RetrieveEvent["FAVORITE_VIEW_CURRENT_CHANGE"] = "favorite-view-current-change";
40902
41039
  /**
40903
- * 左侧字段信息初始化
40904
- */
40905
- RetrieveEvent["LEFT_FIELD_INFO_UPDATE"] = "left-field-info-update";
40906
- /**
40907
- * 左侧字段设置宽度变化
41040
+ * 收藏栏宽度变化
40908
41041
  */
40909
- RetrieveEvent["LEFT_FIELD_SETTING_WIDTH_CHANGE"] = "left-field-setting-width-change";
41042
+ RetrieveEvent["FAVORITE_WIDTH_CHANGE"] = "favorite-width-change";
40910
41043
  /**
40911
- * 左侧字段设置是否展示
41044
+ * 全局滚动
40912
41045
  */
40913
- RetrieveEvent["LEFT_FIELD_SETTING_SHOWN_CHANGE"] = "left-field-setting-shown-change";
41046
+ RetrieveEvent["GLOBAL_SCROLL"] = "global-scroll";
40914
41047
  /**
40915
- * 搜索栏高度变化
41048
+ * 触发高亮设置
40916
41049
  */
40917
- RetrieveEvent["SEARCHBAR_HEIGHT_CHANGE"] = "searchbar-height-change";
41050
+ RetrieveEvent["HILIGHT_TRIGGER"] = "hilight-trigger";
40918
41051
  /**
40919
- * 趋势图高度变化
41052
+ * 打开索引配置
40920
41053
  */
40921
- RetrieveEvent["TREND_GRAPH_HEIGHT_CHANGE"] = "trend-graph-height-change";
41054
+ RetrieveEvent["INDEX_CONFIG_OPEN"] = "index-config-open";
40922
41055
  /**
40923
- * 趋势图搜索
41056
+ * 索引集id 变化
40924
41057
  */
40925
- RetrieveEvent["TREND_GRAPH_SEARCH"] = "trend-graph-search";
41058
+ RetrieveEvent["INDEX_SET_ID_CHANGE"] = "index-set-id-change";
40926
41059
  /**
40927
- * 趋势图缩放
41060
+ * 左侧字段信息更新
40928
41061
  */
40929
- RetrieveEvent["TREND_GRAPH_ZOOM"] = "trend-graph-zoom";
41062
+ RetrieveEvent["LEFT_FIELD_INFO_UPDATE"] = "left-field-info-update";
40930
41063
  /**
40931
- * localStorage 变化
41064
+ * 左侧字段设置是否展示
40932
41065
  */
40933
- RetrieveEvent["STORAGE_CHANGE"] = "storage-change";
41066
+ RetrieveEvent["LEFT_FIELD_SETTING_SHOWN_CHANGE"] = "left-field-setting-shown-change";
40934
41067
  /**
40935
- * 打开索引配置
41068
+ * 左侧字段设置宽度变化
40936
41069
  */
40937
- RetrieveEvent["INDEX_CONFIG_OPEN"] = "index-config-open";
41070
+ RetrieveEvent["LEFT_FIELD_SETTING_WIDTH_CHANGE"] = "left-field-setting-width-change";
40938
41071
  /**
40939
- * 触发高亮设置
41072
+ * 搜索时间变化
40940
41073
  */
40941
- RetrieveEvent["HILIGHT_TRIGGER"] = "hilight-trigger";
41074
+ RetrieveEvent["SEARCH_TIME_CHANGE"] = "search-time-change";
40942
41075
  /**
40943
41076
  * 搜索条件改变
40944
41077
  */
40945
41078
  RetrieveEvent["SEARCH_VALUE_CHANGE"] = "search-value-change";
40946
41079
  /**
40947
- * 搜索时间变化
41080
+ * 搜索栏高度变化
40948
41081
  */
40949
- RetrieveEvent["SEARCH_TIME_CHANGE"] = "search-time-change";
41082
+ RetrieveEvent["SEARCHBAR_HEIGHT_CHANGE"] = "searchbar-height-change";
40950
41083
  /**
40951
- * 全局滚动
41084
+ * 搜索中时间改变
40952
41085
  */
40953
- RetrieveEvent["GLOBAL_SCROLL"] = "global-scroll";
41086
+ RetrieveEvent["SEARCHING_CHANGE"] = "searching-change";
40954
41087
  /**
40955
- * 索引集id 变化
41088
+ * localStorage 变化
40956
41089
  */
40957
- RetrieveEvent["INDEX_SET_ID_CHANGE"] = "index-set-id-change";
41090
+ RetrieveEvent["STORAGE_CHANGE"] = "storage-change";
40958
41091
  /**
40959
- * 搜索中时间改变
41092
+ * 趋势图高度变化
40960
41093
  */
40961
- RetrieveEvent["SEARCHING_CHANGE"] = "searching-change";
41094
+ RetrieveEvent["TREND_GRAPH_HEIGHT_CHANGE"] = "trend-graph-height-change";
41095
+ /**
41096
+ * 趋势图搜索
41097
+ */
41098
+ RetrieveEvent["TREND_GRAPH_SEARCH"] = "trend-graph-search";
41099
+ /**
41100
+ * 趋势图缩放
41101
+ */
41102
+ RetrieveEvent["TREND_GRAPH_ZOOM"] = "trend-graph-zoom";
40962
41103
  })(RetrieveEvent || (RetrieveEvent = {}));
40963
41104
  /* harmony default export */ const retrieve_events = (RetrieveEvent);
40964
41105
  ;// ./src/views/retrieve-core/interface.ts
@@ -41024,6 +41165,7 @@ const getRGBAColors = opacity => ['rgba(255, 235, 204, 1)', 'rgba(206, 235, 222,
41024
41165
  ;// ./src/views/retrieve-core/base.ts
41025
41166
 
41026
41167
 
41168
+
41027
41169
  /* harmony default export */ const base = (class {
41028
41170
  // 滚动条查询条件
41029
41171
  globalScrollSelector;
@@ -41121,32 +41263,7 @@ const getRGBAColors = opacity => ['rgba(255, 235, 204, 1)', 'rgba(206, 235, 222,
41121
41263
  });
41122
41264
  }
41123
41265
  getRegExp(reg) {
41124
- // 如果已经是 RegExp 对象,直接返回
41125
- if (reg instanceof RegExp) return reg;
41126
- const regString = String(reg).trim();
41127
- // 判定是否为标准正则表达式字符串 /pattern/flags
41128
- if (regString.startsWith('/') && regString.lastIndexOf('/') > 0) {
41129
- const lastSlashIndex = regString.lastIndexOf('/');
41130
- const pattern = regString.slice(1, lastSlashIndex); // 提取正则表达式的主体部分
41131
- const flags = regString.slice(lastSlashIndex + 1); // 提取正则表达式的 flags(可能为空)
41132
- // 如果 flags 中包含非法字符,直接将整个字符串作为普通字符串处理
41133
- if (!/^[gimsuy]*$/.test(flags)) {
41134
- return new RegExp(regString.replace(/([.*+?^${}()|[\]\\])/g, '\\$1')); // 转义特殊字符
41135
- }
41136
- try {
41137
- return new RegExp(pattern, flags); // 创建 RegExp 对象
41138
- } catch (error) {
41139
- console.error(`Invalid regular expression: ${regString}`, error);
41140
- throw error; // 如果正则表达式无效,抛出错误
41141
- }
41142
- }
41143
- // 如果不是标准正则表达式字符串,将字符串作为整体处理
41144
- try {
41145
- return new RegExp(regString.replace(/([.*+?^${}()|[\]\\])/g, '\\$1')); // 转义特殊字符
41146
- } catch (error) {
41147
- console.error(`Invalid regular expression: ${regString}`, error);
41148
- throw error; // 如果正则表达式无效,抛出错误
41149
- }
41266
+ return StaticUtil.getRegExp(reg);
41150
41267
  }
41151
41268
  });
41152
41269
  ;// ./src/views/retrieve-v3/index.type.tsx
@@ -41283,6 +41400,9 @@ class RetrieveHelper extends base {
41283
41400
  if (!this.markInstance) {
41284
41401
  return;
41285
41402
  }
41403
+ const {
41404
+ caseSensitive
41405
+ } = this.markInstance.getMarkOptions();
41286
41406
  this.markInstance.setObserverConfig({
41287
41407
  root: document.getElementById(this.logRowsContainerId)
41288
41408
  });
@@ -41292,7 +41412,7 @@ class RetrieveHelper extends base {
41292
41412
  text: keyword,
41293
41413
  className: `highlight-${index}`,
41294
41414
  backgroundColor: this.RGBA_LIST[index % this.RGBA_LIST.length],
41295
- textReg: new RegExp(`^${keyword}$`)
41415
+ textReg: new RegExp(`^${keyword}$`, caseSensitive ? '' : 'i')
41296
41416
  };
41297
41417
  }), reset);
41298
41418
  }
@@ -51504,9 +51624,9 @@ let CollectIndex = class CollectIndex extends api_Component {
51504
51624
  const getRouteQueryParams = () => {
51505
51625
  const {
51506
51626
  ids,
51507
- isUnionIndex,
51508
- search_mode
51627
+ isUnionIndex
51509
51628
  } = this.$store.state.indexItem;
51629
+ const search_mode = SEARCH_MODE_DIC[this.$store.state.storage[BK_LOG_STORAGE.SEARCH_TYPE]] ?? 'ui';
51510
51630
  const unionList = this.$store.state.unionIndexList;
51511
51631
  const clusterParams = this.$store.state.clusterParams;
51512
51632
  const {
@@ -52432,8 +52552,8 @@ CollectIndex = __decorate([vue_class_component_esm], CollectIndex);
52432
52552
  };
52433
52553
  }
52434
52554
  }));
52435
- ;// ./node_modules/thread-loader/dist/cjs.js??clonedRuleSet-3.use[0]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-3.use[1]!./node_modules/ifdef-loader/ifdef-loader.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/retrieve-v2/search-bar/index.vue?vue&type=template&id=fbc6dcba&scoped=true
52436
- var search_barvue_type_template_id_fbc6dcba_scoped_true_render = function render() {
52555
+ ;// ./node_modules/thread-loader/dist/cjs.js??clonedRuleSet-3.use[0]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-3.use[1]!./node_modules/ifdef-loader/ifdef-loader.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/retrieve-v2/search-bar/index.vue?vue&type=template&id=9a10bb56&scoped=true
52556
+ var search_barvue_type_template_id_9a10bb56_scoped_true_render = function render() {
52437
52557
  var _setup$activeFavorite;
52438
52558
  var _vm = this,
52439
52559
  _c = _vm._self._c,
@@ -52611,7 +52731,7 @@ var search_barvue_type_template_id_fbc6dcba_scoped_true_render = function render
52611
52731
  }
52612
52732
  })], 1)], 1)]), _vm._v(" "), _setup.isFilterSecFocused ? [_c(_setup.CommonFilterSelect)] : _vm._e()], 2);
52613
52733
  };
52614
- var search_barvue_type_template_id_fbc6dcba_scoped_true_staticRenderFns = [];
52734
+ var search_barvue_type_template_id_9a10bb56_scoped_true_staticRenderFns = [];
52615
52735
 
52616
52736
  ;// ./node_modules/vue-router/composables.mjs
52617
52737
  /*!
@@ -87016,7 +87136,8 @@ var BookmarkPop = function BookmarkPop() {
87016
87136
  return indexItem.value.addition;
87017
87137
  });
87018
87138
  var searchMode = (0,vue_esm.computed)(function () {
87019
- return indexItem.value.search_mode;
87139
+ var _SEARCH_MODE_DIC$stor;
87140
+ return (_SEARCH_MODE_DIC$stor = SEARCH_MODE_DIC[store.state.storage[BK_LOG_STORAGE.SEARCH_TYPE]]) !== null && _SEARCH_MODE_DIC$stor !== void 0 ? _SEARCH_MODE_DIC$stor : 'ui';
87020
87141
  });
87021
87142
  var clearSearchValueNum = (0,vue_esm.computed)(function () {
87022
87143
  return store.state.clearSearchValueNum;
@@ -87518,11 +87639,11 @@ var BookmarkPop = function BookmarkPop() {
87518
87639
 
87519
87640
  var search_bar_component = normalizeComponent(
87520
87641
  retrieve_v2_search_barvue_type_script_setup_true_lang_js,
87521
- search_barvue_type_template_id_fbc6dcba_scoped_true_render,
87522
- search_barvue_type_template_id_fbc6dcba_scoped_true_staticRenderFns,
87642
+ search_barvue_type_template_id_9a10bb56_scoped_true_render,
87643
+ search_barvue_type_template_id_9a10bb56_scoped_true_staticRenderFns,
87523
87644
  false,
87524
87645
  null,
87525
- "fbc6dcba",
87646
+ "9a10bb56",
87526
87647
  null
87527
87648
 
87528
87649
  )
@@ -97818,6 +97939,7 @@ var panel_util_excluded = ["ip_chooser", "addition", "keyword"];
97818
97939
  */
97819
97940
 
97820
97941
  function getConditionRouterParams(searchList, searchMode, isNewLink) {
97942
+ var append = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
97821
97943
  var indexItem = window.mainComponent.$store.state.indexItem;
97822
97944
  var getIPChooserStr = function getIPChooserStr(ipChooser) {
97823
97945
  if (typeof_typeof(ipChooser) === 'object') return JSON.stringify(ipChooser);
@@ -97871,7 +97993,7 @@ function getConditionRouterParams(searchList, searchMode, isNewLink) {
97871
97993
  ip_chooser: getIPChooserStr(newIPChooser)
97872
97994
  });
97873
97995
  }
97874
- Object.assign(filterQuery, newQueryObj);
97996
+ Object.assign(filterQuery, newQueryObj, append !== null && append !== void 0 ? append : {});
97875
97997
  var routeData = {
97876
97998
  name: 'retrieve',
97877
97999
  params: params,
@@ -99321,6 +99443,7 @@ var log_result_component = normalizeComponent(
99321
99443
  */
99322
99444
 
99323
99445
 
99446
+
99324
99447
  /* harmony default export */ const bklog_popover = ((0,vue_esm.defineComponent)({
99325
99448
  props: {
99326
99449
  options: {
@@ -99342,6 +99465,10 @@ var log_result_component = normalizeComponent(
99342
99465
  beforeHide: {
99343
99466
  type: Function,
99344
99467
  default: () => true
99468
+ },
99469
+ content: {
99470
+ type: String,
99471
+ default: undefined
99345
99472
  }
99346
99473
  },
99347
99474
  setup(props, _ref) {
@@ -99380,7 +99507,7 @@ var log_result_component = normalizeComponent(
99380
99507
  args[_key] = arguments[_key];
99381
99508
  }
99382
99509
  props.options.onShown?.(...args);
99383
- if (props.options.hideOnClick === false && !isDocumentClickBinded) {
99510
+ if (props.options.hideOnClick === false && props.trigger === 'click' && !isDocumentClickBinded) {
99384
99511
  document.addEventListener('click', hanldeDocumentClick);
99385
99512
  isDocumentClickBinded = true;
99386
99513
  }
@@ -99390,7 +99517,7 @@ var log_result_component = normalizeComponent(
99390
99517
  args[_key2] = arguments[_key2];
99391
99518
  }
99392
99519
  props.options.onHidden?.(...args);
99393
- if (props.options.hideOnClick === false && isDocumentClickBinded) {
99520
+ if (props.options.hideOnClick === false && props.trigger === 'click' && isDocumentClickBinded) {
99394
99521
  document.removeEventListener('click', hanldeDocumentClick);
99395
99522
  isDocumentClickBinded = false;
99396
99523
  }
@@ -99414,9 +99541,7 @@ var log_result_component = normalizeComponent(
99414
99541
  instance.show(props.delegateTarget ?? refTargetElement.value);
99415
99542
  };
99416
99543
  const handleRootElementMouseleave = () => {
99417
- if (instance.isShown()) {
99418
- instance.hide(300);
99419
- }
99544
+ instance?.hide(120);
99420
99545
  };
99421
99546
  const handleContentElementMouseenter = () => {
99422
99547
  instance.cancelHide();
@@ -99475,7 +99600,7 @@ var log_result_component = normalizeComponent(
99475
99600
  }, [(0,vue_esm.h)("div", {
99476
99601
  "ref": refContentElement,
99477
99602
  "class": props.contentClass
99478
- }, [slots.content?.()])])]);
99603
+ }, [slots.content?.() ?? props.content])])]);
99479
99604
  }
99480
99605
  }));
99481
99606
  ;// ./node_modules/thread-loader/dist/cjs.js??clonedRuleSet-3.use[0]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-3.use[1]!./node_modules/ifdef-loader/ifdef-loader.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/retrieve-v2/search-result-panel/log-result/index.vue?vue&type=script&lang=js
@@ -101451,7 +101576,7 @@ function grepSyntaxHighlighting() {
101451
101576
  // 主题样式
101452
101577
  EditorView.theme({
101453
101578
  '&': {
101454
- fontSize: '14px',
101579
+ fontSize: '12px',
101455
101580
  height: initialHeight,
101456
101581
  maxHeight: maxHeightForLines
101457
101582
  },
@@ -101484,7 +101609,7 @@ function grepSyntaxHighlighting() {
101484
101609
  color: '#999',
101485
101610
  fontStyle: 'italic',
101486
101611
  fontFamily: 'Monaco, Menlo, Ubuntu Mono, Consolas, source-code-pro, monospace',
101487
- fontSize: '14px'
101612
+ fontSize: '12px'
101488
101613
  },
101489
101614
  // 自定义滚动条样式
101490
101615
  '.cm-scroller::-webkit-scrollbar': {
@@ -101623,10 +101748,13 @@ function grepSyntaxHighlighting() {
101623
101748
 
101624
101749
 
101625
101750
 
101751
+
101752
+
101626
101753
  /* harmony default export */ const grep_cli = ((0,vue_esm.defineComponent)({
101627
101754
  name: 'GrepCli',
101628
101755
  components: {
101629
- GrepCliEditor: grep_cli_editor
101756
+ GrepCliEditor: grep_cli_editor,
101757
+ BklogPopover: bklog_popover
101630
101758
  },
101631
101759
  props: {
101632
101760
  searchCount: {
@@ -101648,6 +101776,9 @@ function grepSyntaxHighlighting() {
101648
101776
  emit
101649
101777
  } = _ref;
101650
101778
  const route = useRoute();
101779
+ const {
101780
+ t
101781
+ } = use_locale();
101651
101782
  const grepValue = (0,vue_esm.ref)(route.query.grep_query ?? '');
101652
101783
  const isCaseSensitive = (0,vue_esm.ref)(false);
101653
101784
  const isRegexMode = (0,vue_esm.ref)(false);
@@ -101728,7 +101859,6 @@ function grepSyntaxHighlighting() {
101728
101859
  // 上一个匹配
101729
101860
  const gotoPrevMatch = () => {
101730
101861
  if (hasResults.value) {
101731
- currentMatchIndex.value = currentMatchIndex.value > 1 ? currentMatchIndex.value - 1 : props.searchCount;
101732
101862
  emit('search-change', {
101733
101863
  content: grepValue.value,
101734
101864
  searchValue: props.searchValue,
@@ -101736,15 +101866,13 @@ function grepSyntaxHighlighting() {
101736
101866
  caseSensitive: isCaseSensitive.value,
101737
101867
  regexMode: isRegexMode.value,
101738
101868
  wordMatch: isWordMatch.value
101739
- },
101740
- currentIndex: currentMatchIndex.value
101869
+ }
101741
101870
  });
101742
101871
  }
101743
101872
  };
101744
101873
  // 下一个匹配
101745
101874
  const gotoNextMatch = () => {
101746
101875
  if (hasResults.value) {
101747
- currentMatchIndex.value = currentMatchIndex.value < props.searchCount ? currentMatchIndex.value + 1 : 1;
101748
101876
  emit('search-change', {
101749
101877
  content: grepValue.value,
101750
101878
  searchValue: props.searchValue,
@@ -101752,8 +101880,7 @@ function grepSyntaxHighlighting() {
101752
101880
  caseSensitive: isCaseSensitive.value,
101753
101881
  regexMode: isRegexMode.value,
101754
101882
  wordMatch: isWordMatch.value
101755
- },
101756
- currentIndex: currentMatchIndex.value
101883
+ }
101757
101884
  });
101758
101885
  }
101759
101886
  };
@@ -101775,9 +101902,14 @@ function grepSyntaxHighlighting() {
101775
101902
  "class": 'grep-cli-container grep-cli-flex'
101776
101903
  }, [(0,vue_esm.h)("div", {
101777
101904
  "class": 'grep-cli-left'
101905
+ }, [(0,vue_esm.h)("div", {
101906
+ "style": {
101907
+ display: 'flex',
101908
+ width: '128px'
101909
+ }
101778
101910
  }, [(0,vue_esm.h)("span", {
101779
101911
  "class": 'grep-cli-label'
101780
- }, ["\u5B57\u6BB5\uFF1A"]), (0,vue_esm.h)("bk-select", {
101912
+ }, [t('字段'), ":"]), (0,vue_esm.h)("bk-select", {
101781
101913
  "class": 'grep-cli-select',
101782
101914
  "attrs": {
101783
101915
  "value": props.fieldValue,
@@ -101794,12 +101926,12 @@ function grepSyntaxHighlighting() {
101794
101926
  "id": option.field_name,
101795
101927
  "name": option.field_name
101796
101928
  }
101797
- }))]), (0,vue_esm.h)("div", {
101929
+ }))])]), (0,vue_esm.h)("div", {
101798
101930
  "class": 'grep-cli-editor'
101799
101931
  }, [(0,vue_esm.h)(grep_cli_editor, {
101800
101932
  "attrs": {
101801
101933
  "value": grepValue.value,
101802
- "placeholder": '-- INSERT, Ctrl + Enter提交查询 --',
101934
+ "placeholder": `'-- INSERT, Ctrl + Enter ${t('提交查询')} --'`,
101803
101935
  "autoHeight": true,
101804
101936
  "minHeight": '34px',
101805
101937
  "maxHeight": '160px'
@@ -101815,7 +101947,7 @@ function grepSyntaxHighlighting() {
101815
101947
  }, [(0,vue_esm.h)("bk-input", {
101816
101948
  "class": 'grep-cli-search-input',
101817
101949
  "attrs": {
101818
- "placeholder": '搜索',
101950
+ "placeholder": t('搜索'),
101819
101951
  "value": props.searchValue,
101820
101952
  "size": 'small'
101821
101953
  },
@@ -101824,37 +101956,55 @@ function grepSyntaxHighlighting() {
101824
101956
  }
101825
101957
  }), (0,vue_esm.h)("div", {
101826
101958
  "class": 'grep-cli-tools'
101959
+ }, [(0,vue_esm.h)(bklog_popover, {
101960
+ "attrs": {
101961
+ "trigger": 'hover',
101962
+ "content": t('大小写匹配'),
101963
+ "options": {
101964
+ placement: 'top',
101965
+ theme: 'dark'
101966
+ }
101967
+ }
101827
101968
  }, [(0,vue_esm.h)("span", {
101828
101969
  "class": ['grep-cli-tool-icon', 'bklog-icon', 'bklog-daxiaoxie', {
101829
101970
  active: isCaseSensitive.value
101830
101971
  }],
101831
- "attrs": {
101832
- "title": '大小写匹配'
101833
- },
101834
101972
  "on": {
101835
101973
  "click": toggleCaseSensitive
101836
101974
  }
101837
- }), (0,vue_esm.h)("span", {
101975
+ })]), (0,vue_esm.h)(bklog_popover, {
101976
+ "attrs": {
101977
+ "trigger": 'hover',
101978
+ "content": t('精确匹配'),
101979
+ "options": {
101980
+ placement: 'top',
101981
+ theme: 'dark'
101982
+ }
101983
+ }
101984
+ }, [(0,vue_esm.h)("span", {
101838
101985
  "class": ['grep-cli-tool-icon', 'bklog-icon', 'bklog-ab', {
101839
- active: isRegexMode.value
101986
+ active: isWordMatch.value
101840
101987
  }],
101841
- "attrs": {
101842
- "title": '精准匹配'
101843
- },
101844
101988
  "on": {
101845
- "click": toggleRegexMode
101989
+ "click": toggleWordMatch
101846
101990
  }
101847
- }), (0,vue_esm.h)("span", {
101991
+ })]), (0,vue_esm.h)(bklog_popover, {
101992
+ "attrs": {
101993
+ "trigger": 'hover',
101994
+ "content": t('正则匹配'),
101995
+ "options": {
101996
+ placement: 'top',
101997
+ theme: 'dark'
101998
+ }
101999
+ }
102000
+ }, [(0,vue_esm.h)("span", {
101848
102001
  "class": ['grep-cli-tool-icon', 'bklog-icon', 'bklog-tongpeifu', {
101849
- active: isWordMatch.value
102002
+ active: isRegexMode.value
101850
102003
  }],
101851
- "attrs": {
101852
- "title": '通配符'
101853
- },
101854
102004
  "on": {
101855
- "click": toggleWordMatch
102005
+ "click": toggleRegexMode
101856
102006
  }
101857
- })])])])]);
102007
+ })])])])])]);
101858
102008
  }
101859
102009
  }));
101860
102010
  ;// ./src/views/retrieve-v3/grep/grep-cli-result.tsx
@@ -101938,7 +102088,7 @@ function grepSyntaxHighlighting() {
101938
102088
  "class": 'cli-result-line-number'
101939
102089
  }, [index + 1]), (0,vue_esm.h)("div", {
101940
102090
  "class": 'cli-result-line-content-wrapper'
101941
- }, [(0,vue_esm.h)(log_result_text_segmentation, {
102091
+ }, [(0,vue_esm.h)(text_segmentation, {
101942
102092
  "attrs": {
101943
102093
  "field": {
101944
102094
  field_name: props.fieldName,
@@ -102131,12 +102281,15 @@ function grepSyntaxHighlighting() {
102131
102281
  // 处理搜索更新
102132
102282
  const handleSearchUpdate = data => {
102133
102283
  searchValue.value = data.searchValue;
102134
- matchMode.value = data.matchMode;
102284
+ // matchMode.value = data.matchMode;
102135
102285
  retrieve_helper.highLightKeywords([searchValue.value], true);
102136
102286
  };
102137
102287
  // 处理匹配模式更新
102138
102288
  const handleMatchModeUpdate = mode => {
102139
- matchMode.value = mode;
102289
+ Object.assign(matchMode.value, mode);
102290
+ retrieve_helper.markInstance?.setCaseSensitive(matchMode.value.caseSensitive);
102291
+ retrieve_helper.markInstance?.setRegExpMode(matchMode.value.regexMode);
102292
+ retrieve_helper.markInstance?.setAccuracy(matchMode.value.wordMatch ? 'exactly' : 'partially');
102140
102293
  retrieve_helper.highLightKeywords([searchValue.value], true);
102141
102294
  };
102142
102295
  const handleFieldChange = v => {
@@ -102272,11 +102425,13 @@ const SearchResultTab = () => null;
102272
102425
 
102273
102426
 
102274
102427
 
102428
+
102275
102429
  /* harmony default export */ const search_result = ((0,vue_esm.defineComponent)({
102276
102430
  name: 'V3ResultContainer',
102277
102431
  setup() {
102278
102432
  const router = useRouter();
102279
102433
  const route = useRoute();
102434
+ const store = use_store();
102280
102435
  const debounceUpdateTabValue = (0,external_lodash_namespaceObject.debounce)(value => {
102281
102436
  const isClustering = value === 'clustering';
102282
102437
  router.replace({
@@ -102297,6 +102452,7 @@ const SearchResultTab = () => null;
102297
102452
  let triggerTrend = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
102298
102453
  debounceUpdateTabValue(tab);
102299
102454
  if (triggerTrend) {
102455
+ store.dispatch('requestIndexSetQuery');
102300
102456
  setTimeout(() => {
102301
102457
  retrieve_helper.fire(retrieve_events.TREND_GRAPH_SEARCH);
102302
102458
  }, 300);
@@ -102333,8 +102489,8 @@ const SearchResultTab = () => null;
102333
102489
  }), renderTabContent()]);
102334
102490
  }
102335
102491
  }));
102336
- ;// ./node_modules/thread-loader/dist/cjs.js??clonedRuleSet-3.use[0]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-3.use[1]!./node_modules/ifdef-loader/ifdef-loader.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/retrieve-v2/sub-bar/index.vue?vue&type=template&id=74d2d0b1
102337
- var sub_barvue_type_template_id_74d2d0b1_render = function render() {
102492
+ ;// ./node_modules/thread-loader/dist/cjs.js??clonedRuleSet-3.use[0]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-3.use[1]!./node_modules/ifdef-loader/ifdef-loader.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/retrieve-v2/sub-bar/index.vue?vue&type=template&id=6680cc42
102493
+ var sub_barvue_type_template_id_6680cc42_render = function render() {
102338
102494
  var _vm = this,
102339
102495
  _c = _vm._self._c,
102340
102496
  _setup = _vm._self._setupProxy;
@@ -102368,7 +102524,7 @@ var sub_barvue_type_template_id_74d2d0b1_render = function render() {
102368
102524
  staticClass: "box-right-option"
102369
102525
  }, [_c(_setup.TimeSetting, {
102370
102526
  staticClass: "custom-border-right"
102371
- }), _vm._v(" "), _setup.isFieldSettingShow && _setup.store.state.spaceUid && _setup.hasCollectorConfigId ? _c(_setup.FieldSetting, {
102527
+ }), _vm._v(" "), !_setup.isExternal ? _c(_setup.ShareLink) : _vm._e(), _vm._v(" "), _setup.isFieldSettingShow && _setup.store.state.spaceUid && _setup.hasCollectorConfigId ? _c(_setup.FieldSetting, {
102372
102528
  ref: "fieldSettingRef",
102373
102529
  staticClass: "custom-border-right"
102374
102530
  }) : _vm._e(), _vm._v(" "), !_setup.isExternal ? _c(_setup.WarningSetting, {
@@ -102410,7 +102566,7 @@ var sub_barvue_type_template_id_74d2d0b1_render = function render() {
102410
102566
  }
102411
102567
  })], 1) : _vm._e()]);
102412
102568
  };
102413
- var sub_barvue_type_template_id_74d2d0b1_staticRenderFns = [];
102569
+ var sub_barvue_type_template_id_6680cc42_staticRenderFns = [];
102414
102570
 
102415
102571
  ;// ./src/components/ellipsis-tag-list/index.tsx
102416
102572
  /*
@@ -104035,10 +104191,321 @@ const CommonList = () => null;
104035
104191
  };
104036
104192
  }
104037
104193
  }));
104194
+ ;// ./src/views/retrieve-v2/sub-bar/share-link.tsx
104195
+
104196
+ /*
104197
+ * Tencent is pleased to support the open source community by making
104198
+ * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
104199
+ *
104200
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
104201
+ *
104202
+ * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
104203
+ *
104204
+ * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
104205
+ *
104206
+ * ---------------------------------------------------
104207
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
104208
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
104209
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
104210
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
104211
+ *
104212
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
104213
+ * the Software.
104214
+ *
104215
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
104216
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104217
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
104218
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
104219
+ * IN THE SOFTWARE.
104220
+ */
104221
+
104222
+
104223
+
104224
+
104225
+
104226
+
104227
+
104228
+
104229
+
104230
+
104231
+ /* harmony default export */ const share_link = ((0,vue_esm.defineComponent)({
104232
+ setup() {
104233
+ const store = use_store();
104234
+ const route = useRoute();
104235
+ const {
104236
+ t
104237
+ } = use_locale();
104238
+ const timezone = (0,vue_esm.computed)(() => store.state.indexItem.timezone);
104239
+ const timeRange = (0,vue_esm.computed)(() => store.state.indexItem.datePickerValue);
104240
+ const format = (0,vue_esm.computed)(() => store.getters.retrieveParams.format);
104241
+ const startTime = (0,vue_esm.computed)(() => store.getters.retrieveParams.start_time);
104242
+ const endTime = (0,vue_esm.computed)(() => store.getters.retrieveParams.end_time);
104243
+ const expireTime = (0,vue_esm.ref)('1d');
104244
+ const expireTimeList = (0,vue_esm.ref)([{
104245
+ id: '1d',
104246
+ name: '1天'
104247
+ }, {
104248
+ id: '1w',
104249
+ name: '1周'
104250
+ }, {
104251
+ id: '1m',
104252
+ name: '1月'
104253
+ }]);
104254
+ const link = (0,vue_esm.ref)('');
104255
+ const formatTimeRange = (0,vue_esm.ref)([store.getters.retrieveParams.start_time, store.getters.retrieveParams.end_time]);
104256
+ const timeValueType = (0,vue_esm.ref)('static');
104257
+ let isDatePickerChange = false;
104258
+ const handleTimeValueTypeChange = value => {
104259
+ timeValueType.value = value;
104260
+ if (value === 'static') {
104261
+ formatTimeRange.value = [startTime.value, endTime.value];
104262
+ }
104263
+ if (value === 'dynamic') {
104264
+ formatTimeRange.value = [timeRange.value[0], timeRange.value[1]];
104265
+ }
104266
+ };
104267
+ handleTimeValueTypeChange(timeValueType.value);
104268
+ const placeholder = (0,vue_esm.computed)(() => {
104269
+ if (timeValueType.value === 'static') {
104270
+ return `"?start_time=${(0,external_dayjs_namespaceObject["default"])(formatTimeRange.value[0]).format(format.value)}&end_time=${(0,external_dayjs_namespaceObject["default"])(formatTimeRange.value[1]).format(format.value)}"`;
104271
+ }
104272
+ return `"?start_time=${formatTimeRange.value[0]}&end_time=${formatTimeRange.value[1]}"`;
104273
+ });
104274
+ const getExpireEndTime = expire => {
104275
+ // expire = '1d' | '1w' | '1m' | '\d+(d|w|m)'
104276
+ const match = expire.match(/^(\d+)([dw]|m)$/);
104277
+ if (!match) return (0,external_dayjs_namespaceObject["default"])().add(1, 'day').unix();
104278
+ const num = parseInt(match[1], 10);
104279
+ const unit = match[2];
104280
+ let duration;
104281
+ switch (unit) {
104282
+ case 'd':
104283
+ duration = num * 24 * 60 * 60 * 1000; // days to milliseconds
104284
+ break;
104285
+ case 'w':
104286
+ duration = num * 7 * 24 * 60 * 60 * 1000; // weeks to milliseconds
104287
+ break;
104288
+ case 'm':
104289
+ duration = num * 30 * 24 * 60 * 60 * 1000; // months to milliseconds
104290
+ break;
104291
+ default:
104292
+ return num * 24 * 60 * 60 * 1000;
104293
+ }
104294
+ return (0,external_dayjs_namespaceObject["default"])().add(duration, 'millisecond').unix();
104295
+ };
104296
+ const handleShareLinkClick = () => {
104297
+ const result = handleTransformToTimestamp(formatTimeRange.value, format.value);
104298
+ const params = {
104299
+ route: {
104300
+ name: route.name,
104301
+ path: route.path,
104302
+ params: {
104303
+ ...route.params
104304
+ },
104305
+ query: {
104306
+ ...route.query,
104307
+ start_time: formatTimeRange.value[0],
104308
+ end_time: formatTimeRange.value[1],
104309
+ timezone: timezone.value,
104310
+ format: format.value
104311
+ }
104312
+ },
104313
+ store: {
104314
+ storage: store.state.storage,
104315
+ indexItem: {
104316
+ ...store.state.indexItem,
104317
+ items: [],
104318
+ datePickerValue: formatTimeRange.value
104319
+ },
104320
+ catchFieldCustomConfig: store.state.retrieve.catchFieldCustomConfig
104321
+ }
104322
+ };
104323
+ src_api.request('retrieve/createOrUpdateToken', {
104324
+ data: {
104325
+ type: 'search',
104326
+ expire_time: getExpireEndTime(expireTime.value),
104327
+ // 默认1天
104328
+ expire_period: expireTime.value,
104329
+ lock_search: false,
104330
+ start_time: result[0],
104331
+ end_time: result[1],
104332
+ timezone: timezone.value,
104333
+ default_time_range: timeRange.value,
104334
+ space_uid: store.state.spaceUid,
104335
+ data: params
104336
+ }
104337
+ }).then(resp => {
104338
+ if (resp.result) {
104339
+ link.value = `${window.location.origin}/#/share/${resp.data.token}`;
104340
+ copyMessage(link.value, '复制成功!');
104341
+ return;
104342
+ }
104343
+ messageError(resp.message || t('生成链接失败,请稍后重试'));
104344
+ }).catch(err => {
104345
+ messageError(err.message || t('生成链接失败,请稍后重试'));
104346
+ console.error(err);
104347
+ });
104348
+ };
104349
+ const beforePopoverHide = e => {
104350
+ if (isDatePickerChange) {
104351
+ isDatePickerChange = false;
104352
+ return false;
104353
+ }
104354
+ return !e.target.closest('.bklog-v3-select-popover');
104355
+ };
104356
+ const beforeShow = () => {
104357
+ handleTimeValueTypeChange(timeValueType.value);
104358
+ return true;
104359
+ };
104360
+ /**
104361
+ * 处理链接有效期变化
104362
+ * @param val 链接有效期
104363
+ */
104364
+ const handleExpireTimeChange = val => {
104365
+ // val = '1d' | '1w' | '1m' | '\d+(d|w|m)'
104366
+ expireTime.value = val;
104367
+ };
104368
+ const handleCutomExpireTimeChange = val => {
104369
+ // 处理自定义链接有效期变化
104370
+ // val = '\d+(d|w|m)'
104371
+ if (/^\d+(d|w|m)$/.test(val)) {
104372
+ expireTime.value = val;
104373
+ const customNum = parseInt(val.slice(0, -1), 10);
104374
+ const customUnit = val.slice(-1);
104375
+ const validUnits = {
104376
+ d: 1,
104377
+ w: 7,
104378
+ m: 30
104379
+ };
104380
+ const count = validUnits[customUnit] * customNum;
104381
+ if (count > 90) {
104382
+ messageError(t('链接有效期不能超过90天,请重新输入'));
104383
+ return;
104384
+ }
104385
+ expireTime.value = val;
104386
+ expireTimeList.value.push({
104387
+ id: val,
104388
+ name: val
104389
+ });
104390
+ } else {
104391
+ messageError(t('链接有效期格式错误,请输入数字和单位[{number}d|w|m]'));
104392
+ }
104393
+ };
104394
+ const getContentView = () => {
104395
+ return (0,vue_esm.h)("div", {
104396
+ "style": 'width: 600px; padding: 20px; display: flex; flex-direction: column; font-size: 12px;'
104397
+ }, [(0,vue_esm.h)("div", {
104398
+ "style": 'font-size: 20px; margin-bottom: 30px;'
104399
+ }, [(0,vue_esm.h)("span", {
104400
+ "class": 'bklog-icon bklog-share'
104401
+ }), (0,vue_esm.h)("span", {
104402
+ "style": 'margin-left: 6px;'
104403
+ }, [t('临时分享')])]), (0,vue_esm.h)("div", {
104404
+ "style": 'display: flex; align-items: flex-start; margin-bottom: 10px;'
104405
+ }, [(0,vue_esm.h)("span", {
104406
+ "style": 'display: inline-block; min-width: fit-content;'
104407
+ }, [t('时间格式'), "\uFF1A"]), (0,vue_esm.h)("div", [(0,vue_esm.h)("div", {
104408
+ "style": 'margin-bottom: 6px;'
104409
+ }, [(0,vue_esm.h)("bk-radio", {
104410
+ "style": 'font-size: 12px;',
104411
+ "attrs": {
104412
+ "checked": timeValueType.value === 'static'
104413
+ },
104414
+ "on": {
104415
+ "change": val => val && handleTimeValueTypeChange('static')
104416
+ }
104417
+ }, [t('静态时间')]), (0,vue_esm.h)("span", {
104418
+ "style": 'margin-left: 8px; font-size: 10px; color: #979BA5;'
104419
+ }, [t('会将时间转换为时间戳,按照访问人的时间进行载入')])]), (0,vue_esm.h)("div", [(0,vue_esm.h)("bk-radio", {
104420
+ "style": 'font-size: 12px;',
104421
+ "attrs": {
104422
+ "checked": timeValueType.value === 'dynamic'
104423
+ },
104424
+ "on": {
104425
+ "change": val => val && handleTimeValueTypeChange('dynamic')
104426
+ }
104427
+ }, [t('动态时间')]), (0,vue_esm.h)("span", {
104428
+ "style": 'margin-left: 8px; font-size: 10px; color: #979BA5;'
104429
+ }, [t('会将近 xxx 这种时间保留,按照访问人的近 xxx 时间进行载入')])])])]), (0,vue_esm.h)("div", {
104430
+ "style": 'margin-bottom: 20px'
104431
+ }, [(0,vue_esm.h)("span", [t('时间示例'), "\uFF1A"]), (0,vue_esm.h)("span", {
104432
+ "style": 'color: #979BA5;'
104433
+ }, [placeholder.value])]), (0,vue_esm.h)("div", {
104434
+ "style": 'display: flex; align-items: center; margin-bottom: 12px;'
104435
+ }, [(0,vue_esm.h)("span", [t('链接有效期'), ":"]), (0,vue_esm.h)("bk-select", {
104436
+ "style": 'width: 200px; margin-left: 10px;',
104437
+ "attrs": {
104438
+ "ext-popover-cls": 'bklog-v3-select-popover',
104439
+ "value": expireTime.value
104440
+ },
104441
+ "on": {
104442
+ "change": handleExpireTimeChange
104443
+ }
104444
+ }, [expireTimeList.value.map(item => (0,vue_esm.h)("bk-option", {
104445
+ "attrs": {
104446
+ "id": item.id,
104447
+ "name": item.name
104448
+ },
104449
+ "key": item.id
104450
+ }, [item.name])), (0,vue_esm.h)("div", {
104451
+ "style": 'display: flex; align-items: center; padding: 10px;',
104452
+ "class": 'bklog-v3-select-popover'
104453
+ }, [(0,vue_esm.h)("span", {
104454
+ "style": 'display: inline-block; min-width: fit-content;'
104455
+ }, [t('自定义'), ":"]), (0,vue_esm.h)("bk-input", {
104456
+ "style": 'width: 100%; height: 28px; margin-left: 4px;',
104457
+ "attrs": {
104458
+ "placeholder": '{number}d|w|m'
104459
+ },
104460
+ "on": {
104461
+ "enter": val => handleCutomExpireTimeChange(val)
104462
+ }
104463
+ })])])]), (0,vue_esm.h)("div", {
104464
+ "style": 'display: flex; width: 100%; margin-top: 12px;'
104465
+ }, [(0,vue_esm.h)("bk-input", {
104466
+ "attrs": {
104467
+ "placeholder": `{SITE_URL}/share/{LINK_ID}`,
104468
+ "readonly": true,
104469
+ "value": link.value
104470
+ }
104471
+ }), (0,vue_esm.h)("bk-button", {
104472
+ "style": 'margin-left: -2px; border-radius: 0 2px 2px 0; min-width: fit-content;',
104473
+ "attrs": {
104474
+ "theme": 'primary'
104475
+ },
104476
+ "on": {
104477
+ "click": handleShareLinkClick
104478
+ }
104479
+ }, [t('生成并复制链接')])])]);
104480
+ };
104481
+ return () => {
104482
+ return (0,vue_esm.h)(bklog_popover, helper_default()([{
104483
+ "style": 'height: 100%;border-right: solid 1px #eaebf0; align-items: center; display: flex; justify-content: center; cursor: pointer; padding: 0 20px;',
104484
+ "attrs": {
104485
+ "beforeHide": beforePopoverHide,
104486
+ "options": {
104487
+ hideOnClick: false,
104488
+ onShow: beforeShow
104489
+ },
104490
+ "trigger": 'click'
104491
+ }
104492
+ }, {
104493
+ scopedSlots: {
104494
+ content: getContentView
104495
+ }
104496
+ }]), [(0,vue_esm.h)("span", {
104497
+ "class": 'bklog-icon bklog-share'
104498
+ }), (0,vue_esm.h)("span", {
104499
+ "style": 'margin-left: 6px;'
104500
+ }, [t('分享')])]);
104501
+ };
104502
+ }
104503
+ }));
104038
104504
  ;// ./node_modules/thread-loader/dist/cjs.js??clonedRuleSet-3.use[0]!./node_modules/babel-loader/lib/index.js??clonedRuleSet-3.use[1]!./node_modules/ifdef-loader/ifdef-loader.js??clonedRuleSet-3.use[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./src/views/retrieve-v2/sub-bar/index.vue?vue&type=script&setup=true&lang=js
104039
104505
 
104040
104506
 
104041
104507
 
104508
+
104042
104509
  function sub_barvue_type_script_setup_true_lang_js_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
104043
104510
  function sub_barvue_type_script_setup_true_lang_js_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? sub_barvue_type_script_setup_true_lang_js_ownKeys(Object(t), !0).forEach(function (r) { defineProperty_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : sub_barvue_type_script_setup_true_lang_js_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
104044
104511
 
@@ -104077,6 +104544,7 @@ var WarningSetting = function WarningSetting() {
104077
104544
 
104078
104545
 
104079
104546
 
104547
+
104080
104548
  /* harmony default export */ const sub_barvue_type_script_setup_true_lang_js = ({
104081
104549
  __name: 'index',
104082
104550
  props: {
@@ -104145,10 +104613,17 @@ var WarningSetting = function WarningSetting() {
104145
104613
  });
104146
104614
  var setRouteParams = function setRouteParams(ids, isUnionIndex) {
104147
104615
  var queryTab = retrieve_helper.routeQueryTabValueFix(indexSetParams.value.items[0], route.query.tab, isUnionIndex);
104616
+ var _indexSetParams$value = indexSetParams.value,
104617
+ search_mode = _indexSetParams$value.search_mode,
104618
+ keyword = _indexSetParams$value.keyword,
104619
+ addition = _indexSetParams$value.addition;
104148
104620
  if (isUnionIndex) {
104149
104621
  router.replace({
104150
104622
  query: sub_barvue_type_script_setup_true_lang_js_objectSpread(sub_barvue_type_script_setup_true_lang_js_objectSpread(sub_barvue_type_script_setup_true_lang_js_objectSpread({}, route.query), queryTab), {}, defineProperty_defineProperty(defineProperty_defineProperty({
104151
104623
  indexId: undefined,
104624
+ search_mode: search_mode,
104625
+ keyword: keyword,
104626
+ addition: JSON.stringify(addition),
104152
104627
  unionList: JSON.stringify(ids),
104153
104628
  clusterParams: undefined
104154
104629
  }, BK_LOG_STORAGE.HISTORY_ID, store.state.storage[BK_LOG_STORAGE.HISTORY_ID]), BK_LOG_STORAGE.FAVORITE_ID, store.state.storage[BK_LOG_STORAGE.FAVORITE_ID]))
@@ -104158,6 +104633,9 @@ var WarningSetting = function WarningSetting() {
104158
104633
  router.replace({
104159
104634
  query: sub_barvue_type_script_setup_true_lang_js_objectSpread(sub_barvue_type_script_setup_true_lang_js_objectSpread(sub_barvue_type_script_setup_true_lang_js_objectSpread({}, route.query), queryTab), {}, defineProperty_defineProperty(defineProperty_defineProperty({
104160
104635
  indexId: ids[0],
104636
+ search_mode: search_mode,
104637
+ keyword: keyword,
104638
+ addition: JSON.stringify(addition),
104161
104639
  unionList: undefined,
104162
104640
  clusterParams: undefined
104163
104641
  }, BK_LOG_STORAGE.HISTORY_ID, store.state.storage[BK_LOG_STORAGE.HISTORY_ID]), BK_LOG_STORAGE.FAVORITE_ID, store.state.storage[BK_LOG_STORAGE.FAVORITE_ID]))
@@ -104187,14 +104665,35 @@ var WarningSetting = function WarningSetting() {
104187
104665
  };
104188
104666
  var handleIndexSetSelected = /*#__PURE__*/function () {
104189
104667
  var _ref = _asyncToGenerator(/*#__PURE__*/regenerator_default().mark(function _callee(payload) {
104190
- var _payload$ids;
104668
+ var _payload$ids, indexSetDefaultCondition, _payload$items$, _payload$items$2;
104191
104669
  return regenerator_default().wrap(function _callee$(_context) {
104192
104670
  while (1) switch (_context.prev = _context.next) {
104193
104671
  case 0:
104194
104672
  if (!(0,external_lodash_namespaceObject.isEqual)(indexSetParams.value.ids, payload.ids) || indexSetParams.value.isUnionIndex !== payload.isUnionIndex) {
104673
+ /** 索引集默认条件 */
104674
+ indexSetDefaultCondition = {};
104675
+ /** 只选择一个索引集且ui模式和sql模式都没有值, 取索引集默认条件 */
104676
+ if (payload.items.length === 1 && !indexSetParams.value.addition.length && !indexSetParams.value.keyword) {
104677
+ if ((_payload$items$ = payload.items[0]) !== null && _payload$items$ !== void 0 && _payload$items$.query_string) {
104678
+ indexSetDefaultCondition = {
104679
+ keyword: payload.items[0].query_string,
104680
+ search_mode: 'sql',
104681
+ addition: []
104682
+ };
104683
+ } else if ((_payload$items$2 = payload.items[0]) !== null && _payload$items$2 !== void 0 && _payload$items$2.addition) {
104684
+ indexSetDefaultCondition = {
104685
+ addition: toConsumableArray_toConsumableArray(payload.items[0].addition),
104686
+ search_mode: 'ui',
104687
+ keyword: ''
104688
+ };
104689
+ }
104690
+ if (indexSetDefaultCondition.search_mode) {
104691
+ store.commit('updateStorage', defineProperty_defineProperty({}, BK_LOG_STORAGE.SEARCH_TYPE, ['ui', 'sql'].indexOf(indexSetDefaultCondition.search_mode)));
104692
+ }
104693
+ }
104195
104694
  retrieve_helper.setIndexsetId(payload.ids, payload.isUnionIndex ? 'union' : 'single', false);
104196
104695
  store.commit('updateUnionIndexList', payload.isUnionIndex ? (_payload$ids = payload.ids) !== null && _payload$ids !== void 0 ? _payload$ids : [] : []);
104197
- store.commit('updateIndexItem', payload);
104696
+ store.commit('updateIndexItem', sub_barvue_type_script_setup_true_lang_js_objectSpread(sub_barvue_type_script_setup_true_lang_js_objectSpread({}, payload), indexSetDefaultCondition));
104198
104697
  if (!payload.isUnionIndex) {
104199
104698
  store.commit('updateIndexId', payload.ids[0]);
104200
104699
  }
@@ -104203,9 +104702,18 @@ var WarningSetting = function WarningSetting() {
104203
104702
  origin_log_list: [],
104204
104703
  list: []
104205
104704
  });
104206
- store.dispatch('requestIndexSetFieldInfo').then(function () {
104705
+ store.dispatch('requestIndexSetFieldInfo').then(function (resp) {
104706
+ var _resp$data, _resp$data2;
104207
104707
  retrieve_helper.fire(retrieve_events.TREND_GRAPH_SEARCH);
104208
- store.dispatch('requestIndexSetQuery');
104708
+ if (resp !== null && resp !== void 0 && (_resp$data = resp.data) !== null && _resp$data !== void 0 && (_resp$data = _resp$data.fields) !== null && _resp$data !== void 0 && _resp$data.length) {
104709
+ store.dispatch('requestIndexSetQuery');
104710
+ }
104711
+ if (!(resp !== null && resp !== void 0 && (_resp$data2 = resp.data) !== null && _resp$data2 !== void 0 && (_resp$data2 = _resp$data2.fields) !== null && _resp$data2 !== void 0 && _resp$data2.length)) {
104712
+ store.commit('updateIndexSetQueryResult', {
104713
+ is_error: true,
104714
+ exception_msg: 'index-set-field-not-found'
104715
+ });
104716
+ }
104209
104717
  });
104210
104718
  setRouteParams(payload.ids, payload.isUnionIndex);
104211
104719
  }
@@ -104353,7 +104861,8 @@ var WarningSetting = function WarningSetting() {
104353
104861
  ClusterSetting: ClusterSetting,
104354
104862
  BarGlobalSetting: BarGlobalSetting,
104355
104863
  MoreSetting: MoreSetting,
104356
- WarningSetting: WarningSetting
104864
+ WarningSetting: WarningSetting,
104865
+ ShareLink: share_link
104357
104866
  };
104358
104867
  }
104359
104868
  });
@@ -104370,8 +104879,8 @@ var WarningSetting = function WarningSetting() {
104370
104879
 
104371
104880
  var sub_bar_component = normalizeComponent(
104372
104881
  retrieve_v2_sub_barvue_type_script_setup_true_lang_js,
104373
- sub_barvue_type_template_id_74d2d0b1_render,
104374
- sub_barvue_type_template_id_74d2d0b1_staticRenderFns,
104882
+ sub_barvue_type_template_id_6680cc42_render,
104883
+ sub_barvue_type_template_id_6680cc42_staticRenderFns,
104375
104884
  false,
104376
104885
  null,
104377
104886
  null,
@@ -104508,16 +105017,16 @@ var sub_bar_component = normalizeComponent(
104508
105017
  };
104509
105018
  });
104510
105019
  /**
104511
- * 解析地址栏参数
104512
- * 在其他模块跳转过来时,这里需要解析路由参数
104513
- * 更新相关参数到store
104514
- */
105020
+ * 解析地址栏参数
105021
+ * 在其他模块跳转过来时,这里需要解析路由参数
105022
+ * 更新相关参数到store
105023
+ */
104515
105024
  const reoverRouteParams = () => {
104516
105025
  update_URL_ARGS(route);
104517
105026
  const routeParams = getDefaultRetrieveParams({
104518
105027
  spaceUid: store.state.storage[BK_LOG_STORAGE.BK_SPACE_UID],
104519
105028
  bkBizId: store.state.storage[BK_LOG_STORAGE.BK_BIZ_ID],
104520
- search_mode: store.state.storage[BK_LOG_STORAGE.SEARCH_TYPE] === 1 ? 'sql' : 'ui'
105029
+ search_mode: SEARCH_MODE_DIC[store.state.storage[BK_LOG_STORAGE.SEARCH_TYPE]] ?? 'ui'
104521
105030
  });
104522
105031
  let activeTab = 'single';
104523
105032
  Object.assign(routeParams, {
@@ -104635,6 +105144,40 @@ var sub_bar_component = normalizeComponent(
104635
105144
  });
104636
105145
  }
104637
105146
  }
105147
+ const {
105148
+ addition,
105149
+ keyword,
105150
+ items
105151
+ } = store.state.indexItem;
105152
+ // 初始化时,判断当前单选索引集是否有默认条件
105153
+ if (items.length === 1 && !addition.length && !keyword) {
105154
+ let searchMode = 'ui';
105155
+ let defaultKeyword = '';
105156
+ let defaultAddition = [];
105157
+ if (items[0]?.query_string) {
105158
+ defaultKeyword = items[0].query_string;
105159
+ searchMode = 'sql';
105160
+ } else if (items[0]?.addition) {
105161
+ defaultAddition = [...items[0].addition];
105162
+ searchMode = 'ui';
105163
+ }
105164
+ store.commit('updateStorage', {
105165
+ [BK_LOG_STORAGE.SEARCH_TYPE]: ['ui', 'sql'].indexOf(searchMode ?? 'ui')
105166
+ });
105167
+ store.commit('updateIndexItem', {
105168
+ addition: defaultAddition,
105169
+ keyword: defaultKeyword,
105170
+ search_mode: searchMode
105171
+ });
105172
+ router.replace({
105173
+ query: {
105174
+ ...route.query,
105175
+ addition: JSON.stringify(defaultAddition),
105176
+ keyword: defaultKeyword,
105177
+ search_mode: searchMode
105178
+ }
105179
+ });
105180
+ }
104638
105181
  if (emptyIndexSetList.length === 0) {
104639
105182
  retrieve_helper.setSearchingValue(true);
104640
105183
  const type = route.query.indexId ? 'single' : 'union';