+
)}
@@ -239,9 +246,27 @@ const getStyles = (theme: GrafanaTheme2) => ({
position: relative;
flex: 10 1 auto;
// padding: 0.5rem 1rem 0.5rem 1.2rem;
- padding: ${theme.spacing(0.5)} ${theme.spacing(1)} ${theme.spacing(0.5)} ${theme.spacing(1.2)}
+ padding: ${theme.spacing(0.5)} ${theme.spacing(1)} ${theme.spacing(0.5)} ${theme.spacing(1.2)};
display: flex;
flex-direction: column;
// white-space: pre-line;
+ font-size: ${theme.typography.bodySmall.fontSize};
+ `,
+ problemDescription: css`
+ position: relative;
+ max-height: 6rem;
+ min-height: 3rem;
+ overflow: hidden;
+
+ &:after {
+ content: '';
+ text-align: right;
+ position: inherit;
+ bottom: 0;
+ right: 0;
+ width: 70%;
+ height: 1.5rem;
+ background: linear-gradient(to right, rgba(0, 0, 0, 0), ${theme.colors.background.canvas} 50%);
+ }
`,
});
diff --git a/src/panel-triggers/components/Problems/Problems.tsx b/src/panel-triggers/components/Problems/Problems.tsx
index 45955b0..ae275fc 100644
--- a/src/panel-triggers/components/Problems/Problems.tsx
+++ b/src/panel-triggers/components/Problems/Problems.tsx
@@ -245,6 +245,7 @@ export default class ProblemList extends PureComponent
(ProblemsPanel)
},
showIf: (options) => options.customLastChangeFormat,
})
+ .addBooleanSwitch({
+ path: 'allowDangerousHTML',
+ name: 'Allow HTML',
+ description: `Format problem description and other data as HTML. Use with caution, it's potential cross-site scripting (XSS) vulnerability.`,
+ defaultValue: defaultPanelOptions.allowDangerousHTML,
+ })
.addCustomEditor({
id: 'resetColumns',
path: 'resizedColumns',
diff --git a/src/panel-triggers/types.ts b/src/panel-triggers/types.ts
index 3ef6493..7951b0c 100644
--- a/src/panel-triggers/types.ts
+++ b/src/panel-triggers/types.ts
@@ -34,6 +34,7 @@ export interface ProblemsPanelOptions {
customLastChangeFormat?: boolean;
lastChangeFormat?: string;
resizedColumns?: RTResized;
+ allowDangerousHTML: boolean;
// Triggers severity and colors
triggerSeverity: TriggerSeverity[];
okEventColor: TriggerColor;
@@ -81,6 +82,7 @@ export const defaultPanelOptions: Partial = {
customLastChangeFormat: false,
lastChangeFormat: '',
resizedColumns: [],
+ allowDangerousHTML: false,
// Triggers severity and colors
triggerSeverity: getDefaultSeverity(),
okEventColor: 'rgb(56, 189, 113)',