mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
new: setting item of record history
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import '../../core/persistant_store.dart';
|
||||
|
||||
class DockerStore extends PersistentStore {
|
||||
class DockerStore extends PersistentStore<String> {
|
||||
String? fetch(String id) {
|
||||
return box.get(id);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:toolbox/data/model/server/private_key_info.dart';
|
||||
import '../../core/persistant_store.dart';
|
||||
import '../model/server/private_key_info.dart';
|
||||
|
||||
class PrivateKeyStore extends PersistentStore {
|
||||
class PrivateKeyStore extends PersistentStore<PrivateKeyInfo> {
|
||||
void put(PrivateKeyInfo info) {
|
||||
box.put(info.id, info);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:toolbox/data/model/server/server_private_info.dart';
|
||||
import '../../core/persistant_store.dart';
|
||||
import '../model/server/server_private_info.dart';
|
||||
|
||||
class ServerStore extends PersistentStore {
|
||||
class ServerStore extends PersistentStore<ServerPrivateInfo> {
|
||||
void put(ServerPrivateInfo info) {
|
||||
box.put(info.id, info);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,35 @@ import '../model/app/net_view.dart';
|
||||
import '../res/default.dart';
|
||||
|
||||
class SettingStore extends PersistentStore {
|
||||
|
||||
// ------BEGIN------
|
||||
// These settings are not displayed in the settings page
|
||||
// You can edit them in the settings json editor (by long press the settings
|
||||
// item in the drawer of the server tab page)
|
||||
|
||||
/// Discussion #146
|
||||
late final serverTabUseOldUI = StoreProperty(
|
||||
box,
|
||||
'serverTabUseOldUI',
|
||||
false,
|
||||
);
|
||||
|
||||
/// Time out for server connect and more...
|
||||
late final timeout = StoreProperty(
|
||||
box,
|
||||
'timeOut',
|
||||
5,
|
||||
);
|
||||
|
||||
/// Record history of SFTP path and etc.
|
||||
late final recordHistory = StoreProperty(
|
||||
box,
|
||||
'recordHistory',
|
||||
true,
|
||||
);
|
||||
// ------END------
|
||||
|
||||
/// Convert all settings into json
|
||||
Map<String, dynamic> toJson() => {for (var e in box.keys) e: box.get(e)};
|
||||
|
||||
late final primaryColor = StoreProperty(
|
||||
@@ -147,20 +176,6 @@ class SettingStore extends PersistentStore {
|
||||
true,
|
||||
);
|
||||
|
||||
/// Discussion #146
|
||||
late final serverTabUseOldUI = StoreProperty(
|
||||
box,
|
||||
'serverTabUseOldUI',
|
||||
false,
|
||||
);
|
||||
|
||||
/// Time out for server connect and more...
|
||||
late final timeout = StoreProperty(
|
||||
box,
|
||||
'timeOut',
|
||||
5,
|
||||
);
|
||||
|
||||
/// Duration of [timeout]
|
||||
Duration get timeoutD => Duration(seconds: timeout.fetch());
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:toolbox/core/persistant_store.dart';
|
||||
import 'package:toolbox/data/model/server/snippet.dart';
|
||||
import '../../core/persistant_store.dart';
|
||||
import '../model/server/snippet.dart';
|
||||
|
||||
class SnippetStore extends PersistentStore {
|
||||
class SnippetStore extends PersistentStore<Snippet> {
|
||||
void put(Snippet snippet) {
|
||||
box.put(snippet.name, snippet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user