-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iOS apps and server code for v5.0.5. New scouting interface, more data collection, and minor bugfixes. **commits** * fix shit * completely rework scouting interface pill shaped goofy gear shifter type interface * new data things * numbers * •_• * blackjack points * stop the server from crashing when you gamble * app store 5.0.5 release
- Loading branch information
Showing
47 changed files
with
1,176 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
ios/beartracks/SystemStatus/Assets.xcassets/AccentColor.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
ios/beartracks/SystemStatus/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
ios/beartracks/SystemStatus/Assets.xcassets/WidgetBackground.colorset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSExtension</key> | ||
<dict> | ||
<key>NSExtensionPointIdentifier</key> | ||
<string>com.apple.widgetkit-extension</string> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// SystemStatusBundle.swift | ||
// SystemStatus | ||
// | ||
// Created by Jayen Agrawal on 2/27/24. | ||
// | ||
|
||
import WidgetKit | ||
import SwiftUI | ||
|
||
@main | ||
struct SystemStatusBundle: WidgetBundle { | ||
var body: some Widget { | ||
SystemStatusLiveActivity() | ||
} | ||
} |
122 changes: 122 additions & 0 deletions
122
ios/beartracks/SystemStatus/SystemStatusLiveActivity.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
// | ||
// SystemStatusLiveActivity.swift | ||
// SystemStatus | ||
// | ||
// Created by Jayen Agrawal on 2/27/24. | ||
// | ||
|
||
import ActivityKit | ||
import WidgetKit | ||
import SwiftUI | ||
|
||
struct SystemStatusAttributes: ActivityAttributes { | ||
public struct ContentState: Codable, Hashable { | ||
var total_mem: Int | ||
var used_mem: Int | ||
var total_swap: Int | ||
var used_swap: Int | ||
var uptime: Int | ||
var load_one: Double | ||
var load_five: Double | ||
var load_fifteen: Double | ||
var sessions: Int | ||
} | ||
var hostname: String | ||
} | ||
|
||
struct SystemStatusLiveActivity: Widget { | ||
var body: some WidgetConfiguration { | ||
ActivityConfiguration(for: SystemStatusAttributes.self) { context in | ||
// Lock screen/banner UI goes here | ||
VStack { | ||
HStack { | ||
ProgressView(value: Float(context.state.used_mem) / Float(context.state.total_mem), total: 1.0) { | ||
Text("RAM\n\(Int(Float(context.state.used_mem) / Float(context.state.total_mem) * 100))%") | ||
} | ||
.progressViewStyle(CircularProgressViewStyle(tint: getColor(value: Float(context.state.used_mem) / Float(context.state.total_mem)))) | ||
Spacer() | ||
ProgressView(value: context.state.load_five, total: 1.0) { | ||
Text("CPU\n\(Int(context.state.load_five * 100))%") | ||
} | ||
.progressViewStyle(CircularProgressViewStyle(tint: getColor(value: Float(context.state.load_five)))) | ||
} | ||
Text("\(context.state.sessions) active sessions") | ||
} | ||
.padding() | ||
.activityBackgroundTint(Color.black) | ||
.activitySystemActionForegroundColor(Color.white) | ||
|
||
} dynamicIsland: { context in | ||
DynamicIsland { | ||
DynamicIslandExpandedRegion(.leading) { | ||
ProgressView(value: Float(context.state.used_mem) / Float(context.state.total_mem), total: 1.0) { | ||
Text("RAM\n\(Int(100 * Float(context.state.used_mem) / Float(context.state.total_mem)))%") | ||
} | ||
.progressViewStyle(CircularProgressViewStyle(tint: getColor(value: Float(context.state.used_mem) / Float(context.state.total_mem)))) | ||
} | ||
DynamicIslandExpandedRegion(.trailing) { | ||
ProgressView(value: context.state.load_five, total: 1.0) { | ||
Text("CPU\n\(Int((context.state.load_five * 100).rounded()))%") | ||
} | ||
.progressViewStyle(CircularProgressViewStyle(tint: getColor(value: Float(context.state.load_five)))) | ||
} | ||
DynamicIslandExpandedRegion(.bottom) { | ||
Text("\(context.state.sessions) active sessions") | ||
} | ||
} compactLeading: { | ||
ProgressView(value: Float(context.state.used_mem) / Float(context.state.total_mem), total: 1.0) { | ||
Label("RAM", systemImage: "memorychip") | ||
.labelStyle(.iconOnly) | ||
} | ||
.progressViewStyle(CircularProgressViewStyle(tint: getColor(value: Float(context.state.used_mem) / Float(context.state.total_mem)))) | ||
} compactTrailing: { | ||
ProgressView(value: context.state.load_five, total: 1.0) { | ||
Label("5m Load", systemImage: "gauge.open.with.lines.needle.33percent") | ||
.labelStyle(.iconOnly) | ||
} | ||
.progressViewStyle(CircularProgressViewStyle(tint: getColor(value: Float(context.state.load_five)))) | ||
} minimal: { | ||
ProgressView(value: context.state.load_five, total: 1.0) { | ||
Label("5m Load", systemImage: "gauge.open.with.lines.needle.33percent") | ||
.labelStyle(.iconOnly) | ||
} | ||
.progressViewStyle(CircularProgressViewStyle(tint: getColor(value: Float(context.state.load_five)))) | ||
} | ||
.widgetURL(URL(string: "https://beartracks.io")) | ||
.keylineTint(Color.red) | ||
} | ||
} | ||
|
||
private func getColor(value: Float) -> Color { | ||
if value > 0.9 { | ||
return Color.red | ||
} else if value > 0.8 { | ||
return Color.yellow | ||
} else { | ||
return Color.green | ||
} | ||
} | ||
} | ||
|
||
extension SystemStatusAttributes { | ||
fileprivate static var preview: SystemStatusAttributes { | ||
SystemStatusAttributes(hostname: "beartracks.io") | ||
} | ||
} | ||
|
||
extension SystemStatusAttributes.ContentState { | ||
fileprivate static var smiley: SystemStatusAttributes.ContentState { | ||
SystemStatusAttributes.ContentState.init(total_mem: 1000, used_mem: 839, total_swap: 0, used_swap: 0, uptime: 2313124, load_one: 0.02, load_five: 0.40, load_fifteen: 0.93, sessions: 2) | ||
} | ||
|
||
fileprivate static var starEyes: SystemStatusAttributes.ContentState { | ||
SystemStatusAttributes.ContentState.init(total_mem: 1000, used_mem: 839, total_swap: 100, used_swap: 0, uptime: 2313124, load_one: 0.02, load_five: 0.40, load_fifteen: 0.93, sessions: 2) | ||
} | ||
} | ||
|
||
#Preview("Notification", as: .content, using: SystemStatusAttributes.preview) { | ||
SystemStatusLiveActivity() | ||
} contentStates: { | ||
SystemStatusAttributes.ContentState.smiley | ||
SystemStatusAttributes.ContentState.starEyes | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ios/beartracks/bearTracks/Assets.xcassets/AppIcon.appiconset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file removed
BIN
-23.8 KB
ios/beartracks/bearTracks/Assets.xcassets/AppIcon.appiconset/l0_icon2.png
Binary file not shown.
Binary file added
BIN
+42.1 KB
ios/beartracks/bearTracks/Assets.xcassets/AppIcon.appiconset/l0_sprite_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.