@adminforth/upload 1.0.19 → 1.0.20
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.
- package/custom/imageGenerator.vue +3 -3
- package/dist/custom/imageGenerator.vue +3 -3
- package/dist/index.js +2 -2
- package/index.ts +2 -2
- package/package.json +1 -1
- package/types.ts +1 -0
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
<script setup lang="ts">
|
|
105
105
|
|
|
106
|
-
import { ref, onMounted } from 'vue'
|
|
106
|
+
import { ref, onMounted, nextTick } from 'vue'
|
|
107
107
|
import { Carousel } from 'flowbite';
|
|
108
108
|
import { callAdminForthApi } from '@/utils';
|
|
109
109
|
|
|
@@ -197,7 +197,7 @@ async function generateImages() {
|
|
|
197
197
|
// 'https://via.placeholder.com/600x400?text=Image+1',
|
|
198
198
|
// 'https://via.placeholder.com/600x400?text=Image+2',
|
|
199
199
|
// ];
|
|
200
|
-
await
|
|
200
|
+
await nextTick();
|
|
201
201
|
|
|
202
202
|
caurosel.value = new Carousel(
|
|
203
203
|
document.getElementById('gallery'),
|
|
@@ -213,7 +213,7 @@ async function generateImages() {
|
|
|
213
213
|
override: true,
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
|
-
await
|
|
216
|
+
await nextTick();
|
|
217
217
|
loading.value = false;
|
|
218
218
|
}
|
|
219
219
|
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
|
|
104
104
|
<script setup lang="ts">
|
|
105
105
|
|
|
106
|
-
import { ref, onMounted } from 'vue'
|
|
106
|
+
import { ref, onMounted, nextTick } from 'vue'
|
|
107
107
|
import { Carousel } from 'flowbite';
|
|
108
108
|
import { callAdminForthApi } from '@/utils';
|
|
109
109
|
|
|
@@ -197,7 +197,7 @@ async function generateImages() {
|
|
|
197
197
|
// 'https://via.placeholder.com/600x400?text=Image+1',
|
|
198
198
|
// 'https://via.placeholder.com/600x400?text=Image+2',
|
|
199
199
|
// ];
|
|
200
|
-
await
|
|
200
|
+
await nextTick();
|
|
201
201
|
|
|
202
202
|
caurosel.value = new Carousel(
|
|
203
203
|
document.getElementById('gallery'),
|
|
@@ -213,7 +213,7 @@ async function generateImages() {
|
|
|
213
213
|
override: true,
|
|
214
214
|
}
|
|
215
215
|
);
|
|
216
|
-
await
|
|
216
|
+
await nextTick();
|
|
217
217
|
loading.value = false;
|
|
218
218
|
}
|
|
219
219
|
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
|
11
11
|
import { ExpirationStatus, GetObjectCommand, PutObjectCommand, S3 } from '@aws-sdk/client-s3';
|
|
12
12
|
import { AdminForthPlugin, suggestIfTypo } from "adminforth";
|
|
13
13
|
import { Readable } from "stream";
|
|
14
|
-
import { RateLimiter,
|
|
14
|
+
import { RateLimiter, getClientIp } from "adminforth";
|
|
15
15
|
const ADMINFORTH_NOT_YET_USED_TAG = 'adminforth-candidate-for-cleanup';
|
|
16
16
|
export default class UploadPlugin extends AdminForthPlugin {
|
|
17
17
|
constructor(options) {
|
|
@@ -418,7 +418,7 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
418
418
|
}
|
|
419
419
|
if ((_d = this.options.generation.rateLimit) === null || _d === void 0 ? void 0 : _d.limit) {
|
|
420
420
|
// rate limit
|
|
421
|
-
const { error } = RateLimiter.checkRateLimit(this.pluginInstanceId, (_e = this.options.generation.rateLimit) === null || _e === void 0 ? void 0 : _e.limit,
|
|
421
|
+
const { error } = RateLimiter.checkRateLimit(this.pluginInstanceId, (_e = this.options.generation.rateLimit) === null || _e === void 0 ? void 0 : _e.limit, getClientIp(headers));
|
|
422
422
|
if (error) {
|
|
423
423
|
return { error: this.options.generation.rateLimit.errorMessage };
|
|
424
424
|
}
|
package/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
|
|
|
4
4
|
import { ExpirationStatus, GetObjectCommand, ObjectCannedACL, PutObjectCommand, S3 } from '@aws-sdk/client-s3';
|
|
5
5
|
import { AdminForthPlugin, AdminForthResourceColumn, AdminForthResourcePages, IAdminForth, IHttpServer, suggestIfTypo } from "adminforth";
|
|
6
6
|
import { Readable } from "stream";
|
|
7
|
-
import { RateLimiter,
|
|
7
|
+
import { RateLimiter, getClientIp } from "adminforth";
|
|
8
8
|
|
|
9
9
|
const ADMINFORTH_NOT_YET_USED_TAG = 'adminforth-candidate-for-cleanup';
|
|
10
10
|
|
|
@@ -464,7 +464,7 @@ export default class UploadPlugin extends AdminForthPlugin {
|
|
|
464
464
|
const { error } = RateLimiter.checkRateLimit(
|
|
465
465
|
this.pluginInstanceId,
|
|
466
466
|
this.options.generation.rateLimit?.limit,
|
|
467
|
-
|
|
467
|
+
getClientIp(headers),
|
|
468
468
|
);
|
|
469
469
|
if (error) {
|
|
470
470
|
return { error: this.options.generation.rateLimit.errorMessage };
|
package/package.json
CHANGED