Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tavern/internal/www/build/asset-manifest.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tavern/internal/www/build/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useFilters } from "../../../context/FilterContext";
const AccessHostActivityTable = ({ hostActivity, term }: { hostActivity: any, term: string }) => {
const currentDate = new Date();
const navigation = useNavigate();
const { filters, updateFilters } = useFilters();
const { filters, updateFilters, setIsLocked } = useFilters();

const handleOnClick = (item: any) => {
if (item?.id === "undefined") {
Expand All @@ -20,11 +20,12 @@ const AccessHostActivityTable = ({ hostActivity, term }: { hostActivity: any, te
const newFilter = {
'label': item?.original?.tag,
'kind': term,
'name': item?.original?.tag,
'name': item?.original?.tagId,
'value': item?.original?.tagId,
'id': item?.original?.tagId
};
updateFilters({ 'beaconFields': [...filters.beaconFields, newFilter] })
setIsLocked(true);
updateFilters({ 'beaconFields': [...filters.beaconFields, newFilter]})
}
navigation(`/hosts`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useFilters } from '../../../context/FilterContext';

const TagBarChart = ({ data, loading, tagKind, children }: { data: Array<any>, loading: boolean, tagKind: string, children?: React.ReactNode }) => {
const navigation = useNavigate();
const { filters, updateFilters } = useFilters();
const { filters, updateFilters, setIsLocked } = useFilters();

if (loading) {
return <EmptyState type={EmptyStateType.loading} label="Formatting group data..." />
Expand All @@ -30,6 +30,7 @@ const TagBarChart = ({ data, loading, tagKind, children }: { data: Array<any>, l
'value': item?.id,
'id': item?.id
};
setIsLocked(true);
updateFilters({ 'beaconFields': [...filters.beaconFields, newFilter] })
}
navigation("/quests")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const useDashboardData = (): UseDashboardDataReturn => {
field: "CREATED_AT"
}],
},
fetchPolicy: 'cache-and-network',
notifyOnNetworkStatusChange: true,
});

Expand All @@ -26,6 +27,7 @@ export const useDashboardData = (): UseDashboardDataReturn => {
data: hostData,
error: hostError
} = useQuery<HostQueryTopLevel>(GET_HOST_QUERY, {
fetchPolicy: 'cache-and-network',
notifyOnNetworkStatusChange: true,
});

Expand Down
5 changes: 3 additions & 2 deletions tavern/internal/www/src/pages/dashboard/hook/useHostData.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { isAfter } from "date-fns";
import { useCallback, useEffect, useState } from "react";

import { getOfflineOnlineStatus } from "../../../utils/utils";
import { getEnumKey, getOfflineOnlineStatus } from "../../../utils/utils";
import { HostEdge, HostQueryTopLevel, TagEdge } from "../../../utils/interfacesQuery";
import { SupportedPlatforms } from "../../../utils/enums";

type UniqueCountHost = {
tagId: string,
Expand Down Expand Up @@ -102,7 +103,7 @@ export const useHostData = (data: HostQueryTopLevel | undefined) => {

applyUniqueTermData(groupTag?.name, groupTag?.id, uniqueGroups, host, beaconStatus);
applyUniqueTermData(serviceTag?.name, serviceTag?.id, uniqueServices, host, beaconStatus);
applyUniqueTermData(host.node.platform, host.node.platform, uniquePlatform, host, beaconStatus);
applyUniqueTermData(getEnumKey(SupportedPlatforms, host.node.platform), host.node.platform, uniquePlatform, host, beaconStatus);
});

setHostActivity(
Expand Down
2 changes: 1 addition & 1 deletion tavern/internal/www/src/utils/constructQueryUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export function constructHostTaskFilterQuery(
const createRecentlyLostQuery = (currentTimestamp: Date) => ({
and: [
{ nextSeenAtGTE: sub(currentTimestamp, { minutes: 5 }).toISOString() },
{ nextSeenAtLT: sub(currentTimestamp, { seconds: 15 }).toISOString() }
{ nextSeenAtLT: sub(currentTimestamp, { seconds: 30 }).toISOString() }
]
});

Expand Down
Loading