Remove not required client info for query clients

master
WolverinDEV 2021-01-07 14:27:36 +01:00
parent 3b60d45ff1
commit ea780c403b
3 changed files with 22 additions and 9 deletions

View File

@ -284,7 +284,7 @@ export class Registry<Events extends { [key: string]: any } = { [key: string]: a
}
index++;
}
})
});
});
}

View File

@ -9,7 +9,7 @@ import {Group, GroupManager, GroupTarget, GroupType} from "../permission/GroupMa
import PermissionType from "../permission/PermissionType";
import {createErrorModal, createInputModal} from "../ui/elements/Modal";
import * as htmltags from "../ui/htmltags";
import {CommandResult, PlaylistSong} from "../connection/ServerConnectionDeclaration";
import {CommandResult} from "../connection/ServerConnectionDeclaration";
import {ChannelEntry} from "./Channel";
import {ConnectionHandler, ViewReasonId} from "../ConnectionHandler";
import {createServerGroupAssignmentModal} from "../ui/modal/ModalGroupAssignment";
@ -290,7 +290,7 @@ export class ClientEntry<Events extends ClientEvents = ClientEvents> extends Cha
}
getStatusIcon() : ClientIcon {
if (this.properties.client_type_exact == ClientType.CLIENT_QUERY) {
if (this.properties.client_type == ClientType.CLIENT_QUERY) {
return ClientIcon.ServerQuery;
} else if (this.properties.client_away) {
return ClientIcon.Away;

View File

@ -436,6 +436,24 @@ const ServerGroupRenderer = () => {
);
};
const ConnectedClientInfoBlock = () => {
const client = useContext(ClientContext);
if(client.type === "query" || client.type === "none") {
return null;
}
return (
<React.Fragment key={"info"}>
<ClientOnlineSince />
<ClientCountry />
<ClientForumAccount />
<ClientVolume />
<ClientVersion />
<ClientStatus />
</React.Fragment>
);
}
const ClientInfoProvider = () => {
const events = useContext(EventsContext);
@ -468,12 +486,7 @@ const ClientInfoProvider = () => {
</div>
<div className={cssStyle.generalInfo}>
<div className={cssStyle.block + " " + cssStyle.blockLeft}>
<ClientOnlineSince />
<ClientCountry />
<ClientForumAccount />
<ClientVolume />
<ClientVersion />
<ClientStatus />
<ConnectedClientInfoBlock />
</div>
<div className={cssStyle.block + " " + cssStyle.blockRight}>
<ChannelGroupRenderer />