Skip to content

Commit

Permalink
Merge pull request #128 from osociety/auto-port-scan
Browse files Browse the repository at this point in the history
Run default scan (Top) if device is passed
  • Loading branch information
git-elliot authored Mar 17, 2024
2 parents 1c7f8ae + ff71e0d commit b10321e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/pages/host_scan_page/widgets/host_scan_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class HostScanWidget extends StatelessWidget {
MaterialPageRoute(
builder: (context) => PortScanPage(
target: host.internetAddress.address,
runDefaultScan: true,
),
),
);
Expand Down
6 changes: 5 additions & 1 deletion lib/pages/network_troubleshoot/port_scan_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import 'package:vernet/ui/custom_tile.dart';
import 'package:vernet/ui/popular_chip.dart';

class PortScanPage extends StatefulWidget {
const PortScanPage({this.target = ''});
const PortScanPage({this.target = '', this.runDefaultScan = false});

final String target;
final bool runDefaultScan;

@override
_PortScanPageState createState() => _PortScanPageState();
Expand Down Expand Up @@ -114,6 +115,9 @@ class _PortScanPageState extends State<PortScanPage>
super.initState();
_tabController = TabController(length: _tabs.length, vsync: this);
_targetIPEditingController.text = widget.target;
if (widget.runDefaultScan) {
Future.delayed(Durations.short2, _startScanning);
}
}

ScanType? _type = ScanType.top;
Expand Down

0 comments on commit b10321e

Please sign in to comment.