mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-13 20:44:16 +00:00
update about
This commit is contained in:
parent
d7ca67b340
commit
2f6a9e81da
@ -1,6 +1,8 @@
|
|||||||
import React from "react"
|
import React from "react"
|
||||||
import * as antd from "antd"
|
import * as antd from "antd"
|
||||||
|
|
||||||
|
import { version as linebridgeVersion } from "linebridge/package.json"
|
||||||
|
|
||||||
import { Icons } from "components/Icons"
|
import { Icons } from "components/Icons"
|
||||||
|
|
||||||
import config from "config"
|
import config from "config"
|
||||||
@ -13,27 +15,6 @@ const connectionsTooltipStrings = {
|
|||||||
warning: "This connection is secure but the server cannot be verified on the trusted certificate authority.",
|
warning: "This connection is secure but the server cannot be verified on the trusted certificate authority.",
|
||||||
}
|
}
|
||||||
|
|
||||||
const Footer = () => {
|
|
||||||
const isDevMode = window.__evite?.env?.NODE_ENV !== "production"
|
|
||||||
|
|
||||||
return <div className="footer">
|
|
||||||
<div>
|
|
||||||
<div>{config.app?.siteName}</div>
|
|
||||||
<div>
|
|
||||||
<antd.Tag>
|
|
||||||
<Icons.Tag />v{window.app.version}
|
|
||||||
</antd.Tag>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<antd.Tag color={isDevMode ? "magenta" : "green"}>
|
|
||||||
{isDevMode ? <Icons.Triangle /> : <Icons.Box />}
|
|
||||||
{isDevMode ? "development" : "production"}
|
|
||||||
</antd.Tag>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
const latencyToColor = (latency, type) => {
|
const latencyToColor = (latency, type) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "http": {
|
case "http": {
|
||||||
@ -98,19 +79,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchServerHealth = async () => {
|
|
||||||
const response = await app.cores.api.customRequest({
|
|
||||||
method: "GET",
|
|
||||||
url: "/server/health",
|
|
||||||
}).catch(() => null)
|
|
||||||
|
|
||||||
console.log(response.data)
|
|
||||||
|
|
||||||
if (response) {
|
|
||||||
setServerHealth(response.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const measurePing = async () => {
|
const measurePing = async () => {
|
||||||
const result = await app.cores.api.measurePing()
|
const result = await app.cores.api.measurePing()
|
||||||
|
|
||||||
@ -123,13 +91,11 @@ export default {
|
|||||||
checkServerVersion()
|
checkServerVersion()
|
||||||
checkServerOrigin()
|
checkServerOrigin()
|
||||||
|
|
||||||
fetchServerHealth()
|
|
||||||
measurePing()
|
measurePing()
|
||||||
|
|
||||||
setCapacitorInfo()
|
setCapacitorInfo()
|
||||||
|
|
||||||
const measureInterval = setInterval(() => {
|
const measureInterval = setInterval(() => {
|
||||||
fetchServerHealth()
|
|
||||||
measurePing()
|
measurePing()
|
||||||
}, 3000)
|
}, 3000)
|
||||||
|
|
||||||
@ -237,20 +203,6 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="field">
|
|
||||||
<div className="field_header">
|
|
||||||
<h3><Icons.MdDataUsage /> Instance usage</h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="field_value">
|
|
||||||
<antd.Progress
|
|
||||||
percent={serverHealth?.cpuUsage.percent ?? 0}
|
|
||||||
status="active"
|
|
||||||
showInfo={false}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="inline_field">
|
<div className="inline_field">
|
||||||
<div className="field_header">
|
<div className="field_header">
|
||||||
<div className="field_icon">
|
<div className="field_icon">
|
||||||
@ -287,7 +239,21 @@ export default {
|
|||||||
<Icons.MdInfo />
|
<Icons.MdInfo />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Evite Engine</p>
|
<p>Linebridge Engine</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field_value">
|
||||||
|
{linebridgeVersion ?? globalThis._linebrige_version ?? "Unknown"}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="inline_field">
|
||||||
|
<div className="field_header">
|
||||||
|
<div className="field_icon">
|
||||||
|
<Icons.MdInfo />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Evite Framework</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="field_value">
|
<div className="field_value">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user