|
49 | 49 | </div> |
50 | 50 | </template> |
51 | 51 | <template #bodyCell="{ column, text, record }"> |
52 | | - <template v-if="column.key === 'name' || (column.key === 'provider' && ['oauthsetting'].includes($route.path.split('/')[1]))"> |
| 52 | + <template v-if="['name', 'provider'].includes(column.key)"> |
53 | 53 | <span |
54 | 54 | v-if="['vm', 'vnfapp'].includes($route.path.split('/')[1])" |
55 | 55 | style="margin-right: 5px" |
|
70 | 70 | style="margin-left: 5px" |
71 | 71 | :actions="actions" |
72 | 72 | :resource="record" |
73 | | - :enabled="quickViewEnabled() && actions.length > 0 && columns && (columns[0].dataIndex === 'name' || (columns[0].dataIndex === 'provider' && ['oauthsetting'].includes($route.path.split('/')[1])))" |
| 73 | + :enabled="quickViewEnabled(actions, columns, column.key)" |
74 | 74 | @exec-action="$parent.execAction" |
75 | 75 | /> |
76 | 76 | <span |
|
257 | 257 | style="margin-right: 8px" |
258 | 258 | :actions="actions" |
259 | 259 | :resource="record" |
260 | | - :enabled="quickViewEnabled() && actions.length > 0" |
| 260 | + :enabled="quickViewEnabled(actions, columns, column.key)" |
261 | 261 | @exec-action="$parent.execAction" |
262 | 262 | /> |
263 | 263 | <span v-if="record.intervaltype===0"> |
|
282 | 282 | style="margin-left: 5px" |
283 | 283 | :actions="actions" |
284 | 284 | :resource="record" |
285 | | - :enabled="quickViewEnabled() && actions.length > 0 && columns && columns[0].dataIndex === 'displayname' " |
| 285 | + :enabled="quickViewEnabled(actions, columns, column.key)" |
286 | 286 | @exec-action="$parent.execAction" |
287 | 287 | /> |
288 | 288 | <router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link> |
|
436 | 436 | style="margin-left: 5px" |
437 | 437 | :actions="actions" |
438 | 438 | :resource="record" |
439 | | - :enabled="quickViewEnabled() && actions.length > 0 && columns && columns[0].dataIndex === 'hypervisor' " |
| 439 | + :enabled="quickViewEnabled(actions, columns, column.key)" |
440 | 440 | @exec-action="$parent.execAction" |
441 | 441 | /> |
442 | 442 | <router-link :to="{ path: $route.path + '/' + record.id }">{{ text }}</router-link> |
|
845 | 845 | style="margin-left: 5px" |
846 | 846 | :actions="actions" |
847 | 847 | :resource="record" |
848 | | - :enabled="quickViewEnabled() && actions.length > 0" |
| 848 | + :enabled="quickViewEnabled(actions, columns, column.key)" |
849 | 849 | @exec-action="$parent.execAction" |
850 | 850 | /> |
851 | 851 | </template> |
@@ -1208,8 +1208,10 @@ export default { |
1208 | 1208 | '/tungstenpolicyset', '/tungstenroutingpolicy', '/firewallrule', '/tungstenfirewallpolicy'].includes(this.$route.path) |
1209 | 1209 | }, |
1210 | 1210 | createPathBasedOnVmType: createPathBasedOnVmType, |
1211 | | - quickViewEnabled () { |
1212 | | - return new RegExp(['/vm', '/kubernetes', '/ssh', '/userdata', '/vmgroup', '/affinitygroup', '/autoscalevmgroup', |
| 1211 | + quickViewEnabled (actions, columns, key) { |
| 1212 | + return actions.length > 0 && |
| 1213 | + (columns && ['name', 'provider', 'hypervisor', 'intervaltype'].includes(columns[0].dataIndex) || ['displayname'].includes(key)) && |
| 1214 | + new RegExp(['/vm', '/kubernetes', '/ssh', '/userdata', '/vmgroup', '/affinitygroup', '/autoscalevmgroup', |
1213 | 1215 | '/volume', '/snapshot', '/vmsnapshot', '/backup', |
1214 | 1216 | '/guestnetwork', '/vpc', '/vpncustomergateway', '/vnfapp', |
1215 | 1217 | '/template', '/iso', |
|
0 commit comments