diff --git a/api/lib/models/Layer.ts b/api/lib/models/Layer.ts index ed91a5dc2..1386aabf6 100644 --- a/api/lib/models/Layer.ts +++ b/api/lib/models/Layer.ts @@ -48,6 +48,25 @@ export default class LayerModel extends Modeler { super(pool, Layer); } + async tasks(): Promise { + const pgres = await this.pool + .select({ + task: Layer.task + }) + .from(Layer) + + if (pgres.length === 0) { + return [] + } else { + const taskSet: Set = new Set(); + for (const t of pgres) { + taskSet.add(t.task.replace(/-v\d+\.\d+\.\d+/, '')) + } + + return Array.from(taskSet); + } + } + async augmented_list(query: GenericListInput = {}): Promise>> { const order = query.order && query.order === 'desc' ? desc : asc; const orderBy = order(query.sort ? this.key(query.sort) : this.requiredPrimaryKey()); diff --git a/api/routes/internal.ts b/api/routes/internal.ts index df0378e13..9a6d61ff5 100644 --- a/api/routes/internal.ts +++ b/api/routes/internal.ts @@ -25,11 +25,13 @@ export default async function router(schema: Schema, config: Config) { order: Default.Order, sort: Type.Optional(Type.String({default: 'created', enum: Object.keys(Layer)})), filter: Default.Filter, + task: Type.Optional(Type.String()), data: Type.Optional(Type.Integer({ minimum: 1 })), connection: Type.Optional(Type.Integer({ minimum: 1 })), }), res: Type.Object({ total: Type.Integer(), + tasks: Type.Array(Type.String()), status: Type.Object({ healthy: Type.Integer(), alarm: Type.Integer(), @@ -50,6 +52,7 @@ export default async function router(schema: Schema, config: Config) { name ~* ${req.query.filter} AND (${Param(req.query.connection)}::BIGINT IS NULL OR ${Param(req.query.connection)}::BIGINT = layers.connection) AND (${Param(req.query.data)}::BIGINT IS NULL OR ${Param(req.query.data)}::BIGINT = layers.data) + AND (${Param(req.query.task)}::TEXT IS NULL OR Starts_With(layers.task, ${Param(req.query.task)}::TEXT)) ` }); @@ -65,6 +68,7 @@ export default async function router(schema: Schema, config: Config) { res.json({ status, total: list.total, + tasks: await config.models.Layer.tasks(), items: list.items.map((layer) => { return { status: alarms.get(layer.id) || 'unknown', diff --git a/api/web/package-lock.json b/api/web/package-lock.json index bd9b6bad7..2399ede9e 100644 --- a/api/web/package-lock.json +++ b/api/web/package-lock.json @@ -3198,9 +3198,9 @@ } }, "node_modules/@tak-ps/vue-tabler": { - "version": "3.51.3", - "resolved": "https://registry.npmjs.org/@tak-ps/vue-tabler/-/vue-tabler-3.51.3.tgz", - "integrity": "sha512-n+noJjeqFk8I+CAygmbyjUi84ME+VxL7j7jZngirhy2klZdfRhVVHW9m5dyEGsv5hvteSLS1GgNchBpKucl8MA==", + "version": "3.51.4", + "resolved": "https://registry.npmjs.org/@tak-ps/vue-tabler/-/vue-tabler-3.51.4.tgz", + "integrity": "sha512-Z8VKO7IKCfIuMuwFLLW531AjBiGxgb+ro2F4HUPTOfsg+4LO/mn/OzodHAZC0EOsopqO7wLVcbyax22BoFRLIQ==", "dev": true, "license": "ISC", "dependencies": { @@ -3789,68 +3789,68 @@ } }, "node_modules/@volar/language-core": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.1.tgz", - "integrity": "sha512-9AKhC7Qn2mQYxj7Dz3bVxeOk7gGJladhWixUYKef/o0o7Bm4an+A3XvmcTHVqZ8stE6lBVH++g050tBtJ4TZPQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.2.tgz", + "integrity": "sha512-sONt5RLvLL1SlBdhyUSthZzuKePbJ7DwFFB9zT0eyWpDl+v7GXGh/RkPxxWaR22bIhYtTzp4Ka1MWatl/53Riw==", "dev": true, "license": "MIT", "dependencies": { - "@volar/source-map": "2.4.1" + "@volar/source-map": "2.4.2" } }, "node_modules/@volar/source-map": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.1.tgz", - "integrity": "sha512-Xq6ep3OZg9xUqN90jEgB9ztX5SsTz1yiV8wiQbcYNjWkek+Ie3dc8l7AVt3EhDm9mSIR58oWczHkzM2H6HIsmQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.2.tgz", + "integrity": "sha512-qiGfGgeZ5DEarPX3S+HcFktFCjfDrFPCXKeXNbrlB7v8cvtPRm8YVwoXOdGG1NhaL5rMlv5BZPVQyu4EdWWIvA==", "dev": true, "license": "MIT" }, "node_modules/@volar/typescript": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.1.tgz", - "integrity": "sha512-UoRzC0PXcwajFQTu8XxKSYNsWNBtVja6Y9gC8eLv7kYm+UEKJCcZ8g7dialsOYA0HKs3Vpg57MeCsawFLC6m9Q==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.2.tgz", + "integrity": "sha512-m2uZduhaHO1SZuagi30OsjI/X1gwkaEAC+9wT/nCNAtJ5FqXEkKvUncHmffG7ESDZPlFFUBK4vJ0D9Hfr+f2EA==", "dev": true, "license": "MIT", "dependencies": { - "@volar/language-core": "2.4.1", + "@volar/language-core": "2.4.2", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "node_modules/@vue/compiler-core": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.0.tgz", - "integrity": "sha512-ja7cpqAOfw4tyFAxgBz70Z42miNDeaqTxExTsnXDLomRpqfyCgyvZvFp482fmsElpfvsoMJUsvzULhvxUTW6Iw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.1.tgz", + "integrity": "sha512-WdjF+NSgFYdWttHevHw5uaJFtKPalhmxhlu2uREj8cLP0uyKKIR60/JvSZNTp0x+NSd63iTiORQTx3+tt55NWQ==", "license": "MIT", "dependencies": { "@babel/parser": "^7.25.3", - "@vue/shared": "3.5.0", + "@vue/shared": "3.5.1", "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.2.0" } }, "node_modules/@vue/compiler-dom": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.0.tgz", - "integrity": "sha512-xYjUybWZXl+1R/toDy815i4PbeehL2hThiSGkcpmIOCy2HoYyeeC/gAWK/Y/xsoK+GSw198/T5O31bYuQx5uvQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.1.tgz", + "integrity": "sha512-Ao23fB1lINo18HLCbJVApvzd9OQe8MgmQSgyY5+umbWj2w92w9KykVmJ4Iv2US5nak3ixc2B+7Km7JTNhQ8kSQ==", "license": "MIT", "dependencies": { - "@vue/compiler-core": "3.5.0", - "@vue/shared": "3.5.0" + "@vue/compiler-core": "3.5.1", + "@vue/shared": "3.5.1" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.0.tgz", - "integrity": "sha512-B9DgLtrqok2GLuaFjLlSL15ZG3ZDBiitUH1ecex9guh/ZcA5MCdwuVE6nsfQxktuZY/QY0awJ35/ripIviCQTQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.1.tgz", + "integrity": "sha512-DFizMNH8eDglLhlfwJ0+ciBsztaYe3fY/zcZjrqL1ljXvUw/UpC84M1d7HpBTCW68SNqZyIxrs1XWmf+73Y65w==", "license": "MIT", "dependencies": { "@babel/parser": "^7.25.3", - "@vue/compiler-core": "3.5.0", - "@vue/compiler-dom": "3.5.0", - "@vue/compiler-ssr": "3.5.0", - "@vue/shared": "3.5.0", + "@vue/compiler-core": "3.5.1", + "@vue/compiler-dom": "3.5.1", + "@vue/compiler-ssr": "3.5.1", + "@vue/shared": "3.5.1", "estree-walker": "^2.0.2", "magic-string": "^0.30.11", "postcss": "^8.4.44", @@ -3858,13 +3858,13 @@ } }, "node_modules/@vue/compiler-ssr": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.0.tgz", - "integrity": "sha512-E263QZmA1dqRd7c3u/sWTLRMpQOT0aZ8av/L9SoD/v/BVMZaWFHPUUBswS+bzrfvG2suJF8vSLKx6k6ba5SUdA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.1.tgz", + "integrity": "sha512-C1hpSHQgRM8bg+5XWWD7CkFaVpSn9wZHCLRd10AmxqrH17d4EMP6+XcZpwBOM7H1jeStU5naEapZZWX0kso1tQ==", "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.5.0", - "@vue/shared": "3.5.0" + "@vue/compiler-dom": "3.5.1", + "@vue/shared": "3.5.1" } }, "node_modules/@vue/compiler-vue2": { @@ -3885,9 +3885,9 @@ "license": "MIT" }, "node_modules/@vue/language-core": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.1.4.tgz", - "integrity": "sha512-i8pfAgNjTNjabBX1xRsuV6aRw2E8bdQXwd5H8m3cUkTVJju3QN5nfdoXET0uK+yXsuloNJPzo6PXFujRRPNmMA==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-2.1.6.tgz", + "integrity": "sha512-MW569cSky9R/ooKMh6xa2g1D0AtRKbL56k83dzus/bx//RDJk24RHWkMzbAlXjMdDNyxAaagKPRquBIxkxlCkg==", "dev": true, "license": "MIT", "dependencies": { @@ -3936,53 +3936,53 @@ } }, "node_modules/@vue/reactivity": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.0.tgz", - "integrity": "sha512-Ew3F5riP3B3ZDGjD3ZKb9uZylTTPSqt8hAf4sGbvbjrjDjrFb3Jm15Tk1/w7WwTE5GbQ2Qhwxx1moc9hr8A/OQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.1.tgz", + "integrity": "sha512-aFE1nMDfbG7V+U5vdOk/NXxH/WX78XuAfX59vWmCM7Ao4lieoc83RkzOAWun61sQXlzNZ4IgROovFBHg+Iz1+Q==", "license": "MIT", "dependencies": { - "@vue/shared": "3.5.0" + "@vue/shared": "3.5.1" } }, "node_modules/@vue/runtime-core": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.0.tgz", - "integrity": "sha512-mQyW0F9FaNRdt8ghkAs+BMG3iQ7LGgWKOpkzUzR5AI5swPNydHGL5hvVTqFaeMzwecF1g0c86H4yFQsSxJhH1w==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.1.tgz", + "integrity": "sha512-Ce92CCholNRHR3ZtzpRp/7CDGIPFxQ7ElXt9iH91ilK5eOrUv3Z582NWJesuM3aYX71BujVG5/4ypUxigGNxjA==", "license": "MIT", "dependencies": { - "@vue/reactivity": "3.5.0", - "@vue/shared": "3.5.0" + "@vue/reactivity": "3.5.1", + "@vue/shared": "3.5.1" } }, "node_modules/@vue/runtime-dom": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.0.tgz", - "integrity": "sha512-NQQXjpdXgyYVJ2M56FJ+lSJgZiecgQ2HhxhnQBN95FymXegRNY/N2htI7vOTwpP75pfxhIeYOJ8mE8sW8KAW6A==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.1.tgz", + "integrity": "sha512-B/fUJfBLp5PwE0EWNfBYnA4JUea8Yufb3wN8fN0/HzaqBdkiRHh4sFHOjWqIY8GS75gj//8VqeEqhcU6yUjIkA==", "license": "MIT", "dependencies": { - "@vue/reactivity": "3.5.0", - "@vue/runtime-core": "3.5.0", - "@vue/shared": "3.5.0", + "@vue/reactivity": "3.5.1", + "@vue/runtime-core": "3.5.1", + "@vue/shared": "3.5.1", "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.0.tgz", - "integrity": "sha512-HyDIFUg+l7L4PKrEnJlCYWHUOlm6NxZhmSxIefZ5MTYjkIPfDfkwhX7hqxAQHfgIAE1uLMLQZwuNR/ozI0NhZg==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.1.tgz", + "integrity": "sha512-C5V/fjQTitgVaRNH5wCoHynaWysjZ+VH68drNsAvQYg4ArHsZUQNz0nHoEWRj41nzqkVn2RUlnWaEOTl2o1Ppg==", "license": "MIT", "dependencies": { - "@vue/compiler-ssr": "3.5.0", - "@vue/shared": "3.5.0" + "@vue/compiler-ssr": "3.5.1", + "@vue/shared": "3.5.1" }, "peerDependencies": { - "vue": "3.5.0" + "vue": "3.5.1" } }, "node_modules/@vue/shared": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.0.tgz", - "integrity": "sha512-m9IgiteBpCkFaMNwCOBkFksA7z8QiKc30ooRuoXWUFRDu0mGyNPlFHmbncF0/Kra1RlX8QrmBbRaIxVvikaR0Q==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.1.tgz", + "integrity": "sha512-NdcTRoO4KuW2RSFgpE2c+E/R/ZHaRzWPxAGxhmxZaaqLh6nYCXx7lc9a88ioqOCxCaV2SFJmujkxbUScW7dNsQ==", "license": "MIT" }, "node_modules/@yr/monotone-cubic-spline": { @@ -4499,6 +4499,13 @@ "node": ">=4" } }, + "node_modules/change-case": { + "version": "5.4.4", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "dev": true, + "license": "MIT" + }, "node_modules/chokidar": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", @@ -7286,14 +7293,15 @@ } }, "node_modules/openapi-typescript": { - "version": "7.3.3", - "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.3.3.tgz", - "integrity": "sha512-NkUBI8fr5mg/3s001UPfUiBpKmHtSjkvFQO/IipCrQal5d5nGFoev1OXdxr7J9PHTswrAqU2hKdpoCL6OnammA==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-7.4.0.tgz", + "integrity": "sha512-u4iVuTGkzKG4rHFUMA/IFXTks9tYVQzkowZsScMOdzJSvIF10qSNySWHTwnN2fD+MEeWFAM8i1f3IUBlgS92eQ==", "dev": true, "license": "MIT", "dependencies": { "@redocly/openapi-core": "^1.16.0", "ansi-colors": "^4.1.3", + "change-case": "^5.4.4", "parse-json": "^8.1.0", "supports-color": "^9.4.0", "yargs-parser": "^21.1.1" @@ -7616,9 +7624,9 @@ } }, "node_modules/postcss": { - "version": "8.4.44", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.44.tgz", - "integrity": "sha512-Aweb9unOEpQ3ezu4Q00DPvvM2ZTUitJdNKeP/+uQgr1IBIqu574IaZoURId7BKtWMREwzKa9OgzPzezWGPWFQw==", + "version": "8.4.45", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz", + "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==", "funding": [ { "type": "opencollective", @@ -8069,9 +8077,9 @@ } }, "node_modules/sass": { - "version": "1.77.8", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.77.8.tgz", - "integrity": "sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ==", + "version": "1.78.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.78.0.tgz", + "integrity": "sha512-AaIqGSrjo5lA2Yg7RvFZrlXDBCp3nV4XP73GrLGvdRWWwk+8H3l0SDvq/5bA4eF+0RFPLuWUk3E+P1U/YqnpsQ==", "license": "MIT", "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -9373,13 +9381,13 @@ } }, "node_modules/vite-plugin-pwa": { - "version": "0.20.3", - "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.20.3.tgz", - "integrity": "sha512-aqCOWWSwfX4o6H+6NyEvhzFs3eENBqYFKUK4FYx5OZ3jGio73BE189bPz9+BBgjHBLozldQVSmZTHySVC2zNkg==", + "version": "0.20.5", + "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.20.5.tgz", + "integrity": "sha512-aweuI/6G6n4C5Inn0vwHumElU/UEpNuO+9iZzwPZGTCH87TeZ6YFMrEY6ZUBQdIHHlhTsbMDryFARcSuOdsz9Q==", "dev": true, "license": "MIT", "dependencies": { - "debug": "^4.3.4", + "debug": "^4.3.6", "pretty-bytes": "^6.1.1", "tinyglobby": "^0.2.0", "workbox-build": "^7.1.0", @@ -9392,7 +9400,7 @@ "url": "https://github.com/sponsors/antfu" }, "peerDependencies": { - "@vite-pwa/assets-generator": "^0.2.4", + "@vite-pwa/assets-generator": "^0.2.6", "vite": "^3.1.0 || ^4.0.0 || ^5.0.0", "workbox-build": "^7.1.0", "workbox-window": "^7.1.0" @@ -9422,16 +9430,16 @@ } }, "node_modules/vue": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.0.tgz", - "integrity": "sha512-1t70favYoFijwfWJ7g81aTd32obGaAnKYE9FNyMgnEzn3F4YncRi/kqAHHKloG0VXTD8vBYMhbgLKCA+Sk6QDw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.1.tgz", + "integrity": "sha512-k4UNnbPOEskodSxMtv+B9GljdB0C9ubZDOmW6vnXVGIfMqmEsY2+ohasjGguhGkMkrcP/oOrbH0dSD41x5JQFw==", "license": "MIT", "dependencies": { - "@vue/compiler-dom": "3.5.0", - "@vue/compiler-sfc": "3.5.0", - "@vue/runtime-dom": "3.5.0", - "@vue/server-renderer": "3.5.0", - "@vue/shared": "3.5.0" + "@vue/compiler-dom": "3.5.1", + "@vue/compiler-sfc": "3.5.1", + "@vue/runtime-dom": "3.5.1", + "@vue/server-renderer": "3.5.1", + "@vue/shared": "3.5.1" }, "peerDependencies": { "typescript": "*" @@ -9558,14 +9566,14 @@ } }, "node_modules/vue-tsc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.1.4.tgz", - "integrity": "sha512-XTzMXQcsixAvNbpou/9qngEsZawaiJRZH3Ja+lfgRfv2A1TJv9vnZ/Kyv7XxPqv/TaZVFSnjGpM87VbWIg6yQg==", + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-2.1.6.tgz", + "integrity": "sha512-f98dyZp5FOukcYmbFpuSCJ4Z0vHSOSmxGttZJCsFeX0M4w/Rsq0s4uKXjcSRsZqsRgQa6z7SfuO+y0HVICE57Q==", "dev": true, "license": "MIT", "dependencies": { "@volar/typescript": "~2.4.1", - "@vue/language-core": "2.1.4", + "@vue/language-core": "2.1.6", "semver": "^7.5.4" }, "bin": { diff --git a/api/web/src/components/Admin/AdminLayers.vue b/api/web/src/components/Admin/AdminLayers.vue index c08d68149..1bddfc687 100644 --- a/api/web/src/components/Admin/AdminLayers.vue +++ b/api/web/src/components/Admin/AdminLayers.vue @@ -24,11 +24,21 @@
- +
+
+ +
+
+ +
+