feat(cloudflare): 支持 API Token 连接验证并发布 v1.6.7
This commit is contained in:
@@ -512,9 +512,9 @@ export const api = {
|
||||
getCfSettings: () => request<CfAppSettings>('/api/cloudflare/settings'),
|
||||
saveCfSettings: (payload: CfAppSettingsInput) =>
|
||||
request<CfAppSettings>('/api/cloudflare/settings', { method: 'PUT', body: JSON.stringify(payload) }),
|
||||
testCfToken: (token: string) =>
|
||||
testCfToken: (token: string, kind: 'tunnel' | 'api') =>
|
||||
request<{ ok: boolean; message: string }>('/api/cloudflare/settings/test', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ token }),
|
||||
body: JSON.stringify({ token, kind }),
|
||||
}, 60_000),
|
||||
}
|
||||
|
||||
@@ -1102,12 +1102,15 @@ export interface CfTunnelPayload {
|
||||
export interface CfAppSettings {
|
||||
default_token_configured: boolean
|
||||
default_token_masked: string
|
||||
api_token_configured: boolean
|
||||
api_token_masked: string
|
||||
mirror: string
|
||||
network: CfNetworkSettings
|
||||
}
|
||||
|
||||
export interface CfAppSettingsInput {
|
||||
token: string
|
||||
api_token: string
|
||||
mirror: string
|
||||
network: CfNetworkSettings
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user