mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-02 21:12:13 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
856932a78d | ||
|
|
067a9f7cad |
@@ -13,6 +13,7 @@
|
||||
- 修复 代理 页展开分组后不显示最新测速结果,需切换节点才刷新
|
||||
- 修复 代理 在全局模式下无法展开节点组
|
||||
- 修复 自定义 CSS 无法修改编辑器字体和字号的问题
|
||||
- 修复 WebDAV 设置清空后无法保存
|
||||
|
||||
**🍎 macOS**
|
||||
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@
|
||||
"react-dom": "19.3.1",
|
||||
"react-error-boundary": "6.1.6",
|
||||
"react-hook-form": "^7.88.0",
|
||||
"react-i18next": "17.1.9",
|
||||
"react-i18next": "17.1.10",
|
||||
"react-markdown": "10.1.0",
|
||||
"react-router": "^8.4.0",
|
||||
"rehype-raw": "^7.0.0",
|
||||
|
||||
Generated
+5
-5
@@ -275,8 +275,8 @@ importers:
|
||||
specifier: ^7.88.0
|
||||
version: 7.88.0(react@19.3.1)
|
||||
react-i18next:
|
||||
specifier: 17.1.9
|
||||
version: 17.1.9(i18next@26.4.2(typescript@6.0.3))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(typescript@6.0.3)
|
||||
specifier: 17.1.10
|
||||
version: 17.1.10(i18next@26.4.2(typescript@6.0.3))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(typescript@6.0.3)
|
||||
react-markdown:
|
||||
specifier: 10.1.0
|
||||
version: 10.1.0(@types/react@19.3.0)(react@19.3.1)(supports-color@7.2.0)
|
||||
@@ -4406,8 +4406,8 @@ packages:
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17 || ^18 || ^19
|
||||
|
||||
react-i18next@17.1.9:
|
||||
resolution: {integrity: sha512-OgYqIH13XHPlWTaaI795Dz+k2AdKnXcOxNQVnf750T8Ij0TYWp1nYvXRpoJBulPqlyk2OAbn1PM4tFKiIj/byA==}
|
||||
react-i18next@17.1.10:
|
||||
resolution: {integrity: sha512-XuUuA/rxukE4hXuR//PN308DuSQkWqKNNWBUj0dDTR087l3+6WLid3NC/w55ALrXA/dtWb7lychJ4rQLR3DCDg==}
|
||||
peerDependencies:
|
||||
i18next: '>= 26.2.0'
|
||||
react: '>= 16.8.0'
|
||||
@@ -9378,7 +9378,7 @@ snapshots:
|
||||
dependencies:
|
||||
react: 19.3.1
|
||||
|
||||
react-i18next@17.1.9(i18next@26.4.2(typescript@6.0.3))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(typescript@6.0.3):
|
||||
react-i18next@17.1.10(i18next@26.4.2(typescript@6.0.3))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(typescript@6.0.3):
|
||||
dependencies:
|
||||
'@babel/runtime': 7.29.7
|
||||
html-parse-stringify: 4.0.1
|
||||
|
||||
@@ -40,9 +40,9 @@ export const BackupConfigViewer = memo(
|
||||
|
||||
const { register, handleSubmit, watch } = useForm<IWebDavConfig>({
|
||||
defaultValues: {
|
||||
url: webdav_url!,
|
||||
username: webdav_username!,
|
||||
password: webdav_password!,
|
||||
url: webdav_url ?? '',
|
||||
username: webdav_username ?? '',
|
||||
password: webdav_password ?? '',
|
||||
},
|
||||
})
|
||||
const url = watch('url')
|
||||
@@ -50,9 +50,9 @@ export const BackupConfigViewer = memo(
|
||||
const password = watch('password')
|
||||
|
||||
const webdavChanged =
|
||||
webdav_url !== url ||
|
||||
webdav_username !== username ||
|
||||
webdav_password !== password
|
||||
(webdav_url ?? '') !== url ||
|
||||
(webdav_username ?? '') !== username ||
|
||||
(webdav_password ?? '') !== password
|
||||
|
||||
const webdavSignature = buildWebdavSignature(verge)
|
||||
const webdavStatus = getWebdavStatus(webdavSignature)
|
||||
@@ -69,9 +69,9 @@ export const BackupConfigViewer = memo(
|
||||
}, [webdav_url, webdav_username, webdav_password, onInit, shouldAutoInit])
|
||||
|
||||
const checkForm = () => {
|
||||
const username = usernameRef.current?.value
|
||||
const username = usernameRef.current?.value.trim()
|
||||
const password = passwordRef.current?.value
|
||||
const url = urlRef.current?.value
|
||||
const url = urlRef.current?.value.trim()
|
||||
|
||||
if (!url) {
|
||||
urlRef.current?.focus()
|
||||
@@ -95,14 +95,15 @@ export const BackupConfigViewer = memo(
|
||||
}
|
||||
|
||||
const save = useLockFn(async (data: IWebDavConfig) => {
|
||||
checkForm()
|
||||
const trimmedUrl = data.url.trim()
|
||||
const trimmedUsername = data.username.trim()
|
||||
const isClearing = !trimmedUrl && !trimmedUsername && !data.password
|
||||
if (!isClearing) checkForm()
|
||||
const signature = buildWebdavSignature({
|
||||
webdav_url: data.url,
|
||||
webdav_username: data.username,
|
||||
webdav_password: data.password,
|
||||
})
|
||||
const trimmedUrl = data.url.trim()
|
||||
const trimmedUsername = data.username.trim()
|
||||
|
||||
try {
|
||||
setLoading(true)
|
||||
@@ -127,7 +128,7 @@ export const BackupConfigViewer = memo(
|
||||
)
|
||||
setWebdavStatus(signature, 'unknown')
|
||||
showNotice.success('settings.modals.backup.messages.webdavConfigSaved')
|
||||
await onSaveSuccess(signature)
|
||||
if (!isClearing) await onSaveSuccess(signature)
|
||||
} catch (error) {
|
||||
showNotice.error(
|
||||
'settings.modals.backup.messages.webdavConfigSaveFailed',
|
||||
@@ -223,9 +224,9 @@ export const BackupConfigViewer = memo(
|
||||
}}
|
||||
>
|
||||
{webdavChanged ||
|
||||
webdav_url === undefined ||
|
||||
webdav_username === undefined ||
|
||||
webdav_password === undefined ? (
|
||||
!webdav_url ||
|
||||
!webdav_username ||
|
||||
!webdav_password ? (
|
||||
<Button
|
||||
variant="contained"
|
||||
color={'primary'}
|
||||
|
||||
@@ -43,7 +43,11 @@ export const getWebdavStatus = (signature: string): WebdavStatus => {
|
||||
}
|
||||
|
||||
export const setWebdavStatus = (signature: string, status: WebdavStatus) => {
|
||||
if (!signature || !canUseStorage()) return
|
||||
if (!canUseStorage()) return
|
||||
if (!signature) {
|
||||
localStorage.removeItem(WEBDAV_STATUS_KEY)
|
||||
return
|
||||
}
|
||||
|
||||
const payload: WebdavStatusCache = {
|
||||
signature,
|
||||
|
||||
Reference in New Issue
Block a user