-
Notifications
You must be signed in to change notification settings - Fork 1
Change icon for region stat #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Seokho Son <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR changes the statistics card to display regions instead of MCIs, updating both the icon and functionality to show unique regions from VMs and Kubernetes clusters.
- Replaces MCI count with region count calculation in the dashboard statistics
- Updates the HTML to use a globe icon and "Regions in Use" label instead of server icon and "Total MCIs"
- Implements logic to extract and count unique regions from both VM and K8s cluster data sources
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
dashboard.js | Adds region counting logic that extracts unique regions from VMs and K8s clusters, replacing the previous MCI count display |
dashboard.html | Updates the statistics card to show region information with a globe icon and appropriate onclick handler |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
vmData.forEach(vm => { | ||
let region = null; | ||
|
||
// Extract region information - try multiple sources | ||
if (vm.region && vm.region.Region) { | ||
region = vm.region.Region; | ||
} else if (vm.location && vm.location.region) { | ||
region = vm.location.region; | ||
} else if (vm.connectionConfig && vm.connectionConfig.regionZoneInfo && vm.connectionConfig.regionZoneInfo.region) { | ||
region = vm.connectionConfig.regionZoneInfo.region; | ||
} else if (vm.regionZoneInfoList && vm.regionZoneInfoList.length > 0 && vm.regionZoneInfoList[0].regionName) { | ||
region = vm.regionZoneInfoList[0].regionName; | ||
} | ||
|
||
if (region) { | ||
regions.add(region); | ||
} | ||
}); | ||
|
||
// Add regions from K8s clusters | ||
k8sData.forEach(cluster => { | ||
let region = null; | ||
|
||
// Extract region information from cluster | ||
if (cluster.region && cluster.region.Region) { | ||
region = cluster.region.Region; | ||
} else if (cluster.location && cluster.location.region) { | ||
region = cluster.location.region; | ||
} else if (cluster.connectionConfig && cluster.connectionConfig.regionZoneInfo && cluster.connectionConfig.regionZoneInfo.region) { | ||
region = cluster.connectionConfig.regionZoneInfo.region; | ||
} | ||
|
||
if (region) { | ||
regions.add(region); | ||
} | ||
}); |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The region extraction logic is duplicated between VM and K8s cluster processing. Consider extracting this into a reusable function to reduce code duplication and improve maintainability.
Copilot uses AI. Check for mistakes.
/approve |
No description provided.