HAwYcDcj%
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 24d704727..9ba8ecb64 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -1204,6 +1204,7 @@ const message = {
S3: 'Amazon S3',
MINIO: 'MINIO',
SFTP: 'SFTP',
+ WebDAV: 'WebDAV',
OneDrive: 'Microsoft OneDrive',
backupDir: 'Backup dir',
codeWarning: 'The current authorization code format is incorrect, please confirm again!',
diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts
index b6eb5ded1..581605b64 100644
--- a/frontend/src/lang/modules/tw.ts
+++ b/frontend/src/lang/modules/tw.ts
@@ -1133,6 +1133,7 @@ const message = {
S3: '亞馬遜 S3 雲存儲',
MINIO: 'MINIO',
SFTP: 'SFTP',
+ WebDAV: 'WebDAV',
OneDrive: '微軟 OneDrive',
codeWarning: '當前授權碼格式錯誤,請重新確認!',
backupDir: '備份路徑',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index bf37fc86f..f41b40e37 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -1134,6 +1134,7 @@ const message = {
S3: '亚马逊 S3 云存储',
MINIO: 'MINIO',
SFTP: 'SFTP',
+ WebDAV: 'WebDAV',
OneDrive: '微软 OneDrive',
codeWarning: '当前授权码格式错误,请重新确认!',
backupDir: '备份路径',
diff --git a/frontend/src/views/setting/backup-account/index.vue b/frontend/src/views/setting/backup-account/index.vue
index f0b508abe..cb858accd 100644
--- a/frontend/src/views/setting/backup-account/index.vue
+++ b/frontend/src/views/setting/backup-account/index.vue
@@ -365,6 +365,51 @@
+
+
+
+
WebDAV
+
+
+ {{ $t('commons.button.edit') }}
+
+
+ {{ $t('commons.button.delete') }}
+
+
+
+
+
+
+ {{ webDAVData.varsJson['address'] }}
+
+
+ {{ webDAVData.varsJson['port'] }}
+
+
+ {{ webDAVData.bucket }}
+
+
+ {{ dateFormat(0, 0, webDAVData.createdAt) }}
+
+
+
+
+ {{ $t('setting.createBackupAccount', ['WebDAV']) }}
+
+
+
@@ -442,6 +487,20 @@ const sftpData = ref({
},
createdAt: new Date(),
});
+const webDAVData = ref({
+ id: 0,
+ type: 'WebDAV',
+ accessKey: '',
+ bucket: '',
+ credential: '',
+ backupPath: '',
+ vars: '',
+ varsJson: {
+ address: '',
+ port: 10080,
+ },
+ createdAt: new Date(),
+});
const oneDriveData = ref({
id: 0,
type: 'OneDrive',
@@ -530,6 +589,9 @@ const search = async () => {
case 'OneDrive':
oneDriveData.value = bac;
break;
+ case 'WebDAV':
+ webDAVData.value = bac;
+ break;
}
}
};
diff --git a/frontend/src/views/setting/backup-account/operate/index.vue b/frontend/src/views/setting/backup-account/operate/index.vue
index 94ea273d5..47a6185af 100644
--- a/frontend/src/views/setting/backup-account/operate/index.vue
+++ b/frontend/src/views/setting/backup-account/operate/index.vue
@@ -195,10 +195,24 @@
:title="$t('setting.archiveHelper')"
/>
-
-
+
+
+
+
+ https://172.16.10.111
+
@@ -347,6 +361,10 @@ function hasEndpoint(val: string) {
return val === 'OSS' || val === 'S3';
}
+function isSftpOrWebDAV(val: string) {
+ return val === 'SFTP' || val === 'WebDAV';
+}
+
const toDoc = () => {
window.open('https://1panel.cn/docs/user_manual/settings/', '_blank', 'noopener,noreferrer');
};
diff --git a/go.mod b/go.mod
index 765ae109e..10f9ea4b2 100644
--- a/go.mod
+++ b/go.mod
@@ -44,6 +44,7 @@ require (
github.com/spf13/afero v1.9.2
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.14.0
+ github.com/studio-b12/gowebdav v0.9.0
github.com/subosito/gotenv v1.4.1
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
github.com/swaggo/gin-swagger v1.5.3
diff --git a/go.sum b/go.sum
index 19fe56120..be6b29099 100644
--- a/go.sum
+++ b/go.sum
@@ -753,6 +753,8 @@ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/studio-b12/gowebdav v0.9.0 h1:1j1sc9gQnNxbXXM4M/CebPOX4aXYtr7MojAVcN4dHjU=
+github.com/studio-b12/gowebdav v0.9.0/go.mod h1:bHA7t77X/QFExdeAnDzK6vKM34kEZAcE1OX4MfiwjkE=
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY=