Fix some types after refactoring on main branch.
This commit is contained in:
parent
d53e45cd81
commit
edc5c20fdb
3 changed files with 11 additions and 10 deletions
|
@ -202,7 +202,7 @@ function buildNodesFilter(): NodesFilter {
|
|||
return nodesFilter;
|
||||
}
|
||||
|
||||
let lastSearchTimestamp: UnixTimestampMilliseconds = 0;
|
||||
let lastSearchTimestamp: UnixTimestampMilliseconds = 0 as UnixTimestampMilliseconds;
|
||||
let searchTimeout: NodeJS.Timeout | undefined = undefined;
|
||||
let lastSearchTerm = "";
|
||||
|
||||
|
@ -221,7 +221,8 @@ function doThrottledSearch(): void {
|
|||
return
|
||||
}
|
||||
|
||||
const now: UnixTimestampMilliseconds = Date.now();
|
||||
// TODO: Share utils.
|
||||
const now: UnixTimestampMilliseconds = Date.now() as UnixTimestampMilliseconds;
|
||||
if (now - SEARCH_THROTTLE_DELAY_MS >= lastSearchTimestamp) {
|
||||
lastSearchTimestamp = now;
|
||||
doSearch();
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import {defineStore} from "pinia";
|
||||
import {type EnhancedNode, isEnhancedNode, type NodesFilter, NodeSortField, SortDirection} from "@/types";
|
||||
import {type DomainSpecificNodeResponse, isDomainSpecificNodeResponse, type NodesFilter, NodeSortField, SortDirection} from "@/types";
|
||||
import {internalApi} from "@/utils/Api";
|
||||
|
||||
interface NodesStoreState {
|
||||
nodes: EnhancedNode[];
|
||||
nodes: DomainSpecificNodeResponse[];
|
||||
page: number;
|
||||
nodesPerPage: number;
|
||||
totalNodes: number;
|
||||
|
@ -24,7 +24,7 @@ export const useNodesStore = defineStore({
|
|||
};
|
||||
},
|
||||
getters: {
|
||||
getNodes(state: NodesStoreState): EnhancedNode[] {
|
||||
getNodes(state: NodesStoreState): DomainSpecificNodeResponse[] {
|
||||
return state.nodes;
|
||||
},
|
||||
|
||||
|
@ -55,9 +55,9 @@ export const useNodesStore = defineStore({
|
|||
if (searchTerm) {
|
||||
query.q = searchTerm;
|
||||
}
|
||||
const result = await internalApi.getPagedList<EnhancedNode, NodeSortField>(
|
||||
const result = await internalApi.getPagedList<DomainSpecificNodeResponse, NodeSortField>(
|
||||
"nodes",
|
||||
isEnhancedNode,
|
||||
isDomainSpecificNodeResponse,
|
||||
page,
|
||||
nodesPerPage,
|
||||
sortDirection,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import {useNodesStore} from "@/stores/nodes";
|
||||
import {onMounted, ref, watch} from "vue";
|
||||
import type {EnhancedNode, MAC, NodesFilter} from "@/types";
|
||||
import type {DomainSpecificNodeResponse, MAC, NodesFilter} from "@/types";
|
||||
import {NodeSortField, SortDirection} from "@/types";
|
||||
import Pager from "@/components/Pager.vue";
|
||||
import LoadingContainer from "@/components/LoadingContainer.vue";
|
||||
|
@ -51,7 +51,7 @@ function redactAllFields(shallRedactFields: boolean): void {
|
|||
nodesRedactFieldsMap.value = {};
|
||||
}
|
||||
|
||||
function shallRedactField(node: EnhancedNode, field: NodeRedactField): boolean {
|
||||
function shallRedactField(node: DomainSpecificNodeResponse, field: NodeRedactField): boolean {
|
||||
const redactFieldsMap = nodesRedactFieldsMap.value[node.mac];
|
||||
if (!redactFieldsMap) {
|
||||
return redactFieldsByDefault.value;
|
||||
|
@ -60,7 +60,7 @@ function shallRedactField(node: EnhancedNode, field: NodeRedactField): boolean {
|
|||
return redactField === undefined ? redactFieldsByDefault.value : redactField;
|
||||
}
|
||||
|
||||
function setRedactField(node: EnhancedNode, field: NodeRedactField, value: boolean): void {
|
||||
function setRedactField(node: DomainSpecificNodeResponse, field: NodeRedactField, value: boolean): void {
|
||||
let redactFieldsMap = nodesRedactFieldsMap.value[node.mac];
|
||||
if (!redactFieldsMap) {
|
||||
redactFieldsMap = {};
|
||||
|
|
Loading…
Reference in a new issue