@spark233/plugin-traffic 0.0.0-stage → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/LICENSE.spark233 +21 -0
  2. package/README.md +34 -2
  3. package/assets/LICENSE.lucide +43 -0
  4. package/assets/icon.ico +0 -0
  5. package/assets/icon.png +0 -0
  6. package/assets/icon.svg +1 -0
  7. package/assets/theme-icons/blue-dark/icon.ico +0 -0
  8. package/assets/theme-icons/blue-dark/icon.png +0 -0
  9. package/assets/theme-icons/blue-light/icon.ico +0 -0
  10. package/assets/theme-icons/blue-light/icon.png +0 -0
  11. package/assets/theme-icons/green-dark/icon.ico +0 -0
  12. package/assets/theme-icons/green-dark/icon.png +0 -0
  13. package/assets/theme-icons/green-light/icon.ico +0 -0
  14. package/assets/theme-icons/green-light/icon.png +0 -0
  15. package/assets/theme-icons/orange-dark/icon.ico +0 -0
  16. package/assets/theme-icons/orange-dark/icon.png +0 -0
  17. package/assets/theme-icons/orange-light/icon.ico +0 -0
  18. package/assets/theme-icons/orange-light/icon.png +0 -0
  19. package/assets/theme-icons/purple-dark/icon.ico +0 -0
  20. package/assets/theme-icons/purple-dark/icon.png +0 -0
  21. package/assets/theme-icons/purple-light/icon.ico +0 -0
  22. package/assets/theme-icons/purple-light/icon.png +0 -0
  23. package/assets/theme-icons/rose-dark/icon.ico +0 -0
  24. package/assets/theme-icons/rose-dark/icon.png +0 -0
  25. package/assets/theme-icons/rose-light/icon.ico +0 -0
  26. package/assets/theme-icons/rose-light/icon.png +0 -0
  27. package/backend.mjs +8144 -0
  28. package/collector.ps1 +46 -0
  29. package/legal/HarmonyOS_Fonts.txt +34 -0
  30. package/legal/SourceHanSerif.txt +96 -0
  31. package/legal/spark233-renderer-THIRD_PARTY_NOTICES.md +670 -0
  32. package/native/Dia2Lib.dll +0 -0
  33. package/native/KernelTraceControl.dll +0 -0
  34. package/native/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
  35. package/native/Microsoft.Data.Sqlite.dll +0 -0
  36. package/native/Microsoft.Diagnostics.FastSerialization.dll +0 -0
  37. package/native/Microsoft.Diagnostics.NETCore.Client.dll +0 -0
  38. package/native/Microsoft.Diagnostics.Tracing.TraceEvent.dll +0 -0
  39. package/native/Microsoft.Extensions.DependencyInjection.Abstractions.dll +0 -0
  40. package/native/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
  41. package/native/Microsoft.Win32.Registry.dll +0 -0
  42. package/native/SQLitePCLRaw.batteries_v2.dll +0 -0
  43. package/native/SQLitePCLRaw.core.dll +0 -0
  44. package/native/SQLitePCLRaw.provider.dynamic_cdecl.dll +0 -0
  45. package/native/System.Buffers.dll +0 -0
  46. package/native/System.Collections.Immutable.dll +0 -0
  47. package/native/System.IO.Pipelines.dll +0 -0
  48. package/native/System.Memory.dll +0 -0
  49. package/native/System.Numerics.Vectors.dll +0 -0
  50. package/native/System.Reflection.Metadata.dll +0 -0
  51. package/native/System.Reflection.TypeExtensions.dll +0 -0
  52. package/native/System.Runtime.CompilerServices.Unsafe.dll +0 -0
  53. package/native/System.Security.AccessControl.dll +0 -0
  54. package/native/System.Security.Principal.Windows.dll +0 -0
  55. package/native/System.Text.Encodings.Web.dll +0 -0
  56. package/native/System.Text.Json.dll +0 -0
  57. package/native/System.Threading.Tasks.Extensions.dll +0 -0
  58. package/native/TraceReloggerLib.dll +0 -0
  59. package/native/e_sqlite3.dll +0 -0
  60. package/native/licenses/Microsoft.Bcl.AsyncInterfaces.nuspec +27 -0
  61. package/native/licenses/Microsoft.Data.Sqlite.Core.nuspec +37 -0
  62. package/native/licenses/Microsoft.Data.Sqlite.nuspec +36 -0
  63. package/native/licenses/Microsoft.Diagnostics.NETCore.Client.nuspec +30 -0
  64. package/native/licenses/Microsoft.Diagnostics.Tracing.TraceEvent.nuspec +41 -0
  65. package/native/licenses/Microsoft.Extensions.DependencyInjection.Abstractions-LICENSE.TXT +23 -0
  66. package/native/licenses/Microsoft.Extensions.DependencyInjection.Abstractions.nuspec +35 -0
  67. package/native/licenses/Microsoft.Extensions.Logging.Abstractions-LICENSE.TXT +23 -0
  68. package/native/licenses/Microsoft.Extensions.Logging.Abstractions.nuspec +48 -0
  69. package/native/licenses/Microsoft.Win32.Registry-LICENSE.TXT +23 -0
  70. package/native/licenses/Microsoft.Win32.Registry.nuspec +94 -0
  71. package/native/licenses/SQLitePCLRaw.bundle_e_sqlite3.nuspec +43 -0
  72. package/native/licenses/SQLitePCLRaw.core.nuspec +19 -0
  73. package/native/licenses/SQLitePCLRaw.lib.e_sqlite3.nuspec +17 -0
  74. package/native/licenses/SQLitePCLRaw.provider.dynamic_cdecl.nuspec +19 -0
  75. package/native/licenses/System.Buffers.nuspec +24 -0
  76. package/native/licenses/System.Collections.Immutable.nuspec +33 -0
  77. package/native/licenses/System.IO.Pipelines.nuspec +38 -0
  78. package/native/licenses/System.Memory.nuspec +32 -0
  79. package/native/licenses/System.Numerics.Vectors.nuspec +27 -0
  80. package/native/licenses/System.Reflection.Metadata-LICENSE.TXT +23 -0
  81. package/native/licenses/System.Reflection.Metadata.nuspec +34 -0
  82. package/native/licenses/System.Reflection.TypeExtensions-LICENSE.TXT +23 -0
  83. package/native/licenses/System.Reflection.TypeExtensions.nuspec +64 -0
  84. package/native/licenses/System.Runtime.CompilerServices.Unsafe.nuspec +27 -0
  85. package/native/licenses/System.Security.AccessControl-LICENSE.TXT +23 -0
  86. package/native/licenses/System.Security.AccessControl.nuspec +55 -0
  87. package/native/licenses/System.Security.Principal.Windows-LICENSE.TXT +23 -0
  88. package/native/licenses/System.Security.Principal.Windows.nuspec +68 -0
  89. package/native/licenses/System.Text.Encodings.Web.nuspec +38 -0
  90. package/native/licenses/System.Text.Json.nuspec +50 -0
  91. package/native/licenses/System.Threading.Tasks.Extensions.nuspec +28 -0
  92. package/native/licenses/System.ValueTuple.nuspec +25 -0
  93. package/native/licenses/dependencies.json +158 -0
  94. package/native/msdia140.dll +0 -0
  95. package/native/resources.json +226 -0
  96. package/native/spark233.Traffic.Core.dll +0 -0
  97. package/native/spark233.Traffic.Core.dll.config +59 -0
  98. package/native/spark233.TrafficClient.exe +0 -0
  99. package/native/spark233.TrafficClient.exe.config +62 -0
  100. package/native/spark233.TrafficService.exe +0 -0
  101. package/native/spark233.TrafficService.exe.config +62 -0
  102. package/native/spark233.TrafficSetup.exe +0 -0
  103. package/native/spark233.TrafficSetup.exe.config +62 -0
  104. package/package.json +356 -3
  105. package/renderer/assets/HarmonyOS_Sans_SC-BKicpBgU.ttf +0 -0
  106. package/renderer/assets/SourceHanSerifSC-Regular-KhFegrri.woff2 +0 -0
  107. package/renderer/assets/index-D40wqc6o.css +2 -0
  108. package/renderer/assets/index-DqTMamUW.js +2 -0
  109. package/renderer/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
  110. package/renderer/assets/vendor-react-DCTAcUCH.js +9 -0
  111. package/renderer/index.html +15 -0
  112. package/renderer/spark233-renderer.json +1 -0
  113. package/renderer/spark233-shared-ui.json +18 -0
  114. package/renderer/spark233-ui.json +11 -0
  115. package/widgets/hud.json +59 -0
  116. package/widgets/traffic-hover.json +36 -0
package/collector.ps1 ADDED
@@ -0,0 +1,46 @@
1
+ param([Parameter(Mandatory=$true)][int]$OwnerProcessId)
2
+ $ErrorActionPreference = 'Stop'
3
+ [Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)
4
+ $ownerProcess = [System.Diagnostics.Process]::GetProcessById($OwnerProcessId)
5
+ $null = $ownerProcess.Handle
6
+ $clock = [System.Diagnostics.Stopwatch]::StartNew()
7
+ $discoveredAt = -30000L
8
+ $physicalIds = @{}
9
+ try {
10
+ while (-not $ownerProcess.HasExited) {
11
+ $started = $clock.ElapsedMilliseconds
12
+ try {
13
+ if ($started - $discoveredAt -ge 30000) {
14
+ $found = @{}
15
+ foreach ($adapter in Get-NetAdapter -Physical -IncludeHidden -ErrorAction Stop) {
16
+ $found[$adapter.InterfaceGuid.ToString().Trim('{}').ToLowerInvariant()] = $true
17
+ }
18
+ $physicalIds = $found
19
+ $discoveredAt = $started
20
+ }
21
+ $adapters = @()
22
+ foreach ($adapter in [System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces()) {
23
+ $id = $adapter.Id.Trim('{}').ToLowerInvariant()
24
+ if (-not $physicalIds.ContainsKey($id) -or $adapter.OperationalStatus -ne 'Up') { continue }
25
+ $properties = $adapter.GetIPProperties()
26
+ $index = 0
27
+ try { $index = $properties.GetIPv4Properties().Index } catch { $index = $properties.GetIPv6Properties().Index }
28
+ $addresses = @($properties.UnicastAddresses | ForEach-Object { $_.Address.ToString() })
29
+ $statistics = $adapter.GetIPStatistics()
30
+ $adapters += @{
31
+ id=$id; index=$index; name=$adapter.Name; description=$adapter.Description
32
+ addresses=$addresses; rx=$statistics.BytesReceived.ToString([Globalization.CultureInfo]::InvariantCulture)
33
+ tx=$statistics.BytesSent.ToString([Globalization.CultureInfo]::InvariantCulture)
34
+ }
35
+ }
36
+ $frame = @{ at=[DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds(); elapsedMs=$clock.ElapsedMilliseconds; adapters=$adapters }
37
+ [Console]::Out.WriteLine(($frame | ConvertTo-Json -Depth 5 -Compress))
38
+ [Console]::Out.Flush()
39
+ } catch {
40
+ [Console]::Out.WriteLine((@{ at=[DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds(); elapsedMs=$clock.ElapsedMilliseconds; error=$_.Exception.Message } | ConvertTo-Json -Compress))
41
+ [Console]::Out.Flush()
42
+ }
43
+ $remaining = 1000 - ($clock.ElapsedMilliseconds - $started)
44
+ if ($remaining -gt 0) { Start-Sleep -Milliseconds $remaining }
45
+ }
46
+ } finally { $ownerProcess.Dispose() }
@@ -0,0 +1,34 @@
1
+ License Notice
2
+ Copyright 2021 Huawei Device Co., Ltd.
3
+ HarmonyOS Sans Fonts Software is licensed under HarmonyOS Sans Fonts License Agreement.
4
+
5
+ --------------------------------------------------------------------------------
6
+ HarmonyOS Sans Fonts License Agreement
7
+
8
+ THIS HARMONYOS SANS FONTS LICENSE AGREEMENT ("AGREEMENT") IS A LEGAL AGREEMENT BETWEEN YOU (EITHER A SINGLE INDIVIDUAL, OR SINGLE LEGAL ENTITY) AND HUAWEI DEVICE CO., LTD.( "LICENSOR")FOR THE USE OF THE HARMONYOS SANS FONTS ACCOMPANYING THIS AGREEMENT.BY DOWNLOADING,COPYING OR OTHERWISE USING HARMONYOS SANS FONTS YOU INDICATE THAT YOU AGREE TO BE BOUND BY ALL OF THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, YOU MAY NOT DOWNLOAD, COPY OR OTHERWISE USE THE HARMONYOS SANS FONTS, AND YOU SHALL PROMPTLY DESTROY AND DELETE ALL THE HARMONYOS SANS FONTS.
9
+
10
+ 1.Definition
11
+ "HarmonyOS Sans Fonts" shall mean the collection of fonts software components provided by Licensor under this Agreement and clearly marked as "HarmonyOS¬ Sans".
12
+
13
+ "YOU" shall mean an individual or legal entity exercising permissions granted by this Agreement.
14
+
15
+ 2.GRANT OF LICENSE
16
+
17
+ Subject to the terms and conditions of this Agreement, Licensor hereby grant YOU a non-transferable, non-exclusive, royalty-free, revocable, worldwide copyright license to use,copy, merge, embed, bundle, redistribute and/or sell unmodified copies of HarmonyOS Sans Fonts with any software except for fonts software,subject to the following conditions:
18
+ 1)YOU shall make a prominent notice in the software to state that HarmonyOS Sans Fonts are used.
19
+ 2)YOU may not make any modifications to HarmonyOS Sans Fonts or any of their individual components.
20
+ 3)Neither HarmonyOS Sans Fonts nor any of their individual components may be redistributed or sold in a stand-alone base. This limitation does not apply to any work created by using HarmonyOS Sans Fonts. You can freely distribute or sell your work, such as materials, logos, application software etc. created by using HarmonyOS Sans Fonts.
21
+ 4)YOU shall retain the copyright notice and this Agreement in any copies of HarmonyOS Sans Fonts.
22
+
23
+ 3.Termination
24
+ This Agreement will be automatically terminated if YOU breach any of this Agreement.
25
+
26
+ 4.NO WARRANTY
27
+ YOU AGREE THAT THE HARMONYOS SANS FONTS ARE PROVIDED BY LICENSOR ON AN "AS IS" BASIS. LICENSOR MAKES NO WARRANTY, EXPRESSED OR IMPLIED OR STATUTORY, WITH RESPECT TO ANY OF THE HARMONYOS SANS FONTS, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.
28
+
29
+ 5.NO LIABILITY
30
+
31
+ IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY DIRECT OR INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE OF OR INABILITY TO USE HARMONYOS SANS FONTS, WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHER LEGAL THEORY, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+
33
+ YOU EXPRESSLY ASSUME ALL LIABILITIES AND RISKS FOR USE OF HARMONYOS SANS FONTS. SHOULD THE HARMONYOS SANS FONTS PROVE DEFECTIVE, YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
34
+
@@ -0,0 +1,96 @@
1
+ Copyright 2017-2022 Adobe (http://www.adobe.com/), with Reserved Font
2
+ Name 'Source'. Source is a trademark of Adobe in the United States
3
+ and/or other countries.
4
+
5
+ This Font Software is licensed under the SIL Open Font License,
6
+ Version 1.1.
7
+
8
+ This license is copied below, and is also available with a FAQ at:
9
+ http://scripts.sil.org/OFL
10
+
11
+ -----------------------------------------------------------
12
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
13
+ -----------------------------------------------------------
14
+
15
+ PREAMBLE
16
+ The goals of the Open Font License (OFL) are to stimulate worldwide
17
+ development of collaborative font projects, to support the font
18
+ creation efforts of academic and linguistic communities, and to
19
+ provide a free and open framework in which fonts may be shared and
20
+ improved in partnership with others.
21
+
22
+ The OFL allows the licensed fonts to be used, studied, modified and
23
+ redistributed freely as long as they are not sold by themselves. The
24
+ fonts, including any derivative works, can be bundled, embedded,
25
+ redistributed and/or sold with any software provided that any reserved
26
+ names are not used by derivative works. The fonts and derivatives,
27
+ however, cannot be released under any other type of license. The
28
+ requirement for fonts to remain under this license does not apply to
29
+ any document created using the fonts or their derivatives.
30
+
31
+ DEFINITIONS
32
+ "Font Software" refers to the set of files released by the Copyright
33
+ Holder(s) under this license and clearly marked as such. This may
34
+ include source files, build scripts and documentation.
35
+
36
+ "Reserved Font Name" refers to any names specified as such after the
37
+ copyright statement(s).
38
+
39
+ "Original Version" refers to the collection of Font Software
40
+ components as distributed by the Copyright Holder(s).
41
+
42
+ "Modified Version" refers to any derivative made by adding to,
43
+ deleting, or substituting -- in part or in whole -- any of the
44
+ components of the Original Version, by changing formats or by porting
45
+ the Font Software to a new environment.
46
+
47
+ "Author" refers to any designer, engineer, programmer, technical
48
+ writer or other person who contributed to the Font Software.
49
+
50
+ PERMISSION & CONDITIONS
51
+ Permission is hereby granted, free of charge, to any person obtaining
52
+ a copy of the Font Software, to use, study, copy, merge, embed,
53
+ modify, redistribute, and sell modified and unmodified copies of the
54
+ Font Software, subject to the following conditions:
55
+
56
+ 1) Neither the Font Software nor any of its individual components, in
57
+ Original or Modified Versions, may be sold by itself.
58
+
59
+ 2) Original or Modified Versions of the Font Software may be bundled,
60
+ redistributed and/or sold with any software, provided that each copy
61
+ contains the above copyright notice and this license. These can be
62
+ included either as stand-alone text files, human-readable headers or
63
+ in the appropriate machine-readable metadata fields within text or
64
+ binary files as long as those fields can be easily viewed by the user.
65
+
66
+ 3) No Modified Version of the Font Software may use the Reserved Font
67
+ Name(s) unless explicit written permission is granted by the
68
+ corresponding Copyright Holder. This restriction only applies to the
69
+ primary font name as presented to the users.
70
+
71
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
72
+ Software shall not be used to promote, endorse or advertise any
73
+ Modified Version, except to acknowledge the contribution(s) of the
74
+ Copyright Holder(s) and the Author(s) or with their explicit written
75
+ permission.
76
+
77
+ 5) The Font Software, modified or unmodified, in part or in whole,
78
+ must be distributed entirely under this license, and must not be
79
+ distributed under any other license. The requirement for fonts to
80
+ remain under this license does not apply to any document created using
81
+ the Font Software.
82
+
83
+ TERMINATION
84
+ This license becomes null and void if any of the above conditions are
85
+ not met.
86
+
87
+ DISCLAIMER
88
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
89
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
90
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
91
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
92
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
93
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
94
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
95
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
96
+ OTHER DEALINGS IN THE FONT SOFTWARE.