diff --git a/ui/src/views/devices/DeviceActivation.tsx b/ui/src/views/devices/DeviceActivation.tsx index c640a4af..3b30b456 100644 --- a/ui/src/views/devices/DeviceActivation.tsx +++ b/ui/src/views/devices/DeviceActivation.tsx @@ -1,7 +1,7 @@ import React, { Component } from "react"; import { RouteComponentProps } from "react-router-dom"; -import { Space, Form, Button, Row, Col, InputNumber } from "antd"; +import { Space, Form, Button, Row, Col, InputNumber, Alert } from "antd"; import { Tenant } from "@chirpstack/chirpstack-api-grpc-web/api/tenant_pb"; import { Application } from "@chirpstack/chirpstack-api-grpc-web/api/application_pb"; @@ -20,6 +20,7 @@ import DevAddrInput from "../../components/DevAddrInput"; import DeviceStore from "../../stores/DeviceStore"; interface FormProps { + disabled: boolean; initialValues: DeviceActivationPb; device: Device; onFinish: (obj: DeviceActivationPb) => void; @@ -58,6 +59,7 @@ class LW10DeviceActivationForm extends Component { value={this.props.initialValues.getDevAddr()} devEui={this.props.device.getDevEui()} formRef={this.formRef} + disabled={this.props.disabled} required /> { name="nwkSEncKey" value={this.props.initialValues.getNwkSEncKey()} formRef={this.formRef} + disabled={this.props.disabled} required /> { name="appSKey" value={this.props.initialValues.getAppSKey()} formRef={this.formRef} + disabled={this.props.disabled} required /> - + - + - @@ -129,6 +133,7 @@ class LW11DeviceActivationForm extends Component { value={this.props.initialValues.getDevAddr()} devEui={this.props.device.getDevEui()} formRef={this.formRef} + disabled={this.props.disabled} required /> { name="nwkSEncKey" value={this.props.initialValues.getNwkSEncKey()} formRef={this.formRef} + disabled={this.props.disabled} required /> { name="sNwkSIntKey" value={this.props.initialValues.getSNwkSIntKey()} formRef={this.formRef} + disabled={this.props.disabled} required /> { name="fNwkSIntKey" value={this.props.initialValues.getFNwkSIntKey()} formRef={this.formRef} + disabled={this.props.disabled} required /> { name="appSKey" value={this.props.initialValues.getAppSKey()} formRef={this.formRef} + disabled={this.props.disabled} required /> - + - + - + - @@ -235,6 +244,10 @@ class DeviceActivation extends Component { return null; } + if (!this.state.deviceActivation && this.props.deviceProfile.getSupportsOtaa()) { + return ; + } + let macVersion = this.props.deviceProfile.getMacVersion(); const lw11 = macVersion === MacVersion.LORAWAN_1_1_0; @@ -246,10 +259,20 @@ class DeviceActivation extends Component { return ( {!lw11 && ( - + )} {lw11 && ( - + )} );