mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-15 09:48:43 +00:00
toggle trace filters
This commit is contained in:
parent
7cf5648042
commit
b1fd8923ca
@ -279,6 +279,7 @@ export default defineComponent({
|
|||||||
dashboardStore.layout[l].children[activeTabIndex.value].children
|
dashboardStore.layout[l].children[activeTabIndex.value].children
|
||||||
);
|
);
|
||||||
needQuery.value = true;
|
needQuery.value = true;
|
||||||
|
console.log(dashboardStore.layout[0])
|
||||||
}
|
}
|
||||||
function removeTab(e: Event) {
|
function removeTab(e: Event) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License. -->
|
limitations under the License. -->
|
||||||
<template>
|
<template>
|
||||||
|
<div class="dashboard-tool">
|
||||||
<div class="dashboard-tool flex-h">
|
<div class="dashboard-tool flex-h">
|
||||||
<div class="flex-h">
|
<div class="flex-h">
|
||||||
<div class="selectors-item" v-if="key !== 10">
|
<div class="selectors-item" v-if="key !== 10">
|
||||||
@ -42,9 +43,7 @@ limitations under the License. -->
|
|||||||
@change="changePods"
|
@change="changePods"
|
||||||
@query="searchPods"
|
@query="searchPods"
|
||||||
class="selectorPod"
|
class="selectorPod"
|
||||||
:isRemote="
|
:isRemote="['EndpointRelation', 'Endpoint'].includes(dashboardStore.entity)"
|
||||||
['EndpointRelation', 'Endpoint'].includes(dashboardStore.entity)
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="selectors-item" v-if="key === 2 || key === 4">
|
<div class="selectors-item" v-if="key === 2 || key === 4">
|
||||||
@ -78,7 +77,11 @@ limitations under the License. -->
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-h tools" v-loading="loading" v-if="$route.query['portal'] !== 'true'">
|
<div
|
||||||
|
class="flex-h tools"
|
||||||
|
v-loading="loading"
|
||||||
|
v-if="$route.query['portal'] !== 'true'"
|
||||||
|
>
|
||||||
<div class="tool-icons flex-h" v-if="dashboardStore.editMode">
|
<div class="tool-icons flex-h" v-if="dashboardStore.editMode">
|
||||||
<el-dropdown content="Controls" placement="bottom">
|
<el-dropdown content="Controls" placement="bottom">
|
||||||
<i>
|
<i>
|
||||||
@ -118,7 +121,8 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Filter />
|
<Filter v-if="showFilter" />
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import Filter from "../related/trace/Filter.vue";
|
import Filter from "../related/trace/Filter.vue";
|
||||||
@ -146,6 +150,10 @@ const dashboardStore = useDashboardStore();
|
|||||||
const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
const params = useRoute().params;
|
const params = useRoute().params;
|
||||||
|
const showFilter = computed(
|
||||||
|
() => dashboardStore.layout[0].activedTabIndex === 2
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
const { query } = useRoute();
|
const { query } = useRoute();
|
||||||
dashboardStore.setViewMode(query["fullview"] === "true");
|
dashboardStore.setViewMode(query["fullview"] === "true");
|
||||||
@ -172,9 +180,7 @@ const states = reactive<{
|
|||||||
currentDestPod: "",
|
currentDestPod: "",
|
||||||
});
|
});
|
||||||
const key = computed(() => {
|
const key = computed(() => {
|
||||||
const type = EntityType.find(
|
const type = EntityType.find((d: Option) => d.value === dashboardStore.entity);
|
||||||
(d: Option) => d.value === dashboardStore.entity
|
|
||||||
);
|
|
||||||
return (type && type.key) || 0;
|
return (type && type.key) || 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -208,9 +214,7 @@ async function setSelector() {
|
|||||||
].includes(String(params.entity))
|
].includes(String(params.entity))
|
||||||
) {
|
) {
|
||||||
setSourceSelector();
|
setSourceSelector();
|
||||||
if (
|
if ([EntityType[2].value, EntityType[3].value].includes(String(params.entity))) {
|
||||||
[EntityType[2].value, EntityType[3].value].includes(String(params.entity))
|
|
||||||
) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setDestSelector();
|
setDestSelector();
|
||||||
@ -278,11 +282,7 @@ async function setSourceSelector() {
|
|||||||
async function setDestSelector() {
|
async function setDestSelector() {
|
||||||
await selectorStore.getService(String(params.destServiceId), true);
|
await selectorStore.getService(String(params.destServiceId), true);
|
||||||
states.currentDestService = selectorStore.currentDestService.value;
|
states.currentDestService = selectorStore.currentDestService.value;
|
||||||
await fetchPods(
|
await fetchPods(String(params.entity), selectorStore.currentDestService.id, false);
|
||||||
String(params.entity),
|
|
||||||
selectorStore.currentDestService.id,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
if (!(selectorStore.destPods.length && selectorStore.destPods[0])) {
|
if (!(selectorStore.destPods.length && selectorStore.destPods[0])) {
|
||||||
selectorStore.setCurrentDestPod(null);
|
selectorStore.setCurrentDestPod(null);
|
||||||
states.currentDestPod = "";
|
states.currentDestPod = "";
|
||||||
@ -295,9 +295,7 @@ async function setDestSelector() {
|
|||||||
(d: { label: string }) => d.label === states.currentDestPod
|
(d: { label: string }) => d.label === states.currentDestPod
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
currentDestPod = selectorStore.destPods.find(
|
currentDestPod = selectorStore.destPods.find((d: { id: string }) => d.id === destPod);
|
||||||
(d: { id: string }) => d.id === destPod
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (currentDestPod) {
|
if (currentDestPod) {
|
||||||
selectorStore.setCurrentDestPod(currentDestPod);
|
selectorStore.setCurrentDestPod(currentDestPod);
|
||||||
@ -326,9 +324,7 @@ async function getServices() {
|
|||||||
(d: { label: string }) => d.label === states.currentService
|
(d: { label: string }) => d.label === states.currentService
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
s = (selectorStore.services || []).find(
|
s = (selectorStore.services || []).find((d: unknown, index: number) => index === 0);
|
||||||
(d: unknown, index: number) => index === 0
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
selectorStore.setCurrentService(s || null);
|
selectorStore.setCurrentService(s || null);
|
||||||
let d;
|
let d;
|
||||||
@ -337,9 +333,7 @@ async function getServices() {
|
|||||||
(d: { label: string }) => d.label === states.currentDestService
|
(d: { label: string }) => d.label === states.currentDestService
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
d = (selectorStore.services || []).find(
|
d = (selectorStore.services || []).find((d: unknown, index: number) => index === 1);
|
||||||
(d: unknown, index: number) => index === 1
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
selectorStore.setCurrentDestService(d || null);
|
selectorStore.setCurrentDestService(d || null);
|
||||||
if (!selectorStore.currentService) {
|
if (!selectorStore.currentService) {
|
||||||
@ -347,18 +341,14 @@ async function getServices() {
|
|||||||
}
|
}
|
||||||
states.currentService = selectorStore.currentService.value;
|
states.currentService = selectorStore.currentService.value;
|
||||||
const e = dashboardStore.entity.split("Relation")[0];
|
const e = dashboardStore.entity.split("Relation")[0];
|
||||||
if (
|
if ([EntityType[2].value, EntityType[3].value].includes(dashboardStore.entity)) {
|
||||||
[EntityType[2].value, EntityType[3].value].includes(dashboardStore.entity)
|
|
||||||
) {
|
|
||||||
fetchPods(e, selectorStore.currentService.id, true);
|
fetchPods(e, selectorStore.currentService.id, true);
|
||||||
}
|
}
|
||||||
if (!selectorStore.currentDestService) {
|
if (!selectorStore.currentDestService) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
states.currentDestService = selectorStore.currentDestService.value;
|
states.currentDestService = selectorStore.currentDestService.value;
|
||||||
if (
|
if ([EntityType[5].value, EntityType[6].value].includes(dashboardStore.entity)) {
|
||||||
[EntityType[5].value, EntityType[6].value].includes(dashboardStore.entity)
|
|
||||||
) {
|
|
||||||
fetchPods(dashboardStore.entity, selectorStore.currentDestService.id, true);
|
fetchPods(dashboardStore.entity, selectorStore.currentDestService.id, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -413,10 +403,7 @@ async function applyDashboard() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function clickIcons(t: { id: string; content: string; name: string }) {
|
async function clickIcons(t: { id: string; content: string; name: string }) {
|
||||||
if (
|
if (dashboardStore.selectedGrid && dashboardStore.selectedGrid.type === "Tab") {
|
||||||
dashboardStore.selectedGrid &&
|
|
||||||
dashboardStore.selectedGrid.type === "Tab"
|
|
||||||
) {
|
|
||||||
setTabControls(t.id);
|
setTabControls(t.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -504,9 +491,7 @@ async function fetchPods(
|
|||||||
(d: { label: unknown }) => d.label === states.currentPod
|
(d: { label: unknown }) => d.label === states.currentPod
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
p = selectorStore.pods.find(
|
p = selectorStore.pods.find((d: unknown, index: number) => index === 0);
|
||||||
(d: unknown, index: number) => index === 0
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
selectorStore.setCurrentPod(p || null);
|
selectorStore.setCurrentPod(p || null);
|
||||||
states.currentPod = selectorStore.currentPod.label;
|
states.currentPod = selectorStore.currentPod.label;
|
||||||
@ -614,12 +599,7 @@ function searchDestPods(query: string) {
|
|||||||
const param = {
|
const param = {
|
||||||
keyword: query,
|
keyword: query,
|
||||||
};
|
};
|
||||||
fetchPods(
|
fetchPods(EntityType[6].value, selectorStore.currentDestService.id, false, param);
|
||||||
EntityType[6].value,
|
|
||||||
selectorStore.currentDestService.id,
|
|
||||||
false,
|
|
||||||
param
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
() => dashboardStore.entity,
|
() => dashboardStore.entity,
|
||||||
|
@ -14,6 +14,14 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License. -->
|
limitations under the License. -->
|
||||||
<template>
|
<template>
|
||||||
<div class="flex-h row">
|
<div class="flex-h row">
|
||||||
|
<div class="flex-h">
|
||||||
|
<el-button type="secondary"> Instance </el-button>
|
||||||
|
<el-button type="secondary"> Status </el-button>
|
||||||
|
<el-button type="secondary">
|
||||||
|
<!-- <Icon size="sm" iconName="duration" /> -->
|
||||||
|
Duration
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
<div class="mr-5" v-if="dashboardStore.entity === EntityType[1].value">
|
<div class="mr-5" v-if="dashboardStore.entity === EntityType[1].value">
|
||||||
<span class="grey mr-5">{{ t("service") }}:</span>
|
<span class="grey mr-5">{{ t("service") }}:</span>
|
||||||
<Selector
|
<Selector
|
||||||
|
Loading…
Reference in New Issue
Block a user