mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-18 08:25:25 +00:00
feat: set dashboard name
This commit is contained in:
parent
078f1bc042
commit
79d4312f7c
@ -134,12 +134,21 @@ function initSelector() {
|
||||
}
|
||||
|
||||
async function setSelector() {
|
||||
if (params.podId) {
|
||||
if (
|
||||
params.entity === EntityType[2].value ||
|
||||
params.entity === EntityType[3].value
|
||||
) {
|
||||
await selectorStore.getService(String(params.serviceId));
|
||||
states.currentService = selectorStore.currentService.value;
|
||||
await fetchPods(String(params.entity), false);
|
||||
if (!(selectorStore.pods.length && selectorStore.pods[0])) {
|
||||
selectorStore.setCurrentPod(null);
|
||||
states.currentPod = "";
|
||||
return;
|
||||
}
|
||||
const pod = params.podId || selectorStore.pods[0].id;
|
||||
const currentPod = selectorStore.pods.filter(
|
||||
(d: { id: string }) => d.id === String(params.podId)
|
||||
(d: { id: string }) => d.id === pod
|
||||
)[0];
|
||||
selectorStore.setCurrentPod(currentPod);
|
||||
states.currentPod = currentPod.label;
|
||||
|
@ -244,14 +244,14 @@ function update() {
|
||||
}
|
||||
function handleGoEndpoint() {
|
||||
const node = topologyStore.node;
|
||||
const path = `/dashboard/${dashboardStore.layerId}/Endpoint/${node.id}/${settings.value.nodeDashboard}`;
|
||||
const path = `/dashboard/${dashboardStore.layerId}/Endpoint/${node.id}/${settings.value.endpointDashboard}`;
|
||||
const routeUrl = router.resolve({ path });
|
||||
|
||||
window.open(routeUrl.href, "_blank");
|
||||
}
|
||||
function handleGoInstance() {
|
||||
const node = topologyStore.node;
|
||||
const path = `/dashboard/${dashboardStore.layerId}/ServiceInstance/${node.id}/${settings.value.nodeDashboard}`;
|
||||
const path = `/dashboard/${dashboardStore.layerId}/ServiceInstance/${node.id}/${settings.value.instanceDashboard}`;
|
||||
const routeUrl = router.resolve({ path });
|
||||
|
||||
window.open(routeUrl.href, "_blank");
|
||||
|
@ -44,6 +44,22 @@ limitations under the License. -->
|
||||
size="small"
|
||||
class="inputs"
|
||||
/>
|
||||
<div class="label">{{ t("dashboards") }}</div>
|
||||
<el-input
|
||||
v-model="states.instanceDashboard"
|
||||
placeholder="Please input a dashboard name for service instances"
|
||||
@change="updateSettings"
|
||||
size="small"
|
||||
class="inputs"
|
||||
/>
|
||||
<div class="label">{{ t("dashboards") }}</div>
|
||||
<el-input
|
||||
v-model="states.endpointDashboard"
|
||||
placeholder="Please input a dashboard name for endpoints"
|
||||
@change="updateSettings"
|
||||
size="small"
|
||||
class="inputs"
|
||||
/>
|
||||
<div class="label">{{ t("metrics") }}</div>
|
||||
<Selector
|
||||
class="inputs"
|
||||
@ -71,6 +87,8 @@ const dashboardStore = useDashboardStore();
|
||||
const states = reactive<{
|
||||
linkDashboard: string;
|
||||
nodeDashboard: string;
|
||||
instanceDashboard: string;
|
||||
endpointDashboard: string;
|
||||
linkMetrics: string[];
|
||||
nodeMetrics: string[];
|
||||
nodeMetricList: Option[];
|
||||
@ -78,6 +96,8 @@ const states = reactive<{
|
||||
}>({
|
||||
linkDashboard: "",
|
||||
nodeDashboard: "",
|
||||
instanceDashboard: "",
|
||||
endpointDashboard: "",
|
||||
linkMetrics: [],
|
||||
nodeMetrics: [],
|
||||
nodeMetricList: [],
|
||||
@ -104,6 +124,8 @@ function updateSettings() {
|
||||
emit("update", {
|
||||
linkDashboard: states.linkDashboard,
|
||||
nodeDashboard: states.nodeDashboard,
|
||||
endpointDashboard: states.endpointDashboard,
|
||||
instanceDashboard: states.instanceDashboard,
|
||||
linkMetrics: states.linkMetrics,
|
||||
nodeMetrics: states.nodeMetrics,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user