mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-20 03:30:50 +08:00
fix(clipboard): add shared helper and remove lint warnings
This commit is contained in:
@@ -409,7 +409,7 @@ function PayloadRulesEditor({
|
|||||||
protocolFirst?: boolean;
|
protocolFirst?: boolean;
|
||||||
onChange: (next: PayloadRule[]) => void;
|
onChange: (next: PayloadRule[]) => void;
|
||||||
}) {
|
}) {
|
||||||
const { t, i18n } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const rules = value.length ? value : [];
|
const rules = value.length ? value : [];
|
||||||
const protocolOptions = useMemo(
|
const protocolOptions = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@@ -417,7 +417,7 @@ function PayloadRulesEditor({
|
|||||||
value: option.value,
|
value: option.value,
|
||||||
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
|
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
|
||||||
})),
|
})),
|
||||||
[t, i18n.resolvedLanguage]
|
[t]
|
||||||
);
|
);
|
||||||
const payloadValueTypeOptions = useMemo(
|
const payloadValueTypeOptions = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@@ -425,7 +425,7 @@ function PayloadRulesEditor({
|
|||||||
value: option.value,
|
value: option.value,
|
||||||
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
|
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
|
||||||
})),
|
})),
|
||||||
[t, i18n.resolvedLanguage]
|
[t]
|
||||||
);
|
);
|
||||||
|
|
||||||
const addRule = () => onChange([...rules, { id: makeClientId(), models: [], params: [] }]);
|
const addRule = () => onChange([...rules, { id: makeClientId(), models: [], params: [] }]);
|
||||||
@@ -668,7 +668,7 @@ function PayloadFilterRulesEditor({
|
|||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
onChange: (next: PayloadFilterRule[]) => void;
|
onChange: (next: PayloadFilterRule[]) => void;
|
||||||
}) {
|
}) {
|
||||||
const { t, i18n } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const rules = value.length ? value : [];
|
const rules = value.length ? value : [];
|
||||||
const protocolOptions = useMemo(
|
const protocolOptions = useMemo(
|
||||||
() =>
|
() =>
|
||||||
@@ -676,7 +676,7 @@ function PayloadFilterRulesEditor({
|
|||||||
value: option.value,
|
value: option.value,
|
||||||
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
|
label: t(option.labelKey, { defaultValue: option.defaultLabel }),
|
||||||
})),
|
})),
|
||||||
[t, i18n.resolvedLanguage]
|
[t]
|
||||||
);
|
);
|
||||||
|
|
||||||
const addRule = () => onChange([...rules, { id: makeClientId(), models: [], params: [] }]);
|
const addRule = () => onChange([...rules, { id: makeClientId(), models: [], params: [] }]);
|
||||||
|
|||||||
Reference in New Issue
Block a user