new: use generated ids for servers (#765)

* new: use generated ids for servers
Fixes #743

* fix: deps.

* fix: migrate related settings

* fix: restore servers from json
This commit is contained in:
lollipopkit🏳️‍⚧️
2025-05-16 21:50:44 +08:00
committed by GitHub
parent d29bd1d806
commit d88e97e699
16 changed files with 1028 additions and 155 deletions

View File

@@ -251,7 +251,7 @@ final class _BackupPageState extends State<BackupPage>
onTap: () async {
final data = await context.showImportDialog(
title: l10n.snippet,
modelDef: SnippetX.example.toJson(),
modelDef: Snippet.example.toJson(),
);
if (data == null) return;
final str = String.fromCharCodes(data);

View File

@@ -672,6 +672,7 @@ extension on _ServerEditPageState {
custom: custom,
wolCfg: wol,
envs: _env.value.isEmpty ? null : _env.value,
id: widget.args?.spi.id ?? ShortId.generate(),
);
if (this.spi == null) {

View File

@@ -118,7 +118,6 @@ final class _AppSettingsPageState extends State<AppSettingsPage> {
@override
Widget build(BuildContext context) {
return MultiList(
thumbVisibility: true,
children: [
[const CenterGreyTitle('App'), _buildApp()],
[CenterGreyTitle(l10n.server), _buildServer()],