update
Some checks failed
Build Flumi / Build Flumi (Linux, 4.4.1, ubuntu-latest, linux) (push) Failing after 1m30s
Build Flumi / Build Flumi (Windows Desktop, 4.4.1, windows-latest, windows) (push) Has been cancelled

This commit is contained in:
2025-11-06 15:39:58 +08:00
parent acfc3b44dd
commit 4e9eafcec5
174 changed files with 1200 additions and 263 deletions

View File

@@ -67,15 +67,15 @@ static func resolve_gurt_domain(domain: String) -> String:
static func get_error_type(error_message: String) -> Dictionary:
if "DNS server is not responding" in error_message or "Domain not found" in error_message:
return {"code": "ERR_NAME_NOT_RESOLVED", "title": "This site can't be reached", "icon": "? :("}
return {"code": "ERR_NAME_NOT_RESOLVED", "title": "无法连接到站点", "icon": "? :("}
elif "timeout" in error_message.to_lower() or "timed out" in error_message.to_lower():
return {"code": "ERR_CONNECTION_TIMED_OUT", "title": "This site can't be reached", "icon": "...?"}
return {"code": "ERR_CONNECTION_TIMED_OUT", "title": "连接网站中超时", "icon": "...?"}
elif "Failed to fetch" in error_message or "No response" in error_message:
return {"code": "ERR_CONNECTION_REFUSED", "title": "This site can't be reached", "icon": ">:("}
return {"code": "ERR_CONNECTION_REFUSED", "title": "连接出现问题", "icon": ">:("}
elif "Invalid domain format" in error_message:
return {"code": "ERR_INVALID_URL", "title": "This page isn't working", "icon": ":|"}
return {"code": "ERR_INVALID_URL", "title": "页面没有在运作", "icon": ":|"}
else:
return {"code": "ERR_UNKNOWN", "title": "Something went wrong", "icon": ">_<"}
return {"code": "ERR_UNKNOWN", "title": "出现未知错误", "icon": ">_<"}
static func create_error_page(error_message: String) -> PackedByteArray:
var error_info = get_error_type(error_message)
@@ -118,14 +118,14 @@ static func create_error_page(error_message: String) -> PackedByteArray:
<div style="error-code">""" + error_info.code + """</div>
<div style="suggestions">
<h2 style="suggestion-title">Try:</h2>
<h2 style="suggestion-title">请尝试:</h2>
<ul style="suggestion-list">
<li style="suggestion-item">Checking if the domain is correctly registered</li>
<li style="suggestion-item">Verifying your DNS server is running</li>
<li style="suggestion-item">Checking your internet connection</li>
<li style="suggestion-item">检查域名是否注册成功</li>
<li style="suggestion-item">检查DNS服务器是否配置在正确</li>
<li style="suggestion-item">检查你的网络连接</li>
</ul>
</div>
<button style="retry-button" id="reload">Reload</button>
<button style="retry-button" id="reload">重新加载</button>
</div>
</body>""").to_utf8_buffer()