mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 15:54:35 +01:00
@@ -20,6 +20,7 @@ import 'package:highlight/languages/nix.dart';
|
||||
import 'package:highlight/languages/objectivec.dart';
|
||||
import 'package:highlight/languages/perl.dart';
|
||||
import 'package:highlight/languages/php.dart';
|
||||
import 'package:highlight/languages/plaintext.dart';
|
||||
import 'package:highlight/languages/powershell.dart';
|
||||
import 'package:highlight/languages/python.dart';
|
||||
import 'package:highlight/languages/ruby.dart';
|
||||
@@ -34,7 +35,7 @@ import 'package:highlight/languages/yaml.dart';
|
||||
|
||||
// KEY: fileNameSuffix
|
||||
// VAL: highlight
|
||||
final _suffix2HighlightMap = {
|
||||
final suffix2HighlightMap = {
|
||||
'dart': dart,
|
||||
'go': go,
|
||||
'rust': rust,
|
||||
@@ -68,12 +69,16 @@ final _suffix2HighlightMap = {
|
||||
'html': htmlbars,
|
||||
'tex': tex,
|
||||
'vim': vim,
|
||||
'plaintext': plaintext,
|
||||
};
|
||||
|
||||
extension HighlightString on String? {
|
||||
Mode? get highlight {
|
||||
return suffix2HighlightMap[highlightCode];
|
||||
}
|
||||
|
||||
String? get highlightCode {
|
||||
if (this == null) return null;
|
||||
final suffix = this!.split('.').last;
|
||||
return _suffix2HighlightMap[suffix];
|
||||
return this!.split('.').last;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ final numReg = RegExp(r'\s{1,}');
|
||||
/// Private Key max allowed size is 20kb
|
||||
const privateKeyMaxSize = 20 * 1024;
|
||||
|
||||
// Editor max allowed size is 1mb
|
||||
const editorMaxSize = 1024 * 1024;
|
||||
|
||||
/// Max debug log lines
|
||||
const maxDebugLogLines = 100;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'package:toolbox/data/model/server/temp.dart';
|
||||
|
||||
import '../model/server/cpu_status.dart';
|
||||
import '../model/server/disk_info.dart';
|
||||
import '../model/server/cpu.dart';
|
||||
import '../model/server/disk.dart';
|
||||
import '../model/server/memory.dart';
|
||||
import '../model/server/net_speed.dart';
|
||||
import '../model/server/server_status.dart';
|
||||
import '../model/server/conn_status.dart';
|
||||
import '../model/server/conn.dart';
|
||||
|
||||
Memory get _initMemory => Memory(
|
||||
total: 1,
|
||||
@@ -23,7 +23,7 @@ OneTimeCpuStatus get _initOneTimeCpuStatus => OneTimeCpuStatus(
|
||||
0,
|
||||
0,
|
||||
);
|
||||
CpuStatus get initCpuStatus => CpuStatus(
|
||||
Cpus get initCpuStatus => Cpus(
|
||||
[_initOneTimeCpuStatus],
|
||||
[_initOneTimeCpuStatus],
|
||||
);
|
||||
@@ -48,7 +48,7 @@ ServerStatus get initStatus => ServerStatus(
|
||||
sysVer: 'Loading...',
|
||||
uptime: '',
|
||||
disk: [
|
||||
DiskInfo(
|
||||
Disk(
|
||||
path: '/',
|
||||
loc: '/',
|
||||
usedPercent: 0,
|
||||
@@ -57,7 +57,7 @@ ServerStatus get initStatus => ServerStatus(
|
||||
avail: '0',
|
||||
)
|
||||
],
|
||||
tcp: ConnStatus(maxConn: 0, active: 0, passive: 0, fail: 0),
|
||||
tcp: Conn(maxConn: 0, active: 0, passive: 0, fail: 0),
|
||||
netSpeed: initNetSpeed,
|
||||
swap: _initSwap,
|
||||
temps: Temperatures(),
|
||||
|
||||
@@ -10,9 +10,9 @@ final virtualKeys = [
|
||||
VirtualKey('Up', key: TerminalKey.arrowUp, icon: Icons.arrow_upward),
|
||||
VirtualKey('End', key: TerminalKey.end),
|
||||
VirtualKey(
|
||||
'Del',
|
||||
key: TerminalKey.delete,
|
||||
icon: Icons.backspace,
|
||||
'File',
|
||||
func: VirtualKeyFunc.file,
|
||||
icon: Icons.file_open,
|
||||
),
|
||||
VirtualKey('Snippet', func: VirtualKeyFunc.snippet, icon: Icons.code),
|
||||
VirtualKey('Tab', key: TerminalKey.tab),
|
||||
|
||||
Reference in New Issue
Block a user