Skip to content

Commit fb56bbf

Browse files
committed
Merge branch 'feat/port-numbers' into chore/all-my-stuffs
# Conflicts: # components.d.ts # package.json # pnpm-lock.yaml # src/tools/index.ts
2 parents b942b46 + b36a01e commit fb56bbf

File tree

5 files changed

+60
-1
lines changed

5 files changed

+60
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@
271271
"postal-mime": "^2.2.7",
272272
"qpdf-wasm-esm-embedded": "^1.1.1",
273273
"potrace": "^2.1.8",
274+
"port-numbers": "^8.0.11",
274275
"qrcode": "^1.5.1",
275276
"rtf-stream-parser": "^3.8.0",
276277
"slashes": "^3.0.12",

pnpm-lock.yaml

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ import { tool as nanoMemo } from './nano-memo';
129129
import { tool as option43Generator } from './option43-generator';
130130
import { tool as pgpEncryption } from './pgp-encryption';
131131
import { tool as pgpKeygen } from './pgp-keygen';
132+
import { tool as portNumbers } from './port-numbers';
132133
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
133134
import { tool as numeronymGenerator } from './numeronym-generator';
134135
import { tool as macAddressGenerator } from './mac-address-generator';
@@ -466,6 +467,7 @@ export const toolsByCategory: ToolCategory[] = [
466467
macAddressGenerator,
467468
ipv6UlaGenerator,
468469
option43Generator,
470+
portNumbers,
469471
],
470472
},
471473
{

src/tools/port-numbers/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { PlugConnected } from '@vicons/tabler';
2+
import { defineTool } from '../tool';
3+
4+
export const tool = defineTool({
5+
name: 'Port Numbers',
6+
path: '/port-numbers',
7+
description: 'Search for assigned usage of a given port and protocol',
8+
keywords: ['port', 'tcp', 'udp', 'protocol'],
9+
component: () => import('./port-numbers.vue'),
10+
icon: PlugConnected,
11+
createdAt: new Date('2024-04-20'),
12+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<script setup lang="ts">
2+
import ports from 'port-numbers';
3+
import SpanCopyable from '@/components/SpanCopyable.vue';
4+
5+
const port = ref(80);
6+
const protocol = ref('tcp');
7+
const result = computed(() => {
8+
const [type, description] = ports[`${port.value}/${protocol.value}` as (keyof typeof ports)];
9+
return { type: type ?? 'unknown', description: description ?? 'Unknown' };
10+
});
11+
</script>
12+
13+
<template>
14+
<div>
15+
<c-card title="Port search">
16+
<n-space>
17+
<n-form-item label="Port number">
18+
<n-input-number v-model:value="port" :min="1" />
19+
</n-form-item>
20+
<n-form-item label="Protocol">
21+
<c-select
22+
v-model:value="protocol"
23+
:options="[{ value: 'tcp', label: 'TCP' }, { value: 'udp', label: 'UDP' }]"
24+
/>
25+
</n-form-item>
26+
</n-space>
27+
</c-card>
28+
29+
<c-card>
30+
<n-form-item label="Type">
31+
<SpanCopyable :value="result?.type" />
32+
</n-form-item>
33+
<n-form-item label="Description">
34+
<SpanCopyable :value="result?.description" />
35+
</n-form-item>
36+
</c-card>
37+
</div>
38+
</template>

0 commit comments

Comments
 (0)