opt.: mem usage
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 547;
|
||||
static const int build = 550;
|
||||
static const String engine = "3.13.2";
|
||||
static const String buildAt = "2023-09-12 14:04:07.018274";
|
||||
static const int modifications = 4;
|
||||
static const int script = 14;
|
||||
static const String buildAt = "2023-09-13 15:19:48";
|
||||
static const int modifications = 45;
|
||||
static const int script = 15;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import '../model/app/dynamic_color.dart';
|
||||
late Color primaryColor;
|
||||
|
||||
class DynamicColors {
|
||||
const DynamicColors._();
|
||||
|
||||
static const content = DynamicColor(Colors.black87, Colors.white70);
|
||||
static const bg = DynamicColor(Colors.white, Colors.black);
|
||||
static const progress = DynamicColor(Colors.black12, Colors.white10);
|
||||
|
||||
@@ -3,6 +3,8 @@ import 'dart:ui';
|
||||
import 'package:toolbox/data/model/ssh/virtual_key.dart';
|
||||
|
||||
class Defaults {
|
||||
const Defaults._();
|
||||
|
||||
// default server details page cards order
|
||||
static const detailCardOrder = [
|
||||
'uptime',
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:toolbox/data/model/app/github_id.dart';
|
||||
|
||||
class GithubIds {
|
||||
const GithubIds._();
|
||||
|
||||
// Thanks
|
||||
// If you want to change the url, please open an issue.
|
||||
// If you want to change the url, please open an issue.
|
||||
static const contributors = <GhId>{
|
||||
'its-tom',
|
||||
'RainSunMe',
|
||||
|
||||
@@ -33,6 +33,8 @@ import 'package:highlight/languages/xml.dart';
|
||||
import 'package:highlight/languages/yaml.dart';
|
||||
|
||||
class Highlights {
|
||||
const Highlights._();
|
||||
|
||||
/// - KEY: fileNameSuffix
|
||||
/// - VAL: highlight
|
||||
static final all = {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class Loggers {
|
||||
const Loggers._();
|
||||
|
||||
static final app = Logger('App');
|
||||
static final parse = Logger('Parse');
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ import 'dart:convert';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
class Miscs {
|
||||
const Miscs._();
|
||||
|
||||
/// RegExp for number
|
||||
static final numReg = RegExp(r'\s{1,}');
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import 'package:path_provider/path_provider.dart';
|
||||
import 'package:toolbox/core/utils/platform.dart';
|
||||
|
||||
class Paths {
|
||||
const Paths._();
|
||||
|
||||
static String? _docDir;
|
||||
static String? _sftpDir;
|
||||
static String? _fontDir;
|
||||
|
||||
@@ -8,59 +8,61 @@ import '../model/server/server_status.dart';
|
||||
import '../model/server/conn.dart';
|
||||
import '../model/server/system.dart';
|
||||
|
||||
Memory get _initMemory => const Memory(
|
||||
total: 1,
|
||||
free: 1,
|
||||
cache: 0,
|
||||
avail: 1,
|
||||
);
|
||||
OneTimeCpuStatus get _initOneTimeCpuStatus => OneTimeCpuStatus(
|
||||
'cpu',
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
);
|
||||
Cpus get initCpuStatus => Cpus(
|
||||
[_initOneTimeCpuStatus],
|
||||
[_initOneTimeCpuStatus],
|
||||
);
|
||||
NetSpeedPart get _initNetSpeedPart => NetSpeedPart(
|
||||
'',
|
||||
BigInt.zero,
|
||||
BigInt.zero,
|
||||
0,
|
||||
);
|
||||
NetSpeed get initNetSpeed => NetSpeed(
|
||||
[_initNetSpeedPart],
|
||||
[_initNetSpeedPart],
|
||||
);
|
||||
Swap get _initSwap => const Swap(
|
||||
total: 0,
|
||||
free: 0,
|
||||
cached: 0,
|
||||
);
|
||||
ServerStatus get initStatus => ServerStatus(
|
||||
cpu: initCpuStatus,
|
||||
mem: _initMemory,
|
||||
sysVer: 'Loading...',
|
||||
uptime: '',
|
||||
disk: [
|
||||
const Disk(
|
||||
path: '/',
|
||||
loc: '/',
|
||||
usedPercent: 0,
|
||||
used: '0',
|
||||
size: '0',
|
||||
avail: '0',
|
||||
)
|
||||
],
|
||||
tcp: const Conn(maxConn: 0, active: 0, passive: 0, fail: 0),
|
||||
netSpeed: initNetSpeed,
|
||||
swap: _initSwap,
|
||||
system: SystemType.linux,
|
||||
temps: Temperatures(),
|
||||
);
|
||||
class InitStatus {
|
||||
const InitStatus._();
|
||||
|
||||
static OneTimeCpuStatus get _initOneTimeCpuStatus => OneTimeCpuStatus(
|
||||
'cpu',
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
);
|
||||
static Cpus get cpus => Cpus(
|
||||
[_initOneTimeCpuStatus],
|
||||
[_initOneTimeCpuStatus],
|
||||
);
|
||||
static NetSpeedPart get _initNetSpeedPart => NetSpeedPart(
|
||||
'',
|
||||
BigInt.zero,
|
||||
BigInt.zero,
|
||||
0,
|
||||
);
|
||||
static NetSpeed get netSpeed => NetSpeed(
|
||||
[_initNetSpeedPart],
|
||||
[_initNetSpeedPart],
|
||||
);
|
||||
static ServerStatus get status => ServerStatus(
|
||||
cpu: cpus,
|
||||
mem: const Memory(
|
||||
total: 1,
|
||||
free: 1,
|
||||
cache: 0,
|
||||
avail: 1,
|
||||
),
|
||||
sysVer: 'Loading...',
|
||||
uptime: '',
|
||||
disk: [
|
||||
const Disk(
|
||||
path: '/',
|
||||
loc: '/',
|
||||
usedPercent: 0,
|
||||
used: '0',
|
||||
size: '0',
|
||||
avail: '0',
|
||||
)
|
||||
],
|
||||
tcp: const Conn(maxConn: 0, active: 0, passive: 0, fail: 0),
|
||||
netSpeed: netSpeed,
|
||||
swap: const Swap(
|
||||
total: 0,
|
||||
free: 0,
|
||||
cached: 0,
|
||||
),
|
||||
system: SystemType.linux,
|
||||
temps: Temperatures(),
|
||||
);
|
||||
}
|
||||
|
||||
18
lib/data/res/store.dart
Normal file
18
lib/data/res/store.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:toolbox/data/store/docker.dart';
|
||||
import 'package:toolbox/data/store/history.dart';
|
||||
import 'package:toolbox/data/store/private_key.dart';
|
||||
import 'package:toolbox/data/store/server.dart';
|
||||
import 'package:toolbox/data/store/setting.dart';
|
||||
import 'package:toolbox/data/store/snippet.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
|
||||
class Stores {
|
||||
const Stores._();
|
||||
|
||||
static final setting = locator<SettingStore>();
|
||||
static final server = locator<ServerStore>();
|
||||
static final docker = locator<DockerStore>();
|
||||
static final history = locator<HistoryStore>();
|
||||
static final key = locator<PrivateKeyStore>();
|
||||
static final snippet = locator<SnippetStore>();
|
||||
}
|
||||
@@ -1,54 +1,57 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:xterm/ui.dart';
|
||||
|
||||
const termDarkTheme = TerminalTheme(
|
||||
cursor: Color.fromARGB(137, 174, 175, 173),
|
||||
selection: Color.fromARGB(147, 174, 175, 173),
|
||||
foreground: Color(0XFFCCCCCC),
|
||||
background: Colors.black,
|
||||
searchHitBackground: Color(0XFFFFFF2B),
|
||||
searchHitBackgroundCurrent: Color(0XFF31FF26),
|
||||
searchHitForeground: Color(0XFF000000),
|
||||
red: Color.fromARGB(255, 194, 54, 33),
|
||||
green: Color.fromARGB(255, 37, 188, 36),
|
||||
yellow: Color.fromARGB(255, 173, 173, 39),
|
||||
blue: Color.fromARGB(255, 73, 46, 225),
|
||||
magenta: Color.fromARGB(255, 211, 56, 211),
|
||||
cyan: Color.fromARGB(255, 51, 187, 200),
|
||||
white: Color.fromARGB(255, 203, 204, 205),
|
||||
brightBlack: Color.fromARGB(255, 129, 131, 131),
|
||||
brightRed: Color.fromARGB(255, 252, 57, 31),
|
||||
brightGreen: Color.fromARGB(255, 49, 231, 34),
|
||||
brightYellow: Color.fromARGB(255, 234, 236, 35),
|
||||
brightBlue: Color.fromARGB(255, 88, 51, 255),
|
||||
brightMagenta: Color.fromARGB(255, 249, 53, 248),
|
||||
brightCyan: Color.fromARGB(255, 20, 240, 240),
|
||||
brightWhite: Color.fromARGB(255, 233, 235, 235),
|
||||
black: Colors.black,
|
||||
);
|
||||
class TerminalThemes {
|
||||
const TerminalThemes._();
|
||||
|
||||
const termLightTheme = TerminalTheme(
|
||||
cursor: Color.fromARGB(153, 174, 175, 173),
|
||||
selection: Color.fromARGB(102, 174, 175, 173),
|
||||
foreground: Color(0XFF000000),
|
||||
background: Color(0XFFFFFFFF),
|
||||
searchHitBackground: Color(0XFFFFFF2B),
|
||||
searchHitBackgroundCurrent: Color(0XFF31FF26),
|
||||
searchHitForeground: Color(0XFF000000),
|
||||
red: Color.fromARGB(255, 194, 54, 33),
|
||||
green: Color.fromARGB(255, 37, 188, 36),
|
||||
yellow: Color.fromARGB(255, 173, 173, 39),
|
||||
blue: Color.fromARGB(255, 73, 46, 225),
|
||||
magenta: Color.fromARGB(255, 211, 56, 211),
|
||||
cyan: Color.fromARGB(255, 51, 187, 200),
|
||||
white: Color.fromARGB(255, 203, 204, 205),
|
||||
brightBlack: Color.fromARGB(255, 129, 131, 131),
|
||||
brightRed: Color.fromARGB(255, 252, 57, 31),
|
||||
brightGreen: Color.fromARGB(255, 49, 231, 34),
|
||||
brightYellow: Color.fromARGB(255, 234, 236, 35),
|
||||
brightBlue: Color.fromARGB(255, 88, 51, 255),
|
||||
brightMagenta: Color.fromARGB(255, 249, 53, 248),
|
||||
brightCyan: Color.fromARGB(255, 20, 240, 240),
|
||||
brightWhite: Color.fromARGB(255, 233, 235, 235),
|
||||
black: Colors.black,
|
||||
);
|
||||
static const dark = TerminalTheme(
|
||||
cursor: Color.fromARGB(137, 174, 175, 173),
|
||||
selection: Color.fromARGB(147, 174, 175, 173),
|
||||
foreground: Color(0XFFCCCCCC),
|
||||
background: Colors.black,
|
||||
searchHitBackground: Color(0XFFFFFF2B),
|
||||
searchHitBackgroundCurrent: Color(0XFF31FF26),
|
||||
searchHitForeground: Color(0XFF000000),
|
||||
red: Color.fromARGB(255, 194, 54, 33),
|
||||
green: Color.fromARGB(255, 37, 188, 36),
|
||||
yellow: Color.fromARGB(255, 173, 173, 39),
|
||||
blue: Color.fromARGB(255, 73, 46, 225),
|
||||
magenta: Color.fromARGB(255, 211, 56, 211),
|
||||
cyan: Color.fromARGB(255, 51, 187, 200),
|
||||
white: Color.fromARGB(255, 203, 204, 205),
|
||||
brightBlack: Color.fromARGB(255, 129, 131, 131),
|
||||
brightRed: Color.fromARGB(255, 252, 57, 31),
|
||||
brightGreen: Color.fromARGB(255, 49, 231, 34),
|
||||
brightYellow: Color.fromARGB(255, 234, 236, 35),
|
||||
brightBlue: Color.fromARGB(255, 88, 51, 255),
|
||||
brightMagenta: Color.fromARGB(255, 249, 53, 248),
|
||||
brightCyan: Color.fromARGB(255, 20, 240, 240),
|
||||
brightWhite: Color.fromARGB(255, 233, 235, 235),
|
||||
black: Colors.black,
|
||||
);
|
||||
static const light = TerminalTheme(
|
||||
cursor: Color.fromARGB(153, 174, 175, 173),
|
||||
selection: Color.fromARGB(102, 174, 175, 173),
|
||||
foreground: Color(0XFF000000),
|
||||
background: Color(0XFFFFFFFF),
|
||||
searchHitBackground: Color(0XFFFFFF2B),
|
||||
searchHitBackgroundCurrent: Color(0XFF31FF26),
|
||||
searchHitForeground: Color(0XFF000000),
|
||||
red: Color.fromARGB(255, 194, 54, 33),
|
||||
green: Color.fromARGB(255, 37, 188, 36),
|
||||
yellow: Color.fromARGB(255, 173, 173, 39),
|
||||
blue: Color.fromARGB(255, 73, 46, 225),
|
||||
magenta: Color.fromARGB(255, 211, 56, 211),
|
||||
cyan: Color.fromARGB(255, 51, 187, 200),
|
||||
white: Color.fromARGB(255, 203, 204, 205),
|
||||
brightBlack: Color.fromARGB(255, 129, 131, 131),
|
||||
brightRed: Color.fromARGB(255, 252, 57, 31),
|
||||
brightGreen: Color.fromARGB(255, 49, 231, 34),
|
||||
brightYellow: Color.fromARGB(255, 234, 236, 35),
|
||||
brightBlue: Color.fromARGB(255, 88, 51, 255),
|
||||
brightMagenta: Color.fromARGB(255, 249, 53, 248),
|
||||
brightCyan: Color.fromARGB(255, 20, 240, 240),
|
||||
brightWhite: Color.fromARGB(255, 233, 235, 235),
|
||||
black: Colors.black,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class UIs {
|
||||
const UIs._();
|
||||
|
||||
/// Font style
|
||||
|
||||
static const textSize9Grey = TextStyle(color: Colors.grey, fontSize: 9);
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class Urls {
|
||||
const Urls._();
|
||||
|
||||
static const resBase = 'https://res.lolli.tech/serverbox';
|
||||
static const myGithub = 'https://github.com/lollipopkit';
|
||||
static const appHelp = '$myGithub/flutter_server_box#-help';
|
||||
|
||||
Reference in New Issue
Block a user