Skip to content

Commit

Permalink
Merge pull request #74 from Muska-Ami/dev
Browse files Browse the repository at this point in the history
Update to v0.1.7+rc2
  • Loading branch information
Muska-Ami authored Feb 14, 2024
2 parents 480f9af + a042375 commit 98cfb67
Show file tree
Hide file tree
Showing 82 changed files with 2,121 additions and 2,154 deletions.
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ linter:
# producing the lint.
rules:
prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
always_use_package_imports: true
avoid_web_libraries_in_flutter: true
use_build_context_synchronously: false
annotate_overrides: true
# avoid_print: false # Uncomment to disable the `avoid_print` rule

# Additional information about this file can be found at
Expand Down
229 changes: 0 additions & 229 deletions lib/controllers/FrpcSettingController.dart

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:nyalcf/utils/frpc/ProcessManager.dart';
import 'package:nyalcf/utils/frpc/process_manager.dart';

/// 控制台 GetX 状态控制器
class ConsoleController extends GetxController {
var widgets = <DataRow>[].obs;
RxList<DataRow> widgets = <DataRow>[].obs;

/// UI组件列表
var process_list = <Map>[].obs;
RxList<Map<String, dynamic>> processList = <Map<String, dynamic>>[].obs;

/// 进程管理列表
/// 添加进程
addProcess(p_map) {
process_list.add(p_map);
process_list.refresh();
addProcess(Map<String, dynamic> pMap) {
processList.add(pMap);
processList.refresh();
}

/// 移除进程
removeProcess(p_map) {
process_list.remove(p_map);
process_list.refresh();
removeProcess(Map<String, dynamic> pMap) {
processList.remove(pMap);
processList.refresh();
}

/// 清空进程
clearProcess() {
process_list.clear();
process_list.refresh();
processList.clear();
processList.refresh();
}

/// 加载进程管理信息
load() {
widgets.value = <DataRow>[];
process_list.forEach((element) {
final process = element['process'];
final proxy_id = element['proxy_id'];
for (Map<String, dynamic> element in processList) {
final Process process = element['process'];
final int proxyId = element['proxy_id'];

/// 添加进程管理信息至UI组件列表
widgets.add(DataRow(cells: [
widgets.add(DataRow(cells: <DataCell>[
DataCell(Text(process.pid.toString())),

/// 进程ID
DataCell(Text(proxy_id.toString())),
DataCell(Text(proxyId.toString())),

/// 代理ID
DataCell(
IconButton(
icon: Icon(Icons.close),
icon: const Icon(Icons.close),
onPressed: () {
/// 杀死进程
FrpcProcessManager().kill(element);
Expand All @@ -56,6 +58,6 @@ class ConsoleController extends GetxController {
),
]));
widgets.refresh();
});
}
}
}
Loading

0 comments on commit 98cfb67

Please sign in to comment.