Skip to content

Commit

Permalink
1.3 优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
aardio committed Nov 4, 2022
1 parent f859780 commit 0ced3e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
4 changes: 2 additions & 2 deletions default.aproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="Ghips" libEmbed="true" icon="\app.ico" ui="win" output="Ghips.exe" CompanyName="aardio" FileDescription="Ghips" LegalCopyright="Copyright (C) aardio" ProductName="Ghips" InternalName="Ghips" FileVersion="1.2.0.0" ProductVersion="1.2.0.0" publishDir="/dist/" dstrip="false" local="false" ignored="false">
<project ver="10" name="Ghips" libEmbed="true" icon="\app.ico" ui="win" output="Ghips.exe" CompanyName="aardio" FileDescription="Ghips" LegalCopyright="Copyright (C) aardio" ProductName="Ghips" InternalName="Ghips" FileVersion="1.3.0.0" ProductVersion="1.3.0.0" publishDir="/dist/" dstrip="false" local="false" ignored="false">
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
<folder name="资源文件" path="res" embed="true"/>
<folder name="资源文件" path="res" embed="true" local="false" ignored="false"/>
<folder name="窗体文件" path="dlg" comment="目录" embed="true"/>
</project>
38 changes: 18 additions & 20 deletions main.aardio
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,14 @@ winform.plusUpdateIps.oncommand = function(id,event,triggeredByTimer){
winform.editIpCurrent.text = wsock.getIp("www.github.com")

winform.plusUpdateIps.disabledText = {'\uF254';'\uF251';'\uF252';'\uF253';'\uF250'}
winform.text = "请稍候,正在测试github.com所有可用IP的响应速度"

var metaInfo = thread.invokeAndWait(
function(){
import web.rest.jsonClient;
var http = web.rest.jsonClient();
var github = http.api("https://api.github.com/")
var github = http.api("https://api.github.com/");

return github.meta.get() : { web = {
"192.30.252.0",
"185.199.108.0",
"140.82.112.0",
"143.55.64.0",
"20.201.28.151",
"20.205.243.166",
"102.133.202.242",
"20.248.137.48",
"20.207.73.82",
"20.27.177.113",
"20.200.245.247",
"20.233.54.53"
} };
return github.meta.get();
}
)

Expand All @@ -73,11 +59,23 @@ winform.plusUpdateIps.oncommand = function(id,event,triggeredByTimer){
gitHubIps = table.map(metaInfo.web,lambda(v)..string.match(v,"^\d+\.\d+\.\d+\.\d+"))
}
elseif(!gitHubIps){
return winform.msgboxErr("您的操作系统版本过低")
gitHubIps = {
"192.30.252.0",
"185.199.108.0",
"140.82.112.0",
"143.55.64.0",
"20.201.28.151",
"20.205.243.166",
"102.133.202.242",
"20.248.137.48",
"20.207.73.82",
"20.27.177.113",
"20.200.245.247",
"20.233.54.53"
}
}

var pingThread = function( ip ) {
import inet.http;
import wsock.tcp.client;

var result = 0;
Expand All @@ -91,7 +89,7 @@ winform.plusUpdateIps.oncommand = function(id,event,triggeredByTimer){
return;
};

sendData =/***********
var sendData =/***********
GET / HTTP/1.1
Host: www.github.com
Connection: close
Expand All @@ -118,7 +116,7 @@ Accept-Charset:utf-8;
}

import thread.manage;
manage = thread.manage(#gitHubIps)
var manage = thread.manage(#gitHubIps)

var ipData = {}
for(k,ip in gitHubIps){
Expand Down

0 comments on commit 0ced3e7

Please sign in to comment.