fix: 修复配额说明重复和undefined问题

- 在editStorageForm中初始化oss_storage_quota_value和oss_quota_unit
- 删除重复的旧配额说明块,保留新的当前配额设置显示

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-22 19:39:53 +08:00
commit 4350113979
7649 changed files with 897277 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
export declare const SHA_256_HASH: {
name: "SHA-256";
};
export declare const SHA_256_HMAC_ALGO: {
name: "HMAC";
hash: {
name: "SHA-256";
};
};
export declare const EMPTY_DATA_SHA_256: Uint8Array;

View File

@@ -0,0 +1,40 @@
export var SHA_256_HASH = { name: "SHA-256" };
export var SHA_256_HMAC_ALGO = {
name: "HMAC",
hash: SHA_256_HASH
};
export var EMPTY_DATA_SHA_256 = new Uint8Array([
227,
176,
196,
66,
152,
252,
28,
20,
154,
251,
244,
200,
153,
111,
185,
36,
39,
174,
65,
228,
100,
155,
147,
76,
164,
149,
153,
27,
120,
82,
184,
85
]);
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,YAAY,GAAwB,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAErE,MAAM,CAAC,IAAM,iBAAiB,GAAgD;IAC5E,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,YAAY;CACnB,CAAC;AAEF,MAAM,CAAC,IAAM,kBAAkB,GAAG,IAAI,UAAU,CAAC;IAC/C,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,GAAG;IACH,GAAG;IACH,EAAE;IACF,EAAE;IACF,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,EAAE;IACF,GAAG;IACH,EAAE;IACF,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,GAAG;IACH,GAAG;IACH,GAAG;IACH,EAAE;IACF,GAAG;IACH,EAAE;IACF,GAAG;IACH,EAAE;CACH,CAAC,CAAC"}

View File

@@ -0,0 +1,8 @@
import { Checksum, SourceData } from "@aws-sdk/types";
export declare class Sha256 implements Checksum {
private hash;
constructor(secret?: SourceData);
update(data: SourceData, encoding?: "utf8" | "ascii" | "latin1"): void;
digest(): Promise<Uint8Array>;
reset(): void;
}

View File

@@ -0,0 +1,27 @@
import { Sha256 as WebCryptoSha256 } from "./webCryptoSha256";
import { Sha256 as JsSha256 } from "@aws-crypto/sha256-js";
import { supportsWebCrypto } from "@aws-crypto/supports-web-crypto";
import { locateWindow } from "@aws-sdk/util-locate-window";
import { convertToBuffer } from "@aws-crypto/util";
var Sha256 = /** @class */ (function () {
function Sha256(secret) {
if (supportsWebCrypto(locateWindow())) {
this.hash = new WebCryptoSha256(secret);
}
else {
this.hash = new JsSha256(secret);
}
}
Sha256.prototype.update = function (data, encoding) {
this.hash.update(convertToBuffer(data));
};
Sha256.prototype.digest = function () {
return this.hash.digest();
};
Sha256.prototype.reset = function () {
this.hash.reset();
};
return Sha256;
}());
export { Sha256 };
//# sourceMappingURL=crossPlatformSha256.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"crossPlatformSha256.js","sourceRoot":"","sources":["../../src/crossPlatformSha256.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;IAGE,gBAAY,MAAmB;QAC7B,IAAI,iBAAiB,CAAC,YAAY,EAAE,CAAC,EAAE;YACrC,IAAI,CAAC,IAAI,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;SACzC;aAAM;YACL,IAAI,CAAC,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;SAClC;IACH,CAAC;IAED,uBAAM,GAAN,UAAO,IAAgB,EAAE,QAAsC;QAC7D,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,uBAAM,GAAN;QACE,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;IAED,sBAAK,GAAL;QACE,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IACH,aAAC;AAAD,CAAC,AAtBD,IAsBC"}

View File

@@ -0,0 +1,2 @@
export * from "./crossPlatformSha256";
export { Sha256 as WebCryptoSha256 } from "./webCryptoSha256";

View File

@@ -0,0 +1,3 @@
export * from "./crossPlatformSha256";
export { Sha256 as WebCryptoSha256 } from "./webCryptoSha256";
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}

View File

@@ -0,0 +1,2 @@
import { SourceData } from "@aws-sdk/types";
export declare function isEmptyData(data: SourceData): boolean;

View File

@@ -0,0 +1,7 @@
export function isEmptyData(data) {
if (typeof data === "string") {
return data.length === 0;
}
return data.byteLength === 0;
}
//# sourceMappingURL=isEmptyData.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"isEmptyData.js","sourceRoot":"","sources":["../../src/isEmptyData.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,IAAgB;IAC1C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,OAAO,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;KAC1B;IAED,OAAO,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC;AAC/B,CAAC"}

View File

@@ -0,0 +1,10 @@
import { Checksum, SourceData } from "@aws-sdk/types";
export declare class Sha256 implements Checksum {
private readonly secret?;
private key;
private toHash;
constructor(secret?: SourceData);
update(data: SourceData): void;
digest(): Promise<Uint8Array>;
reset(): void;
}

View File

@@ -0,0 +1,53 @@
import { isEmptyData, convertToBuffer } from "@aws-crypto/util";
import { EMPTY_DATA_SHA_256, SHA_256_HASH, SHA_256_HMAC_ALGO, } from "./constants";
import { locateWindow } from "@aws-sdk/util-locate-window";
var Sha256 = /** @class */ (function () {
function Sha256(secret) {
this.toHash = new Uint8Array(0);
this.secret = secret;
this.reset();
}
Sha256.prototype.update = function (data) {
if (isEmptyData(data)) {
return;
}
var update = convertToBuffer(data);
var typedArray = new Uint8Array(this.toHash.byteLength + update.byteLength);
typedArray.set(this.toHash, 0);
typedArray.set(update, this.toHash.byteLength);
this.toHash = typedArray;
};
Sha256.prototype.digest = function () {
var _this = this;
if (this.key) {
return this.key.then(function (key) {
return locateWindow()
.crypto.subtle.sign(SHA_256_HMAC_ALGO, key, _this.toHash)
.then(function (data) { return new Uint8Array(data); });
});
}
if (isEmptyData(this.toHash)) {
return Promise.resolve(EMPTY_DATA_SHA_256);
}
return Promise.resolve()
.then(function () {
return locateWindow().crypto.subtle.digest(SHA_256_HASH, _this.toHash);
})
.then(function (data) { return Promise.resolve(new Uint8Array(data)); });
};
Sha256.prototype.reset = function () {
var _this = this;
this.toHash = new Uint8Array(0);
if (this.secret && this.secret !== void 0) {
this.key = new Promise(function (resolve, reject) {
locateWindow()
.crypto.subtle.importKey("raw", convertToBuffer(_this.secret), SHA_256_HMAC_ALGO, false, ["sign"])
.then(resolve, reject);
});
this.key.catch(function () { });
}
};
return Sha256;
}());
export { Sha256 };
//# sourceMappingURL=webCryptoSha256.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"webCryptoSha256.js","sourceRoot":"","sources":["../../src/webCryptoSha256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