- 在editStorageForm中初始化oss_storage_quota_value和oss_quota_unit - 删除重复的旧配额说明块,保留新的当前配额设置显示 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
import { debugId, toDebugString } from "../debug";
|
|
import { evaluateConditions } from "./evaluateConditions";
|
|
import { getEndpointHeaders } from "./getEndpointHeaders";
|
|
import { getEndpointProperties } from "./getEndpointProperties";
|
|
import { getEndpointUrl } from "./getEndpointUrl";
|
|
export const evaluateEndpointRule = (endpointRule, options) => {
|
|
const { conditions, endpoint } = endpointRule;
|
|
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
if (!result) {
|
|
return;
|
|
}
|
|
const endpointRuleOptions = {
|
|
...options,
|
|
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
|
|
};
|
|
const { url, properties, headers } = endpoint;
|
|
options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
|
|
return {
|
|
...(headers != undefined && {
|
|
headers: getEndpointHeaders(headers, endpointRuleOptions),
|
|
}),
|
|
...(properties != undefined && {
|
|
properties: getEndpointProperties(properties, endpointRuleOptions),
|
|
}),
|
|
url: getEndpointUrl(url, endpointRuleOptions),
|
|
};
|
|
};
|