Copilot commented on code in PR #12149:
URL: https://github.com/apache/cloudstack/pull/12149#discussion_r2740419949
##########
ui/src/components/view/ListView.vue:
##########
@@ -865,6 +865,14 @@
<template v-if="['isfeatured'].includes(column.key) &&
['guestoscategory'].includes($route.path.split('/')[1])">
{{ record.isfeatured ? $t('label.yes') : $t('label.no') }}
</template>
+ <template v-if="['agentscount'].includes(column.key)">
+ <router-link
+ v-if="['managementserver'].includes($route.path.split('/')[1]) &&
$router.resolve('/host').matched[0].redirect !== '/exception/404'"
Review Comment:
Using `.includes()` with single-element arrays is less efficient than direct
equality comparison. For checking a single value, consider using `column.key
=== 'agentscount'` instead of `['agentscount'].includes(column.key)` for better
performance and consistency with the majority of column checks in this file
(e.g., lines 207, 210, 227, 230, 280, etc.). The same applies to the route path
check on line 870 which could use `$route.path.split('/')[1] ===
'managementserver'`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]