diff --git a/api/src/services/server.ts b/api/src/services/server.ts index 5da4c87dcc..7afbeadb65 100644 --- a/api/src/services/server.ts +++ b/api/src/services/server.ts @@ -50,6 +50,17 @@ export class ServerService { info.project = projectInfo; + if (this.accountability?.user) { + if (env.RATE_LIMITER_ENABLED) { + info.rateLimit = { + points: env.RATE_LIMITER_POINTS, + duration: env.RATE_LIMITER_DURATION, + }; + } else { + info.rateLimit = false; + } + } + if (this.accountability?.admin === true) { const osType = os.type() === 'Darwin' ? 'macOS' : os.type(); @@ -58,10 +69,12 @@ export class ServerService { info.directus = { version, }; + info.node = { version: process.versions.node, uptime: Math.round(process.uptime()), }; + info.os = { type: osType, version: osVersion, diff --git a/app/src/api.ts b/app/src/api.ts index 7114e434c1..174e75ca1c 100644 --- a/app/src/api.ts +++ b/app/src/api.ts @@ -3,7 +3,7 @@ import { useRequestsStore } from '@/stores/'; import { getRootPath } from '@/utils/get-root-path'; import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'; import { addQueryToPath } from './utils/add-query-to-path'; -import PQueue from 'p-queue'; +import PQueue, { Options, DefaultAddOptions } from 'p-queue'; const api = axios.create({ baseURL: getRootPath(), @@ -13,7 +13,7 @@ const api = axios.create({ }, }); -const queue = new PQueue({ concurrency: 5, intervalCap: 5, interval: 500, carryoverConcurrencyCount: true }); +let queue = new PQueue({ concurrency: 5, intervalCap: 5, interval: 500, carryoverConcurrencyCount: true }); interface RequestConfig extends AxiosRequestConfig { id: string; @@ -113,3 +113,8 @@ export function addTokenToURL(url: string, token?: string): string { return addQueryToPath(url, { access_token: accessToken }); } + +export async function replaceQueue(options?: Options) { + await queue.onIdle(); + queue = new PQueue(options); +} diff --git a/app/src/components/register.ts b/app/src/components/register.ts index f3ee2875b2..472436dfde 100644 --- a/app/src/components/register.ts +++ b/app/src/components/register.ts @@ -29,6 +29,7 @@ import VForm from './v-form'; import VHover from './v-hover/'; import VHighlight from './v-highlight.vue'; import VIcon from './v-icon/'; +import VImage from './v-image.vue'; import VIconFile from './v-icon-file.vue'; import VInfo from './v-info/'; import VInput from './v-input/'; @@ -81,6 +82,7 @@ export function registerComponents(app: App): void { app.component('VHover', VHover); app.component('VHighlight', VHighlight); app.component('VIcon', VIcon); + app.component('VImage', VImage); app.component('VIconFile', VIconFile); app.component('VInfo', VInfo); app.component('VInput', VInput); diff --git a/app/src/components/v-image.vue b/app/src/components/v-image.vue new file mode 100644 index 0000000000..9ddda3ec82 --- /dev/null +++ b/app/src/components/v-image.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/app/src/displays/file/file.vue b/app/src/displays/file/file.vue index 54c8b3fa95..4a5dee0617 100644 --- a/app/src/displays/file/file.vue +++ b/app/src/displays/file/file.vue @@ -1,5 +1,5 @@