mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
remove serverStatus
component
This commit is contained in:
parent
2cb806fde9
commit
dfcf086d6c
@ -313,14 +313,30 @@ class App extends React.Component {
|
||||
const initializationTasks = [
|
||||
async () => {
|
||||
try {
|
||||
// get remotes origins from config
|
||||
const defaultRemotes = config.remotes
|
||||
|
||||
// get storaged remotes origins
|
||||
const storedRemotes = await app.settings.get("remotes") ?? {}
|
||||
|
||||
// mount main api bridge
|
||||
await this.props.cores.ApiCore.connectBridge("main", {
|
||||
locked: true
|
||||
origin: storedRemotes.mainApi ?? defaultRemotes.mainApi,
|
||||
locked: true,
|
||||
})
|
||||
|
||||
// and initialize it
|
||||
await this.props.cores.ApiCore.namespaces["main"].initialize()
|
||||
|
||||
// now attach the auth server
|
||||
await this.props.cores.ApiCore.connectBridge("auth", {
|
||||
origin: storedRemotes.authApi ?? defaultRemotes.authApi,
|
||||
locked: true,
|
||||
})
|
||||
|
||||
// and initialize it
|
||||
await this.props.cores.ApiCore.namespaces["auth"].initialize()
|
||||
|
||||
app.eventBus.emit("app.initialization.api_success")
|
||||
} catch (error) {
|
||||
app.eventBus.emit("app.initialization.api_error", error)
|
||||
|
@ -12,8 +12,6 @@ import "./index.less"
|
||||
|
||||
export const Card = (props) => {
|
||||
const isProduction = import.meta.env.PROD
|
||||
const isWSMainConnected = window.app.ws.mainSocketConnected
|
||||
const WSMainOrigin = app.ws.sockets.main.io.uri
|
||||
|
||||
return <ACard
|
||||
bodyClassName="aboutApp_card"
|
||||
@ -35,12 +33,6 @@ export const Card = (props) => {
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="group">
|
||||
<h3><Icons.Globe />Server information</h3>
|
||||
<div>
|
||||
<antd.Tag color={isWSMainConnected ? "green" : "red"}><Icons.Cpu />{WSMainOrigin}</antd.Tag>
|
||||
</div>
|
||||
</div>
|
||||
<div className="group">
|
||||
<h3><Icons.GitMerge />Versions</h3>
|
||||
<div>
|
||||
|
@ -1,31 +0,0 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
export default () => {
|
||||
const [connected, setConnected] = React.useState(window.app.ws.mainSocketConnected ?? false)
|
||||
|
||||
window.app.eventBus.on("websocket_connected", (status) => {
|
||||
setConnected(true)
|
||||
})
|
||||
|
||||
window.app.eventBus.on("websocket_disconnected", (status) => {
|
||||
setConnected(false)
|
||||
})
|
||||
|
||||
const getColor = () => {
|
||||
if (!connected) {
|
||||
return "red"
|
||||
}
|
||||
|
||||
return "blue"
|
||||
}
|
||||
|
||||
return <div>
|
||||
<div key="health">
|
||||
<Icons.Activity /> <antd.Tag color={getColor()}>
|
||||
{connected ? "Connected" : "Disconnected"}
|
||||
</antd.Tag>
|
||||
</div>
|
||||
</div>
|
||||
}
|
@ -7,7 +7,6 @@ export { default as RenderError } from "./RenderError"
|
||||
export { default as ActionsBar } from "./ActionsBar"
|
||||
export { default as SelectableList } from "./SelectableList"
|
||||
export { default as ObjectInspector } from "./ObjectInspector"
|
||||
export { default as ServerStatus } from "./ServerStatus"
|
||||
export { default as ModifierTag } from "./ModifierTag"
|
||||
export { default as UserSelector } from "./UserSelector"
|
||||
export { default as Clock } from "./Clock"
|
||||
|
@ -1,8 +1,7 @@
|
||||
import React from "react"
|
||||
import * as antd from "antd"
|
||||
import { Icons } from "components/Icons"
|
||||
|
||||
import { AppSearcher, ServerStatus, Clock, } from "components"
|
||||
import { AppSearcher, Clock } from "components"
|
||||
import { Translation } from "react-i18next"
|
||||
|
||||
import "./index.less"
|
||||
@ -31,9 +30,6 @@ export default class Main extends React.Component {
|
||||
(t) => <h1>{t("main_welcome")} {user.fullName ?? user.username ?? "Guest"}</h1>
|
||||
}</Translation>
|
||||
</div>
|
||||
{!window.isMobile && <div>
|
||||
<ServerStatus />
|
||||
</div>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user