Implement support for device-profile templates + TTN importer.

This commit is contained in:
Orne Brocaar
2022-06-07 19:28:41 +01:00
parent d1630e5722
commit d9d3f14e80
59 changed files with 12091 additions and 282 deletions

View File

@ -35,6 +35,18 @@ class CodeEditor extends Component<IProps, IState> {
}
}
componentDidUpdate(oldProps: IProps) {
if (this.props === oldProps) {
return;
}
if (this.props.value) {
this.setState({
value: this.props.value,
});
}
}
updateField = () => {
let value = this.state.value;

View File

@ -118,6 +118,11 @@ class SideMenu extends Component<RouteComponentProps, IState> {
this.setState({ selectedKey: "ns-api-keys" });
}
// ns device-profile templates
if (/\/device-profile-templates(\/([\w-]{36}\/edit|create))?/g.exec(path)) {
this.setState({ selectedKey: "ns-device-profile-templates" });
}
// tenant dashboard
if (/\/tenants\/[\w-]{36}/g.exec(path)) {
this.setState({ selectedKey: "tenant-dashboard" });
@ -163,6 +168,11 @@ class SideMenu extends Component<RouteComponentProps, IState> {
{ 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> },
{
key: "ns-device-profile-templates",
icon: <ControlOutlined />,
label: <Link to="/device-profile-templates">Device-profile templates</Link>,
},
],
});
}