️ 细节优化

This commit is contained in:
yeyang
2024-04-21 21:06:45 +08:00
parent 5b5bcc9ea9
commit a45de12eb1
3 changed files with 6 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ SauceNAOMinSim: 60
hideImgWhenSaucenaoNSFW: 0
#绕过 Cloudflare Challenge 所使用的 TLS 版本,建议可选值:["TLSv1.1", "TLSv1.2"]
cfTLSVersion: TLSv1.1
#是否使用 Puppeteer 请求 ascii2d 以绕过 cf js challenge该功能需安装puppeteer-extra 和 puppeteer-extra-plugin-stealth 依赖
#是否使用 Puppeteer 请求 ascii2d 以绕过 cf js challenge
ascii2dUsePuppeteer: false
#ascii2d搜图返回结果的最大数量
ascii2dResultMaxQuantity: 3

View File

@@ -72,7 +72,7 @@ const callAscii2dUrlApi = async(imgUrl) => {
let res = await request.cfGet(`${domain}/search/url/${imgUrl}`).catch(
err => {
if (err.stack?.includes("legacy sigalg disallowed or unsupported")) {
throw new ReplyError(`Error Tls版本过低 请尝试将配置文件的cfTLSVersion字段改为TLS1.2\n详情请参考https://www.yenai.ren/faq.html#openssl-%E9%94%99%E8%AF%AF\n错误信息:${err.stack}`)
throw new ReplyError(`Error Tls版本过低 请尝试将配置文件的cfTLSVersion字段改为TLS1.2\n详情请参考https://yenai.trss.me/faq.html#openssl-%E9%94%99%E8%AF%AF\n错误信息:${err.stack}`)
} else {
throw err
}

View File

@@ -4,19 +4,19 @@ import { si, Circle } from "./utils.js"
export default async function getCpuInfo() {
let { currentLoad: { currentLoad }, cpu, fullLoad } = await si.get({
currentLoad: "currentLoad",
cpu: "manufacturer,speed,cores",
cpu: "vendor,speed,cores",
fullLoad: "*"
})
let { manufacturer, speed, cores } = cpu
let { vendor, speed, cores } = cpu
if (currentLoad == null || currentLoad == undefined) return false
fullLoad = Math.round(fullLoad)
manufacturer = manufacturer?.split(" ")?.[0] || ""
vendor = vendor?.split(" ")?.[0] ?? "unknown"
return {
...Circle(currentLoad / 100),
inner: Math.round(currentLoad) + "%",
title: "CPU",
info: [
`${manufacturer} ${cores}${speed}GHz`,
`${vendor} ${cores}${speed}GHz`,
`CPU满载率 ${fullLoad}%`
]