adapt changes to golang api

This commit is contained in:
Marvin Zhang
2019-07-21 16:48:58 +08:00
parent 95d30691a0
commit ece3659155
40 changed files with 263 additions and 2004 deletions

View File

@@ -0,0 +1,48 @@
<template>
<el-tag :type="type">
{{$t(label)}}
</el-tag>
</template>
<script>
export default {
name: 'StatusTag',
props: {
status: {
type: String,
default: ''
}
},
data () {
return {
statusDict: {
pending: { label: 'Pending', type: 'primary' },
running: { label: 'Running', type: 'warning' },
finished: { label: 'Finished', type: 'success' },
error: { label: 'Error', type: 'danger' },
cancelled: { label: 'Cancelled', type: 'info' }
}
}
},
computed: {
type () {
const s = this.statusDict[this.status]
if (s) {
return s.type
}
return ''
},
label () {
const s = this.statusDict[this.status]
if (s) {
return s.label
}
return 'NA'
}
}
}
</script>
<style scoped>
</style>