Refactor db and local-cache code

Separated cwmp and ui code into distinct files to enhance clarity and
maintainability with varied internal data representations.
This commit is contained in:
Zaid Humaimidi committed 2023-09-29 14:55:44 -07:00
1 parent 493f1d2f37
commit c3954c277f
31 files changed
+1542 -1530

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@ import { m } from "../components";
import * as notifications from "../notifications";
import * as store from "../store";
import { getIcon } from "../icons";
import { decodeTag } from "../../lib/common";
import { decodeTag } from "../../lib/util";
const component: ClosureComponent = (): Component => {
return {
+1 -1
View File
@@ -22,7 +22,7 @@ import { parse, stringify, map } from "../lib/common/expression/parser";
import memoize from "../lib/common/memoize";
import Autocomplete from "./autocomplete-compnent";
import * as smartQuery from "./smart-query";
import { validQuery } from "../lib/mongodb-functions";
import { validQuery } from "../lib/db/synth";
import { Expression } from "../lib/types";
const getAutocomplete = memoize((resource) => {
+1 -1
View File
@@ -19,7 +19,7 @@
import config from "./config";
import { Expression } from "../lib/types";
import { encodeTag } from "../lib/common";
import { encodeTag } from "../lib/util";
const resources = {
devices: {},
+2 -2
View File
@@ -21,7 +21,7 @@ import m from "mithril";
import { stringify } from "../lib/common/expression/parser";
import { or, and, evaluate } from "../lib/common/expression/util";
import memoize from "../lib/common/memoize";
import { QueryOptions, Expression, Task } from "../lib/types";
import { Expression, Task } from "../lib/types";
import * as notifications from "./notifications";
import { configSnapshot, genieacsVersion } from "./config";
import { QueueTask } from "./task-queue";
@@ -342,7 +342,7 @@ function inferQuery(resourceType, queryResponse): void {
export function fetch(
resourceType: string,
filter: Expression,
options: QueryOptions = {}
options: { limit?: number; sort?: { [param: string]: number } } = {}
): QueryResponse {
const filterStr = memoizedStringify(filter);
const sort = Object.assign({}, options.sort);