Split private gateways under tenant in uplink / downlink.

This makes it possible to share uplink data with other tenants, but do
not allow other tenants to use these gateways for downlinks.
This commit is contained in:
Orne Brocaar
2023-02-14 13:36:21 +00:00
parent d3defb7dff
commit f776dd3898
39 changed files with 1090 additions and 527 deletions

View File

@ -37,12 +37,25 @@ class ListTenants extends Component {
},
},
{
title: "Private gateways",
dataIndex: "privateGateways",
key: "privateGateways",
title: "Private gateways (uplink)",
dataIndex: "privateGatewaysUp",
key: "privateGatewaysUp",
width: 250,
render: (text, record) => {
if (record.privateGateways) {
if (record.privateGatewaysUp) {
return "yes";
} else {
return "no";
}
},
},
{
title: "Private gateways (down)",
dataIndex: "privateGatewaysDown",
key: "privateGatewaysDown",
width: 250,
render: (text, record) => {
if (record.privateGatewaysDown) {
return "yes";
} else {
return "no";

View File

@ -23,7 +23,8 @@ class TenantForm extends Component<IProps, IState> {
tenant.setCanHaveGateways(values.canHaveGateways);
tenant.setMaxGatewayCount(values.maxGatewayCount);
tenant.setMaxDeviceCount(values.maxDeviceCount);
tenant.setPrivateGateways(values.privateGateways);
tenant.setPrivateGatewaysUp(values.privateGatewaysUp);
tenant.setPrivateGatewaysDown(values.privateGatewaysDown);
this.props.onFinish(tenant);
};
@ -38,7 +39,7 @@ class TenantForm extends Component<IProps, IState> {
<Input.TextArea disabled={this.props.disabled} />
</Form.Item>
<Row>
<Col span={12}>
<Col span={8}>
<Form.Item
label="Tenant can have gateways"
name="canHaveGateways"
@ -48,11 +49,21 @@ class TenantForm extends Component<IProps, IState> {
<Switch disabled={this.props.disabled} />
</Form.Item>
</Col>
<Col span={12}>
<Col span={8}>
<Form.Item
label="Gateways are private"
name="privateGateways"
tooltip="Gateways can only be used by the devices of this tenant."
label="Gateways are private (uplink)"
name="privateGatewaysUp"
tooltip="Uplink received by gateways of this tenant can only be used by the devices of this tenant."
valuePropName="checked"
>
<Switch disabled={this.props.disabled} />
</Form.Item>
</Col>
<Col span={8}>
<Form.Item
label="Gateways are private (downlink)"
name="privateGatewaysDown"
tooltip="Other tenants can not use the gateways of this tenant for downlinks. This can be useful in case uplinks are shared with other tenants, but you want to avoid other tenants using downlink airtime of your gateways."
valuePropName="checked"
>
<Switch disabled={this.props.disabled} />