Skip to content

Commit

Permalink
Merge pull request #152 from casanet/development
Browse files Browse the repository at this point in the history
Dashboards UI/UX fixes
  • Loading branch information
haimkastner authored Jul 11, 2020
2 parents 0c61466 + 7db0e51 commit 6cad5a8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ process.on('exit', (code) => {
});
process.on('SIGINT', () => {
logger.warn(`[home-iot-server] About to exit SIGINT`);
process.exit(1);
});
process.on('SIGTERM', () => {
logger.warn(`[home-iot-server] About to exit SIGTERM`);
Expand Down
4 changes: 2 additions & 2 deletions backend/src/modules/tasmota/tasmotaHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export class TasmotaHandler extends BrandModuleBase {
private async getAcStatus(minion: Minion): Promise<MinionStatus | ErrorResponse> {
try {
await request(`http://${minion.device.pysicalDevice.ip}/cm?cmnd=State`);
return await this.commandsCacheManager.getCachedStatus(minion);

} catch (error) {
logger.warn(`Sent Tasmota command ${minion.minionId} fail, ${JSON.stringify(error.message)}`);
Expand All @@ -113,6 +112,7 @@ export class TasmotaHandler extends BrandModuleBase {
message: 'tasmota request fail.',
} as ErrorResponse;
}
return await this.commandsCacheManager.getCachedStatus(minion);
}

private async setSwitchStatus(minion: Minion, setStatus: MinionStatus): Promise<void | ErrorResponse> {
Expand All @@ -128,8 +128,8 @@ export class TasmotaHandler extends BrandModuleBase {
}

private async setAcStatus(minion: Minion, setStatus: MinionStatus): Promise<void | ErrorResponse> {
const hexCommandCode = await this.commandsCacheManager.getIrCommand(minion, setStatus) as string;
try {
const hexCommandCode = await this.commandsCacheManager.getIrCommand(minion, setStatus) as string;
// Convert the broadlink command format to the pules array
const pulesArray = broadlinkToPulesArray(hexCommandCode);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/core/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

<div class="settings-viewer-wrapper">
<div class="settings-viewer-title">
<div class="settings-viewer-title-spacer"> {{ 'REDIRECT_TO_THE_LIGHT_VERSION' | translate }}</div>
<div class="settings-viewer-title-spacer"> <a href="/light-app/index.html">{{ 'REDIRECT_TO_THE_LIGHT_VERSION' | translate }}</a></div>
<button mat-icon-button matTooltipPosition="below" onclick="window.open('/light-app/index.html')"
matTooltip="{{'REDIRECT_TO_THE_LIGHT_VERSION' | translate}}">
<mat-icon>reply</mat-icon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<app-loader *ngIf="dataLoading"></app-loader>
<div *ngIf="!dataLoading" fxLayout="row wrap" fxFill>
<div *ngIf="!dataLoading" fxLayout="row wrap" fxFill style="overflow: auto;">
<div fxFlex fxLayout="column" fxLayoutAlign="space-between"
*ngFor="let minion of minions" fxFlex.lt-sm="100" fxFlex.sm="50" fxFlex.md="25">

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/light-app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</div>

<div class="dashboard-link-container">
<a class="casanet-title" target="_blank" href="/">Casanet dashboard</a>
<a class="casanet-title" href="/">Casanet dashboard</a>
</div>
</div>

Expand Down

0 comments on commit 6cad5a8

Please sign in to comment.