|
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> |
|
834 | 834 | style="margin-left: 5px" |
835 | 835 | :actions="actions" |
836 | 836 | :resource="record" |
837 | | - :enabled="quickViewEnabled() && actions.length > 0" |
| 837 | + :enabled="quickViewEnabled(actions, columns, column.key)" |
838 | 838 | @exec-action="$parent.execAction" |
839 | 839 | /> |
840 | 840 | </template> |
@@ -1179,17 +1179,19 @@ export default { |
1179 | 1179 | '/tungstenpolicyset', '/tungstenroutingpolicy', '/firewallrule', '/tungstenfirewallpolicy'].includes(this.$route.path) |
1180 | 1180 | }, |
1181 | 1181 | createPathBasedOnVmType: createPathBasedOnVmType, |
1182 | | - quickViewEnabled () { |
1183 | | - return new RegExp(['/vm', '/kubernetes', '/ssh', '/userdata', '/vmgroup', '/affinitygroup', '/autoscalevmgroup', |
1184 | | - '/volume', '/snapshot', '/vmsnapshot', '/backup', |
1185 | | - '/guestnetwork', '/vpc', '/vpncustomergateway', '/vnfapp', |
1186 | | - '/template', '/iso', |
1187 | | - '/project', '/account', 'buckets', 'objectstore', |
1188 | | - '/zone', '/pod', '/cluster', '/host', '/storagepool', '/imagestore', '/systemvm', '/router', '/ilbvm', '/annotation', |
1189 | | - '/computeoffering', '/systemoffering', '/diskoffering', '/backupoffering', '/networkoffering', '/vpcoffering', |
1190 | | - '/tungstenfabric', '/oauthsetting', '/guestos', '/guestoshypervisormapping', '/webhook', 'webhookdeliveries', '/quotatariff', '/sharedfs', |
1191 | | - '/ipv4subnets', '/managementserver', '/gpucard', '/gpudevices', '/vgpuprofile', '/extension', '/snapshotpolicy', '/backupschedule'].join('|')) |
1192 | | - .test(this.$route.path) |
| 1182 | + quickViewEnabled (actions, columns, key) { |
| 1183 | + return actions.length > 0 && |
| 1184 | + (columns && ['name', 'provider', 'hypervisor', 'intervaltype'].includes(columns[0].dataIndex) || ['displayname'].includes(key)) && |
| 1185 | + new RegExp(['/vm', '/kubernetes', '/ssh', '/userdata', '/vmgroup', '/affinitygroup', '/autoscalevmgroup', |
| 1186 | + '/volume', '/snapshot', '/vmsnapshot', '/backup', |
| 1187 | + '/guestnetwork', '/vpc', '/vpncustomergateway', '/vnfapp', |
| 1188 | + '/template', '/iso', |
| 1189 | + '/project', '/account', 'buckets', 'objectstore', |
| 1190 | + '/zone', '/pod', '/cluster', '/host', '/storagepool', '/imagestore', '/systemvm', '/router', '/ilbvm', '/annotation', |
| 1191 | + '/computeoffering', '/systemoffering', '/diskoffering', '/backupoffering', '/networkoffering', '/vpcoffering', |
| 1192 | + '/tungstenfabric', '/oauthsetting', '/guestos', '/guestoshypervisormapping', '/webhook', 'webhookdeliveries', '/quotatariff', '/sharedfs', |
| 1193 | + '/ipv4subnets', '/managementserver', '/gpucard', '/gpudevices', '/vgpuprofile', '/extension', '/snapshotpolicy', '/backupschedule'].join('|')) |
| 1194 | + .test(this.$route.path) |
1193 | 1195 | }, |
1194 | 1196 | enableGroupAction () { |
1195 | 1197 | return ['vm', 'alert', 'vmgroup', 'ssh', 'userdata', 'affinitygroup', 'autoscalevmgroup', 'volume', 'snapshot', |
|
0 commit comments