mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-16 21:55:24 +00:00
update tools
This commit is contained in:
parent
b0461d0833
commit
71c629b83a
@ -152,7 +152,6 @@ export const EntityType = [
|
|||||||
},
|
},
|
||||||
{ value: "EndpointRelation", label: "Endpoint Relation", key: 4 },
|
{ value: "EndpointRelation", label: "Endpoint Relation", key: 4 },
|
||||||
];
|
];
|
||||||
export const hasTopology = ["All", "Service", "ServiceRelation", "Endpoint"];
|
|
||||||
export const TableEntity: any = {
|
export const TableEntity: any = {
|
||||||
InstanceList: EntityType[3].value,
|
InstanceList: EntityType[3].value,
|
||||||
EndpointList: EntityType[2].value,
|
EndpointList: EntityType[2].value,
|
||||||
@ -162,18 +161,51 @@ export const SortOrder = [
|
|||||||
{ label: "DES", value: "DES" },
|
{ label: "DES", value: "DES" },
|
||||||
{ label: "ASC", value: "ASC" },
|
{ label: "ASC", value: "ASC" },
|
||||||
];
|
];
|
||||||
export const ToolIcons = [
|
export const AllTools = [
|
||||||
|
{ name: "playlist_add", content: "Add Widget", id: "addWidget" },
|
||||||
|
{ name: "all_inbox", content: "Add Tab", id: "addTab" },
|
||||||
|
{ name: "device_hub", content: "Add Topology", id: "addTopology" },
|
||||||
|
{ name: "merge", content: "Add Trace", id: "addTrace" },
|
||||||
|
{ name: "assignment", content: "Add Log", id: "addLog" },
|
||||||
|
{ name: "save", content: "Apply", id: "apply" },
|
||||||
|
];
|
||||||
|
export const ServiceTools = [
|
||||||
{ name: "playlist_add", content: "Add Widget", id: "addWidget" },
|
{ name: "playlist_add", content: "Add Widget", id: "addWidget" },
|
||||||
{ name: "all_inbox", content: "Add Tab", id: "addTab" },
|
{ name: "all_inbox", content: "Add Tab", id: "addTab" },
|
||||||
{ name: "device_hub", content: "Add Topology", id: "addTopology" },
|
{ name: "device_hub", content: "Add Topology", id: "addTopology" },
|
||||||
{ name: "merge", content: "Add Trace", id: "addTrace" },
|
{ name: "merge", content: "Add Trace", id: "addTrace" },
|
||||||
{ name: "timeline", content: "Add Profile", id: "addProfile" },
|
{ name: "timeline", content: "Add Profile", id: "addProfile" },
|
||||||
{ name: "assignment", content: "Add Log", id: "addLog" },
|
{ name: "assignment", content: "Add Log", id: "addLog" },
|
||||||
// { name: "save_alt", content: "Export", id: "export" },
|
{ name: "save", content: "Apply", id: "apply" },
|
||||||
// { name: "folder_open", content: "Import", id: "import" },
|
|
||||||
// { name: "settings", content: "Settings", id: "settings" },
|
|
||||||
// { name: "save", content: "Apply", id: "apply" },
|
|
||||||
];
|
];
|
||||||
|
export const InstanceTools = [
|
||||||
|
{ name: "playlist_add", content: "Add Widget", id: "addWidget" },
|
||||||
|
{ name: "all_inbox", content: "Add Tab", id: "addTab" },
|
||||||
|
{ name: "device_hub", content: "Add Topology", id: "addTopology" },
|
||||||
|
{ name: "merge", content: "Add Trace", id: "addTrace" },
|
||||||
|
{ name: "assignment", content: "Add Log", id: "addLog" },
|
||||||
|
{ name: "save", content: "Apply", id: "apply" },
|
||||||
|
];
|
||||||
|
export const EndpointTools = [
|
||||||
|
{ name: "playlist_add", content: "Add Widget", id: "addWidget" },
|
||||||
|
{ name: "all_inbox", content: "Add Tab", id: "addTab" },
|
||||||
|
{ name: "device_hub", content: "Add Topology", id: "addTopology" },
|
||||||
|
{ name: "merge", content: "Add Trace", id: "addTrace" },
|
||||||
|
{ name: "assignment", content: "Add Log", id: "addLog" },
|
||||||
|
{ name: "save", content: "Apply", id: "apply" },
|
||||||
|
];
|
||||||
|
export const ServiceRelationTools = [
|
||||||
|
{ name: "playlist_add", content: "Add Widget", id: "addWidget" },
|
||||||
|
{ name: "all_inbox", content: "Add Tab", id: "addTab" },
|
||||||
|
{ name: "device_hub", content: "Add Topology", id: "addTopology" },
|
||||||
|
{ name: "save", content: "Apply", id: "apply" },
|
||||||
|
];
|
||||||
|
export const PodRelationTools = [
|
||||||
|
{ name: "playlist_add", content: "Add Widget", id: "addWidget" },
|
||||||
|
{ name: "all_inbox", content: "Add Tab", id: "addTab" },
|
||||||
|
{ name: "save", content: "Apply", id: "apply" },
|
||||||
|
];
|
||||||
|
|
||||||
export const ScopeType = [
|
export const ScopeType = [
|
||||||
{ value: "Service", label: "Service", key: 1 },
|
{ value: "Service", label: "Service", key: 1 },
|
||||||
{ value: "Endpoint", label: "Endpoint", key: 3 },
|
{ value: "Endpoint", label: "Endpoint", key: 3 },
|
||||||
@ -214,4 +246,3 @@ export const QueryOrders = [
|
|||||||
{ label: "Start Time", value: "BY_START_TIME" },
|
{ label: "Start Time", value: "BY_START_TIME" },
|
||||||
{ label: "Duration", value: "BY_DURATION" },
|
{ label: "Duration", value: "BY_DURATION" },
|
||||||
];
|
];
|
||||||
export const TraceEntitys = ["All", "Service", "ServiceInstance", "Endpoint"];
|
|
||||||
|
@ -75,35 +75,30 @@ limitations under the License. -->
|
|||||||
<div class="tool-icons">
|
<div class="tool-icons">
|
||||||
<span
|
<span
|
||||||
@click="clickIcons(t)"
|
@click="clickIcons(t)"
|
||||||
v-for="(t, index) in ToolIcons"
|
v-for="(t, index) in toolIcons"
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="t.content"
|
:title="t.content"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon class="icon-btn" size="sm" :iconName="t.name" />
|
||||||
class="icon-btn"
|
|
||||||
size="sm"
|
|
||||||
:iconName="t.name"
|
|
||||||
v-if="
|
|
||||||
!['topology', 'trace', 'profile'].includes(t.id) ||
|
|
||||||
(t.id === 'topology' &&
|
|
||||||
hasTopology.includes(dashboardStore.entity)) ||
|
|
||||||
(t.id === 'trace' &&
|
|
||||||
TraceEntitys.includes(dashboardStore.entity)) ||
|
|
||||||
(t.id === 'profile' &&
|
|
||||||
dashboardStore.entity === EntityType[0].value)
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive, watch } from "vue";
|
import { reactive, watch, ref } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
import { EntityType, ToolIcons, hasTopology, TraceEntitys } from "../data";
|
import {
|
||||||
|
EntityType,
|
||||||
|
AllTools,
|
||||||
|
ServiceTools,
|
||||||
|
InstanceTools,
|
||||||
|
EndpointTools,
|
||||||
|
PodRelationTools,
|
||||||
|
ServiceRelationTools,
|
||||||
|
} from "../data";
|
||||||
import { useSelectorStore } from "@/store/modules/selectors";
|
import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { Option } from "@/types/app";
|
import { Option } from "@/types/app";
|
||||||
@ -113,6 +108,7 @@ const selectorStore = useSelectorStore();
|
|||||||
const appStore = useAppStoreWithOut();
|
const appStore = useAppStoreWithOut();
|
||||||
const params = useRoute().params;
|
const params = useRoute().params;
|
||||||
const type = EntityType.filter((d: Option) => d.value === params.entity)[0];
|
const type = EntityType.filter((d: Option) => d.value === params.entity)[0];
|
||||||
|
const toolIcons = ref<any[]>(PodRelationTools);
|
||||||
const states = reactive<{
|
const states = reactive<{
|
||||||
destService: string;
|
destService: string;
|
||||||
destPod: string;
|
destPod: string;
|
||||||
@ -137,6 +133,7 @@ dashboardStore.setEntity(String(params.entity));
|
|||||||
initSelector();
|
initSelector();
|
||||||
|
|
||||||
function initSelector() {
|
function initSelector() {
|
||||||
|
getTools();
|
||||||
if (params.serviceId) {
|
if (params.serviceId) {
|
||||||
setSelector();
|
setSelector();
|
||||||
} else {
|
} else {
|
||||||
@ -401,6 +398,27 @@ async function fetchPods(type: string, serviceId: string, setPod: boolean) {
|
|||||||
ElMessage.error(resp.errors);
|
ElMessage.error(resp.errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getTools() {
|
||||||
|
switch (dashboardStore.entity) {
|
||||||
|
case EntityType[1].value:
|
||||||
|
toolIcons.value = AllTools;
|
||||||
|
break;
|
||||||
|
case EntityType[0].value:
|
||||||
|
toolIcons.value = ServiceTools;
|
||||||
|
break;
|
||||||
|
case EntityType[2].value:
|
||||||
|
toolIcons.value = EndpointTools;
|
||||||
|
break;
|
||||||
|
case EntityType[3].value:
|
||||||
|
toolIcons.value = InstanceTools;
|
||||||
|
break;
|
||||||
|
case EntityType[4].value:
|
||||||
|
toolIcons.value = ServiceRelationTools;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
toolIcons.value = PodRelationTools;
|
||||||
|
}
|
||||||
|
}
|
||||||
watch(
|
watch(
|
||||||
() => appStore.durationTime,
|
() => appStore.durationTime,
|
||||||
() => {
|
() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user