mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-09 11:03:00 +00:00
jsx: update and address eslint
add script to top-level package.json to run eslint in subdir
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
const jhdata = window.jhdata || {};
|
||||
const base_url = jhdata.base_url || "/";
|
||||
const xsrfToken = jhdata.xsrf_token;
|
||||
@@ -17,3 +19,21 @@ export const jhapiRequest = (endpoint, method, data) => {
|
||||
body: data ? JSON.stringify(data) : null,
|
||||
});
|
||||
};
|
||||
|
||||
// need to declare the subset of fields we use, at least
|
||||
export const Server = PropTypes.shape({
|
||||
name: PropTypes.string,
|
||||
url: PropTypes.string,
|
||||
active: PropTypes.boolean,
|
||||
pending: PropTypes.string,
|
||||
last_activity: PropTypes.string,
|
||||
});
|
||||
|
||||
export const User = PropTypes.shape({
|
||||
admin: PropTypes.boolean,
|
||||
name: PropTypes.string,
|
||||
last_activity: PropTypes.string,
|
||||
url: PropTypes.string,
|
||||
server: Server,
|
||||
servers: PropTypes.objectOf(Server),
|
||||
});
|
||||
|
Reference in New Issue
Block a user