-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problems: add ack field to table view, closes #946
- Loading branch information
1 parent
0df9023
commit 4f92024
Showing
6 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import { css } from 'emotion'; | ||
import { RTCell } from '../../types'; | ||
import { ProblemDTO } from '../../../datasource-zabbix/types'; | ||
import { FAIcon } from '../FAIcon'; | ||
import { useTheme, stylesFactory } from '@grafana/ui'; | ||
import { GrafanaTheme } from '@grafana/data'; | ||
|
||
const getStyles = stylesFactory((theme: GrafanaTheme) => { | ||
return { | ||
countLabel: css` | ||
font-size: ${theme.typography.size.sm}; | ||
`, | ||
}; | ||
}); | ||
|
||
export const AckCell: React.FC<RTCell<ProblemDTO>> = (props: RTCell<ProblemDTO>) => { | ||
const problem = props.original; | ||
const theme = useTheme(); | ||
const styles = getStyles(theme); | ||
|
||
return ( | ||
<div> | ||
{problem.acknowledges?.length > 0 && | ||
<> | ||
<FAIcon icon="comments" /> | ||
<span className={styles.countLabel}> ({problem.acknowledges?.length})</span> | ||
</> | ||
} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AckCell; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters