From 03f99d61d861b6267c92ebc36b52888ce14eab8e Mon Sep 17 00:00:00 2001 From: sharevb Date: Sat, 3 Feb 2024 12:36:05 +0100 Subject: [PATCH 1/3] feat(new tool): IP Geolocation IP Geolocation information using ip-api.com FIx #454 --- components.d.ts | 1 + src/tools/index.ts | 11 +- src/tools/ip-geo-location/index.ts | 12 ++ src/tools/ip-geo-location/ip-geo-location.vue | 112 ++++++++++++++++++ 4 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 src/tools/ip-geo-location/index.ts create mode 100644 src/tools/ip-geo-location/ip-geo-location.vue diff --git a/components.d.ts b/components.d.ts index fabbe793..846de9d6 100644 --- a/components.d.ts +++ b/components.d.ts @@ -112,6 +112,7 @@ declare module '@vue/runtime-core' { IconMdiVideo: typeof import('~icons/mdi/video')['default'] InputCopyable: typeof import('./src/components/InputCopyable.vue')['default'] IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default'] + IpGeoLocation: typeof import('./src/tools/ip-geo-location/ip-geo-location.vue')['default'] Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default'] Ipv4RangeExpander: typeof import('./src/tools/ipv4-range-expander/ipv4-range-expander.vue')['default'] Ipv4SubnetCalculator: typeof import('./src/tools/ipv4-subnet-calculator/ipv4-subnet-calculator.vue')['default'] diff --git a/src/tools/index.ts b/src/tools/index.ts index 2a477ed2..5792219c 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -2,6 +2,7 @@ import { tool as base64FileConverter } from './base64-file-converter'; import { tool as base64StringConverter } from './base64-string-converter'; import { tool as basicAuthGenerator } from './basic-auth-generator'; import { tool as textToUnicode } from './text-to-unicode'; +import { tool as ipGeoLocation } from './ip-geo-location'; import { tool as pdfSignatureChecker } from './pdf-signature-checker'; import { tool as numeronymGenerator } from './numeronym-generator'; import { tool as macAddressGenerator } from './mac-address-generator'; @@ -147,7 +148,15 @@ export const toolsByCategory: ToolCategory[] = [ }, { name: 'Network', - components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator], + components: [ + ipv4SubnetCalculator, + ipv4AddressConverter, + ipv4RangeExpander, + macAddressLookup, + macAddressGenerator, + ipv6UlaGenerator, + ipGeoLocation, + ], }, { name: 'Math', diff --git a/src/tools/ip-geo-location/index.ts b/src/tools/ip-geo-location/index.ts new file mode 100644 index 00000000..81e4e1eb --- /dev/null +++ b/src/tools/ip-geo-location/index.ts @@ -0,0 +1,12 @@ +import { World } from '@vicons/tabler'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'IP Geo Location', + path: '/ip-geo-location', + description: 'Retrieve information about an IPv4/6 address or domain location', + keywords: ['ip', 'domain', 'geo', 'location'], + component: () => import('./ip-geo-location.vue'), + icon: World, + createdAt: new Date('2024-01-17'), +}); diff --git a/src/tools/ip-geo-location/ip-geo-location.vue b/src/tools/ip-geo-location/ip-geo-location.vue new file mode 100644 index 00000000..ed973685 --- /dev/null +++ b/src/tools/ip-geo-location/ip-geo-location.vue @@ -0,0 +1,112 @@ + + + From a3e4ed9b8755ff9e8bcfba102c0ef3d97e0c4285 Mon Sep 17 00:00:00 2001 From: ShareVB Date: Sat, 20 Jul 2024 20:29:39 +0200 Subject: [PATCH 2/3] fix: use ipinfo.io to allow https --- components.d.ts | 2 + src/tools/ip-geo-location/ip-geo-location.vue | 51 ++++++++++--------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/components.d.ts b/components.d.ts index 846de9d6..55bbb8d7 100644 --- a/components.d.ts +++ b/components.d.ts @@ -137,6 +137,7 @@ declare module '@vue/runtime-core' { MenuLayout: typeof import('./src/components/MenuLayout.vue')['default'] MetaTagGenerator: typeof import('./src/tools/meta-tag-generator/meta-tag-generator.vue')['default'] MimeTypes: typeof import('./src/tools/mime-types/mime-types.vue')['default'] + NA: typeof import('naive-ui')['NA'] NAlert: typeof import('naive-ui')['NAlert'] NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] NCheckbox: typeof import('naive-ui')['NCheckbox'] @@ -163,6 +164,7 @@ declare module '@vue/runtime-core' { NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] NMenu: typeof import('naive-ui')['NMenu'] + NP: typeof import('naive-ui')['NP'] NProgress: typeof import('naive-ui')['NProgress'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NSlider: typeof import('naive-ui')['NSlider'] diff --git a/src/tools/ip-geo-location/ip-geo-location.vue b/src/tools/ip-geo-location/ip-geo-location.vue index ed973685..26394f5f 100644 --- a/src/tools/ip-geo-location/ip-geo-location.vue +++ b/src/tools/ip-geo-location/ip-geo-location.vue @@ -1,39 +1,25 @@