Skip to content

Commit

Permalink
feat:op前端新增下载项目统计数据 #1361 (#1362)
Browse files Browse the repository at this point in the history
  • Loading branch information
lannoy0523 authored Nov 1, 2023
1 parent 6fc5b5a commit 6cc6c4f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/frontend/devops-op/src/views/node/ProjectMetrics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@
<el-form-item>
<el-button size="mini" type="primary" @click="queryPage(1)">查询</el-button>
</el-form-item>
<el-form-item label="大小(单位GB)" style="margin-left: 15px">
<el-input v-model="limitSize" type="text" onkeyup="value=value.replace(/[^\d]/g,'')" size="small" width="50" placeholder="请输入数字" />
</el-form-item>
<el-form-item label="REPO类型" style="margin-left: 15px">
<el-select v-model="type" placeholder="请选择REPO类型" clearable>
<el-option label="GENERIC" value="GENERIC" />
<el-option label="DOCKER" value="DOCKER" />
<el-option label="DDC" value="DDC" />
<el-option label="MAVEN" value="MAVEN" />
<el-option label="PYPI" value="PYPI" />
<el-option label="NPM" value="NPM" />
<el-option label="HELM" value="HELM" />
<el-option label="COMPOSER" value="COMPOSER" />
<el-option label="RPM" value="RPM" />
<el-option label="GIT" value="GIT" />
<el-option label="NUGET" value="NUGET" />
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click="download()">下载</el-button>
</el-form-item>
</el-form>
<el-table
:data="projectData"
Expand Down Expand Up @@ -92,6 +113,8 @@ export default {
loading: true,
projectData: [],
projectId: this.$route.query.projectId ? this.$route.query.projectId : '',
limitSize: '',
type: null,
total: 0,
query: {
pageNumber: 1,
Expand Down Expand Up @@ -153,6 +176,19 @@ export default {
},
formatNormalDate(data) {
return formatNormalDate(data)
},
download() {
let realType
if (this.type === '') {
realType = null
} else {
realType = this.type
}
const url = '/opdata/api/project/metrics/list/project/capSize/download/?' + (this.limitSize === '' ? '' : 'limitSize=' + this.limitSize * 1024 * 1024 * 1024 + '&') + 'type=' + realType
window.open(
'/web' + url,
'_self'
)
}
}
}
Expand Down

0 comments on commit 6cc6c4f

Please sign in to comment.