Update UI dependencies.

This commit is contained in:
Orne Brocaar 2022-04-29 15:45:52 +01:00
parent eec9b1891d
commit d8377cd26a
10 changed files with 5394 additions and 6533 deletions

6
Cargo.lock generated
View File

@ -574,7 +574,7 @@ dependencies = [
[[package]]
name = "backend"
version = "1.0.0"
version = "4.0.0-test.1"
dependencies = [
"aes-kw",
"anyhow",
@ -871,7 +871,7 @@ dependencies = [
[[package]]
name = "chirpstack_api"
version = "4.0.0"
version = "4.0.0-test.1"
dependencies = [
"hex",
"pbjson",
@ -2041,7 +2041,7 @@ dependencies = [
[[package]]
name = "lrwn"
version = "1.0.0"
version = "4.0.0-test.1"
dependencies = [
"aes 0.7.5",
"anyhow",

View File

@ -5,10 +5,10 @@
"dependencies": {
"@ant-design/colors": "^6.0.0",
"@chirpstack/chirpstack-api-grpc-web": "file:../api/grpc-web",
"@fortawesome/fontawesome-free": "^5.15.4",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.16",
"@fortawesome/fontawesome-free": "^6.1.1",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.1.18",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
@ -18,30 +18,27 @@
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.7",
"@types/react-text-mask": "^5.4.9",
"@types/uuid": "^8.3.1",
"antd": "^4.15.3",
"antd-mask-input": "^0.1.15",
"chart.js": "^3.6.0",
"@types/react-router-dom": "^5.3.3",
"antd": "^4.20.1",
"antd-mask-input": "^2.0.7",
"chart.js": "^3.7.1",
"chartjs-adapter-moment": "^1.0.0",
"chartjs-chart-matrix": "^1.1.1",
"codemirror": "^5.65.2",
"google-protobuf": "^3.15.8",
"grpc-web": "^1.2.1",
"codemirror": "^5.65.3",
"google-protobuf": "^3.20.1",
"grpc-web": "^1.3.1",
"leaflet": "^1.7.1",
"leaflet.awesome-markers": "^2.0.5",
"react": "^17.0.2",
"react-chartjs-2": "^4.0.0",
"react-chartjs-2": "^4.1.0",
"react-codemirror2": "^7.2.1",
"react-dom": "^17.0.2",
"react-json-tree": "^0.15.1",
"react-leaflet": "^3.2.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"typescript": "^4.1.2",
"uuid": "^8.3.2",
"web-vitals": "^1.0.1"
"react-router-dom": "^5.3.1",
"react-scripts": "5.0.1",
"typescript": "^4.6.4",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",

View File

@ -1,7 +1,7 @@
import React, { Component } from "react";
import { withRouter, RouteComponentProps, Link } from "react-router-dom";
import { Menu } from "antd";
import { Menu, MenuProps } from "antd";
import { CloudOutlined, HomeOutlined, UserOutlined, DashboardOutlined, KeyOutlined, WifiOutlined, ControlOutlined, AppstoreOutlined } from "@ant-design/icons";
import { GetTenantResponse, ListTenantsRequest, ListTenantsResponse } from "@chirpstack/chirpstack-api-grpc-web/api/tenant_pb";
@ -10,7 +10,6 @@ import Autocomplete, { OptionCallbackFunc, OptionsCallbackFunc } from "../compon
import TenantStore from "../stores/TenantStore";
import SessionStore from "../stores/SessionStore";
const { SubMenu } = Menu;
interface IState {
tenantId: string;
@ -139,6 +138,37 @@ class SideMenu extends Component<RouteComponentProps, IState> {
render() {
const tenantId = this.state.tenantId;
let items: MenuProps["items"] = [];
if (SessionStore.isAdmin()) {
items.push({
key: "ns",
label: "Network Server",
icon: <CloudOutlined />,
children: [
{key: "ns-dashboard", icon: <DashboardOutlined />, label: <Link to="/dashboard">Dashboard</Link>},
{key: "ns-tenants", icon: <HomeOutlined />, label: <Link to="/tenants">Tenants</Link>},
{key: "ns-users", icon: <UserOutlined />, label: <Link to="/users">Users</Link>},
{key: "ns-api-keys", icon: <KeyOutlined />, label: <Link to="/api-keys">API keys</Link>},
],
});
}
if (tenantId !== "") {
items.push({
key: "tenant",
label: "Tenant",
icon: <HomeOutlined />,
children: [
{key: "tenant-dashboard", icon: <DashboardOutlined />, label: <Link to={`/tenants/${tenantId}`}>Dashboard</Link>},
{key: "tenant-users", icon: <UserOutlined />, label: <Link to={`/tenants/${tenantId}/users`}>Users</Link>},
{key: "tenant-api-keys", icon: <KeyOutlined />, label: <Link to={`/tenants/${tenantId}/api-keys`}>API keys</Link>},
{key: "tenant-device-profiles", icon: <ControlOutlined />, label: <Link to={`/tenants/${tenantId}/device-profiles`}>Device profiles</Link>},
{key: "tenant-gateways", icon: <WifiOutlined />, label: <Link to={`/tenants/${tenantId}/gateways`}>Gateways</Link>},
{key: "tenant-applications", icon: <AppstoreOutlined />, label: <Link to={`/tenants/${tenantId}/applications`}>Applications</Link>},
],
});
}
return(
<div>
@ -155,22 +185,8 @@ class SideMenu extends Component<RouteComponentProps, IState> {
openKeys={["ns", "tenant"]}
selectedKeys={[this.state.selectedKey]}
expandIcon={<div></div>}
>
{SessionStore.isAdmin() && <SubMenu key="ns" title="Network Server" icon={<CloudOutlined />}>
<Menu.Item key="ns-dashboard" icon={<DashboardOutlined />}><Link to="/dashboard">Dashboard</Link></Menu.Item>
<Menu.Item key="ns-tenants" icon={<HomeOutlined />}><Link to="/tenants">Tenants</Link></Menu.Item>
<Menu.Item key="ns-users" icon={<UserOutlined />}><Link to="/users">Users</Link></Menu.Item>
<Menu.Item key="ns-api-keys" icon={<KeyOutlined />}><Link to="/api-keys">API keys</Link></Menu.Item>
</SubMenu>}
{tenantId !== "" && <SubMenu key="tenant" title="Tenant" icon={<HomeOutlined />}>
<Menu.Item key="tenant-dashboard" icon={<DashboardOutlined />}><Link to={`/tenants/${tenantId}`}>Dashboard</Link></Menu.Item>
<Menu.Item key="tenant-users" icon={<UserOutlined />}><Link to={`/tenants/${tenantId}/users`}>Users</Link></Menu.Item>
<Menu.Item key="tenant-api-keys" icon={<KeyOutlined />}><Link to={`/tenants/${tenantId}/api-keys`}>API keys</Link></Menu.Item>
<Menu.Item key="tenant-device-profiles" icon={<ControlOutlined />}><Link to={`/tenants/${tenantId}/device-profiles`}>Device profiles</Link></Menu.Item>
<Menu.Item key="tenant-gateways" icon={<WifiOutlined />}><Link to={`/tenants/${tenantId}/gateways`}>Gateways</Link></Menu.Item>
<Menu.Item key="tenant-applications" icon={<AppstoreOutlined />}><Link to={`/tenants/${tenantId}/applications`}>Applications</Link></Menu.Item>
</SubMenu>}
</Menu>
items={items}
/>
</div>
);
}

View File

@ -9,7 +9,7 @@ import "chartjs-adapter-moment";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import "antd/dist/antd.css";
import "antd/dist/antd.min.css";
import "leaflet/dist/leaflet.css";
import "leaflet.awesome-markers/dist/leaflet.awesome-markers.css";
import "@fortawesome/fontawesome-free/css/all.css";

View File

@ -57,7 +57,7 @@ class HttpIntegrationForm extends Component<IProps> {
<Form.List name="headersMap">
{(fields, { add, remove }) => (
<>
{fields.map(( {key, name, fieldKey, ...restField} ) => (
{fields.map(( {key, name, ...restField} ) => (
<Row gutter={24}>
<Col span={6}>
<Form.Item

View File

@ -348,7 +348,7 @@ class DeviceProfileForm extends Component<IProps, IState> {
<Form.List name="tagsMap">
{(fields, { add, remove }) => (
<>
{fields.map(( {key, name, fieldKey, ...restField} ) => (
{fields.map(( {key, name, ...restField} ) => (
<Row gutter={24}>
<Col span={6}>
<Form.Item

View File

@ -110,7 +110,7 @@ class DeviceForm extends Component<IProps> {
<Form.List name="tagsMap">
{(fields, { add, remove }) => (
<>
{fields.map(( {key, name, fieldKey, ...restField} ) => (
{fields.map(( {key, name, ...restField} ) => (
<Row gutter={24}>
<Col span={6}>
<Form.Item
@ -150,7 +150,7 @@ class DeviceForm extends Component<IProps> {
<Form.List name="variablesMap">
{(fields, { add, remove }) => (
<>
{fields.map(( {key, name, fieldKey, ...restField} ) => (
{fields.map(( {key, name, ...restField} ) => (
<Row gutter={24}>
<Col span={6}>
<Form.Item

View File

@ -140,7 +140,7 @@ class GatewayForm extends Component<IProps, IState> {
<Form.List name="tagsMap">
{(fields, { add, remove }) => (
<>
{fields.map(( {key, name, fieldKey, ...restField} ) => (
{fields.map(( {key, name, ...restField} ) => (
<Row gutter={24}>
<Col span={6}>
<Form.Item

View File

@ -140,6 +140,7 @@ class Login extends Component<RouteComponentProps, LoginState> {
if (this.props.location.search === "") {
InternalStore.settings((resp: SettingsResponse) => {
console.log("SDF");
this.setState({
loaded: true,
oidcEnabled: resp.getOpenidConnect()!.getEnabled(),

11821
ui/yarn.lock

File diff suppressed because it is too large Load Diff