hello.html 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!doctype html><html lang="zh-CN"><head>
  2. <meta charset="utf-8">
  3. <meta name="viewport" content="width=device-width, initial-scale=1">
  4. <title>Hello,亲: 本WebAPI支持IP城市定位和域名查IP定位</title>
  5. <meta name="keywords" content="开源WebAIP,开源IP定位,IP地址查询,极速批量IP地址查询,IP地址精确查询,IP精准定位,高精度IP定位,国外IP定位">
  6. <link rel="icon" href="/logo/favicon.png" type="image/png">
  7. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet">
  8. <style type="text/css">
  9. body { background-color: #f5f5f5;
  10. font-family: "PingFang SC", "Helvetica Neue", "Helvetica", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;}
  11. .main { max-width: 950px; padding: 19px 29px 29px; margin: 0 auto 20px; background-color: #fff;
  12. border: 1px solid #e5e5e5; -webkit-border-radius: 5px; -moz-border-radius: 5px;
  13. border-radius: 5px; -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
  14. -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
  15. .f14 {font-size: 0.875em; /* 14px/16=0.875em */}
  16. a {color: #666; text-decoration: none} a:hover {color: #45B6F7;text-decoration: none;} a:focus {outline: 0;}
  17. </style>
  18. </head>
  19. <body style="text-align:center;">
  20. {% include 'navbar.html' %}
  21. <div class="main center-block">
  22. {% if ip %}
  23. <a href="https://262235.xyz/ip/maps/"> <img class="img-fluid" style="margin:0px"
  24. src="https://api.map.baidu.com/staticimage/v2?ak=tF8XaCqUG9ZjFR66lqqNXmLzeT24gtGF&mcode=666666&center=110,35&width=890&height=400&zoom=4 "/>
  25. </a><br>
  26. <div class=""><button type="button" class="btn btn-outline-danger">Hello, 来自 {{ city }} 的亲:</button></div>
  27. <h3 class="card-title"><button type="button" class="btn btn-outline-info btn-sm">当前IP地址: </button>
  28. {{ ipaddr }} <a href="https://262235.xyz/maps.php?city={{ city }}" class="btn btn-primary btn-sm">查看地图</a> </h3>
  29. {% else %}
  30. <h1>Hello World!</h1>
  31. {% endif %}
  32. <div><button type="button" class="btn btn-outline-danger btn-sm">填写IP/域名:</button>
  33. <input id="name" type="text">
  34. <input type="button" id="btn" value="查询" class="btn btn-primary btn-sm">
  35. <input type="button" id="json" value="获得json" class="btn btn-info btn-sm"></div>
  36. <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  37. <script>
  38. $("#btn").click(function () {
  39. jump_url()
  40. })
  41. function jump_url(params) {
  42. var name = $("#name").val();
  43. const url = window.location.href;
  44. window.location.href = '/ip/' + name
  45. }
  46. $("#json").click(function () {
  47. getjson()
  48. })
  49. function getjson(params) {
  50. var ip = $("#name").val();
  51. const url = 'https://api.map.baidu.com/location/ip?ak=tF8XaCqUG9ZjFR66lqqNXmLzeT24gtGF&ip=';
  52. window.location.href = url + ip + '&coor=bd09ll'
  53. }
  54. </script>
  55. <br>
  56. <form action="/ips/" method="post">
  57. <div class="alert-warning">
  58. <h5> 批量ip查询地址: <input type="submit" value="点击查询" class="btn btn-primary btn-sm" ></h5>
  59. </div>
  60. <textarea type="text" name ="ips" cols=120 rows=5 class="form-control f14"
  61. placeholder="输入多行包含ip地址的日志,例:
  62. http://192.168.1.189:5000/ips/
  63. 172.67.158.52 cloudflare.com"></textarea>
  64. </form><br>
  65. <div class="row">
  66. <div class="col-sm-6">
  67. <div class="card">
  68. <div class="card-header-sm text-white bg-secondary">命令行 curl 调用API:</div>
  69. <div class="card-body-sm f14">
  70. <strong>curl -sL 262235.xyz/ip</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# 命令行 -L 参数能重定向 <br>
  71. <strong>curl -sL 262235.xyz/ip/8.8.8.8</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# 查询自定义 IP 定位<br>
  72. <strong>curl -sL 262235.xyz/ip/github.com</strong>&nbsp;&nbsp;# 按域名查 IP 定位
  73. </div>
  74. </div>
  75. </div>
  76. <div class="col-sm-6">
  77. <div class="card">
  78. <div class="card-header-sm text-white bg-secondary">本WebAPI支持IP城市定位和域名查IP定位</div>
  79. <div class="card-body-sm f14">
  80. <span class="badge rounded-pill bg-primary">github源码:</span>&nbsp;&nbsp;<a href="https://github.com/hongwenjun/ip">https://github.com/hongwenjun/ip</a><br>
  81. <span class="badge rounded-pill bg-danger">docker镜像:</span>&nbsp;&nbsp;<a href="https://hub.docker.com/r/hongwenjun/ip">https://hub.docker.com/r/hongwenjun/ip</a><br>
  82. <span class="badge rounded-pill bg-info text-dark">搭建WebAPI:</span>&nbsp;&nbsp;<a href="https://262235.xyz/index.php/archives/342/">Python网络开发简单的IP城市定位WebAPI</a>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js" ></script>
  89. </body></html>