@@ -19,6 +19,8 @@ import { getNameFilter } from '@/utils/common/tableFilter'
1919import SingleActionsMixin from ' ../mixins/singleActions'
2020import ColumnsMixin from ' ../mixins/columns'
2121
22+ const credentialIdFilterFormatter = (val ) => ` id.equals('${ val} ')`
23+
2224export default {
2325 name: ' ContainerSecretList' ,
2426 mixins: [WindowsMixin, ListMixin, ColumnsMixin, SingleActionsMixin],
@@ -27,6 +29,10 @@ export default {
2729 getParams: {
2830 type: Object ,
2931 },
32+ type: {
33+ type: String ,
34+ default: ' container_secret' ,
35+ },
3036 },
3137 data () {
3238 return {
@@ -39,7 +45,7 @@ export default {
3945 id: {
4046 label: this .$t (' table.title.id' ),
4147 filter: true ,
42- formatter : val => ` id.equals(' ${ val } ') ` ,
48+ formatter: credentialIdFilterFormatter ,
4349 },
4450 name: getNameFilter (),
4551 },
@@ -62,6 +68,7 @@ export default {
6268 buttonType: ' primary' ,
6369 validate: true ,
6470 }),
71+ hidden: this .type === ' container_image' ,
6572 },
6673 {
6774 label: this .$t (' table.action.delete' ),
@@ -84,13 +91,26 @@ export default {
8491 },
8592 created () {
8693 this .initSidePageTab (' detail' )
87- this .list .fetchData ()
94+ const q = this .$route .query || {}
95+ if (this .type === ' container_image' && q .type === ' container_image' && q .id ) {
96+ const idStr = String (Array .isArray (q .id ) ? q .id [0 ] : q .id ).trim ()
97+ if (idStr) {
98+ this .list .changeFilter ({
99+ id: [idStr],
100+ __condition_id: ' equals' ,
101+ })
102+ } else {
103+ this .list .fetchData ()
104+ }
105+ } else {
106+ this .list .fetchData ()
107+ }
88108 },
89109 methods: {
90110 getParam () {
91111 const ret = {
92112 ... this .getParams ,
93- ' filter.0' : ' type.equals(container_secret) ' ,
113+ ' filter.0' : ` type.equals(${ this . type } ) ` ,
94114 }
95115 if (this .$store .getters .scope === ' project' ) {
96116 const uid = this .$store .getters .userInfo ? .id
0 commit comments