-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Admin Dashboard - Migrate to Own Coordinator/Folder (#1300)
* Migrate all files from UserDashboard to AdminDashboard. Rename accordingly since this is an admin only function. Move all AdminDashboard items from SettingsCoordinator to their own AdminDashboardCoordinator. Move all ViewModels to ONLY live inside of the iOS build since tvOS is * cleanup * fix for sub navigation --------- Co-authored-by: Ethan Pippin <[email protected]>
- Loading branch information
Showing
50 changed files
with
181 additions
and
157 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
// | ||
// Swiftfin is subject to the terms of the Mozilla Public | ||
// License, v2.0. If a copy of the MPL was not distributed with this | ||
// file, you can obtain one at https://mozilla.org/MPL/2.0/. | ||
// | ||
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors | ||
// | ||
|
||
import JellyfinAPI | ||
import Stinsen | ||
import SwiftUI | ||
|
||
final class AdminDashboardCoordinator: NavigationCoordinatable { | ||
|
||
let stack = NavigationStack(initial: \AdminDashboardCoordinator.start) | ||
|
||
@Root | ||
var start = makeStart | ||
|
||
@Route(.push) | ||
var activeSessions = makeActiveSessions | ||
@Route(.push) | ||
var activeDeviceDetails = makeActiveDeviceDetails | ||
@Route(.push) | ||
var tasks = makeTasks | ||
@Route(.push) | ||
var devices = makeDevices | ||
@Route(.push) | ||
var deviceDetails = makeDeviceDetails | ||
@Route(.push) | ||
var editServerTask = makeEditServerTask | ||
@Route(.modal) | ||
var addServerTaskTrigger = makeAddServerTaskTrigger | ||
@Route(.push) | ||
var serverLogs = makeServerLogs | ||
@Route(.push) | ||
var users = makeUsers | ||
@Route(.push) | ||
var userDetails = makeUserDetails | ||
@Route(.push) | ||
var userDevices = makeUserDevices | ||
@Route(.modal) | ||
var addServerUser = makeAddServerUser | ||
@Route(.push) | ||
var apiKeys = makeAPIKeys | ||
|
||
@ViewBuilder | ||
func makeAdminDashboard() -> some View { | ||
AdminDashboardView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeActiveSessions() -> some View { | ||
ActiveSessionsView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeActiveDeviceDetails(box: BindingBox<SessionInfo?>) -> some View { | ||
ActiveSessionDetailView(box: box) | ||
} | ||
|
||
@ViewBuilder | ||
func makeTasks() -> some View { | ||
ServerTasksView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeDevices() -> some View { | ||
DevicesView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeDeviceDetails(device: DeviceInfo) -> some View { | ||
DeviceDetailsView(device: device) | ||
} | ||
|
||
@ViewBuilder | ||
func makeEditServerTask(observer: ServerTaskObserver) -> some View { | ||
EditServerTaskView(observer: observer) | ||
} | ||
|
||
func makeAddServerTaskTrigger(observer: ServerTaskObserver) -> NavigationViewCoordinator<BasicNavigationViewCoordinator> { | ||
NavigationViewCoordinator { | ||
AddTaskTriggerView(observer: observer) | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func makeServerLogs() -> some View { | ||
ServerLogsView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeUsers() -> some View { | ||
ServerUsersView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeUserDetails(user: UserDto) -> some View { | ||
ServerUserDetailsView(user: user) | ||
} | ||
|
||
func makeAddServerUser() -> NavigationViewCoordinator<BasicNavigationViewCoordinator> { | ||
NavigationViewCoordinator { | ||
AddServerUserView() | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func makeUserDevices() -> some View { | ||
DevicesView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeAPIKeys() -> some View { | ||
APIKeysView() | ||
} | ||
|
||
@ViewBuilder | ||
func makeStart() -> some View { | ||
AdminDashboardView() | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.