Fix problem details layout, fixes #1252
This commit is contained in:
@@ -102,106 +102,110 @@ export class ProblemDetails extends PureComponent<ProblemDetailsProps, ProblemDe
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`problem-details-container ${displayClass}`}>
|
<div className={`problem-details-container ${displayClass}`}>
|
||||||
<div className="problem-details">
|
<div className="problem-details-head">
|
||||||
<div className="problem-details-row">
|
<div className="problem-actions-left">
|
||||||
<div className="problem-value-container">
|
<ExploreButton problem={problem} panelId={this.props.panelId} />
|
||||||
<div className="problem-age">
|
</div>
|
||||||
<FAIcon icon="clock-o" />
|
{problem.showAckButton &&
|
||||||
<span>{age}</span>
|
<div className="problem-actions">
|
||||||
|
<ModalController>
|
||||||
|
{({ showModal, hideModal }) => (
|
||||||
|
<ExecScriptButton
|
||||||
|
className="problem-action-button"
|
||||||
|
onClick={() => {
|
||||||
|
showModal(ExecScriptModal, {
|
||||||
|
getScripts: this.getScripts,
|
||||||
|
onSubmit: this.onExecuteScript,
|
||||||
|
onDismiss: hideModal,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</ModalController>
|
||||||
|
<ModalController>
|
||||||
|
{({ showModal, hideModal }) => (
|
||||||
|
<AckButton
|
||||||
|
className="problem-action-button"
|
||||||
|
onClick={() => {
|
||||||
|
showModal(AckModal, {
|
||||||
|
canClose: problem.manual_close === '1',
|
||||||
|
severity: problemSeverity,
|
||||||
|
onSubmit: this.ackProblem,
|
||||||
|
onDismiss: hideModal,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</ModalController>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<ProblemStatusBar problem={problem} alerts={alerts} className={compactStatusBar && 'compact'} />
|
||||||
|
</div>
|
||||||
|
<div className="problem-details-body">
|
||||||
|
<div className="problem-details">
|
||||||
|
<div className="problem-details-row">
|
||||||
|
<div className="problem-value-container">
|
||||||
|
<div className="problem-age">
|
||||||
|
<FAIcon icon="clock-o" />
|
||||||
|
<span>{age}</span>
|
||||||
|
</div>
|
||||||
|
{problem.items && <ProblemItems items={problem.items} />}
|
||||||
</div>
|
</div>
|
||||||
{problem.items && <ProblemItems items={problem.items} />}
|
|
||||||
</div>
|
</div>
|
||||||
<div className="problem-actions-left">
|
{problem.comments &&
|
||||||
<ExploreButton problem={problem} panelId={this.props.panelId} />
|
<div className="problem-description-row">
|
||||||
</div>
|
<div className="problem-description">
|
||||||
<ProblemStatusBar problem={problem} alerts={alerts} className={compactStatusBar && 'compact'} />
|
<Tooltip placement="right" content={problem.comments}>
|
||||||
{problem.showAckButton &&
|
<span className="description-label">Description: </span>
|
||||||
<div className="problem-actions">
|
</Tooltip>
|
||||||
<ModalController>
|
<span>{problem.comments}</span>
|
||||||
{({ showModal, hideModal }) => (
|
</div>
|
||||||
<ExecScriptButton
|
</div>
|
||||||
className="navbar-button navbar-button--settings"
|
}
|
||||||
onClick={() => {
|
{problem.tags && problem.tags.length > 0 &&
|
||||||
showModal(ExecScriptModal, {
|
<div className="problem-tags">
|
||||||
getScripts: this.getScripts,
|
{problem.tags && problem.tags.map(tag =>
|
||||||
onSubmit: this.onExecuteScript,
|
<EventTag
|
||||||
onDismiss: hideModal,
|
key={tag.tag + tag.value}
|
||||||
});
|
tag={tag}
|
||||||
}}
|
highlight={tag.tag === problem.correlation_tag}
|
||||||
/>
|
onClick={this.handleTagClick}
|
||||||
)}
|
/>)
|
||||||
</ModalController>
|
}
|
||||||
<ModalController>
|
</div>
|
||||||
{({ showModal, hideModal }) => (
|
}
|
||||||
<AckButton
|
{this.props.showTimeline && this.state.events.length > 0 &&
|
||||||
className="navbar-button navbar-button--settings"
|
<ProblemTimeline events={this.state.events} timeRange={this.props.timeRange} />
|
||||||
onClick={() => {
|
}
|
||||||
showModal(AckModal, {
|
{showAcknowledges && !wideLayout &&
|
||||||
canClose: problem.manual_close === '1',
|
<div className="problem-ack-container">
|
||||||
severity: problemSeverity,
|
<h6><FAIcon icon="reply-all" /> Acknowledges</h6>
|
||||||
onSubmit: this.ackProblem,
|
<AcknowledgesList acknowledges={problem.acknowledges} />
|
||||||
onDismiss: hideModal,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</ModalController>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{problem.comments &&
|
{showAcknowledges && wideLayout &&
|
||||||
<div className="problem-description-row">
|
<div className="problem-details-middle">
|
||||||
<div className="problem-description">
|
<div className="problem-ack-container">
|
||||||
<Tooltip placement="right" content={problem.comments}>
|
<h6><FAIcon icon="reply-all" /> Acknowledges</h6>
|
||||||
<span className="description-label">Description: </span>
|
<AcknowledgesList acknowledges={problem.acknowledges} />
|
||||||
</Tooltip>
|
|
||||||
<span>{problem.comments}</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
{problem.tags && problem.tags.length > 0 &&
|
<div className="problem-details-right">
|
||||||
<div className="problem-tags">
|
|
||||||
{problem.tags && problem.tags.map(tag =>
|
|
||||||
<EventTag
|
|
||||||
key={tag.tag + tag.value}
|
|
||||||
tag={tag}
|
|
||||||
highlight={tag.tag === problem.correlation_tag}
|
|
||||||
onClick={this.handleTagClick}
|
|
||||||
/>)
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
{this.props.showTimeline && this.state.events.length > 0 &&
|
|
||||||
<ProblemTimeline events={this.state.events} timeRange={this.props.timeRange} />
|
|
||||||
}
|
|
||||||
{showAcknowledges && !wideLayout &&
|
|
||||||
<div className="problem-ack-container">
|
|
||||||
<h6><FAIcon icon="reply-all" /> Acknowledges</h6>
|
|
||||||
<AcknowledgesList acknowledges={problem.acknowledges} />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
{showAcknowledges && wideLayout &&
|
|
||||||
<div className="problem-details-middle">
|
|
||||||
<div className="problem-ack-container">
|
|
||||||
<h6><FAIcon icon="reply-all" /> Acknowledges</h6>
|
|
||||||
<AcknowledgesList acknowledges={problem.acknowledges} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
<div className="problem-details-right">
|
|
||||||
<div className="problem-details-right-item">
|
|
||||||
<FAIcon icon="database" />
|
|
||||||
<span>{problem.datasource}</span>
|
|
||||||
</div>
|
|
||||||
{problem.proxy &&
|
|
||||||
<div className="problem-details-right-item">
|
<div className="problem-details-right-item">
|
||||||
<FAIcon icon="cloud" />
|
<FAIcon icon="database" />
|
||||||
<span>{problem.proxy}</span>
|
<span>{problem.datasource}</span>
|
||||||
</div>
|
</div>
|
||||||
}
|
{problem.proxy &&
|
||||||
{problem.groups && <ProblemGroups groups={problem.groups} className="problem-details-right-item" />}
|
<div className="problem-details-right-item">
|
||||||
{problem.hosts && <ProblemHosts hosts={problem.hosts} className="problem-details-right-item" />}
|
<FAIcon icon="cloud" />
|
||||||
|
<span>{problem.proxy}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{problem.groups && <ProblemGroups groups={problem.groups} className="problem-details-right-item" />}
|
||||||
|
{problem.hosts && <ProblemHosts hosts={problem.hosts} className="problem-details-right-item" />}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -215,6 +215,7 @@
|
|||||||
|
|
||||||
.problem-details-container {
|
.problem-details-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
background-color: $problem-details-background;
|
background-color: $problem-details-background;
|
||||||
border-bottom-width: 0px;
|
border-bottom-width: 0px;
|
||||||
@@ -227,7 +228,7 @@
|
|||||||
transition-property: opacity, max-height;
|
transition-property: opacity, max-height;
|
||||||
|
|
||||||
&.show {
|
&.show {
|
||||||
max-height: 20rem;
|
max-height: 23rem;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
box-shadow: inset -3px 3px 10px $problem-container-shadow;
|
box-shadow: inset -3px 3px 10px $problem-container-shadow;
|
||||||
}
|
}
|
||||||
@@ -244,6 +245,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.problem-details-head {
|
||||||
|
display: flex;
|
||||||
|
padding: 0.5rem 1rem 0.5rem 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.problem-details-body {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
.problem-details {
|
.problem-details {
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 10 1 auto;
|
flex: 10 1 auto;
|
||||||
@@ -256,7 +266,8 @@
|
|||||||
|
|
||||||
.problem-description {
|
.problem-description {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 4.5rem;
|
max-height: 4.5rem;
|
||||||
|
min-height: 3rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
&:after {
|
&:after {
|
||||||
@@ -358,7 +369,11 @@
|
|||||||
|
|
||||||
.problem-actions {
|
.problem-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-left: 1.6rem;
|
margin-right: 1.6rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.problem-action-button {
|
||||||
|
margin-right: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.problem-actions-left {
|
.problem-actions-left {
|
||||||
@@ -376,6 +391,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.problem-ack-container {
|
.problem-ack-container {
|
||||||
|
max-height: 8rem;
|
||||||
margin-top: 0.6rem;
|
margin-top: 0.6rem;
|
||||||
margin-left: -0.6rem;
|
margin-left: -0.6rem;
|
||||||
padding: 1.2rem 0.6rem;
|
padding: 1.2rem 0.6rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user