Merge branch 'feat/port-numbers' into chore/all-my-stuffs

# Conflicts:
#	components.d.ts
#	package.json
#	pnpm-lock.yaml
#	src/tools/index.ts
This commit is contained in:
ShareVB committed 2024-11-03 23:04:39 +01:00
commit fb56bbfce1
5 files changed
+60 -1

No files matched your search

+1
View File
@@ -271,6 +271,7 @@
"postal-mime": "^2.2.7",
"qpdf-wasm-esm-embedded": "^1.1.1",
"potrace": "^2.1.8",
"port-numbers": "^8.0.11",
"qrcode": "^1.5.1",
"rtf-stream-parser": "^3.8.0",
"slashes": "^3.0.12",
+7 -1
View File
@@ -524,6 +524,9 @@ dependencies:
plausible-tracker:
specifier: ^0.3.8
version: 0.3.8
port-numbers:
specifier: ^8.0.11
version: 8.0.17
postal-mime:
specifier: ^2.2.7
version: 2.3.2
@@ -11360,7 +11363,6 @@ packages:
/jsesc@2.5.2:
resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
engines: {node: '>=4'}
hasBin: true
/jsesc@3.0.2:
resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==}
@@ -13136,6 +13138,10 @@ packages:
engines: {node: '>=12.13.0'}
dev: false
/port-numbers@8.0.17:
resolution: {integrity: sha512-Eqkk3e3QS8PSKlsaXjZnDDBi8RItEOXp9BAVbq/7ilN7TNZLQAPcPxT88iPQpz8DIoyqsia7J+k6/acjV/tLaA==}
dev: false
/postal-mime@2.3.2:
resolution: {integrity: sha512-OZaLbLfLBEJa0ENZRuRwhAminaJevjqHtSICcegO4VOc4QgNHAzNTfVT3gN+KO9YyPFPZQOZ9vtJNmv0n2y8tQ==}
dev: false
+2
View File
@@ -129,6 +129,7 @@ import { tool as nanoMemo } from './nano-memo';
import { tool as option43Generator } from './option43-generator';
import { tool as pgpEncryption } from './pgp-encryption';
import { tool as pgpKeygen } from './pgp-keygen';
import { tool as portNumbers } from './port-numbers';
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
import { tool as numeronymGenerator } from './numeronym-generator';
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -466,6 +467,7 @@ export const toolsByCategory: ToolCategory[] = [
macAddressGenerator,
ipv6UlaGenerator,
option43Generator,
portNumbers,
],
},
{
+12
View File
@@ -0,0 +1,12 @@
import { PlugConnected } from '@vicons/tabler';
import { defineTool } from '../tool';
export const tool = defineTool({
name: 'Port Numbers',
path: '/port-numbers',
description: 'Search for assigned usage of a given port and protocol',
keywords: ['port', 'tcp', 'udp', 'protocol'],
component: () => import('./port-numbers.vue'),
icon: PlugConnected,
createdAt: new Date('2024-04-20'),
});
+38
View File
@@ -0,0 +1,38 @@
<script setup lang="ts">
import ports from 'port-numbers';
import SpanCopyable from '@/components/SpanCopyable.vue';
const port = ref(80);
const protocol = ref('tcp');
const result = computed(() => {
const [type, description] = ports[`${port.value}/${protocol.value}` as (keyof typeof ports)];
return { type: type ?? 'unknown', description: description ?? 'Unknown' };
});
</script>
<template>
<div>
<c-card title="Port search">
<n-space>
<n-form-item label="Port number">
<n-input-number v-model:value="port" :min="1" />
</n-form-item>
<n-form-item label="Protocol">
<c-select
v-model:value="protocol"
:options="[{ value: 'tcp', label: 'TCP' }, { value: 'udp', label: 'UDP' }]"
/>
</n-form-item>
</n-space>
</c-card>
<c-card>
<n-form-item label="Type">
<SpanCopyable :value="result?.type" />
</n-form-item>
<n-form-item label="Description">
<SpanCopyable :value="result?.description" />
</n-form-item>
</c-card>
</div>
</template>