mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-30 18:00:56 +01:00
adapt changes to golang api
This commit is contained in:
48
frontend/src/components/Status/StatusTag.vue
Normal file
48
frontend/src/components/Status/StatusTag.vue
Normal 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>
|
||||
Reference in New Issue
Block a user