mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-09-21 18:33:24 +00:00
48d354494f
* Add ByteFormat utility for human-readable byte sizes * Show log level and feedback bundle size on feedback collection * Fix gap between text and feedback spinner * Add CaptureFeedbackProgress IPC event surface * Emit progress events during feedback bundle creation * Replace fixed feedback timeout with progress-event watch * Log feedback collection lifecycle in CollectFeedbackLogs * Simplify stream feedback progress via service heartbeat with stall detection * Remove duplicate file size logic, fix log levels for debugging/errors * Fix feedback in progress flag readability * Fix feedback progress events * Update release notes
31 lines
1.0 KiB
C#
31 lines
1.0 KiB
C#
/*
|
|
Copyright NetFoundry Inc.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
namespace ZitiDesktopEdge.Utility {
|
|
public static class ByteFormat {
|
|
public static string Format(long bytes) {
|
|
string[] suffixes = { "B", "KB", "MB", "GB", "TB" };
|
|
double value = bytes;
|
|
int index = 0;
|
|
while (value >= 1024 && index < suffixes.Length - 1) {
|
|
value = value / 1024;
|
|
index++;
|
|
}
|
|
return value.ToString("0.0") + " " + suffixes[index];
|
|
}
|
|
}
|
|
}
|