File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import { tool as angleConverter } from './angle-converter';
25
25
import { tool as floatingPointNumberConverter } from './floating-point-number-converter' ;
26
26
import { tool as snowflakeIdExtractor } from './snowflake-id-extractor' ;
27
27
import { tool as emailNormalizer } from './email-normalizer' ;
28
+ import { tool as myIp } from './my-ip' ;
28
29
import { tool as geoDistanceCalculator } from './geo-distance-calculator' ;
29
30
import { tool as xVrSpamcauseDecoder } from './x-vr-spamcause-decoder' ;
30
31
import { tool as bounceParser } from './bounce-parser' ;
@@ -491,6 +492,7 @@ export const toolsByCategory: ToolCategory[] = [
491
492
raidCalculator ,
492
493
sipAuth ,
493
494
xVrSpamcauseDecoder ,
495
+ myIp ,
494
496
] ,
495
497
} ,
496
498
{
Original file line number Diff line number Diff line change
1
+ import { World } from '@vicons/tabler' ;
2
+ import { defineTool } from '../tool' ;
3
+
4
+ export const tool = defineTool ( {
5
+ name : 'My IP Address' ,
6
+ path : '/my-ip' ,
7
+ description : 'Get your client IP Address (IPv4/6) using https://getjsonip.com/' ,
8
+ keywords : [ 'my' , 'client' , 'ip' ] ,
9
+ component : ( ) => import ( './my-ip.vue' ) ,
10
+ icon : World ,
11
+ createdAt : new Date ( '2025-01-01' ) ,
12
+ } ) ;
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import { computedRefreshableAsync } from ' @/composable/computedRefreshable' ;
3
+ import { useCopy } from ' @/composable/copy' ;
4
+
5
+ const [clientIP, refreshClientIP] = computedRefreshableAsync (async () => {
6
+ try {
7
+ return (await (await fetch (' https://jsonip.com' , { mode: ' cors' })).json ()).ip ?.toString ();
8
+ }
9
+ catch (e : any ) {
10
+ return e .toString ();
11
+ }
12
+ });
13
+
14
+ const { copy } = useCopy ({ source: clientIP , text: ' Client IP copied to the clipboard' });
15
+ </script >
16
+
17
+ <template >
18
+ <c-card title =" Your IPv4/6 address" >
19
+ <div class =" ip" >
20
+ {{ clientIP }}
21
+ </div >
22
+ <div flex justify-center gap-3 >
23
+ <c-button @click =" copy()" >
24
+ Copy
25
+ </c-button >
26
+ <c-button @click =" refreshClientIP" >
27
+ Refresh
28
+ </c-button >
29
+ </div >
30
+ </c-card >
31
+ </template >
32
+
33
+ <style lang="less" scoped>
34
+ .ip {
35
+ text-align : center ;
36
+ font-size : 26px ;
37
+ font-weight : 400 ;
38
+ margin : 10px 0 25px ;
39
+ }
40
+ </style >
You can’t perform that action at this time.
0 commit comments