chore(ui): use innerText instead of innerHTML

This commit is contained in:
Guanran Wang 2024-11-22 18:05:18 +08:00
parent c38133fd6c
commit ae370e8a62
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF
2 changed files with 18 additions and 18 deletions

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1731533236,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1730272153, "lastModified": 1731890469,
"narHash": "sha256-B5WRZYsRlJgwVHIV6DvidFN7VX7Fg9uuwkRW9Ha8z+w=", "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2d2a9ddbe3f2c00747398f3dc9b05f7f2ebb0f53", "rev": "5083ec887760adfe12af64830a66807423a859a7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -66,11 +66,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730321837, "lastModified": 1732187120,
"narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", "narHash": "sha256-XdW2mYXvPHYtZ8oQqO3tRYtxx7kI0Hs3NU64IwAtD68=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", "rev": "37f8f47cb618eddee0c0dd31a582b1cd3013c7f6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,4 +1,4 @@
async function main() { async function main(): Promise<void> {
fetch("https://ip.ny4.dev/api/v1/ip") fetch("https://ip.ny4.dev/api/v1/ip")
.then((response) => { .then((response) => {
if (!response.ok) { if (!response.ok) {
@ -7,8 +7,8 @@ async function main() {
return response.json(); return response.json();
}) })
.then((data) => { .then((data) => {
document.getElementById("check-ny4-ip")!.innerHTML = data.ip; document.getElementById("check-ny4-ip")!.innerText = data.ip;
document.getElementById("check-ny4-location")!.innerHTML = [ document.getElementById("check-ny4-location")!.innerText = [
data.city, data.city,
data.region, data.region,
data.country, data.country,
@ -25,8 +25,8 @@ async function main() {
return response.json(); return response.json();
}) })
.then((data) => { .then((data) => {
document.getElementById("check-ipsb-ip")!.innerHTML = data.ip; document.getElementById("check-ipsb-ip")!.innerText = data.ip;
document.getElementById("check-ipsb-location")!.innerHTML = [ document.getElementById("check-ipsb-location")!.innerText = [
data.city, data.city,
data.region, data.region,
data.country, data.country,
@ -43,8 +43,8 @@ async function main() {
return response.json(); return response.json();
}) })
.then((data) => { .then((data) => {
document.getElementById("check-ipapiis-ip")!.innerHTML = data.ip; document.getElementById("check-ipapiis-ip")!.innerText = data.ip;
document.getElementById("check-ipapiis-location")!.innerHTML = [ document.getElementById("check-ipapiis-location")!.innerText = [
data.location.city, data.location.city,
data.location.state, data.location.state,
data.location.country, data.location.country,
@ -62,8 +62,8 @@ async function main() {
}) })
.then((data) => { .then((data) => {
const v = data.data; const v = data.data;
document.getElementById("check-speedtestcn-ip")!.innerHTML = v.ip; document.getElementById("check-speedtestcn-ip")!.innerText = v.ip;
document.getElementById("check-speedtestcn-location")!.innerHTML = [ document.getElementById("check-speedtestcn-location")!.innerText = [
v.city, v.city,
v.province, v.province,
v.country, v.country,