Skip to content

Commit

Permalink
Merge pull request #5 from blabla-yy/feature/cpu+memory
Browse files Browse the repository at this point in the history
Cpu/Memory Widget
  • Loading branch information
blabla-yy authored Nov 16, 2023
2 parents 6ca1abb + 47c40a8 commit 8a52458
Show file tree
Hide file tree
Showing 39 changed files with 540 additions and 117 deletions.
48 changes: 34 additions & 14 deletions NetworkMonitor.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
7593FB6C2AFB8F06006514EF /* SysUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 755E5DEC23546BE10055946F /* SysUtils.swift */; };
7593FB6D2AFB8F09006514EF /* StringUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753054F0238E5B0000072D6E /* StringUtils.swift */; };
7593FB6F2AFCCA4B006514EF /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7579DCE22372CFCB0083D47D /* Localizable.strings */; };
75BA1AFE2B05F73F006DAF68 /* SysInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75BA1AFD2B05F73F006DAF68 /* SysInfo.swift */; };
75BA1AFF2B05FC04006DAF68 /* SysInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75BA1AFD2B05F73F006DAF68 /* SysInfo.swift */; };
75BA1B042B06029F006DAF68 /* MemoryWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75BA1B022B0600E1006DAF68 /* MemoryWidget.swift */; };
75BA1B072B0605FC006DAF68 /* CpuWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75BA1B052B0605F4006DAF68 /* CpuWidget.swift */; };
75C65D9E2351AA2500A12690 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75C65D9D2351AA2500A12690 /* AppDelegate.swift */; };
75C65DA22351AA2600A12690 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75C65DA12351AA2600A12690 /* Assets.xcassets */; };
75C65DA52351AA2600A12690 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 75C65DA32351AA2600A12690 /* Main.storyboard */; };
Expand All @@ -32,10 +36,12 @@
75E7980F2AFB3C9F0035B0E0 /* SharedData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E7980E2AFB3C9F0035B0E0 /* SharedData.swift */; };
75E798162AFB3CB70035B0E0 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75E798152AFB3CB70035B0E0 /* WidgetKit.framework */; };
75E798182AFB3CB70035B0E0 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 75E798172AFB3CB70035B0E0 /* SwiftUI.framework */; };
75E7981B2AFB3CB70035B0E0 /* widgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E7981A2AFB3CB70035B0E0 /* widgetBundle.swift */; };
75E7981D2AFB3CB80035B0E0 /* widget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E7981C2AFB3CB70035B0E0 /* widget.swift */; };
75E7981B2AFB3CB70035B0E0 /* WidgetBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E7981A2AFB3CB70035B0E0 /* WidgetBundle.swift */; };
75E7981D2AFB3CB80035B0E0 /* NetworkWidget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E7981C2AFB3CB70035B0E0 /* NetworkWidget.swift */; };
75E7981F2AFB3CBA0035B0E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 75E7981E2AFB3CBA0035B0E0 /* Assets.xcassets */; };
75E798242AFB3CBA0035B0E0 /* widgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 75E798142AFB3CB70035B0E0 /* widgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
F0F25DDB2B065AA5003EB2FC /* snapshot.json in Resources */ = {isa = PBXBuildFile; fileRef = F0F25DD92B065970003EB2FC /* snapshot.json */; };
F0F25DDC2B065AA8003EB2FC /* snapshot.json in Resources */ = {isa = PBXBuildFile; fileRef = F0F25DD92B065970003EB2FC /* snapshot.json */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -96,6 +102,9 @@
7579DCE12372CFCB0083D47D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
7579DCE32372D12B0083D47D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
7579DCE42372D12B0083D47D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
75BA1AFD2B05F73F006DAF68 /* SysInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SysInfo.swift; sourceTree = "<group>"; };
75BA1B022B0600E1006DAF68 /* MemoryWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoryWidget.swift; sourceTree = "<group>"; };
75BA1B052B0605F4006DAF68 /* CpuWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CpuWidget.swift; sourceTree = "<group>"; };
75C65D9A2351AA2500A12690 /* NetworkMonitor.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NetworkMonitor.app; sourceTree = BUILT_PRODUCTS_DIR; };
75C65D9D2351AA2500A12690 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
75C65DA12351AA2600A12690 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -109,11 +118,12 @@
75E798142AFB3CB70035B0E0 /* widgetExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = widgetExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
75E798152AFB3CB70035B0E0 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
75E798172AFB3CB70035B0E0 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
75E7981A2AFB3CB70035B0E0 /* widgetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = widgetBundle.swift; sourceTree = "<group>"; };
75E7981C2AFB3CB70035B0E0 /* widget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = widget.swift; sourceTree = "<group>"; };
75E7981A2AFB3CB70035B0E0 /* WidgetBundle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetBundle.swift; sourceTree = "<group>"; };
75E7981C2AFB3CB70035B0E0 /* NetworkWidget.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkWidget.swift; sourceTree = "<group>"; };
75E7981E2AFB3CBA0035B0E0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
75E798202AFB3CBA0035B0E0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
75E798212AFB3CBA0035B0E0 /* widget.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = widget.entitlements; sourceTree = "<group>"; };
F0F25DD92B065970003EB2FC /* snapshot.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = snapshot.json; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -163,6 +173,7 @@
75C65D912351AA2500A12690 = {
isa = PBXGroup;
children = (
F0F25DD92B065970003EB2FC /* snapshot.json */,
75515E6D23A0E84500A84695 /* InfoPlist.strings */,
753054F5238E679500072D6E /* CHANGELOG.md */,
7579DCE22372CFCB0083D47D /* Localizable.strings */,
Expand Down Expand Up @@ -222,6 +233,7 @@
75C65DB32351AC2800A12690 /* utils */ = {
isa = PBXGroup;
children = (
75BA1AFD2B05F73F006DAF68 /* SysInfo.swift */,
753FD0282A66B158004B9FF3 /* UIntExtensions.swift */,
75C65DB42351AC3E00A12690 /* CmdUtils.swift */,
755E5DEC23546BE10055946F /* SysUtils.swift */,
Expand Down Expand Up @@ -251,8 +263,10 @@
75E798192AFB3CB70035B0E0 /* widget */ = {
isa = PBXGroup;
children = (
75E7981A2AFB3CB70035B0E0 /* widgetBundle.swift */,
75E7981C2AFB3CB70035B0E0 /* widget.swift */,
75E7981A2AFB3CB70035B0E0 /* WidgetBundle.swift */,
75E7981C2AFB3CB70035B0E0 /* NetworkWidget.swift */,
75BA1B022B0600E1006DAF68 /* MemoryWidget.swift */,
75BA1B052B0605F4006DAF68 /* CpuWidget.swift */,
75E7981E2AFB3CBA0035B0E0 /* Assets.xcassets */,
75E798202AFB3CBA0035B0E0 /* Info.plist */,
75E798212AFB3CBA0035B0E0 /* widget.entitlements */,
Expand Down Expand Up @@ -379,13 +393,15 @@
75515E6B23A0E84500A84695 /* InfoPlist.strings in Resources */,
7579DCE02372CFCB0083D47D /* Localizable.strings in Resources */,
75C65DA52351AA2600A12690 /* Main.storyboard in Resources */,
F0F25DDC2B065AA8003EB2FC /* snapshot.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
75E798122AFB3CB70035B0E0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F0F25DDB2B065AA5003EB2FC /* snapshot.json in Resources */,
75E7981F2AFB3CBA0035B0E0 /* Assets.xcassets in Resources */,
7593FB6F2AFCCA4B006514EF /* Localizable.strings in Resources */,
);
Expand All @@ -407,6 +423,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
75BA1AFE2B05F73F006DAF68 /* SysInfo.swift in Sources */,
75E7980F2AFB3C9F0035B0E0 /* SharedData.swift in Sources */,
753054F1238E5B0000072D6E /* StringUtils.swift in Sources */,
75139B9C25C2B7A300FBE6EF /* Nettop.swift in Sources */,
Expand All @@ -427,10 +444,13 @@
buildActionMask = 2147483647;
files = (
7593FB6D2AFB8F09006514EF /* StringUtils.swift in Sources */,
75BA1AFF2B05FC04006DAF68 /* SysInfo.swift in Sources */,
75BA1B042B06029F006DAF68 /* MemoryWidget.swift in Sources */,
7593FB6A2AFB8E25006514EF /* SharedData.swift in Sources */,
75BA1B072B0605FC006DAF68 /* CpuWidget.swift in Sources */,
7593FB6C2AFB8F06006514EF /* SysUtils.swift in Sources */,
75E7981B2AFB3CB70035B0E0 /* widgetBundle.swift in Sources */,
75E7981D2AFB3CB80035B0E0 /* widget.swift in Sources */,
75E7981B2AFB3CB70035B0E0 /* WidgetBundle.swift in Sources */,
75E7981D2AFB3CB80035B0E0 /* NetworkWidget.swift in Sources */,
7593FB6B2AFB8F02006514EF /* UIntExtensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -651,7 +671,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -666,7 +686,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)";
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.4.0;
MARKETING_VERSION = 1.4.1;
PRODUCT_BUNDLE_IDENTIFIER = com.blabla.monitor;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -685,7 +705,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -700,7 +720,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)";
MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 1.4.0;
MARKETING_VERSION = 1.4.1;
PRODUCT_BUNDLE_IDENTIFIER = com.blabla.monitor;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -724,7 +744,7 @@
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = widget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = widget;
INFOPLIST_KEY_CFBundleDisplayName = SystemStateWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 yahaha. All rights reserved.";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -760,7 +780,7 @@
GCC_C_LANGUAGE_STANDARD = gnu17;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = widget/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = widget;
INFOPLIST_KEY_CFBundleDisplayName = SystemStateWidget;
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2023 yahaha. All rights reserved.";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,27 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "1"
BundleIdentifier = "com.apple.widgetkit.simulator"
RemotePath = "/System/Library/CoreServices/WidgetKit Simulator.app/Contents/MacOS/WidgetKit Simulator">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "75E798132AFB3CB70035B0E0"
BuildableName = "widgetExtension.appex"
BlueprintName = "widgetExtension"
ReferencedContainer = "container:NetworkMonitor.xcodeproj">
</BuildableReference>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "75C65D992351AA2500A12690"
BuildableName = "NetworkMonitor.app"
BlueprintName = "NetworkMonitor"
ReferencedContainer = "container:NetworkMonitor.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</MacroExpansion>
<EnvironmentVariables>
<EnvironmentVariable
key = "_XCWidgetKind"
Expand All @@ -90,6 +101,7 @@
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
Expand Down
2 changes: 2 additions & 0 deletions en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
"Basic" = "Basic";
"Status Bar" = "Status Bar";
"Keep Decimals" = "Keep Decimals";

"CFBundleDisplayName" = "StatusMonitor";
1 change: 0 additions & 1 deletion monitor/App.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//
// App.swift
// NetworkMonitor
//
// Created by wyy on 2023/11/1.
// Copyright © 2023 yahaha. All rights reserved.
Expand Down
Binary file not shown.
Binary file not shown.
Binary file removed monitor/Assets.xcassets/AppIcon.appiconset/16x16.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed monitor/Assets.xcassets/AppIcon.appiconset/32x32 1.png
Binary file not shown.
Binary file removed monitor/Assets.xcassets/AppIcon.appiconset/32x32.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed monitor/Assets.xcassets/AppIcon.appiconset/64x64.png
Binary file not shown.
132 changes: 66 additions & 66 deletions monitor/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
{
"images" : [
{
"filename" : "16x16.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "32x32.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "32x32 1.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "64x64.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "128x128.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "256x256.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "256x256 1.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "512x512.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "512x512 1.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "1024x1024.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
"images": [
{
"size": "16x16",
"idiom": "mac",
"filename": "icon-16.png",
"scale": "1x"
},
{
"size": "16x16",
"idiom": "mac",
"filename": "icon-16@2x.png",
"scale": "2x"
},
{
"size": "32x32",
"idiom": "mac",
"filename": "icon-32.png",
"scale": "1x"
},
{
"size": "32x32",
"idiom": "mac",
"filename": "icon-32@2x.png",
"scale": "2x"
},
{
"size": "128x128",
"idiom": "mac",
"filename": "icon-128.png",
"scale": "1x"
},
{
"size": "128x128",
"idiom": "mac",
"filename": "icon-128@2x.png",
"scale": "2x"
},
{
"size": "256x256",
"idiom": "mac",
"filename": "icon-256.png",
"scale": "1x"
},
{
"size": "256x256",
"idiom": "mac",
"filename": "icon-256@2x.png",
"scale": "2x"
},
{
"size": "512x512",
"idiom": "mac",
"filename": "icon-512.png",
"scale": "1x"
},
{
"size": "512x512",
"idiom": "mac",
"filename": "icon-512@2x.png",
"scale": "2x"
}
],
"info": {
"version": 1,
"author": "icon.wuruihong.com"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8a52458

Please sign in to comment.