Skip to content

Commit 8ad10e9

Browse files
committed
호스트 상세 라이센스 정보 표시 수정
1 parent 6662b7d commit 8ad10e9

2 files changed

Lines changed: 16 additions & 20 deletions

File tree

ui/public/locales/ko_KR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4751,7 +4751,7 @@
47514751
"message.dr.mirrored.cluster.disable": "\uc120\ud0dd\ud55c \uc7ac\ud574\ubcf5\uad6c \ud074\ub7ec\uc2a4\ud130\ub97c \ube44\ud65c\uc131\ud654\ud558\ub294 \uacbd\uc6b0 Secondary \ud074\ub7ec\uc2a4\ud130\uc758 \ubbf8\ub7ec\ub9c1 \uac00\uc0c1\uba38\uc2e0\uc774 \uc804\ubd80 \uc0ad\uc81c\ub429\ub2c8\ub2e4. \ube44\ud65c\uc131\ud654\ub97c \uc6d0\ud558\uc2dc\uba74 '\ube44\ud65c\uc131\ud654\ud558\uaca0\uc2b5\ub2c8\ub2e4' \ubb38\uad6c\ub97c \uc785\ub825\ud558\uc2ed\uc2dc\uc624.",
47524752
"message.success.disable.disaster.recovery.cluster": "\uc7ac\ud574\ubcf5\uad6c \ud074\ub7ec\uc2a4\ud130\ub97c \uc131\uacf5\uc801\uc73c\ub85c \ube44\ud65c\uc131\ud654\ud588\uc2b5\ub2c8\ub2e4.",
47534753
"message.error.confirm.create.dr.mirroring.vm": "\uc555\ucd95/\uc911\ubcf5\uc81c\uac70 \uae30\ub2a5\uc774 \ud65c\uc131\ud654\ub418\uc5b4\uc788\ub294 \uacbd\uc6b0 \ubbf8\ub7ec\ub9c1 \uac00\uc0c1\uba38\uc2e0\uc744 \uc0dd\uc131\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.",
4754-
"message.alert.licenseexpired": "\ub77c\uc774\uc13c\uc2a4 \uc720\ud6a8 \uc77c\uc790",
4754+
"message.alert.licenseexpired": "\ub77c\uc774\uc13c\uc2a4 \uc720\ud6a8\uae30\uac04",
47554755
"message.license.renewal.required": "\ub77c\uc774\uc13c\uc2a4 \uc720\ud6a8\uae30\uac04\uc774 \uc9c0\ub0ac\uc2b5\ub2c8\ub2e4. \uc2e0\uaddc \ub77c\uc774\uc120\uc2a4\ub97c \ub4f1\ub85d \ud6c4 \uc0ac\uc6a9\ud574 \uc8fc\uc138\uc694.",
47564756
"message.license.not.found": "\ub77c\uc774\uc120\uc2a4 \uc815\ubcf4\ub97c \ud655\uc778\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc2e0\uaddc \ub77c\uc774\uc120\uc2a4 \ub4f1\ub85d \ud6c4 \uc0ac\uc6a9\ud574 \uc8fc\uc138\uc694.",
47574757
"message.license.days.left": "\uc77c \ud6c4 \ub9cc\ub8cc"

ui/src/components/view/DetailsTab.vue

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
</template>
2525
</a-alert>
2626
<div v-if="['host'].includes($route.meta.name)">
27-
<a-alert type="error" :showIcon="true" v-if="!dataResource.licenseExpiryDate" :message="$t('message.license.not.found')" />
28-
<a-alert type="error" :showIcon="true" v-else-if="isLicenseNotStarted(dataResource.licenseStartDate)" :message="$t('message.alert.licenseexpired') + ' : ' + dataResource.licenseStartDate + ' ~ ' + dataResource.licenseExpiryDate+ '(' + calculateDday(dataResource.licenseExpiryDate) + $t('message.license.days.left') + ')'" />
29-
<a-alert type="error" :showIcon="true" v-else-if="isLicenseExpired(dataResource.licenseExpiryDate)" :message="$t('message.alert.licenseexpired') + ' : ' + dataResource.licenseStartDate + ' ~ ' + dataResource.licenseExpiryDate + '(' + $t('message.license.renewal.required') + ')'" />
30-
<a-alert type="success" :showIcon="true" v-else :message="$t('message.alert.licenseexpired') + ' : ' + dataResource.licenseStartDate + ' ~ ' + dataResource.licenseExpiryDate + '(' + calculateDday(dataResource.licenseExpiryDate) + $t('message.license.days.left') + ')'" />
27+
<a-alert type="success" :showIcon="true" v-if="licenseCode == 'OK'" :message="$t('message.alert.licenseexpired') + ' : ' + dataResource.licenseStartDate + '~' + dataResource.licenseExpiryDate + '(' + calculateDday(dataResource.licenseExpiryDate) + $t('message.license.days.left') + ')'" />
28+
<a-alert type="error" :showIcon="true" v-else-if="licenseCode == 'PASSED'" :message="$t('message.alert.licenseexpired') + ' : ' + dataResource.licenseStartDate + '~' + dataResource.licenseExpiryDate + '(' + $t('message.license.renewal.required') + ')'" />
29+
<a-alert type="error" :showIcon="true" v-else-if="licenseCode == 'NOSTART'" :message="$t('message.alert.licenseexpired') + ' : ' + dataResource.licenseStartDate + '~' + dataResource.licenseExpiryDate + '(' + calculateDday(dataResource.licenseExpiryDate) + $t('message.license.days.left') + ')'" />
30+
<a-alert type="error" :showIcon="true" v-else-if="licenseCode == 'NONE'" :message="$t('message.license.not.found')" />
3131
</div>
3232
<a-alert v-if="ip4routes" type="info" :showIcon="true" :message="$t('label.add.upstream.ipv4.routes')">
3333
<template #description>
@@ -242,7 +242,7 @@ export default {
242242
expired: false,
243243
expiryDate: ''
244244
},
245-
licenseStateType: 'error'
245+
licenseCode: 'NONE'
246246
}
247247
},
248248
mounted () {
@@ -473,6 +473,7 @@ export default {
473473
return `label.${source}`
474474
},
475475
fetchLicenseInfo () {
476+
const today = new Date()
476477
api('licenseCheck', { hostid: this.resource.id }).then(response => {
477478
const licenseData = response?.null?.licensecheck
478479
if (licenseData) {
@@ -483,25 +484,25 @@ export default {
483484
this.dataResource.hostId = licenseData.hostid
484485
this.dataResource.hasLicense = licenseData.haslicense === 'true'
485486
this.dataResource.licenseValid = licenseData.success === 'true'
486-
if (this.isLicenseExpired(this.dataResource.licenseExpiryDate)) {
487-
this.licenseStateType = 'error'
487+
488+
if (today <= expiryDate && today >= issuedDate) {
489+
this.licenseCode = 'OK'
490+
} else if (today > expiryDate) {
491+
this.licenseCode = 'PASSED'
492+
} else if (today < issuedDate) {
493+
this.licenseCode = 'NOSTART'
488494
} else {
489-
this.licenseStateType = 'success'
495+
this.licenseCode = 'NONE'
490496
}
491497
} else {
492498
this.dataResource.licenseStartDate = ''
493499
this.dataResource.licenseExpiryDate = ''
494500
this.dataResource.hasLicense = false
495501
this.dataResource.licenseValid = false
496-
this.licenseStateType = 'error'
502+
this.licenseCode = 'NONE'
497503
}
498504
})
499505
},
500-
isLicenseExpired (expiryDate) {
501-
const today = new Date()
502-
const expiry = new Date(expiryDate)
503-
return today > expiry
504-
},
505506
calculateDday (expiryDate) {
506507
const today = new Date()
507508
const expiry = new Date(expiryDate)
@@ -514,11 +515,6 @@ export default {
514515
return value
515516
}
516517
return `0${value}`
517-
},
518-
isLicenseNotStarted (startDate) {
519-
const today = new Date()
520-
const start = new Date(startDate)
521-
return today < start
522518
}
523519
}
524520
}

0 commit comments

Comments
 (0)