diff --git a/nezha-fronted/src/components/common/project/addNode.vue b/nezha-fronted/src/components/common/project/addNode.vue index d72129a4f..03f670bef 100644 --- a/nezha-fronted/src/components/common/project/addNode.vue +++ b/nezha-fronted/src/components/common/project/addNode.vue @@ -345,19 +345,41 @@ this.esc(); }, beforeAvatarUpload(file){ + let this_=this let isJPG = (file.type === 'image/jpeg' || file.type === 'image/png'); const isLt2M = file.size / 1024 / 1024 < 2; if (!isJPG) { - this.$message.error('上传图片只能是 JPG/png 格式!'); + this.$message.error( this_.$t('project.topology.imgFormat')); + return false; } - if (!isLt2M) { - this.$message.error('上传图片大小不能超过 2MB!'); - } - this.file=file; - this.upload(); - return false; + // if (!isLt2M) { + // this.$message.error( this_.$t('project.topology.imgSize')); + // return false; + // } + const isSize = new Promise(function(resolve, reject) { + let width = 100; + let height = 100; + let _URL = window.URL || window.webkitURL; + let img = new Image(); + img.onload = function() { + console.log(img.width); + let valid = img.width > width && img.height > height; + valid ? resolve() : reject(); + } + img.src = _URL.createObjectURL(file); + }).then(() => { + if(isJPG){ + this.file=file; + this.upload(); + } + return file; + }, () => { + this.$message.error( this_.$t('project.topology.imgMeasure')); + return Promise.reject(); + }); + return false; }, handleAvatarSuccess(file,res){ diff --git a/nezha-fronted/src/components/page/dashboard/overview/overview2.vue b/nezha-fronted/src/components/page/dashboard/overview/overview2.vue index 758d63240..e7e79b244 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/overview2.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/overview2.vue @@ -112,7 +112,7 @@
-
+
{{item.name}} { this.assetLoading = true; @@ -1662,6 +1665,7 @@ top: 0; left: 0; z-index: 10; + cursor: pointer; } /deep/ .el-carousel__indicator--horizontal .el-carousel__button{ background-color: #C0C4CC;