Disable "Refetch" button for offline hosts (#799)

- Disable "Refetch" button if the host is offline
- Disable the refetch tooltip if the host is in the `refetch_requested` state.
This commit is contained in:
noahtalerman
2021-05-18 18:02:39 -04:00
committed by GitHub
parent c965e93339
commit 27cfe19ac2
7 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -5,5 +5,5 @@
justify-content: center;
position: relative;
min-height: 100vh;
background-color: $gradients-dark-gradient;
background-color: $gradients-dark-gradient-vertical;
}
@@ -3,7 +3,7 @@
cursor: pointer;
&--selected {
background-color: $ui-vibrant-blue-10;
background-color: $ui-vibrant-blue-25;
}
&:focus {
@@ -11,7 +11,7 @@
}
&--selected {
background-color: $ui-vibrant-blue-10;
background-color: $ui-vibrant-blue-25;
}
&:hover {
@@ -8,6 +8,6 @@
}
&--selected {
background-color: $ui-vibrant-blue-10;
background-color: $ui-vibrant-blue-25;
}
}
@@ -13,7 +13,7 @@ $base-class: "panel-group-item";
&.#{$base-class}--selected {
font-weight: $bold;
background-color: $ui-vibrant-blue-10;
background-color: $ui-vibrant-blue-25;
.#{$base-class}__count {
font-weight: $bold;
@@ -218,7 +218,7 @@ export class HostDetailsPage extends Component {
backgroundColor="#3e4771"
>
<span className={`${baseClass}__tooltip-text`}>
You cant query <br /> a offline host.
You cant query <br /> an offline host.
</span>
</ReactTooltip>
<Button onClick={toggleDeleteHostModal()} variant="active">
@@ -380,7 +380,7 @@ export class HostDetailsPage extends Component {
className="refetch"
data-tip
data-for="refetch-tooltip"
data-tip-disable={isOnline}
data-tip-disable={isOnline || showRefetchLoadingSpinner}
>
<Button
className={`
@@ -389,6 +389,7 @@ export class HostDetailsPage extends Component {
${isOffline ? "refetch-offline" : ""}
${showRefetchLoadingSpinner ? "refetch-spinner" : "refetch-btn"}
`}
disabled={isOffline}
onClick={onRefetchHost}
>
{showRefetchLoadingSpinner
@@ -527,7 +528,7 @@ export class HostDetailsPage extends Component {
</span>
<span className="info__header">Updated at</span>
<span className="info__data">
{humanHostLastSeen(aboutData.seen_time)}
{humanHostLastSeen(titleData.detail_updated_at)}
</span>
<span className="info__header">Uptime</span>
<span className="info__data">
+1 -1
View File
@@ -46,7 +46,7 @@ a {
}
.wrapper {
background: $gradients-dark-gradient;
background: $gradients-dark-gradient-vertical;
margin: 0;
}