Skip to content

Commit

Permalink
fixing tooltip theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jun 11, 2022
1 parent 7695cc1 commit 09a8574
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
20 changes: 19 additions & 1 deletion webapp/frontend/src/app/modules/detail/detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {

// Private
private _unsubscribeAll: Subject<any>;
private systemPrefersDark: boolean;

/**
* Constructor
Expand All @@ -77,6 +78,9 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
this.smartAttributeDataSource = new MatTableDataSource();
// this.recentTransactionsTableColumns = ['status', 'id', 'name', 'value', 'worst', 'thresh'];
this.smartAttributeTableColumns = ['status', 'id', 'name', 'value', 'worst', 'thresh','ideal', 'failure', 'history'];

this.systemPrefersDark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;

}

// -----------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -373,6 +377,11 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
enabled: false
}
},
// theme:{
// // @ts-ignore
// // mode:
// mode: 'dark',
// },
tooltip: {
fixed: {
enabled: false
Expand All @@ -389,7 +398,9 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
},
marker: {
show: false
}
},
theme: this.determineTheme(this.config)

},
stroke: {
width: 2,
Expand All @@ -398,6 +409,13 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
};
}

private determineTheme(config:AppConfig): string {
if (config.theme === 'system') {
return this.systemPrefersDark ? 'dark' : 'light'
} else {
return config.theme
}
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions webapp/frontend/src/styles/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@
color: #0694a2 !important
}
}
.apexcharts-tooltip {
background: #242b38 !important;
//color: orange;
}
}

0 comments on commit 09a8574

Please sign in to comment.