⚡️ 细节优化
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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}%`
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user