Skip to content

Commit

Permalink
add copy rule name and description to VT
Browse files Browse the repository at this point in the history
  • Loading branch information
fariss committed Aug 16, 2024
1 parent 076bb13 commit 03e2195
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/explorer/src/components/RuleMatchesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
<span v-if="item.icon !== 'vt-icon'" :class="item.icon" />
<VTIcon v-else-if="item.icon === 'vt-icon'" />
<span>{{ item.label }}</span>
<i v-if="item.description" class="pi pi-info-circle text-xs" v-tooltip.right="item.description" />
</a>
</template>
</ContextMenu>
Expand Down Expand Up @@ -215,6 +216,13 @@ const expandedKeys = ref({});
const menu = ref();
const selectedNode = ref({});
const contextMenuItems = computed(() => [
{
label: "Copy rule name",
icon: "pi pi-copy",
command: () => {
navigator.clipboard.writeText(selectedNode.value.data?.name);
}
},
{
label: "View source",
icon: "pi pi-eye",
Expand All @@ -232,6 +240,7 @@ const contextMenuItems = computed(() => [
label: "Lookup rule in VirusTotal",
icon: "vt-icon",
target: "_blank",
description: "Requires VirusTotal Premium account",
url: createVirusTotalUrl(selectedNode.value.data?.name)
}
]);
Expand Down

0 comments on commit 03e2195

Please sign in to comment.