UI: fixed show commands in mqtt

This commit is contained in:
Vladyslav_Prykhodko 2023-07-24 10:55:11 +03:00
parent cef453b14a
commit 6a3be7fbaa
4 changed files with 8 additions and 6 deletions

View File

@ -156,8 +156,12 @@ public class DeviceСonnectivityServiceImpl implements DeviceConnectivityService
.ifPresent(v -> mqttCommands.put(MQTT, v));
List<String> mqttsPublishCommand = getMqttsPublishCommand(baseUrl, topic, deviceCredentials);
if (mqttsPublishCommand != null){
ArrayNode arrayNode = mqttCommands.putArray(MQTTS);
mqttsPublishCommand.forEach(arrayNode::add);
if (mqttsPublishCommand.size() > 1) {
ArrayNode arrayNode = mqttCommands.putArray(MQTTS);
mqttsPublishCommand.forEach(arrayNode::add);
} else {
mqttCommands.put(MQTTS, mqttsPublishCommand.get(0));
}
}
ObjectNode dockerMqttCommands = JacksonUtil.newObjectNode();

View File

@ -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.security.DeviceCredentials;
import java.util.ArrayList;
import java.util.List;
public class DeviceConnectivityUtil {
public static final String HTTP = "http";

View File

@ -123,6 +123,7 @@
margin: 0;
background: #F3F6FA;
border-color: #305680;
padding-right: 38px;
}
}
button.clipboard-btn {

View File

@ -171,7 +171,7 @@ export class DeviceCheckConnectivityDialogComponent extends
if (Array.isArray(commands)) {
const formatCommands: Array<string> = [];
commands.forEach(command => formatCommands.push(this.createMarkDownSingleCommand(command)));
return formatCommands.join('<br />\n');
return formatCommands.join(`\n<br />\n\n`);
} else {
return this.createMarkDownSingleCommand(commands);
}