link dashboard

This commit is contained in:
Fine 2022-08-19 17:18:42 +08:00
parent 1ad7cabcd4
commit cce1f08719
3 changed files with 13 additions and 20 deletions

View File

@ -287,7 +287,7 @@ async function setSourceSelector() {
await selectorStore.getService(String(params.serviceId));
states.currentService = selectorStore.currentService.value;
const e = String(params.entity).split("Relation")[0];
await fetchPods(e, selectorStore.currentService.id, false);
await fetchPods(e, selectorStore.currentService.id, true);
if (!(selectorStore.pods.length && selectorStore.pods[0])) {
selectorStore.setCurrentPod(null);
states.currentPod = "";
@ -336,7 +336,7 @@ async function setDestSelector() {
await fetchPods(
String(params.entity),
selectorStore.currentDestService.id,
false
true
);
if (!(selectorStore.destPods.length && selectorStore.destPods[0])) {
selectorStore.setCurrentDestPod(null);

View File

@ -23,7 +23,7 @@ limitations under the License. -->
<Icon size="middle" iconName="settings" />
</div>
<div class="process-setting" v-if="showSettings && dashboardStore.editMode">
<Settings @update="updateSettings" @updateNodes="freshNodes" />
<Settings @update="updateSettings" />
</div>
</template>
<script lang="ts" setup>
@ -342,16 +342,9 @@ function shuffleArray(array: number[][]) {
}
function handleLinkClick(event: any, d: Call) {
if (
d.source.layer !== dashboardStore.layerId ||
d.target.layer !== dashboardStore.layerId
) {
return;
}
event.stopPropagation();
networkProfilingStore.setNode(null);
networkProfilingStore.setLink(d);
console.log(config.value);
if (!config.value.linkDashboard) {
return;
}
@ -366,13 +359,13 @@ function handleLinkClick(event: any, d: Call) {
);
return;
}
const path = `/dashboard/related/${dashboard.layer}/${EntityType[7].value}/${d.source.id}/${d.target.id}/${dashboard.name}`;
const path = `/dashboard/${dashboard.layer}/${EntityType[7].value}/${d.source.serviceId}/${d.source.serviceInstanceId}/${d.source.id}/${d.target.serviceId}/${d.target.serviceInstanceId}/${d.target.id}/${dashboard.name}`;
const routeUrl = router.resolve({ path });
window.open(routeUrl.href, "_blank");
}
function updateSettings(config: any) {
config.value = config;
function updateSettings(param: any) {
config.value = param;
}
function setConfig() {
@ -438,13 +431,13 @@ watch(
padding: 5px;
border-radius: 3px;
position: absolute;
top: 20px;
top: 10px;
right: 10px;
}
.process-setting {
position: absolute;
top: 65px;
top: 45px;
right: 10px;
width: 300px;
height: 160px;

View File

@ -65,13 +65,13 @@ function getDashboards() {
function changeLinkDashboard(opt: { value: string }[]) {
linkDashboard.value = opt[0].value;
const param = {
const p = {
...dashboardStore.selectedGrid,
linkDashboard: linkDashboard.value,
linkDashboard: opt[0].value,
};
dashboardStore.selectWidget(param);
dashboardStore.setConfigs(param);
emits("update", param);
dashboardStore.selectWidget(p);
dashboardStore.setConfigs(p);
emits("update", p);
}
</script>
<style lang="scss" scoped>