Skip to content

Commit

Permalink
Merge pull request #3 from blabla-yy/detail
Browse files Browse the repository at this point in the history
V1.3.0
  • Loading branch information
blabla-yy authored Nov 2, 2023
2 parents 1019bed + cbd49b5 commit 9df9768
Show file tree
Hide file tree
Showing 26 changed files with 733 additions and 179 deletions.
92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
.DS_Store
Preview Content/
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
## 1.0.1
1. 提供应用图标
2. 文字本地化
3. 应用名:monitor -> BandwidthMonitor

## 1.2.0
1. 优化性能
2. 支持macOS 10.15以上
3. 更换icon

## 1.3.0
1. macOS 13+
2. 可配置化
3. 兼容macOS 14

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO"
parallelizable = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "753FCFBF2A664315004B9FF3"
BuildableName = "NetworkMonitorTests.xctest"
BlueprintName = "NetworkMonitorTests"
ReferencedContainer = "container:NetworkMonitor.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "75C65D992351AA2500A12690"
BuildableName = "BandwidthMonitor.app"
BlueprintName = "BandwidthMonitor"
ReferencedContainer = "container:BandwidthMonitor.xcodeproj">
BuildableName = "NetworkMonitor.app"
BlueprintName = "NetworkMonitor"
ReferencedContainer = "container:NetworkMonitor.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -34,9 +34,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "753FCFBF2A664315004B9FF3"
BuildableName = "BandwidthMonitorTests.xctest"
BlueprintName = "BandwidthMonitorTests"
ReferencedContainer = "container:BandwidthMonitor.xcodeproj">
BuildableName = "NetworkMonitorTests.xctest"
BlueprintName = "NetworkMonitorTests"
ReferencedContainer = "container:NetworkMonitor.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
Expand All @@ -57,9 +57,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "75C65D992351AA2500A12690"
BuildableName = "BandwidthMonitor.app"
BlueprintName = "BandwidthMonitor"
ReferencedContainer = "container:BandwidthMonitor.xcodeproj">
BuildableName = "NetworkMonitor.app"
BlueprintName = "NetworkMonitor"
ReferencedContainer = "container:NetworkMonitor.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
Expand All @@ -74,9 +74,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "75C65D992351AA2500A12690"
BuildableName = "BandwidthMonitor.app"
BlueprintName = "BandwidthMonitor"
ReferencedContainer = "container:BandwidthMonitor.xcodeproj">
BuildableName = "NetworkMonitor.app"
BlueprintName = "NetworkMonitor"
ReferencedContainer = "container:NetworkMonitor.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>NetworkMonitorTests.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>NetworkTraffic.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//
// BandwidthMonitorTests.swift
// BandwidthMonitorTests
// NetworkMonitorTests.swift
// NetworkMonitorTests
//
// Created by wyy on 2023/7/18.
// Copyright © 2023 yahaha. All rights reserved.
//

import XCTest

final class BandwidthMonitorTests: XCTestCase {
final class NetworkMonitorTests: XCTestCase {

override func setUpWithError() throws {
// Put setup code here. This method is called before the invocation of each test method in the class.
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# MacOS 流量监控
# MacOS NetworkMonitor

![image](https://raw.githubusercontent.com/QaQAdrian/monitor/master/demo.png)

## 介绍
Mac状态栏应用,可以实时显示网速
## Feature
- Real-time network traffic statistics
- Configurable tcp, udp and other statistical rules

## 系统要求
macOS 10.15以上

## 安装运行
首次执行后,需要在 设置 -> 隐私与安全性 -> 提示"BandwidthMonitor"未知开发者,点击仍要打开。(项目没有涉及用户隐私或修改系统信息的部分)
## System Requirements
macOS 13 or later
(v1.2.0 macOS 10.15 or later)

## Installation
If opening fails, you can try this.
System Settings -> Privacy and Security -> "NetworkMonitor" cannot be opened because it is from an unidentified developer click "Open Anyway".

## License
See [LICENSE.md](LICENSE) for licensing information.
2 changes: 1 addition & 1 deletion en.lproj/InfoPlist.strings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
InfoPlist.strings
BandwidthMonitor
NetworkMonitor

Created by wyy on 2019/12/11.
Copyright © 2019 yahaha. All rights reserved.
Expand Down
20 changes: 20 additions & 0 deletions en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,23 @@
"upload" = "Upload";
"download" = "Download";
"quit" = "Quit";

"Open main window" = "Open main window";

"tcpAndUdp" = "TCP and UDP";
"tcp" = "TCP";
"udp" = "UDP";
"route" = "Routing Table";

"wifi" = "WiFi";
"wired" = "Wired";
"loopback" = "Loopback";
"awdl" = "Apple Wireless Direct Link";
//"expensive" = "Expensive";
"external" = "Non-Loopback";

"all" = "All";

"Basic" = "Basic";
"Status Bar" = "Status Bar";
"Keep Decimals" = "Keep Decimals";
30 changes: 30 additions & 0 deletions monitor/App.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// App.swift
// NetworkMonitor
//
// Created by wyy on 2023/11/1.
// Copyright © 2023 yahaha. All rights reserved.
//

import SwiftUI

@main
struct Main: App {
static let id = "main"

@NSApplicationDelegateAdaptor(AppDelegate.self) var delegate
@Environment(\.openWindow) var openWindow

var body: some Scene {
WindowGroup(id: Main.id) {
ContentView()
.onAppear {
// trick
DispatchQueue.main.async {
delegate.networkBar?.openWindow = openWindow
}
}
.environmentObject(delegate.nettop)
}
}
}
Loading

0 comments on commit 9df9768

Please sign in to comment.