Skip to content
Snippets Groups Projects

Show worker costs

Merged ml bonhomme requested to merge costs into release-1.7.2
All threads resolved!
Files
4
@@ -9,16 +9,19 @@
<span class="mx-1" :title="worker.name">
{{ worker.name }}
</span>
<span v-if="hasCost" class="tag is-warning"></span>
</template>
<script>
<script lang="ts">
import { defineComponent, PropType } from 'vue'
import { WORKER_TYPE_COLORS } from '@/config'
import { Worker } from '@/types/worker'
export default {
export default defineComponent({
props: {
// A worker instance to build base tag elements
worker: {
type: Object,
type: Object as PropType<Worker>,
required: true
}
},
@@ -28,7 +31,10 @@ export default {
},
workerClass () {
return WORKER_TYPE_COLORS[this.workerType]?.cssClass ?? WORKER_TYPE_COLORS.default.cssClass
},
hasCost () {
return parseFloat(this.worker.cost_gpu_hour) > 0 || parseFloat(this.worker.cost_cpu_hour) > 0 || parseFloat(this.worker.cost_1k_elements) > 0
}
}
}
})
</script>
Loading