Skip to content

Commit

Permalink
fix: change the layout for the offline devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Meng-20 committed Dec 17, 2024
1 parent a49451a commit 9fdb2d0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 10 deletions.
22 changes: 18 additions & 4 deletions webui/src/components/Appliance/Appliances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2017,13 +2017,27 @@ export default {
const selectedBladeStatus = computed(() => bladeStore.selectedBladeStatus);

const statusColor = computed(() => {
return selectedBladeStatus.value === "online" ? "#6ebe4a" : "#ff9f40";
if (selectedBladeStatus.value === "online") {
return "#6ebe4a";
} else if (selectedBladeStatus.value === "unavailable") {
return "#ff9f40";
} else if (selectedBladeStatus.value === "offline") {
return "#b00020";
} else {
return "#B0B0B0"; // Default unknown status
}
});

const statusIcon = computed(() => {
return selectedBladeStatus.value === "online"
? "mdi-check-circle"
: "mdi-close-circle";
if (selectedBladeStatus.value === "online") {
return "mdi-check-circle";
} else if (selectedBladeStatus.value === "unavailable") {
return "mdi-alert-circle";
} else if (selectedBladeStatus.value === "offline") {
return "mdi-close-circle";
} else {
return "mdi-help-circle"; // Default unknown status
}
});

// Methods to update state
Expand Down
26 changes: 20 additions & 6 deletions webui/src/components/CXL-Hosts/CXL-Hosts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ export default {
hostPortStore.hostPortStore(newHostId),
hostMemoryStore.hostMemoryStore(newHostId),
hostMemoryDeviceStore.hostMemoryDeviceStore(newHostId),
hostStore.fetchHostById(newHostId)
hostStore.fetchHostById(newHostId),
]);

// Update the URL with the new host ID
Expand All @@ -1152,13 +1152,27 @@ export default {
const selectedHostStatus = computed(() => hostStore.selectedHostStatus);

const statusColor = computed(() => {
return selectedHostStatus.value === "online" ? "#6ebe4a" : "#ff9f40";
if (selectedHostStatus.value === "online") {
return "#6ebe4a";
} else if (selectedHostStatus.value === "unavailable") {
return "#ff9f40";
} else if (selectedHostStatus.value === "offline") {
return "#b00020";
} else {
return "#B0B0B0"; // Default unknown status
}
});

const statusIcon = computed(() => {
return selectedHostStatus.value === "online"
? "mdi-check-circle"
: "mdi-close-circle";
if (selectedHostStatus.value === "online") {
return "mdi-check-circle";
} else if (selectedHostStatus.value === "unavailable") {
return "mdi-alert-circle";
} else if (selectedHostStatus.value === "offline") {
return "mdi-close-circle";
} else {
return "mdi-help-circle"; // Default unknown status
}
});

// Methods to update state
Expand Down Expand Up @@ -1200,4 +1214,4 @@ export default {
.highlighted-tab {
font-weight: bold;
}
</style>
</style>

0 comments on commit 9fdb2d0

Please sign in to comment.