-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: software center improvements ui (#660)
- Loading branch information
Showing
17 changed files
with
608 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
core/ui/src/components/software-center/CertificationLevelBadge.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!-- | ||
Copyright (C) 2024 Nethesis S.r.l. | ||
SPDX-License-Identifier: GPL-3.0-or-later | ||
--> | ||
<template> | ||
<cv-interactive-tooltip alignment="center" direction="top"> | ||
<template slot="trigger"> | ||
<NsTag | ||
:label=" | ||
$t('software_center.level_level', { | ||
level: `${level}/5`, | ||
}) | ||
" | ||
:kind="getLevelColor()" | ||
:icon="getLevelIcon()" | ||
class="level-tooltip" | ||
/> | ||
</template> | ||
<template slot="content"> | ||
<h6 class="mg-bottom-sm"> | ||
{{ $t("software_center.level_level", { level }) }} | ||
</h6> | ||
<p class="mg-bottom-sm"> | ||
{{ $t(`software_center.level_${level}_description`) }} | ||
</p> | ||
<cv-link | ||
href="https://docs.nethserver.org/projects/ns8/en/latest/software_center.html#certification-levels" | ||
target="_blank" | ||
rel="noreferrer" | ||
class="inline" | ||
> | ||
{{ $t("common.more_info") }} | ||
</cv-link> | ||
</template> | ||
</cv-interactive-tooltip> | ||
</template> | ||
|
||
<script> | ||
import Security16 from "@carbon/icons-vue/es/security/16"; | ||
import WarningAlt16 from "@carbon/icons-vue/es/warning--alt/16"; | ||
import Error16 from "@carbon/icons-vue/es/error/16"; | ||
import Rule16 from "@carbon/icons-vue/es/rule/16"; | ||
|
||
export default { | ||
name: "CertificationLevelBadge", | ||
props: { | ||
level: { | ||
type: Number, | ||
required: true, | ||
}, | ||
}, | ||
data() { | ||
return { | ||
Security16, | ||
WarningAlt16, | ||
Rule16, | ||
Error16, | ||
}; | ||
}, | ||
methods: { | ||
getLevelColor() { | ||
if (this.level > 0 && this.level < 5) { | ||
return "blue"; | ||
} else if (this.level == 5) { | ||
return "green"; | ||
} else { | ||
return "gray"; | ||
} | ||
}, | ||
getLevelIcon() { | ||
switch (this.level) { | ||
case 1: | ||
return this.WarningAlt16; | ||
case 2: | ||
case 3: | ||
case 4: | ||
return this.Rule16; | ||
case 5: | ||
return this.Security16; | ||
default: | ||
return this.Error16; | ||
} | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@import "../../styles/carbon-utils"; | ||
|
||
.level-tooltip { | ||
cursor: pointer; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.