diff --git a/bklog/web/src/views/retrieve-v2/monitor/trace.ts b/bklog/web/src/views/retrieve-v2/monitor/trace.ts
new file mode 100644
index 0000000000..564a5718f1
--- /dev/null
+++ b/bklog/web/src/views/retrieve-v2/monitor/trace.ts
@@ -0,0 +1,55 @@
+/*
+* Tencent is pleased to support the open source community by making
+* 蓝鲸智云PaaS平台 (BlueKing PaaS) available.
+*
+* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
+*
+* 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.
+*
+* License for 蓝鲸智云PaaS平台 (BlueKing PaaS):
+*
+* ---------------------------------------------------
+* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
+* the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+* IN THE SOFTWARE.
+*/
+window.__IS_MONITOR_COMPONENT__ = true;
+window.__IS_MONITOR_TRACE__ = true;
+window.__IS_MONITOR_APM__ = process.env.MONITOR_APP === 'apm';
+import Vue from 'vue';
+
+import LogButton from '@/components/log-button';
+import JsonFormatWrapper from '@/global/json-format-wrapper.vue';
+import useStore from '@/hooks/use-store';
+import i18n from '@/language/i18n';
+
+import MonitorRetrieve from './monitor.vue';
+
+import '../../../static/style.css';
+const logStore = useStore();
+const initMonitorState = (payload) => {
+ logStore.commit('initMonitorState', payload);
+};
+const initGlobalComponents = () => {
+ Vue.component('JsonFormatWrapper', JsonFormatWrapper);
+ Vue.component('LogButton', LogButton);
+}
+const Vue2 = Vue;
+export {
+ MonitorRetrieve,
+ logStore,
+ i18n,
+ initMonitorState,
+ initGlobalComponents,
+ Vue2,
+}
diff --git a/bklog/web/src/views/retrieve-v2/monitor/utils.ts b/bklog/web/src/views/retrieve-v2/monitor/utils.ts
index 47d60f9f7c..9061ee22b3 100644
--- a/bklog/web/src/views/retrieve-v2/monitor/utils.ts
+++ b/bklog/web/src/views/retrieve-v2/monitor/utils.ts
@@ -34,8 +34,8 @@ export function monitorLink(routeParams: IRouterParams) {
...window.mainComponent.$router.query,
...window.mainComponent.$router.params,
...routeParams,
- name: 'apm-others',
- path: '/apm/service'
+ name: window.__IS_MONITOR_TRACE__ ? 'trace-retrieval' : 'apm-others',
+ path: window.__IS_MONITOR_TRACE__ ? '/trace/home' : '/apm/service'
};
const url = window.mainComponent.$router.resolve(params).href;
return url;
diff --git a/bklog/web/src/views/retrieve-v2/result-comp/context-log.vue b/bklog/web/src/views/retrieve-v2/result-comp/context-log.vue
index f4fdd735d1..c4126253b3 100644
--- a/bklog/web/src/views/retrieve-v2/result-comp/context-log.vue
+++ b/bklog/web/src/views/retrieve-v2/result-comp/context-log.vue
@@ -272,7 +272,7 @@
this.isConfigLoading = true;
const res = await this.$http.request('retrieve/getLogTableHead', {
params: {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
},
query: {
scope: 'search_context',
@@ -315,7 +315,7 @@
this.logLoading = true;
const res = await this.$http.request('retrieve/getContentLog', {
params: {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
},
data,
});
@@ -387,7 +387,7 @@
try {
const configRes = await this.$http.request('retrieve/getFieldsConfigByContextLog', {
params: {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
config_id: this.currentConfigID,
},
});
@@ -395,7 +395,7 @@
sort_list: configRes.data.sort_list,
name: configRes.data.name,
config_id: this.currentConfigID,
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
});
await this.$http.request('retrieve/updateFieldsConfig', {
data,
diff --git a/bklog/web/src/views/retrieve-v2/result-comp/export-history.vue b/bklog/web/src/views/retrieve-v2/result-comp/export-history.vue
index 1173036e68..5f2ec66948 100644
--- a/bklog/web/src/views/retrieve-v2/result-comp/export-history.vue
+++ b/bklog/web/src/views/retrieve-v2/result-comp/export-history.vue
@@ -416,7 +416,7 @@
this.$http
.request('retrieve/exportAsync', {
params: {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
},
data,
})
@@ -486,10 +486,12 @@
break;
}
}
- const params = Object.keys(queryParamsStr).reduce((output, key) => {
- output.push(`${key}=${encodeURIComponent(queryParamsStr[key])}`);
- return output;
- }, []).join('&') ;
+ const params = Object.keys(queryParamsStr)
+ .reduce((output, key) => {
+ output.push(`${key}=${encodeURIComponent(queryParamsStr[key])}`);
+ return output;
+ }, [])
+ .join('&');
const jumpUrl = `${window.SITE_URL}#/retrieve/${indexSetID}?spaceUid=${spaceUid}&bizId=${dict.bk_biz_id}&${params}`;
window.open(jumpUrl, '_blank');
},
@@ -535,7 +537,7 @@
const { limit, current } = this.pagination;
const queryUrl = this.isUnionSearch ? 'unionSearch/unionExportHistory' : 'retrieve/getExportHistoryList';
const params = {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
bk_biz_id: this.bkBizId,
page: current,
pagesize: limit,
diff --git a/bklog/web/src/views/retrieve-v2/result-comp/export-log.vue b/bklog/web/src/views/retrieve-v2/result-comp/export-log.vue
index 71342035a4..8e6e222f6d 100644
--- a/bklog/web/src/views/retrieve-v2/result-comp/export-log.vue
+++ b/bklog/web/src/views/retrieve-v2/result-comp/export-log.vue
@@ -310,7 +310,7 @@
return [];
},
routerIndexSet() {
- return window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId;
+ return window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId;
},
},
beforeUnmount() {
diff --git a/bklog/web/src/views/retrieve-v2/result-comp/fields-setting.vue b/bklog/web/src/views/retrieve-v2/result-comp/fields-setting.vue
index 28a3713086..2036d6648f 100644
--- a/bklog/web/src/views/retrieve-v2/result-comp/fields-setting.vue
+++ b/bklog/web/src/views/retrieve-v2/result-comp/fields-setting.vue
@@ -407,7 +407,7 @@
await this.$http
.request('retrieve/postFieldsConfig', {
data: {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
index_set_ids: this.unionIndexList,
index_set_type: this.isUnionSearch ? 'union' : 'single',
display_fields: this.shadowVisible,
@@ -584,7 +584,7 @@
sort_list: updateItem.sort_list,
display_fields: updateItem.display_fields,
config_id: undefined,
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
index_set_ids: this.unionIndexList,
index_set_type: this.isUnionSearch ? 'union' : 'single',
};
@@ -614,7 +614,7 @@
await this.$http.request('retrieve/deleteFieldsConfig', {
data: {
config_id: configID,
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
index_set_ids: this.unionIndexList,
index_set_type: this.isUnionSearch ? 'union' : 'single',
},
@@ -664,7 +664,11 @@
data: {
...(this.isUnionSearch
? { index_set_ids: this.unionIndexList }
- : { index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId }),
+ : {
+ index_set_id: window.__IS_MONITOR_COMPONENT__
+ ? this.$route.query.indexId
+ : this.$route.params.indexId,
+ }),
scope: 'default',
index_set_type: this.isUnionSearch ? 'union' : 'single',
},
diff --git a/bklog/web/src/views/retrieve-v2/result-comp/kv-list.vue b/bklog/web/src/views/retrieve-v2/result-comp/kv-list.vue
index e6ae17b96e..2f3667581e 100644
--- a/bklog/web/src/views/retrieve-v2/result-comp/kv-list.vue
+++ b/bklog/web/src/views/retrieve-v2/result-comp/kv-list.vue
@@ -279,7 +279,7 @@
}
if (path) {
- const url = `${window.__IS_MONITOR_APM__ ? location.origin : window.MONITOR_URL}${path}`;
+ const url = `${window.__IS_MONITOR_COMPONENT__ ? location.origin : window.MONITOR_URL}${path}`;
window.open(url, '_blank');
}
},
diff --git a/bklog/web/src/views/retrieve-v2/result-comp/real-time-log.vue b/bklog/web/src/views/retrieve-v2/result-comp/real-time-log.vue
index e8d0f1cbbc..a80467bfeb 100644
--- a/bklog/web/src/views/retrieve-v2/result-comp/real-time-log.vue
+++ b/bklog/web/src/views/retrieve-v2/result-comp/real-time-log.vue
@@ -235,7 +235,7 @@
this.loading = true;
this.$http
.request('retrieve/getRealTimeLog', {
- params: { index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId },
+ params: { index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId },
data: Object.assign({ order: '-', size: 50, zero: this.zero }, this.params),
})
.then(res => {
diff --git a/bklog/web/src/views/retrieve-v2/search-bar/index.vue b/bklog/web/src/views/retrieve-v2/search-bar/index.vue
index e0845443ab..26c5059028 100644
--- a/bklog/web/src/views/retrieve-v2/search-bar/index.vue
+++ b/bklog/web/src/views/retrieve-v2/search-bar/index.vue
@@ -6,7 +6,7 @@
import { useRoute, useRouter } from 'vue-router/composables';
import { RetrieveUrlResolver } from '@/store/url-resolver';
- // #if APP !== 'apm'
+ // #if MONITOR_APP !== 'apm' && MONITOR_APP !== 'trace'
import BookmarkPop from './bookmark-pop';
// #else
// #code const BookmarkPop = () => null;
@@ -193,7 +193,7 @@
};
const handleRefresh = isRefresh => {
- // #if APP !== 'apm'
+ // #if MONITOR_APP !== 'apm' && MONITOR_APP !== 'trace'
emit('refresh', isRefresh);
// #endif
};
diff --git a/bklog/web/src/views/retrieve-v2/search-bar/ip-selector.vue b/bklog/web/src/views/retrieve-v2/search-bar/ip-selector.vue
index 8b79941a98..6fb5055722 100644
--- a/bklog/web/src/views/retrieve-v2/search-bar/ip-selector.vue
+++ b/bklog/web/src/views/retrieve-v2/search-bar/ip-selector.vue
@@ -1,8 +1,14 @@
+
diff --git a/bklog/web/src/views/retrieve-v2/search-result-panel/original-log/table-log.vue b/bklog/web/src/views/retrieve-v2/search-result-panel/original-log/table-log.vue
index 12da9da64c..f6f6e82826 100644
--- a/bklog/web/src/views/retrieve-v2/search-result-panel/original-log/table-log.vue
+++ b/bklog/web/src/views/retrieve-v2/search-result-panel/original-log/table-log.vue
@@ -128,10 +128,14 @@
import tableRowDeepViewMixin from '@/mixins/table-row-deep-view-mixin';
import RetrieveLoader from '@/skeleton/retrieve-loader';
import { mapState } from 'vuex';
-
import { bigNumberToString } from '../../../../common/util';
+ // #if MONITOR_APP !== 'trace'
import ContextLog from '../../result-comp/context-log';
import RealTimeLog from '../../result-comp/real-time-log';
+ // #else
+ // #code const ContextLog = () => null;
+ // #code const RealTimeLog = () => null;
+ // #endif
import OriginalList from './original-list';
import TableList from './table-list';
@@ -277,7 +281,7 @@
this.$http
.request('retrieve/getWebConsoleUrl', {
params: {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
},
query: queryData,
})
@@ -347,7 +351,7 @@
height: calc(100% - 42px);
.bklog-skeleton-loading {
- position: absolute;
+ position: absolute !important;
top: 0;
z-index: 10;
}
diff --git a/bklog/web/src/views/retrieve-v2/search-result-panel/panel-util.js b/bklog/web/src/views/retrieve-v2/search-result-panel/panel-util.js
index 28182f7675..7a87f8ba39 100644
--- a/bklog/web/src/views/retrieve-v2/search-result-panel/panel-util.js
+++ b/bklog/web/src/views/retrieve-v2/search-result-panel/panel-util.js
@@ -76,7 +76,7 @@ export function getConditionRouterParams(searchList, searchMode, isNewLink) {
params,
query: filterQuery,
};
- if (window.__IS_MONITOR_APM__) {
+ if (window.__IS_MONITOR_COMPONENT__) {
return monitorLink(routeData);
}
return window.mainComponent.$router.resolve(routeData).href;
diff --git a/bklog/web/src/views/retrieve-v2/setting-modal/log-cluster.vue b/bklog/web/src/views/retrieve-v2/setting-modal/log-cluster.vue
index 99f50bae7e..8518be3b2d 100644
--- a/bklog/web/src/views/retrieve-v2/setting-modal/log-cluster.vue
+++ b/bklog/web/src/views/retrieve-v2/setting-modal/log-cluster.vue
@@ -283,7 +283,7 @@
this.globalLoading = true;
try {
const params = {
- index_set_id: window.__IS_MONITOR_APM__ ? this.$route.query.indexId : this.$route.params.indexId,
+ index_set_id: window.__IS_MONITOR_COMPONENT__ ? this.$route.query.indexId : this.$route.params.indexId,
};
const data = { collector_config_id: this.configID };
const baseUrl = '/logClustering';
diff --git a/bklog/web/src/views/retrieve/index.vue b/bklog/web/src/views/retrieve/index.vue
index b48351d94e..d0c7b1944f 100644
--- a/bklog/web/src/views/retrieve/index.vue
+++ b/bklog/web/src/views/retrieve/index.vue
@@ -30,6 +30,7 @@
@@ -296,7 +296,11 @@
getStorageIndexItem,
} from '@/common/util';
import AuthContainerPage from '@/components/common/auth-container-page';
+ // #if MONITOR_APP !== 'apm' && MONITOR_APP !== 'trace'
import LogIpSelector from '@/components/log-ip-selector/log-ip-selector';
+ // #else
+ // #code const LogIpSelector = () => null;
+ // #endif
import indexSetSearchMixin from '@/mixins/indexSet-search-mixin';
import tableRowDeepViewMixin from '@/mixins/table-row-deep-view-mixin';
import axios from 'axios';
@@ -310,12 +314,12 @@
import AddCollectDialog from './collect/add-collect-dialog';
import CollectIndex from './collect/collect-index';
import SelectIndexSet from './condition-comp/select-index-set.tsx';
+ import FieldFilter from './field-filter-comp';
import NoIndexSet from './result-comp/no-index-set';
import ResultHeader from './result-comp/result-header';
import ResultMain from './result-comp/result-main';
import SearchComp from './search-comp';
import SettingModal from './setting-modal/index.vue';
- import FieldFilter from './field-filter-comp';
const CancelToken = axios.CancelToken;
const currentTime = Math.floor(new Date().getTime() / 1000);
@@ -1738,7 +1742,7 @@
// 更新联合查询的begin
const unionConfigs = this.unionIndexList.map(item => ({
begin: this.isTablePagination
- ? (this.catchUnionBeginList.find(cItem => String(cItem?.index_set_id) === item)?.begin ?? 0)
+ ? this.catchUnionBeginList.find(cItem => String(cItem?.index_set_id) === item)?.begin ?? 0
: 0,
index_set_id: item,
}));
diff --git a/bklog/web/webpack.config.js b/bklog/web/webpack.config.js
index 4151c99045..092622f276 100644
--- a/bklog/web/webpack.config.js
+++ b/bklog/web/webpack.config.js
@@ -92,8 +92,8 @@ if (fs.existsSync(path.resolve(__dirname, './local.settings.js'))) {
const localConfig = require('./local.settings');
devConfig = Object.assign({}, devConfig, localConfig);
}
-module.exports = (baseConfig, { app, mobile, production, fta, email = false }) => {
- const isMonitorRetrieveBuild = app === 'apm' && production; // 判断是否监控检索构建
+module.exports = (baseConfig, { app, mobile, production, fta, log, email = false }) => {
+ const isMonitorRetrieveBuild = ['apm', 'trace'].includes(process.env.MONITOR_APP) && production; // 判断是否监控检索构建
const config = baseConfig;
const distUrl = path.resolve('../static/dist');
if (!production) {
@@ -117,7 +117,8 @@ module.exports = (baseConfig, { app, mobile, production, fta, email = false }) =
devHost: JSON.stringify(`${devConfig.host}`),
loginHost: JSON.stringify(devConfig.loginHost),
loginUrl: JSON.stringify(`${devConfig.loginHost}/login/`),
- APP: JSON.stringify(`${app}`),
+ APP: JSON.stringify(`${process.env.MONITOR_APP}`),
+ MONITOR_APP: JSON.stringify(`${process.env.MONITOR_APP}`),
},
},
}),
@@ -191,6 +192,15 @@ module.exports = (baseConfig, { app, mobile, production, fta, email = false }) =
})
: plugin;
}),
- cache: typeof devConfig.cache === 'boolean' ? devConfig.cache : config.cache,
+ cache: production
+ ? false
+ : {
+ buildDependencies: {
+ config: [__filename],
+ },
+ cacheDirectory: path.resolve(__dirname, '.cache'),
+ name: `${process.env.MONITOR_APP || config.app}-cache`,
+ type: 'filesystem',
+ },
};
};