File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed
Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -661,16 +661,27 @@ export default {
661661 return [' Admin' , ' DomainAdmin' ].includes (this .$store .getters .userInfo .roletype )
662662 },
663663 fetchCksTemplates () {
664- const params = {
665- templatefilter: this .isAdminOrDomainAdmin () ? ' all' : ' self' ,
666- forcks: true
664+ var filters = []
665+ if (this .isAdminOrDomainAdmin ()) {
666+ filters = [' all' ]
667+ } else {
668+ filters = [' self' , ' featured' , ' community' ]
667669 }
668- this .templateLoading = true
669- api (' listTemplates' , params).then (json => {
670- this .templates = json? .listtemplatesresponse ? .template || []
671- }).finally (() => {
672- this .templateLoading = false
673- })
670+ var ckstemplates = []
671+ for (const filtername of filters) {
672+ const params = {
673+ templatefilter: filtername,
674+ forcks: true
675+ }
676+ this .templateLoading = true
677+ api (' listTemplates' , params).then (json => {
678+ var templates = json? .listtemplatesresponse ? .template || []
679+ ckstemplates .push (... templates)
680+ }).finally (() => {
681+ this .templateLoading = false
682+ })
683+ }
684+ this .templates = ckstemplates
674685 },
675686 fetchNetworkData () {
676687 const params = {}
You can’t perform that action at this time.
0 commit comments