Skip to content

Commit

Permalink
devices with ssl error were not shown correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Machriam committed Jun 11, 2024
1 parent 55c76a5 commit 87d24e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@
const outletClient = new PowerOutletClient();
try {
devices = await client.getDevices();
devices
.filter((d) => d.health.deviceId != undefined)
.forEach(async (element) => {
const deviceId = element.health.deviceId!;
var outlet = await outletClient.powerOutletForDevice(deviceId);
outletByDevice[deviceId] = outlet;
});
const outletDevices = devices.filter((d) => d.health?.deviceId != undefined);
for (let i = 0; i < outletDevices.length; i++) {
const deviceId = outletDevices[i].health.deviceId!;
var outlet = await outletClient.powerOutletForDevice(deviceId);
outletByDevice[deviceId] = outlet;
}
} catch (ex) {
console.log(ex);
devices = [];
}
}
Expand Down Expand Up @@ -232,10 +232,10 @@
items={existingOutlets}></Select>
</div>
{/if}
<button class="btn btn-primary" on:click={async () => await checkStatus(device.ip)}
>Check Device</button>
{/if}
<button on:click={() => openConsole(device.ip)} class="btn btn-primary"> Open Console </button>
<button class="btn btn-primary" on:click={async () => await checkStatus(device.ip)}
>Check Device</button>
</td>
</tr>
</tbody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<button
on:click={() => deviceSelected(device)}
class="p-0 m-0 ms-3 alert {(selectedDevice?.ip == device.ip ? 'selected' : '') + ` available-${device.retryTimes}`}">
{device.health?.deviceName}<br />
{device.health?.deviceName ?? "not configured"}<br />
{device.ip}
</button>
{/each}
Expand Down

0 comments on commit 87d24e6

Please sign in to comment.