diff --git a/apiserver/paasng/paasng/plat_admin/admin42/serializers/runtimes.py b/apiserver/paasng/paasng/plat_admin/admin42/serializers/runtimes.py index 19d0efa7af..4e80c359aa 100644 --- a/apiserver/paasng/paasng/plat_admin/admin42/serializers/runtimes.py +++ b/apiserver/paasng/paasng/plat_admin/admin42/serializers/runtimes.py @@ -187,13 +187,13 @@ class Meta: exclude = ["modules", "id", "created", "updated", "environments"] def validate_name(self, name: str) -> str: - if AppSlugBuilder.objects.filter(name=name).exists(): + if AppSlugRunner.objects.filter(name=name).exists(): raise serializers.ValidationError("name already exists") return name class AppSlugRunnerUpdateInputSLZ(AppSlugRunnerCreateInputSLZ): def validate_name(self, name: str) -> str: - if AppSlugBuilder.objects.exclude(id=self.instance.id).filter(name=name).exists(): + if AppSlugRunner.objects.exclude(id=self.instance.id).filter(name=name).exists(): raise serializers.ValidationError("name already exists") return name diff --git a/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/buildpacks.html b/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/buildpacks.html index e3e35c728b..c1555679a3 100644 --- a/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/buildpacks.html +++ b/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/buildpacks.html @@ -100,7 +100,7 @@ $[ props.row.version ] - + @@ -416,6 +416,16 @@ size: 'medium' }, typeFilters: typeFilters, + isHiddenFilters: [ + { + text: '是', + value: false, + }, + { + text: '否', + value: true, + } + ], } }, methods: { @@ -428,11 +438,16 @@ } await this.$http.get(url).then(res => { this.data = res; + }); + if (this.curRegionActive === 'all') { this.regionList = [{"key": "all", "text": `全部 (${this.data.length})`}]; for (let i = 0; i < regions.length; i++) { - this.regionList.push({"key": regions[i], "text": `${regions[i]} (${this.data.filter(item => item.region === regions[i]).length})`}); + this.regionList.push({ + "key": regions[i], + "text": `${regions[i]} (${this.data.filter(item => item.region === regions[i]).length})` + }); } - }); + } } catch (e) { if (e.response.status === 400) { this.$bkMessage({ @@ -480,7 +495,7 @@ } if (success) { this.cancelDialog(); - await this.fetchBuildPackList(); + this.switchRegion("all"); } }, handleCreate: function () { @@ -533,11 +548,7 @@ deleteRow: async function (row) { const url = this.fillUrlTemplate(URLRouter.detail, {row}); await this.$http.delete(url); - - const index = this.data.findIndex(item => item.id === row.id); - if (index !== -1) { - this.data.splice(index, 1); - } + this.switchRegion("all"); }, handleBind: async function (row) { try { @@ -683,8 +694,8 @@ return row[property] === value } }, - mounted: function () { - this.fetchBuildPackList(); + mounted: async function () { + await this.fetchBuildPackList(); }, }) }) @@ -851,5 +862,9 @@ border-radius: 2px; background-color: #e6e9ea; } + + .bk-checkbox-text { + font-weight: normal; + } {% endblock %} diff --git a/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugbuilders.html b/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugbuilders.html index 3afe9c0ddf..db62b6f1f6 100644 --- a/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugbuilders.html +++ b/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugbuilders.html @@ -66,7 +66,7 @@ - + - + - + @@ -487,6 +487,26 @@ size: 'medium' }, typeFilters: typeFilters, + isHiddenFilters: [ + { + text: '是', + value: false, + }, + { + text: '否', + value: true, + } + ], + isDefaultFilters: [ + { + text: '是', + value: true, + }, + { + text: '否', + value: false, + }, + ], } }, methods: { @@ -499,11 +519,16 @@ } await this.$http.get(url).then(res => { this.data = res; + }) + if (this.curRegionActive === 'all') { this.regionList = [{"key": "all", "text": `全部 (${this.data.length})`}]; for (let i = 0; i < regions.length; i++) { - this.regionList.push({"key": regions[i], "text": `${regions[i]} (${this.data.filter(item => item.region === regions[i]).length})`}); + this.regionList.push({ + "key": regions[i], + "text": `${regions[i]} (${this.data.filter(item => item.region === regions[i]).length})` + }); } - }) + } } catch (e) { if (e.response.status === 400) { this.$bkMessage({ @@ -554,7 +579,7 @@ } if (success) { this.cancelDialog(); - await this.fetchSlugBuilderList(); + this.switchRegion("all"); } }, handleCreate: function () { @@ -609,11 +634,7 @@ deleteRow: async function (row) { const url = this.fillUrlTemplate(URLRouter.detail, {row}); await this.$http.delete(url); - - const index = this.data.findIndex(item => item.id === row.id); - if (index !== -1) { - this.data.splice(index, 1); - } + this.switchRegion("all"); }, handleBind: async function (row) { try { @@ -759,8 +780,8 @@ return row[property] === value } }, - mounted: function () { - this.fetchSlugBuilderList(); + mounted: async function () { + await this.fetchSlugBuilderList(); }, }) }) @@ -928,6 +949,10 @@ background-color: #e6e9ea; } + .bk-checkbox-text { + font-weight: normal; + } + .empty-text { font-size: 14px; } diff --git a/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugrunners.html b/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugrunners.html index 057e5504cb..bcbf02538b 100644 --- a/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugrunners.html +++ b/apiserver/paasng/paasng/plat_admin/admin42/templates/admin42/platformmgr/runtimes/slugrunners.html @@ -57,12 +57,12 @@ $[ props.row.image + ':' + props.row.tag ] - + - + @@ -372,6 +372,26 @@ size: 'medium' }, typeFilters: typeFilters, + isHiddenFilters: [ + { + text: '是', + value: false, + }, + { + text: '否', + value: true, + } + ], + isDefaultFilters: [ + { + text: '是', + value: true, + }, + { + text: '否', + value: false, + }, + ], } }, methods: { @@ -384,11 +404,16 @@ } await this.$http.get(url).then(res => { this.data = res; + }) + if (this.curRegionActive === 'all') { this.regionList = [{"key": "all", "text": `全部 (${this.data.length})`}]; for (let i = 0; i < regions.length; i++) { - this.regionList.push({"key": regions[i], "text": `${regions[i]} (${this.data.filter(item => item.region === regions[i]).length})`}); + this.regionList.push({ + "key": regions[i], + "text": `${regions[i]} (${this.data.filter(item => item.region === regions[i]).length})` + }); } - }) + } } catch (e) { if (e.response.status === 400) { this.$bkMessage({ @@ -438,7 +463,7 @@ } if (success) { this.cancelDialog(); - await this.fetchSlugrunnerList(); + this.switchRegion("all"); } }, handleCreate: function () { @@ -493,11 +518,7 @@ deleteRow: async function (row) { const url = this.fillUrlTemplate(URLRouter.detail, {row}); await this.$http.delete(url); - - const index = this.data.findIndex(item => item.id === row.id); - if (index !== -1) { - this.data.splice(index, 1); - } + this.switchRegion("all"); }, fillUrlTemplate: function (url_template, {row}) { if (!row) { @@ -568,7 +589,7 @@ switchRegion: function(region) { this.expandRowKeys = []; this.curRegionActive = region; - this.fetchSlugBuilderList(); + this.fetchSlugrunnerList(); }, handleSettingChange ({ fields, size }) { this.setting.size = size; @@ -579,8 +600,8 @@ return row[property] === value } }, - mounted: function () { - this.fetchSlugrunnerList(); + mounted: async function () { + await this.fetchSlugrunnerList(); }, }) })