mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 22:43:00 +00:00
Fix /jsx with prettifier
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
share/jupyterhub/templates/
|
share/jupyterhub/templates/
|
||||||
|
share/jupyterhub/static/js/admin-react.js
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": [
|
"extends": ["plugin:react/recommended"],
|
||||||
"plugin:react/recommended"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": 6,
|
"ecmaVersion": 6,
|
||||||
"sourceType": "module",
|
"sourceType": "module",
|
||||||
@@ -14,10 +12,7 @@
|
|||||||
"version": "detect"
|
"version": "detect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": ["eslint-plugin-react", "prettier"],
|
||||||
"eslint-plugin-react",
|
|
||||||
"prettier"
|
|
||||||
],
|
|
||||||
"env": {
|
"env": {
|
||||||
"es6": true,
|
"es6": true,
|
||||||
"browser": true
|
"browser": true
|
||||||
@@ -29,10 +24,7 @@
|
|||||||
},
|
},
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": [
|
"files": ["**/*.test.js", "**/*.test.jsx"],
|
||||||
"**/*.test.js",
|
|
||||||
"**/*.test.jsx"
|
|
||||||
],
|
|
||||||
"env": {
|
"env": {
|
||||||
"jest": true
|
"jest": true
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
# Jupyterhub Admin Dashboard - React Variant
|
# Jupyterhub Admin Dashboard - React Variant
|
||||||
|
|
||||||
This repository contains current updates to the Jupyterhub Admin Dashboard service,
|
This repository contains current updates to the Jupyterhub Admin Dashboard service,
|
||||||
reducing the complexity from a mass of templated HTML to a simple React web application.
|
reducing the complexity from a mass of templated HTML to a simple React web application.
|
||||||
This will integrate with Jupyterhub, speeding up client interactions while simplifying the
|
This will integrate with Jupyterhub, speeding up client interactions while simplifying the
|
||||||
admin dashboard codebase.
|
admin dashboard codebase.
|
||||||
|
|
||||||
### Build Commands
|
### Build Commands
|
||||||
|
|
||||||
- `yarn build`: Installs all dependencies and bundles the application
|
- `yarn build`: Installs all dependencies and bundles the application
|
||||||
- `yarn hot`: Bundles the application and runs a mock (serverless) version on port 8000
|
- `yarn hot`: Bundles the application and runs a mock (serverless) version on port 8000
|
||||||
- `yarn lint`: Lints JSX with ESLint
|
- `yarn lint`: Lints JSX with ESLint
|
||||||
|
@@ -17,7 +17,7 @@ import EditUser from "./components/EditUser/EditUser";
|
|||||||
|
|
||||||
import "./style/root.css";
|
import "./style/root.css";
|
||||||
|
|
||||||
const store = createStore(reducers, initialState)
|
const store = createStore(reducers, initialState);
|
||||||
|
|
||||||
const App = (props) => {
|
const App = (props) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
.sort-icon {
|
.sort-icon {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
top: .125em;
|
top: 0.125em;
|
||||||
position: relative;
|
position: relative;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
.resets .modal {
|
.resets .modal {
|
||||||
display: block;
|
display: block;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
z-index: 2000
|
z-index: 2000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Global Util Classes */
|
/* Global Util Classes */
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
const webpack = require("webpack")
|
const webpack = require("webpack");
|
||||||
const path = require("path")
|
const path = require("path");
|
||||||
const express = require("express")
|
const express = require("express");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
entry: path.resolve(__dirname, "src", "App.jsx"),
|
entry: path.resolve(__dirname, "src", "App.jsx"),
|
||||||
@@ -15,14 +15,14 @@ module.exports = {
|
|||||||
{
|
{
|
||||||
test: /\.(css)/,
|
test: /\.(css)/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
use: ["style-loader", "css-loader"]
|
use: ["style-loader", "css-loader"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.(png|jpe?g|gif|svg|woff2?|ttf)$/i,
|
test: /\.(png|jpe?g|gif|svg|woff2?|ttf)$/i,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
use: "file-loader"
|
use: "file-loader",
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
publicPath: "/",
|
publicPath: "/",
|
||||||
@@ -30,37 +30,68 @@ module.exports = {
|
|||||||
path: path.resolve(__dirname, "build"),
|
path: path.resolve(__dirname, "build"),
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".css", ".js", ".jsx"]
|
extensions: [".css", ".js", ".jsx"],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [new webpack.HotModuleReplacementPlugin()],
|
||||||
new webpack.HotModuleReplacementPlugin
|
|
||||||
],
|
|
||||||
devServer: {
|
devServer: {
|
||||||
contentBase: path.resolve(__dirname, "build"),
|
contentBase: path.resolve(__dirname, "build"),
|
||||||
port: 9000,
|
port: 9000,
|
||||||
before: (app, server) => {
|
before: (app, server) => {
|
||||||
var user_data = JSON.parse('[{"kind":"user","name":"foo","admin":true,"groups":[],"server":"/user/foo/","pending":null,"created":"2020-12-07T18:46:27.112695Z","last_activity":"2020-12-07T21:00:33.336354Z","servers":{"":{"name":"","last_activity":"2020-12-07T20:58:02.437408Z","started":"2020-12-07T20:58:01.508266Z","pending":null,"ready":true,"state":{"pid":28085},"url":"/user/foo/","user_options":{},"progress_url":"/hub/api/users/foo/server/progress"}}},{"kind":"user","name":"bar","admin":false,"groups":[],"server":null,"pending":null,"created":"2020-12-07T18:46:27.115528Z","last_activity":"2020-12-07T20:43:51.013613Z","servers":{}}]')
|
var user_data = JSON.parse(
|
||||||
var group_data = JSON.parse('[{"kind":"group","name":"testgroup","users":[]}, {"kind":"group","name":"testgroup2","users":["foo", "bar"]}]')
|
'[{"kind":"user","name":"foo","admin":true,"groups":[],"server":"/user/foo/","pending":null,"created":"2020-12-07T18:46:27.112695Z","last_activity":"2020-12-07T21:00:33.336354Z","servers":{"":{"name":"","last_activity":"2020-12-07T20:58:02.437408Z","started":"2020-12-07T20:58:01.508266Z","pending":null,"ready":true,"state":{"pid":28085},"url":"/user/foo/","user_options":{},"progress_url":"/hub/api/users/foo/server/progress"}}},{"kind":"user","name":"bar","admin":false,"groups":[],"server":null,"pending":null,"created":"2020-12-07T18:46:27.115528Z","last_activity":"2020-12-07T20:43:51.013613Z","servers":{}}]'
|
||||||
app.use(express.json())
|
);
|
||||||
|
var group_data = JSON.parse(
|
||||||
|
'[{"kind":"group","name":"testgroup","users":[]}, {"kind":"group","name":"testgroup2","users":["foo", "bar"]}]'
|
||||||
|
);
|
||||||
|
app.use(express.json());
|
||||||
|
|
||||||
// get user_data
|
// get user_data
|
||||||
app.get("/hub/api/users", (req, res) => { res.set("Content-Type", "application/json").send(JSON.stringify(user_data)) })
|
app.get("/hub/api/users", (req, res) => {
|
||||||
|
res
|
||||||
|
.set("Content-Type", "application/json")
|
||||||
|
.send(JSON.stringify(user_data));
|
||||||
|
});
|
||||||
// get group_data
|
// get group_data
|
||||||
app.get("/hub/api/groups", (req, res) => { res.set("Content-Type", "application/json").send(JSON.stringify(group_data)) })
|
app.get("/hub/api/groups", (req, res) => {
|
||||||
|
res
|
||||||
|
.set("Content-Type", "application/json")
|
||||||
|
.send(JSON.stringify(group_data));
|
||||||
|
});
|
||||||
// add users to group
|
// add users to group
|
||||||
app.post("/hub/api/groups/*/users", (req, res) => { console.log(req.url, req.body); res.status(200).end() })
|
app.post("/hub/api/groups/*/users", (req, res) => {
|
||||||
|
console.log(req.url, req.body);
|
||||||
|
res.status(200).end();
|
||||||
|
});
|
||||||
// remove users from group
|
// remove users from group
|
||||||
app.delete("/hub/api/groups/*", (req, res) => { console.log(req.url, req.body); res.status(200).end() })
|
app.delete("/hub/api/groups/*", (req, res) => {
|
||||||
|
console.log(req.url, req.body);
|
||||||
|
res.status(200).end();
|
||||||
|
});
|
||||||
// add users
|
// add users
|
||||||
app.post("/hub/api/users", (req, res) => { console.log(req.url, req.body); res.status(200).end() })
|
app.post("/hub/api/users", (req, res) => {
|
||||||
|
console.log(req.url, req.body);
|
||||||
|
res.status(200).end();
|
||||||
|
});
|
||||||
// delete user
|
// delete user
|
||||||
app.delete("/hub/api/users", (req, res) => { console.log(req.url, req.body); res.status(200).end() })
|
app.delete("/hub/api/users", (req, res) => {
|
||||||
|
console.log(req.url, req.body);
|
||||||
|
res.status(200).end();
|
||||||
|
});
|
||||||
// start user server
|
// start user server
|
||||||
app.post("/hub/api/users/*/server", (req, res) => { console.log(req.url, req.body); res.status(200).end() })
|
app.post("/hub/api/users/*/server", (req, res) => {
|
||||||
|
console.log(req.url, req.body);
|
||||||
|
res.status(200).end();
|
||||||
|
});
|
||||||
// stop user server
|
// stop user server
|
||||||
app.delete("/hub/api/users/*/server", (req, res) => { console.log(req.url, req.body); res.status(200).end() })
|
app.delete("/hub/api/users/*/server", (req, res) => {
|
||||||
|
console.log(req.url, req.body);
|
||||||
|
res.status(200).end();
|
||||||
|
});
|
||||||
// shutdown hub
|
// shutdown hub
|
||||||
app.post("/hub/api/shutdown", (req, res) => { console.log(req.url, req.body); res.status(200).end() })
|
app.post("/hub/api/shutdown", (req, res) => {
|
||||||
}
|
console.log(req.url, req.body);
|
||||||
}
|
res.status(200).end();
|
||||||
}
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user