Improve webdav settings

This commit is contained in:
2025-02-18 18:37:57 +08:00
parent c28f4d40c2
commit bd53416968
2 changed files with 55 additions and 3 deletions

View File

@@ -353,7 +353,11 @@
"No updates found": "未找到更新",
"All Comics": "全部漫画",
"The comic will be marked as no updates as soon as you read it.": "漫画将在您阅读后立即标记为无更新",
"Disable": "禁用"
"Disable": "禁用",
"Once the operation is successful, app will automatically sync data with the server.": "操作成功后, APP将自动与服务器同步数据",
"Webdav is enabled." : "已启用Webdav",
"Cache cleared": "缓存已清除",
"Disabled": "已禁用"
},
"zh_TW": {
"Home": "首頁",
@@ -709,6 +713,10 @@
"No updates found": "未找到更新",
"All Comics": "全部漫畫",
"The comic will be marked as no updates as soon as you read it.": "漫畫將在您閱讀後立即標記為無更新",
"Disable": "禁用"
"Disable": "禁用",
"Once the operation is successful, app will automatically sync data with the server.": "操作成功後, APP將自動與服務器同步數據",
"Webdav is enabled." : "已啟用Webdav",
"Cache cleared": "緩存已清除",
"Disabled": "已禁用"
}
}

View File

@@ -332,8 +332,8 @@ class _WebdavSettingState extends State<_WebdavSetting> {
String pass = "";
bool isTesting = false;
bool upload = true;
bool isEnabled = false;
@override
void initState() {
@@ -348,6 +348,7 @@ class _WebdavSettingState extends State<_WebdavSetting> {
url = configs[0];
user = configs[1];
pass = configs[2];
isEnabled = true;
}
@override
@@ -411,6 +412,49 @@ class _WebdavSettingState extends State<_WebdavSetting> {
],
),
const SizedBox(height: 16),
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(8),
),
child: Row(
children: [
const Icon(Icons.info_outline, size: 20),
const SizedBox(width: 8),
Expanded(
child: Text("Once the operation is successful, app will automatically sync data with the server.".tl),
),
],
),
),
if (isEnabled)
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(8),
),
child: Row(
children: [
const Icon(Icons.sync, size: 20),
const SizedBox(width: 8),
Expanded(
child: Text("Webdav is enabled.".tl),
),
Button.text(
onPressed: () {
appdata.settings['webdav'] = [];
appdata.saveData();
context.showMessage(message: "Disabled".tl);
App.rootPop();
},
child: Text("Disable".tl),
)
],
),
).paddingTop(16),
const SizedBox(height: 16),
Center(
child: Button.filled(
isLoading: isTesting,