diff options
author | 2022-12-27 09:38:35 +0100 | |
---|---|---|
committer | 2022-12-27 09:38:35 +0100 | |
commit | acc7f0a586c64500c5f720e70cdbccf9bffe76d9 (patch) | |
tree | 0d1303641ec9d10821f108010e2cec4c9a8f50f9 /src/tools/jwt-parser/claim.vue | |
parent | ebb7301a98cf4ad29334393853428f097c1b1ed3 (diff) | |
download | it-tools-acc7f0a586c64500c5f720e70cdbccf9bffe76d9.tar.gz it-tools-acc7f0a586c64500c5f720e70cdbccf9bffe76d9.tar.zst it-tools-acc7f0a586c64500c5f720e70cdbccf9bffe76d9.zip |
feat(new-tool): jwt parser (#262)
* npm install jwt-decode
* added base tool structure
* added function to decode JWT and display header and payload
* use a table to display the data
* show human readable values
* added switch to toggle display of parsed values
* lint
* replaced basic package-lock.json with pnpm-lock.json
* change the icon of the tool
* simplify return
* use camelCase
* added description of the tool
* always parse the values
* use camelCase...
Diffstat (limited to 'src/tools/jwt-parser/claim.vue')
-rw-r--r-- | src/tools/jwt-parser/claim.vue | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/tools/jwt-parser/claim.vue b/src/tools/jwt-parser/claim.vue new file mode 100644 index 0000000..3f298a2 --- /dev/null +++ b/src/tools/jwt-parser/claim.vue @@ -0,0 +1,29 @@ +<template> + <n-space> + <em>{{ claim }}</em> + <span v-if="label.label !== claim"> + <n-popover placement="right" trigger="hover"> + <template #trigger> + <n-icon :component="InfoCircle" trigger /> + </template> + {{ label.label }} + <template v-if="label.ref !== ''" #footer> {{ label.ref }} </template> + </n-popover> + </span> + </n-space> +</template> + +<script setup lang="ts"> +import { computed } from 'vue'; +import { InfoCircle } from '@vicons/tabler'; +import { getClaimLabel } from './jwt-parser.service'; + +const props = defineProps({ + claim: { + type: String, + default: '', + }, +}); + +const label = computed(() => getClaimLabel(props.claim ? props.claim : '')); +</script> |