mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-06-28 22:56:48 +08:00
Update
This commit is contained in:
@@ -26,6 +26,7 @@ class ServerStatus {
|
||||
required this.meilisearchEnabled,
|
||||
this.meilisearch,
|
||||
required this.noUser,
|
||||
required this.isDocker,
|
||||
});
|
||||
|
||||
@JsonKey(name: 'ffmpeg_api_enabled')
|
||||
@@ -37,6 +38,8 @@ class ServerStatus {
|
||||
final MeilisearchInfo? meilisearch;
|
||||
@JsonKey(name: 'no_user')
|
||||
final bool noUser;
|
||||
@JsonKey(name: 'is_docker')
|
||||
final bool isDocker;
|
||||
|
||||
factory ServerStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServerStatusFromJson(json);
|
||||
|
||||
@@ -27,6 +27,7 @@ ServerStatus _$ServerStatusFromJson(Map<String, dynamic> json) => ServerStatus(
|
||||
: MeilisearchInfo.fromJson(
|
||||
json['meilisearch'] as Map<String, dynamic>),
|
||||
noUser: json['no_user'] as bool,
|
||||
isDocker: json['is_docker'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServerStatusToJson(ServerStatus instance) =>
|
||||
@@ -36,4 +37,5 @@ Map<String, dynamic> _$ServerStatusToJson(ServerStatus instance) =>
|
||||
'meilisearch_enabled': instance.meilisearchEnabled,
|
||||
'meilisearch': instance.meilisearch,
|
||||
'no_user': instance.noUser,
|
||||
'is_docker': instance.isDocker,
|
||||
};
|
||||
|
||||
@@ -17,6 +17,7 @@ class AuthInfo {
|
||||
bool _isChecking = false;
|
||||
bool get isChecking => _isChecking;
|
||||
bool? get isAdmin => _user?.isAdmin;
|
||||
bool? get isDocker => _status?.isDocker;
|
||||
|
||||
void clear() {
|
||||
_user = null;
|
||||
|
||||
@@ -387,36 +387,40 @@ class _ServerSettingsPage extends State<ServerSettingsPage>
|
||||
}
|
||||
},
|
||||
)),
|
||||
_buildWithVecticalPadding(NumberFormField(
|
||||
min: 0,
|
||||
max: 65535,
|
||||
initialValue: _now.port ?? _config!.port,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: i18n.listeningPort,
|
||||
),
|
||||
onChanged: (s) {
|
||||
if (s != null) {
|
||||
setState(() {
|
||||
_now.port = s;
|
||||
_changed = true;
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
_buildWithVecticalPadding(TextFormField(
|
||||
initialValue: _now.hostname ?? _config!.hostname,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: i18n.listeningHostname,
|
||||
),
|
||||
onChanged: (s) {
|
||||
setState(() {
|
||||
_now.hostname = s;
|
||||
_changed = true;
|
||||
});
|
||||
},
|
||||
)),
|
||||
auth.isDocker == true
|
||||
? Container()
|
||||
: _buildWithVecticalPadding(NumberFormField(
|
||||
min: 0,
|
||||
max: 65535,
|
||||
initialValue: _now.port ?? _config!.port,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: i18n.listeningPort,
|
||||
),
|
||||
onChanged: (s) {
|
||||
if (s != null) {
|
||||
setState(() {
|
||||
_now.port = s;
|
||||
_changed = true;
|
||||
});
|
||||
}
|
||||
},
|
||||
)),
|
||||
auth.isDocker == true
|
||||
? Container()
|
||||
: _buildWithVecticalPadding(TextFormField(
|
||||
initialValue: _now.hostname ?? _config!.hostname,
|
||||
decoration: InputDecoration(
|
||||
border: const OutlineInputBorder(),
|
||||
labelText: i18n.listeningHostname,
|
||||
),
|
||||
onChanged: (s) {
|
||||
setState(() {
|
||||
_now.hostname = s;
|
||||
_changed = true;
|
||||
});
|
||||
},
|
||||
)),
|
||||
_buildWithVecticalPadding(TextFormField(
|
||||
initialValue: _now.meiliHost ?? _config!.meiliHost,
|
||||
decoration: InputDecoration(
|
||||
|
||||
Reference in New Issue
Block a user