mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-12 06:40:40 +00:00
feat: add configurable Antigravity user agent version
This commit is contained in:
1 parent
9377c96746
commit
a07a0dac63
19 files changed
+341
-35
No files matched your search
@@ -3451,6 +3451,36 @@
|
||||
</div>
|
||||
<Toggle v-model="form.rewrite_message_cache_control" />
|
||||
</div>
|
||||
|
||||
<!-- Antigravity UA 版本 -->
|
||||
<div>
|
||||
<label
|
||||
class="mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
{{
|
||||
t(
|
||||
"admin.settings.gatewayForwarding.antigravityUserAgentVersion",
|
||||
)
|
||||
}}
|
||||
</label>
|
||||
<input
|
||||
v-model="form.antigravity_user_agent_version"
|
||||
type="text"
|
||||
class="input max-w-xs font-mono text-sm"
|
||||
:placeholder="
|
||||
t(
|
||||
'admin.settings.gatewayForwarding.antigravityUserAgentVersionPlaceholder',
|
||||
)
|
||||
"
|
||||
/>
|
||||
<p class="mt-1.5 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{
|
||||
t(
|
||||
"admin.settings.gatewayForwarding.antigravityUserAgentVersionHint",
|
||||
)
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Web Search Emulation -->
|
||||
@@ -6571,6 +6601,7 @@ const form = reactive<SettingsForm>({
|
||||
enable_cch_signing: false,
|
||||
enable_anthropic_cache_ttl_1h_injection: false,
|
||||
rewrite_message_cache_control: false,
|
||||
antigravity_user_agent_version: "",
|
||||
// Balance & quota notification
|
||||
balance_low_notify_enabled: false,
|
||||
balance_low_notify_threshold: 0,
|
||||
@@ -7642,6 +7673,8 @@ async function saveSettings() {
|
||||
enable_anthropic_cache_ttl_1h_injection:
|
||||
form.enable_anthropic_cache_ttl_1h_injection,
|
||||
rewrite_message_cache_control: form.rewrite_message_cache_control,
|
||||
antigravity_user_agent_version:
|
||||
form.antigravity_user_agent_version?.trim() || "",
|
||||
// Payment configuration
|
||||
payment_enabled: form.payment_enabled,
|
||||
risk_control_enabled: form.risk_control_enabled,
|
||||
|
||||
@@ -370,6 +370,7 @@ const baseSettingsResponse = {
|
||||
enable_cch_signing: false,
|
||||
enable_anthropic_cache_ttl_1h_injection: false,
|
||||
rewrite_message_cache_control: false,
|
||||
antigravity_user_agent_version: "",
|
||||
payment_enabled: true,
|
||||
payment_min_amount: 1,
|
||||
payment_max_amount: 10000,
|
||||
@@ -622,6 +623,26 @@ describe("admin SettingsView payment visible method controls", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("submits Antigravity user agent version gateway setting", async () => {
|
||||
getSettings.mockResolvedValueOnce({
|
||||
...baseSettingsResponse,
|
||||
antigravity_user_agent_version: "1.23.2",
|
||||
});
|
||||
|
||||
const wrapper = mountView();
|
||||
|
||||
await flushPromises();
|
||||
await wrapper.find("form").trigger("submit.prevent");
|
||||
await flushPromises();
|
||||
|
||||
expect(updateSettings).toHaveBeenCalledTimes(1);
|
||||
expect(updateSettings).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
antigravity_user_agent_version: "1.23.2",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("updates provider enablement immediately and reloads providers", async () => {
|
||||
const provider = {
|
||||
id: 7,
|
||||
|
||||
Reference in new issue
Block a user