Skip to content

Commit

Permalink
update manage server page
Browse files Browse the repository at this point in the history
Signed-off-by: MohammedAbdi <[email protected]>
  • Loading branch information
mamy-CS committed Sep 30, 2024
1 parent 82214ac commit 3668ab9
Show file tree
Hide file tree
Showing 11 changed files with 357 additions and 267 deletions.
21 changes: 18 additions & 3 deletions frontend/src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ type NavigationBarProp = {
spireDebugServerInfoUpdateFunc: (globalDebugServerInfo: DebugServerInfo) => void,
// dispatches a payload for an Error Message/ Success Message of an executed function as a string and has a return type of void
tornjakMessageFunc: (globalErrorMessage: string) => void,
// the selected server for manager mode
globalServerSelected: string,
// tornjak error messege
globalErrorMessage: string,
}

type NavigationBarState = {}
Expand Down Expand Up @@ -89,9 +93,18 @@ class NavigationBar extends Component<NavigationBarProp, NavigationBarState> {
}
}
}
this.TornjakApi.populateLocalTornjakServerInfo(this.props.tornjakServerInfoUpdateFunc, this.props.tornjakMessageFunc);
this.TornjakApi.populateLocalTornjakDebugServerInfo(this.props.spireDebugServerInfoUpdateFunc, this.props.tornjakMessageFunc);
this.TornjakApi.populateServerInfo(this.props.globalTornjakServerInfo, this.props.serverInfoUpdateFunc);
if (IsManager) {
if (this.props.globalServerSelected !== "" && (this.props.globalErrorMessage === "OK" || this.props.globalErrorMessage === "")) {
// this.TornjakApi.populateAgentsUpdate(this.props.globalServerSelected, this.props.agentsListUpdateFunc, this.props.tornjakMessageFunc)
// this.TornjakApi.populateEntriesUpdate(this.props.globalServerSelected, this.props.entriesListUpdateFunc, this.props.tornjakMessageFunc)
// this.TornjakApi.refreshSelectorsState(this.props.globalServerSelected, this.props.agentworkloadSelectorInfoFunc);
// this.setState({ selectedServer: this.props.globalServerSelected });
}
} else {
this.TornjakApi.populateLocalTornjakServerInfo(this.props.tornjakServerInfoUpdateFunc, this.props.tornjakMessageFunc);
this.TornjakApi.populateLocalTornjakDebugServerInfo(this.props.spireDebugServerInfoUpdateFunc, this.props.tornjakMessageFunc);
this.TornjakApi.populateServerInfo(this.props.globalTornjakServerInfo, this.props.serverInfoUpdateFunc);
}
}

render() {
Expand Down Expand Up @@ -188,6 +201,8 @@ const mapStateToProps = (state: RootState) => ({
globalServerInfo: state.servers.globalServerInfo,
globalDebugServerInfo: state.servers.globalDebugServerInfo,
globalTornjakServerInfo: state.servers.globalTornjakServerInfo,
globalServerSelected: state.servers.globalServerSelected,
globalErrorMessage: state.tornjak.globalErrorMessage,
})

export default connect(
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/select-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { RootState } from 'redux/reducers';
import {
AgentsList,
ServersList,
ServerInfo,
TornjakServerInfo,
DebugServerInfo,
Expand All @@ -27,7 +28,7 @@ type SelectServerProp = {
// tornjak server debug info of the selected server
globalDebugServerInfo: DebugServerInfo,
// dispatches a payload for the list of available servers and their basic info as array of strings and has a return type of void
serversListUpdateFunc: (globalServersList: Array<string>) => void,
serversListUpdateFunc: (globalServersList: ServersList[]) => void,
// dispatches a payload for the server selected in the redux state as a string and has a return type of void
serverSelectedFunc: (globalServerSelected: string) => void,
// dispatches a payload for the server trust domain and nodeAttestorPlugin and has a return type of void
Expand All @@ -43,7 +44,7 @@ type SelectServerProp = {
// tornjak server info of the selected server
globalTornjakServerInfo: TornjakServerInfo,
// list of avialable servers
globalServersList: Array<string>,
globalServersList: ServersList[],
// error/ success messege returned for a specific function
globalErrorMessage: string,
}
Expand Down
251 changes: 0 additions & 251 deletions frontend/src/components/server-management.js

This file was deleted.

Loading

0 comments on commit 3668ab9

Please sign in to comment.