adminforth 2.4.0-next.177 → 2.4.0-next.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Interface for Captcha adapters.
3
+ */
4
+
5
+ export interface CaptchaAdapter {
6
+ /**
7
+ * Returns the script source URL for the captcha widget.
8
+ */
9
+ getScriptSrc(): string;
10
+
11
+ /**
12
+ * Returns the site key for the captcha.
13
+ */
14
+ getSiteKey(): string;
15
+
16
+ /**
17
+ * Returns the widget ID for the captcha.
18
+ */
19
+ getWidgetId(): string;
20
+
21
+ /**
22
+ * Returns the token for the captcha.
23
+ */
24
+ getToken(): Promise<string> | string;
25
+
26
+ /**
27
+ * Validates the captcha token.
28
+ */
29
+ validate(token: string, ip: string): Promise<Record<string, any>>;
30
+ }
@@ -5,3 +5,4 @@ export type { KeyValueAdapter } from './KeyValueAdapter.js';
5
5
  export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
6
6
  export type { OAuth2Adapter } from './OAuth2Adapter.js';
7
7
  export type { StorageAdapter } from './StorageAdapter.js';
8
+ export type { CaptchaAdapter } from './CaptchaAdapter.js';
@@ -189,7 +189,7 @@ import ResourceListTable from '@/components/ResourceListTable.vue';
189
189
  import { useCoreStore } from '@/stores/core';
190
190
  import { useFiltersStore } from '@/stores/filters';
191
191
  import { callAdminForthApi, currentQuery, getIcon, setQuery } from '@/utils';
192
- import { computed, onMounted, ref, watch, nextTick, type Ref } from 'vue';
192
+ import { computed, onMounted, onUnmounted, ref, watch, nextTick, type Ref } from 'vue';
193
193
  import { useRoute } from 'vue-router';
194
194
  import { showErrorTost } from '@/composables/useFrontendApi'
195
195
  import { getCustomComponent, initThreeDotsDropdown } from '@/utils';
@@ -387,6 +387,13 @@ class SortQuerySerializer {
387
387
 
388
388
  let listAutorefresher: any = null;
389
389
 
390
+ function clearAutoRefresher() {
391
+ if (listAutorefresher) {
392
+ clearInterval(listAutorefresher);
393
+ listAutorefresher = null;
394
+ }
395
+ }
396
+
390
397
  async function init() {
391
398
 
392
399
  await coreStore.fetchResourceFull({
@@ -434,10 +441,7 @@ async function init() {
434
441
  }
435
442
  });
436
443
 
437
- if (listAutorefresher) {
438
- clearInterval(listAutorefresher);
439
- listAutorefresher = null;
440
- }
444
+ clearAutoRefresher();
441
445
  if (coreStore.resource!.options?.listRowsAutoRefreshSeconds) {
442
446
  listAutorefresher = setInterval(async () => {
443
447
  await adminforth.list.silentRefresh();
@@ -505,6 +509,10 @@ onMounted(async () => {
505
509
  initInProcess = false;
506
510
  });
507
511
 
512
+ onUnmounted(() => {
513
+ clearAutoRefresher();
514
+ });
515
+
508
516
  watch([page], async () => {
509
517
  setQuery({ page: page.value });
510
518
  });
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Interface for Captcha adapters.
3
+ */
4
+ export interface CaptchaAdapter {
5
+ /**
6
+ * Returns the script source URL for the captcha widget.
7
+ */
8
+ getScriptSrc(): string;
9
+ /**
10
+ * Returns the site key for the captcha.
11
+ */
12
+ getSiteKey(): string;
13
+ /**
14
+ * Returns the widget ID for the captcha.
15
+ */
16
+ getWidgetId(): string;
17
+ /**
18
+ * Returns the token for the captcha.
19
+ */
20
+ getToken(): Promise<string> | string;
21
+ /**
22
+ * Validates the captcha token.
23
+ */
24
+ validate(token: string, ip: string): Promise<Record<string, any>>;
25
+ }
26
+ //# sourceMappingURL=CaptchaAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaptchaAdapter.d.ts","sourceRoot":"","sources":["../../../types/adapters/CaptchaAdapter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,YAAY,IAAI,MAAM,CAAC;IAEvB;;OAEG;IACH,UAAU,IAAI,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;CACrE"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Interface for Captcha adapters.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=CaptchaAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CaptchaAdapter.js","sourceRoot":"","sources":["../../../types/adapters/CaptchaAdapter.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -5,4 +5,5 @@ export type { KeyValueAdapter } from './KeyValueAdapter.js';
5
5
  export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
6
6
  export type { OAuth2Adapter } from './OAuth2Adapter.js';
7
7
  export type { StorageAdapter } from './StorageAdapter.js';
8
+ export type { CaptchaAdapter } from './CaptchaAdapter.js';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../types/adapters/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.177",
3
+ "version": "2.4.0-next.179",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",