Skip to content

Commit 680000c

Browse files
frontend: components: version-chooser: VersionCard: Add color per verison
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
1 parent a289c19 commit 680000c

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

core/frontend/src/components/version-chooser/VersionCard.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<v-sheet
3-
class="d-flex flex-column align-center my-4 pa-4 flex-sm-row py-sm-0"
3+
class="d-flex flex-column align-center my-1 pa-4 flex-sm-row py-sm-0"
4+
:style="{ background: `linear-gradient(135deg in oklab, transparent 80%, ${backgroundColor} 100%)` }"
45
:elevation="$vuetify.breakpoint.xs ? 1 : 0"
56
>
67
<div class="d-flex">
@@ -165,6 +166,7 @@ import TimeAgo from 'javascript-time-ago'
165166
import en from 'javascript-time-ago/locale/en.json'
166167
import Vue, { PropType } from 'vue'
167168
169+
import { isBeta, isStable } from '@/components/kraken/Utils'
168170
import settings from '@/libs/settings'
169171
import helper from '@/store/helper'
170172
import { Dictionary } from '@/types/common'
@@ -261,6 +263,18 @@ export default Vue.extend({
261263
&& !this.updateAvailable && this.isFromBR && this.allImagesLoaded
262264
&& this.bootstrapVersion !== `${this.image.repository.split('/')[0]}/blueos-bootstrap:${this.image.tag}`
263265
},
266+
backgroundColor(): string {
267+
if (isStable(this.image.tag)) {
268+
return 'var(--v-success-base)'
269+
}
270+
271+
// 1.4 or anything like is our latest beta
272+
if (isBeta(this.image.tag) || /\d+\.\d+/.test(this.image.tag)) {
273+
return 'var(--v-warning-lighten2)'
274+
}
275+
276+
return 'var(--v-critical-base)'
277+
},
264278
},
265279
methods: {
266280
asTimeAgo(value: string) {

0 commit comments

Comments
 (0)