mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:toolbox/data/res/misc.dart';
|
import 'package:toolbox/data/res/misc.dart';
|
||||||
|
|
||||||
class BgRunMC {
|
abstract final class BgRunMC {
|
||||||
const BgRunMC._();
|
|
||||||
|
|
||||||
static const _channel = MethodChannel('${Miscs.pkgName}/app_retain');
|
static const _channel = MethodChannel('${Miscs.pkgName}/app_retain');
|
||||||
|
|
||||||
static void moveToBg() {
|
static void moveToBg() {
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:toolbox/data/res/misc.dart';
|
import 'package:toolbox/data/res/misc.dart';
|
||||||
|
|
||||||
class HomeWidgetMC {
|
abstract final class HomeWidgetMC {
|
||||||
const HomeWidgetMC._();
|
|
||||||
|
|
||||||
static const _channel = MethodChannel('${Miscs.pkgName}/home_widget');
|
static const _channel = MethodChannel('${Miscs.pkgName}/home_widget');
|
||||||
|
|
||||||
static void update() {
|
static void update() {
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ import 'package:flutter/foundation.dart';
|
|||||||
import 'package:hive_flutter/hive_flutter.dart';
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
import 'package:toolbox/data/res/path.dart';
|
import 'package:toolbox/data/res/path.dart';
|
||||||
|
|
||||||
// class SecureStore {
|
// abstract final class SecureStore {
|
||||||
// SecureStore._();
|
|
||||||
|
|
||||||
// static const _secureStorage = FlutterSecureStorage();
|
// static const _secureStorage = FlutterSecureStorage();
|
||||||
|
|
||||||
// static HiveAesCipher? _cipher;
|
// static HiveAesCipher? _cipher;
|
||||||
|
|||||||
@@ -25,11 +25,9 @@ class SyncResult<T, E> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ICloud {
|
abstract final class ICloud {
|
||||||
static const _containerId = 'iCloud.tech.lolli.serverbox';
|
static const _containerId = 'iCloud.tech.lolli.serverbox';
|
||||||
|
|
||||||
const ICloud._();
|
|
||||||
|
|
||||||
/// Upload file to iCloud
|
/// Upload file to iCloud
|
||||||
///
|
///
|
||||||
/// - [relativePath] is the path relative to [docDir],
|
/// - [relativePath] is the path relative to [docDir],
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ import 'package:local_auth/local_auth.dart';
|
|||||||
import 'package:toolbox/core/utils/platform/base.dart';
|
import 'package:toolbox/core/utils/platform/base.dart';
|
||||||
import 'package:local_auth/error_codes.dart' as errs;
|
import 'package:local_auth/error_codes.dart' as errs;
|
||||||
|
|
||||||
class BioAuth {
|
abstract final class BioAuth {
|
||||||
const BioAuth._();
|
|
||||||
|
|
||||||
static final _auth = LocalAuthentication();
|
static final _auth = LocalAuthentication();
|
||||||
|
|
||||||
static bool get isPlatformSupported => isAndroid || isIOS || isWindows;
|
static bool get isPlatformSupported => isAndroid || isIOS || isWindows;
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ import 'package:share_plus/share_plus.dart';
|
|||||||
import 'package:toolbox/core/extension/context/locale.dart';
|
import 'package:toolbox/core/extension/context/locale.dart';
|
||||||
import 'package:toolbox/data/res/provider.dart';
|
import 'package:toolbox/data/res/provider.dart';
|
||||||
|
|
||||||
class Shares {
|
abstract final class Shares {
|
||||||
const Shares._();
|
|
||||||
|
|
||||||
static Future<bool> files(List<String> filePaths) async {
|
static Future<bool> files(List<String> filePaths) async {
|
||||||
for (final filePath in filePaths) {
|
for (final filePath in filePaths) {
|
||||||
if (!await File(filePath).exists()) {
|
if (!await File(filePath).exists()) {
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import '../model/app/dynamic_color.dart';
|
|||||||
|
|
||||||
late Color primaryColor;
|
late Color primaryColor;
|
||||||
|
|
||||||
class DynamicColors {
|
abstract final class DynamicColors {
|
||||||
const DynamicColors._();
|
|
||||||
|
|
||||||
static const content = DynamicColor(Colors.black87, Colors.white70);
|
static const content = DynamicColor(Colors.black87, Colors.white70);
|
||||||
static const bg = DynamicColor(Colors.white, Colors.black);
|
static const bg = DynamicColor(Colors.white, Colors.black);
|
||||||
static const progress = DynamicColor(Colors.black12, Colors.white10);
|
static const progress = DynamicColor(Colors.black12, Colors.white10);
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ import 'dart:ui';
|
|||||||
|
|
||||||
import 'package:toolbox/data/model/ssh/virtual_key.dart';
|
import 'package:toolbox/data/model/ssh/virtual_key.dart';
|
||||||
|
|
||||||
class Defaults {
|
abstract final class Defaults {
|
||||||
const Defaults._();
|
|
||||||
|
|
||||||
// default server details page cards order
|
// default server details page cards order
|
||||||
static const detailCardOrder = [
|
static const detailCardOrder = [
|
||||||
'uptime',
|
'uptime',
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
import 'package:toolbox/data/model/app/github_id.dart';
|
import 'package:toolbox/data/model/app/github_id.dart';
|
||||||
|
|
||||||
class GithubIds {
|
abstract final class GithubIds {
|
||||||
const GithubIds._();
|
|
||||||
|
|
||||||
// Thanks
|
// Thanks
|
||||||
// If you want to change the url, please open an issue.
|
// If you want to change your Github ID, please open an issue.
|
||||||
static const contributors = <GhId>{
|
static const contributors = <GhId>{
|
||||||
'its-tom',
|
'its-tom',
|
||||||
'RainSunMe',
|
'RainSunMe',
|
||||||
@@ -41,6 +39,8 @@ class GithubIds {
|
|||||||
'balh55y',
|
'balh55y',
|
||||||
'wc7086',
|
'wc7086',
|
||||||
'michaelsara',
|
'michaelsara',
|
||||||
'xingleiwu'
|
'xingleiwu',
|
||||||
|
'Cooper098',
|
||||||
|
'xushuojie',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,9 +32,7 @@ import 'package:highlight/languages/vim.dart';
|
|||||||
import 'package:highlight/languages/xml.dart';
|
import 'package:highlight/languages/xml.dart';
|
||||||
import 'package:highlight/languages/yaml.dart';
|
import 'package:highlight/languages/yaml.dart';
|
||||||
|
|
||||||
class Highlights {
|
abstract final class Highlights {
|
||||||
const Highlights._();
|
|
||||||
|
|
||||||
/// - KEY: fileNameSuffix
|
/// - KEY: fileNameSuffix
|
||||||
/// - VAL: highlight
|
/// - VAL: highlight
|
||||||
static final all = {
|
static final all = {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import 'package:logging/logging.dart';
|
import 'package:logging/logging.dart';
|
||||||
|
|
||||||
class Loggers {
|
abstract final class Loggers {
|
||||||
const Loggers._();
|
|
||||||
|
|
||||||
static final root = Logger('Root');
|
static final root = Logger('Root');
|
||||||
static final app = Logger('App');
|
static final app = Logger('App');
|
||||||
static final parse = Logger('Parse');
|
static final parse = Logger('Parse');
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class Miscs {
|
abstract final class Miscs {
|
||||||
const Miscs._();
|
|
||||||
|
|
||||||
/// RegExp for number
|
/// RegExp for number
|
||||||
static final numReg = RegExp(r'\s{1,}');
|
static final numReg = RegExp(r'\s{1,}');
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,7 @@ import 'package:path_provider/path_provider.dart';
|
|||||||
import 'package:toolbox/core/utils/platform/base.dart';
|
import 'package:toolbox/core/utils/platform/base.dart';
|
||||||
import 'package:toolbox/core/utils/platform/path.dart';
|
import 'package:toolbox/core/utils/platform/path.dart';
|
||||||
|
|
||||||
class Paths {
|
abstract final class Paths {
|
||||||
const Paths._();
|
|
||||||
|
|
||||||
static String? _docDir;
|
static String? _docDir;
|
||||||
static String? _sftpDir;
|
static String? _sftpDir;
|
||||||
static String? _fontDir;
|
static String? _fontDir;
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import 'package:toolbox/data/provider/sftp.dart';
|
|||||||
import 'package:toolbox/data/provider/snippet.dart';
|
import 'package:toolbox/data/provider/snippet.dart';
|
||||||
import 'package:toolbox/locator.dart';
|
import 'package:toolbox/locator.dart';
|
||||||
|
|
||||||
class Pros {
|
abstract final class Pros {
|
||||||
const Pros._();
|
|
||||||
|
|
||||||
static final app = locator<AppProvider>();
|
static final app = locator<AppProvider>();
|
||||||
static final debug = locator<DebugProvider>();
|
static final debug = locator<DebugProvider>();
|
||||||
static final docker = locator<DockerProvider>();
|
static final docker = locator<DockerProvider>();
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import 'package:toolbox/data/model/app/rebuild.dart';
|
import 'package:toolbox/data/model/app/rebuild.dart';
|
||||||
|
|
||||||
class RebuildNodes {
|
abstract final class RebuildNodes {
|
||||||
const RebuildNodes._();
|
|
||||||
|
|
||||||
static final app = RebuildNode();
|
static final app = RebuildNode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,7 @@ import '../model/server/net_speed.dart';
|
|||||||
import '../model/server/conn.dart';
|
import '../model/server/conn.dart';
|
||||||
import '../model/server/system.dart';
|
import '../model/server/system.dart';
|
||||||
|
|
||||||
class InitStatus {
|
abstract final class InitStatus {
|
||||||
const InitStatus._();
|
|
||||||
|
|
||||||
static OneTimeCpuStatus get _initOneTimeCpuStatus => OneTimeCpuStatus(
|
static OneTimeCpuStatus get _initOneTimeCpuStatus => OneTimeCpuStatus(
|
||||||
'cpu',
|
'cpu',
|
||||||
0,
|
0,
|
||||||
|
|||||||
@@ -7,9 +7,7 @@ import 'package:toolbox/data/store/setting.dart';
|
|||||||
import 'package:toolbox/data/store/snippet.dart';
|
import 'package:toolbox/data/store/snippet.dart';
|
||||||
import 'package:toolbox/locator.dart';
|
import 'package:toolbox/locator.dart';
|
||||||
|
|
||||||
class Stores {
|
abstract final class Stores {
|
||||||
const Stores._();
|
|
||||||
|
|
||||||
static final setting = locator<SettingStore>();
|
static final setting = locator<SettingStore>();
|
||||||
static final server = locator<ServerStore>();
|
static final server = locator<ServerStore>();
|
||||||
static final docker = locator<DockerStore>();
|
static final docker = locator<DockerStore>();
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:xterm/ui.dart';
|
import 'package:xterm/ui.dart';
|
||||||
|
|
||||||
class TerminalThemes {
|
abstract final class TerminalThemes {
|
||||||
const TerminalThemes._();
|
|
||||||
|
|
||||||
static const dark = TerminalTheme(
|
static const dark = TerminalTheme(
|
||||||
cursor: Color.fromARGB(137, 174, 175, 173),
|
cursor: Color.fromARGB(137, 174, 175, 173),
|
||||||
selection: Color.fromARGB(147, 174, 175, 173),
|
selection: Color.fromARGB(147, 174, 175, 173),
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class UIs {
|
abstract final class UIs {
|
||||||
const UIs._();
|
|
||||||
|
|
||||||
/// Font style
|
/// Font style
|
||||||
|
|
||||||
static const textSize9Grey = TextStyle(color: Colors.grey, fontSize: 9);
|
static const textSize9Grey = TextStyle(color: Colors.grey, fontSize: 9);
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
class Urls {
|
abstract final class Urls {
|
||||||
const Urls._();
|
|
||||||
|
|
||||||
static const resBase = 'https://res.lolli.tech/serverbox';
|
static const resBase = 'https://res.lolli.tech/serverbox';
|
||||||
static const myGithub = 'https://github.com/lollipopkit';
|
static const myGithub = 'https://github.com/lollipopkit';
|
||||||
static const appHelp = '$myGithub/flutter_server_box#-help';
|
static const appHelp = '$myGithub/flutter_server_box#-help';
|
||||||
|
|||||||
@@ -325,8 +325,7 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
if (processes.isNotEmpty) {
|
if (processes.isNotEmpty) {
|
||||||
children.addAll(processes.map((e) => _buildGpuProcessItem(e)));
|
children.addAll(processes.map((e) => _buildGpuProcessItem(e)));
|
||||||
}
|
}
|
||||||
return CardX(
|
return ListTile(
|
||||||
ListTile(
|
|
||||||
title: Text(item.name, style: UIs.textSize13),
|
title: Text(item.name, style: UIs.textSize13),
|
||||||
leading: Text(
|
leading: Text(
|
||||||
'${item.temp}°C',
|
'${item.temp}°C',
|
||||||
@@ -366,7 +365,6 @@ class _ServerDetailPageState extends State<ServerDetailPage>
|
|||||||
},
|
},
|
||||||
child: const Icon(Icons.info_outline, size: 17),
|
child: const Icon(Icons.info_outline, size: 17),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user