mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 04:23:01 +00:00
Combine API props, update tests for redux hooks
This commit is contained in:
@@ -155,7 +155,7 @@ const ServerDashboard = (props) => {
|
||||
{/* Shutdown Jupyterhub */}
|
||||
<Button
|
||||
variant="danger"
|
||||
className="shutdown-button"
|
||||
id="shutdown-button"
|
||||
onClick={shutdownHub}
|
||||
>
|
||||
Shutdown Hub
|
||||
@@ -288,15 +288,4 @@ SortHandler.propTypes = {
|
||||
callback: PropTypes.func,
|
||||
};
|
||||
|
||||
const withHubActions = withProps((props) => ({
|
||||
updateUsers: (cb) => jhapiRequest("/users", "GET"),
|
||||
shutdownHub: () => jhapiRequest("/shutdown", "POST"),
|
||||
startServer: (name) => jhapiRequest("/users/" + name + "/server", "POST"),
|
||||
stopServer: (name) => jhapiRequest("/users/" + name + "/server", "DELETE"),
|
||||
startAll: (names) =>
|
||||
names.map((e) => jhapiRequest("/users/" + e + "/server", "POST")),
|
||||
stopAll: (names) =>
|
||||
names.map((e) => jhapiRequest("/users/" + e + "/server", "DELETE")),
|
||||
}));
|
||||
|
||||
export default compose(withHubActions)(ServerDashboard);
|
||||
export default ServerDashboard;
|
||||
|
Reference in New Issue
Block a user