diff --git a/src/config.py b/src/config.py index 31e078f..b0a3581 100644 --- a/src/config.py +++ b/src/config.py @@ -31,8 +31,6 @@ class Config: logger.error(f"没有权限读取配置文件 {self.path}: {str(e)}") raise - logger.info(f"配置文件 {self.path} 加载成功") - @property def rss_url(self): try: diff --git a/src/tools.py b/src/tools.py index cfd2dee..6ca3053 100644 --- a/src/tools.py +++ b/src/tools.py @@ -13,14 +13,14 @@ def check_website_status(url): :return:True 可以访问,False 不可以。 """ try: - response = requests.get(url, timeout=5) # Set timeout to 5 seconds + response = requests.get(url, timeout=30) # Set timeout to 5 seconds if response.status_code == 200: return True else: logger.error(f"{url} 网站无法访问,状态码:{response.status_code}") return False except requests.Timeout as e: - logger.error(f"{url} 请求超时,错误:{e}") + logger.error(f"{url} 请求超时 30 秒,错误:{e}") return False except requests.ConnectionError as e: logger.error(f"{url} 连接错误,错误:{e}") @@ -57,7 +57,7 @@ def get_domain_life(url): domain_url = f"https://rdap.verisign.com/com/v1/domain/{url}" try: - response = requests.get(domain_url, headers=headers) + response = requests.get(domain_url, headers=headers, timeout=30) response.raise_for_status() # Raises stored HTTPError, if one occurred. registration_date = response.json().get('events')[0].get('eventDate') diff --git a/static/painting/css/painting.css b/static/painting/css/painting.css index fe07883..a7f42f0 100644 --- a/static/painting/css/painting.css +++ b/static/painting/css/painting.css @@ -76,6 +76,47 @@ html { #tab1 { background-image: url('../img/page1.jpg'); + position: relative; +} + +.popup { + position: absolute; + bottom: 0.5rem; + background: #fff; + padding: 1.5rem; + border: 1px solid #d1d1d1; +} + +.popup > .notice > hr { + margin: 1rem 0; +} + +.popup > .selection { + text-align: right; +} + +.selection > button { + border: none; + padding: 0.75rem 1rem; + margin: 0.5rem 0 0 0.5rem; +} + +.allow { + cursor: pointer; +} + +.deny { + background-color: #059862; + cursor: pointer; + color: #fff; + padding: 0.5rem 0; + opacity: 0.8; +} + +.deny:hover, +.deny:focus { + opacity: 1; + cursor: pointer; } #tab2 { diff --git a/templates/painting.html b/templates/painting.html index 0ff659d..d8c709e 100644 --- a/templates/painting.html +++ b/templates/painting.html @@ -13,10 +13,37 @@ {% endif %} - +
- +亲爱的{{ data.blog_name }}
@@ -70,11 +97,14 @@