-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed whitelist and banlist not showing up, added in flags to player.…
… Bumped version number to 3.0.2
- Loading branch information
Showing
558 changed files
with
37,785 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
interface Window { | ||
store: any; | ||
NodeMisrcon: any; | ||
} | ||
|
||
declare module 'react-chartkick'; | ||
declare module 'electron-find'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,51 @@ | ||
import CssBaseline from '@material-ui/core/CssBaseline'; | ||
import { MuiThemeProvider } from '@material-ui/core/styles'; | ||
import { NodeMisrcon } from 'node-misrcon'; | ||
import * as React from 'react'; | ||
import { Provider } from 'react-redux'; | ||
import { MemoryRouter, Redirect, Route, Switch } from 'react-router'; | ||
import { PersistGate } from 'redux-persist/integration/react'; | ||
|
||
import Layout from './components/Layout'; | ||
import { configureStore } from './redux/store'; | ||
import routes, { homepage } from './routes'; | ||
import { GlobalStyles } from './styles/global-styles'; | ||
import ScrollbarStyles from './styles/scrollbar-styles'; | ||
import { theme } from './styles/theme'; | ||
|
||
import routes from './routes'; | ||
window.NodeMisrcon = NodeMisrcon; | ||
const { store, persistor } = configureStore(); | ||
window.store = store; | ||
|
||
type Props = {}; | ||
interface Props {} | ||
export const App: React.FunctionComponent<Props> = () => { | ||
return ( | ||
<MemoryRouter> | ||
<Layout> | ||
<Switch> | ||
<Route exact path="/" render={() => <Redirect to="/console" />} /> | ||
{routes.map((route, idx) => ( | ||
<Route key={idx} path={route.path} component={route.component} /> | ||
))} | ||
</Switch> | ||
</Layout> | ||
</MemoryRouter> | ||
<Provider store={store}> | ||
<PersistGate loading={null} persistor={persistor}> | ||
<MuiThemeProvider theme={theme}> | ||
<CssBaseline /> | ||
<GlobalStyles /> | ||
<ScrollbarStyles /> | ||
<MemoryRouter> | ||
<Layout> | ||
<Switch> | ||
<Route | ||
exact | ||
path="/" | ||
render={() => <Redirect to={homepage} />} | ||
/> | ||
{routes.map((route, idx) => ( | ||
<Route | ||
key={idx} | ||
path={route.path} | ||
component={route.component} | ||
/> | ||
))} | ||
</Switch> | ||
</Layout> | ||
</MemoryRouter> | ||
</MuiThemeProvider> | ||
</PersistGate> | ||
</Provider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import Button from '@material-ui/core/Button'; | ||
import { ICellRendererParams } from 'ag-grid-community'; | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import { | ||
banSteamIDThunk, | ||
removeBanSteamIDThunk | ||
} from '../../redux/players/actions'; | ||
import { isBannedOnActiveServerBySteamIDSelector } from '../../redux/players/selectors'; | ||
import { getGetStateFunc } from '../../redux/selectors'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
width: 100%; | ||
height: 50px; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
const BanControlsRenderer: React.FunctionComponent<ICellRendererParams> = ({ | ||
data | ||
}) => { | ||
const { steam } = data; | ||
const dispatch = (window as any).store.dispatch; | ||
const getState = getGetStateFunc(dispatch); | ||
const isBanned = isBannedOnActiveServerBySteamIDSelector(getState(), { | ||
steam | ||
}); | ||
|
||
const handleClick = () => { | ||
if (isBanned) { | ||
dispatch(removeBanSteamIDThunk(steam)); | ||
} else { | ||
dispatch(banSteamIDThunk(steam)); | ||
} | ||
}; | ||
return ( | ||
<Wrapper> | ||
<Button onClick={handleClick}>{isBanned ? 'UnBan' : 'Ban'}</Button> | ||
</Wrapper> | ||
); | ||
}; | ||
export default BanControlsRenderer; |
32 changes: 32 additions & 0 deletions
32
src/components/FrameworkRenderers/KickControlsRenderer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Button from '@material-ui/core/Button'; | ||
import { ICellRendererParams } from 'ag-grid-community'; | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import { kickSteamIDThunk } from '../../redux/players/actions'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
width: 100%; | ||
height: 50px; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
const KickControlsRenderer: React.FunctionComponent<ICellRendererParams> = ({ | ||
data | ||
}) => { | ||
const { steam, active } = data; | ||
const dispatch = (window as any).store.dispatch; | ||
const handleClick = () => { | ||
dispatch(kickSteamIDThunk(steam)); | ||
}; | ||
return ( | ||
<Wrapper> | ||
<Button onClick={handleClick} disabled={!active}> | ||
Kick | ||
</Button> | ||
</Wrapper> | ||
); | ||
}; | ||
export default KickControlsRenderer; |
50 changes: 50 additions & 0 deletions
50
src/components/FrameworkRenderers/WhitelistControlsRenderer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import Button from '@material-ui/core/Button'; | ||
import { ICellRendererParams } from 'ag-grid-community'; | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
import { | ||
removeWhitelistSteamIDThunk, | ||
whitelistSteamIDThunk | ||
} from '../../redux/players/actions'; | ||
import { isWhitelistedOnActiveServerBySteamIDSelector } from '../../redux/players/selectors'; | ||
import { getGetStateFunc } from '../../redux/selectors'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
width: 100%; | ||
height: 50px; | ||
align-items: center; | ||
justify-content: center; | ||
`; | ||
|
||
const WhitelistControlsRenderer: React.FunctionComponent< | ||
ICellRendererParams | ||
> = ({ data }) => { | ||
const { steam } = data; | ||
const dispatch = (window as any).store.dispatch; | ||
const getState = getGetStateFunc(dispatch); | ||
const isWhitelisted = isWhitelistedOnActiveServerBySteamIDSelector( | ||
getState(), | ||
{ | ||
steam | ||
} | ||
); | ||
|
||
const handleClick = () => { | ||
if (isWhitelisted) { | ||
dispatch(removeWhitelistSteamIDThunk(steam)); | ||
} else { | ||
dispatch(whitelistSteamIDThunk(steam)); | ||
} | ||
}; | ||
return ( | ||
<Wrapper> | ||
<Button onClick={handleClick}> | ||
{' '} | ||
{isWhitelisted ? 'UnWhitelist' : 'Whitelist'} | ||
</Button> | ||
</Wrapper> | ||
); | ||
}; | ||
export default WhitelistControlsRenderer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import Divider from '@material-ui/core/Divider'; | ||
import * as React from 'react'; | ||
import styled from 'styled-components'; | ||
import { text } from '../styles/colors'; | ||
|
||
const Wrapper = styled.div` | ||
display: flex; | ||
width: 100%; | ||
align-items: center; | ||
flex-direction: column; | ||
margin-top: 10px; | ||
padding: 10px; | ||
`; | ||
|
||
const SettingName = styled.div` | ||
font-size: 1em; | ||
font-weight: 600; | ||
color: ${text.primary}; | ||
justify-content: left; | ||
width: 100%; | ||
margin-bottom: 20px; | ||
`; | ||
const SettingDescription = styled.div` | ||
width: 100%; | ||
color: ${text.secondary}; | ||
margin-bottom: 30px; | ||
`; | ||
const ActionWrapper = styled.div` | ||
width: 100%; | ||
`; | ||
|
||
interface Props { | ||
name: string; | ||
description: string | React.ReactElement; | ||
} | ||
const SettingsDialogSettingBoxToggle: React.FunctionComponent<Props> = ({ | ||
children, | ||
name, | ||
description | ||
}) => { | ||
return ( | ||
<> | ||
<Wrapper> | ||
<SettingName>{name}</SettingName> | ||
<SettingDescription>{description}</SettingDescription> | ||
<ActionWrapper>{children}</ActionWrapper> | ||
</Wrapper> | ||
<Divider | ||
style={{ marginTop: 50, width: '100%' }} | ||
light | ||
variant={'fullWidth'} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default SettingsDialogSettingBoxToggle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.