mirror of
https://github.com/mandiant/capa.git
synced 2026-01-08 03:11:05 -08:00
add tooltip to show decimal/octal rep
This commit is contained in:
@@ -31,7 +31,15 @@
|
||||
<template v-else-if="node.data.type === 'feature'">
|
||||
<span>
|
||||
- {{ node.data.typeValue }}:
|
||||
<span :class="{ 'text-green-700': node.data.typeValue !== 'regex' }" class="font-monospace">
|
||||
<span
|
||||
:class="{ 'text-green-700': node.data.typeValue !== 'regex' }"
|
||||
class="font-monospace"
|
||||
v-tooltip.top="{
|
||||
value: getTooltipContent(node.data),
|
||||
showDelay: 1000,
|
||||
hideDelay: 300
|
||||
}"
|
||||
>
|
||||
{{ node.data.name }}
|
||||
</span>
|
||||
</span>
|
||||
@@ -63,4 +71,14 @@ defineProps({
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
const getTooltipContent = (data) => {
|
||||
if (data.typeValue === "number" || data.typeValue === "offset") {
|
||||
const decimalValue = parseInt(data.name, 16);
|
||||
const octalValue = "0o" + decimalValue.toString(8);
|
||||
return `Decimal: ${decimalValue}
|
||||
Octal: ${octalValue}`;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user