UI: fixed show commands in mqtt
This commit is contained in:
parent
cef453b14a
commit
6a3be7fbaa
@ -156,8 +156,12 @@ public class DeviceСonnectivityServiceImpl implements DeviceConnectivityService
|
|||||||
.ifPresent(v -> mqttCommands.put(MQTT, v));
|
.ifPresent(v -> mqttCommands.put(MQTT, v));
|
||||||
List<String> mqttsPublishCommand = getMqttsPublishCommand(baseUrl, topic, deviceCredentials);
|
List<String> mqttsPublishCommand = getMqttsPublishCommand(baseUrl, topic, deviceCredentials);
|
||||||
if (mqttsPublishCommand != null){
|
if (mqttsPublishCommand != null){
|
||||||
|
if (mqttsPublishCommand.size() > 1) {
|
||||||
ArrayNode arrayNode = mqttCommands.putArray(MQTTS);
|
ArrayNode arrayNode = mqttCommands.putArray(MQTTS);
|
||||||
mqttsPublishCommand.forEach(arrayNode::add);
|
mqttsPublishCommand.forEach(arrayNode::add);
|
||||||
|
} else {
|
||||||
|
mqttCommands.put(MQTTS, mqttsPublishCommand.get(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectNode dockerMqttCommands = JacksonUtil.newObjectNode();
|
ObjectNode dockerMqttCommands = JacksonUtil.newObjectNode();
|
||||||
|
|||||||
@ -19,9 +19,6 @@ import org.thingsboard.common.util.JacksonUtil;
|
|||||||
import org.thingsboard.server.common.data.device.credentials.BasicMqttCredentials;
|
import org.thingsboard.server.common.data.device.credentials.BasicMqttCredentials;
|
||||||
import org.thingsboard.server.common.data.security.DeviceCredentials;
|
import org.thingsboard.server.common.data.security.DeviceCredentials;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DeviceConnectivityUtil {
|
public class DeviceConnectivityUtil {
|
||||||
|
|
||||||
public static final String HTTP = "http";
|
public static final String HTTP = "http";
|
||||||
|
|||||||
@ -123,6 +123,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
background: #F3F6FA;
|
background: #F3F6FA;
|
||||||
border-color: #305680;
|
border-color: #305680;
|
||||||
|
padding-right: 38px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
button.clipboard-btn {
|
button.clipboard-btn {
|
||||||
|
|||||||
@ -171,7 +171,7 @@ export class DeviceCheckConnectivityDialogComponent extends
|
|||||||
if (Array.isArray(commands)) {
|
if (Array.isArray(commands)) {
|
||||||
const formatCommands: Array<string> = [];
|
const formatCommands: Array<string> = [];
|
||||||
commands.forEach(command => formatCommands.push(this.createMarkDownSingleCommand(command)));
|
commands.forEach(command => formatCommands.push(this.createMarkDownSingleCommand(command)));
|
||||||
return formatCommands.join('<br />\n');
|
return formatCommands.join(`\n<br />\n\n`);
|
||||||
} else {
|
} else {
|
||||||
return this.createMarkDownSingleCommand(commands);
|
return this.createMarkDownSingleCommand(commands);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user