Add loading spinner to host details' scripts tab (#15607)

This commit is contained in:
Luke Heath 2023-12-12 16:34:53 -06:00 committed by GitHub
parent 0967256cce
commit 6ee5d87d48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1 @@
- Fixed loading indicator not appearing on host details' scripts tab.

View file

@ -15,6 +15,7 @@ import Card from "components/Card";
import TableContainer from "components/TableContainer";
import EmptyTable from "components/EmptyTable";
import DataError from "components/DataError";
import Spinner from "components/Spinner";
import { ITableQueryData } from "components/TableContainer/TableContainer";
import { IHost } from "interfaces/host";
import { IUser } from "interfaces/user";
@ -102,12 +103,14 @@ const Scripts = ({
return (
<Card className={baseClass} borderRadiusSize="large" includeShadow>
<h2>Scripts</h2>
{data && data.length === 0 ? (
{isLoadingScriptData && <Spinner />}
{!isLoadingScriptData && data && data.length === 0 && (
<EmptyTable
header="No scripts are available for this host"
info="Expecting to see scripts? Try selecting “Refetch” to ask this host to report new vitals."
/>
) : (
)}
{!isLoadingScriptData && data && data.length > 0 && (
<TableContainer
resultsTitle=""
emptyComponent={() => <></>}