mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
display capacitor app info
This commit is contained in:
parent
4827018288
commit
de946b115b
@ -70,6 +70,15 @@ export default {
|
|||||||
const [serverHealth, setServerHealth] = React.useState(null)
|
const [serverHealth, setServerHealth] = React.useState(null)
|
||||||
const [secureConnection, setSecureConnection] = React.useState(false)
|
const [secureConnection, setSecureConnection] = React.useState(false)
|
||||||
const [connectionPing, setConnectionPing] = React.useState({})
|
const [connectionPing, setConnectionPing] = React.useState({})
|
||||||
|
const [capInfo, setCapInfo] = React.useState(null)
|
||||||
|
|
||||||
|
const setCapacitorInfo = async () => {
|
||||||
|
if (Capacitor.Plugins.App) {
|
||||||
|
const info = await Capacitor.Plugins.App.getInfo()
|
||||||
|
|
||||||
|
setCapInfo(info)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const checkServerVersion = async () => {
|
const checkServerVersion = async () => {
|
||||||
const serverManifest = await app.cores.api.customRequest()
|
const serverManifest = await app.cores.api.customRequest()
|
||||||
@ -117,6 +126,8 @@ export default {
|
|||||||
fetchServerHealth()
|
fetchServerHealth()
|
||||||
measurePing()
|
measurePing()
|
||||||
|
|
||||||
|
setCapacitorInfo()
|
||||||
|
|
||||||
const measureInterval = setInterval(() => {
|
const measureInterval = setInterval(() => {
|
||||||
fetchServerHealth()
|
fetchServerHealth()
|
||||||
measurePing()
|
measurePing()
|
||||||
@ -191,6 +202,8 @@ export default {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
gap: "0.5rem",
|
gap: "0.5rem",
|
||||||
fontSize: "1.4rem",
|
fontSize: "1.4rem",
|
||||||
|
justifyContent: "space-evenly",
|
||||||
|
width: "100%",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@ -309,6 +322,54 @@ export default {
|
|||||||
{Capacitor.platform}
|
{Capacitor.platform}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{
|
||||||
|
capInfo && <div className="inline_field">
|
||||||
|
<div className="field_header">
|
||||||
|
<div className="field_icon">
|
||||||
|
<Icons.MdInfo />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>App ID</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field_value">
|
||||||
|
{capInfo.id}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
capInfo && <div className="inline_field">
|
||||||
|
<div className="field_header">
|
||||||
|
<div className="field_icon">
|
||||||
|
<Icons.MdInfo />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>App Build</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field_value">
|
||||||
|
{capInfo.build}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
capInfo && <div className="inline_field">
|
||||||
|
<div className="field_header">
|
||||||
|
<div className="field_icon">
|
||||||
|
<Icons.MdInfo />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>App Version</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="field_value">
|
||||||
|
{capInfo.version}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user