-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Admin/User Dashboard #1230
base: main
Are you sure you want to change the base?
Conversation
@LePips Absolutely no rush on this but I wanted to get your thought on this PR and make sure I was going in the right direction for what the Admin Dashboard would include. |
…eady-ish for review.
…change the image will stay the same. Use a random image found for Portrait/Landscape.
When it's transcoding, does it also show the reason/format ? That generally the most useful thing I sometimes check on the go. I don't think we should fully duplicate all functionality of the web interface, even vue is struggling with that. |
I have the type broken out like Jellyfin-Web:
I could look at adding this in but I originally skipped it since phone screen real estate is a lot smaller and I was worried it was starting to get cluttered. |
Correct, it seems those activity tiles already can already be expanded based on the little V arrow. At least the transcode reason would be nice to have as an extra item there. Target audio and video code would be useful too, but IMHO not as important. Although both are definitely things that can be added as a follow up at a later time. Also will this get a tvOS variant? It seems less useful there. |
That looks fine to me, but I'll link Erik to this PR to see if he wants to chime in. |
Since these can be very detailed views, I think a better design would be to have the list of sessions with bare details and we push to a session with more details instead of expanding. |
I can do that. What should be included in the high level view? My thought is:
Then I can add everything else to the details page. Also, for the progress bar, do we want the color to indicate Play/Pause or should it use the accent color? |
I think maybe we can use play and pause icon instead of the text? That should save some space
2 Colored progress bar like in web? It shows playback and transcoding progress in 1 bar. Edit: like it's on the first one in the screenshot here #1230 (comment)
I think accent color, using color to indicate playback is going to be less obvious than using just a string or icon. |
Swiftfin/Views/UserDashboardView/ActiveSessionsView/ActiveSessionRowView.swift
Outdated
Show resolved
Hide resolved
I'm going to call it for now. I've pushed my latest changes so anyone who wants to look it over / recommend anything this should be the latest version. There is still a TON of reorganization that I need to do. I've also overloaded the Details Page with just about every detail I could find. If there is anything else needed, I can add it but I think I've hit the point where it's more likely that we start removing things from it. Screenshots can be found below: Video In ActionSimulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-07.at.01.32.59.mp4I have some outstanding issues I want to cleanup but it may be a bit:
|
The video shows it without the poster/thumbnail, I think that looks much cleaner! Also what happens when there is only a poster (Primary) available? |
I think I'm calling images a wrong way? I need to look at that. I get images from my server but demo.jellyfin.org doesn't seem to pull images. I'm leaning towards no images on the main screen with posters on the details? I'm only able to get 4 sessions on a single screen with these posters. Right now, I am looking at the Library Customization for Poster Type to determine with poster is used for this. I think I need to look at where I get images from since there should be some sort of placeholder if the image isn't there. I had one prior but I moved to use the ImageView and I haven't taken the time to dig into it. |
No images on the main screen would be good to fit more, and also no need to download a bunch of extra images. 👍
I think the image type you want is |
Why are there two sections (STREAMS & ONLINE)? What's the difference? |
Streams are those clients actively streaming something. Online is clients marked online in jellyfin, IIRC recent activity in the last X minutes. Also welcome 😃 |
I split this into people are are connected to Jellyfin and people who are connected and streaming something. Personally, on Jellyfin-Web, I'm always more interested in what's being streamed opposed to whose only online. So splitting these out is partially a preference from me. See an example below. In this case, the iPhone is ONLINE and the Android TV would be STREAMING. I'm not sold on that verbiage so if there is a better way to name that I'm all ears! |
Do the screenshots below look correct: Which type of warning would you prefer I use? Or, should I be splitting this how I have this how where Server Shutdown/Restart are the Type 1 and Type 2 is the alert style: Finally, layout wise, is this more of what you are looking for? My current version is committed on this PR. It's still really messy since I've been moving things around but it should be buildable to visually see where this stands. Scheduled tasks I think are 100% ready to go. I added an isStarted check to show the loading progress for the potential 5 seconds between kicking off a task and waiting for the first poll back on the task progress. This way there is immediate feedback even if progress isn't reported back yet. Active Sessions I need some feedback on the button. |
…he ViewModels from the User Dashboard. Moved the grid back to the CollectionVGrid and the flicker has returned... Cleaned up the Tasks and required a confirmation for all tasks. Still need to clean up strings and organization and fix the buttons and also make a list version of the Active Devices.
Swiftfin/Views/UserDashboardView/ScheduledTasksView/ScheduledTasksView.swift
Outdated
Show resolved
Hide resolved
@ViewBuilder | ||
private func sectionForCategory(_ category: String, tasks: [TaskInfo]) -> some View { | ||
Section(header: Text(category)) { | ||
ForEach(tasks, id: \.id) { task in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a TaskInfo
file in Shared/Extensions/JellyfinAPI
and have TaskInfo
conform to Identifiable
.
The new tasks looks better but I personally don't really care for the "ran for X minutes" bit or showing that it was completed outright, only that it failed or cancelled/aborted as I see that more pressing. I would also want to use the label I have been using to indicate warnings elsewhere: Label(/* message */, systemImage: "exclamationmark.circle.fill") I think I like the To make this easier in code, we don't need a bunch of booleans for showing which dialog for each task. There are overloads that take a The session design was a bit more what I was looking for however I would like to use the portrait images instead. I will have to think more about the overall design. I would recommend taking a look at how |
At least on my server, Portrait (for movies/shows) is (almost) always available, backdrops, thumbs, episode thumbs are not. So I think it would indeed make sense to use portraits here, I think for most servers they will have a higher chance of being available. Since these are tall not wide, maybe the other UI elements on the card can be shifted to the right of the poster to save some horizontal space since there seems to be a bit less information on them now? That might look uglier though but in my head it makes sense. |
|
I've made those updates. I still have some cleanup I want to do with the pivots but I wanted to get the listView version of this out there so I could make sure this was going the right direction: Let me know if we want anything added or removed. The list view I think looks a little weird with the text alignment when there is no NowPlayingItem but it'd look weirder to align it with no image. I wanted to pull the same device icons that server is using but it looks like those are just hardcoded paths in the web folder. I could still get those by doing like... |
…ore. Ensure Marks are up to date.
…ore. Ensure Marks are up to date. Actually Stage all my changes...
…h to resume conversions.
I think I'm happy with the current state of this. I'm sure there is some room for improvement in terms of the Swift / Code Layout side of this. I have a lot of stuff broken out into files for repeated sections but I've pulled back a bit for smaller sections. I'm also having a tough time determining when to use a Func vs a Var so I'm sure some of that can be cleaned up as well. The big highlights since the last review are:
I added a filler icon on the ListView Idle Devices. Let me know if we want that image removed (I'd need to figure out spacing), changed (I like what they do Here) or if we want this added to the Grid Buttons as well. Please see our screenshots below! For feedback, I'm primarily concerned about format / UI just to make sure that's all up to snuff. Outside of that, I am not sure if my stateful view models are correct since I kind of based them off HomeView. EDIT: |
I've had time to take a look at this and have started on my changes. Some main changes: 1 - I have split the "server connection" and "Dashboard" settings views as they serve different purposes. The former being how the client is connected to the server. I have really only taken a look at the tasks and haven't gotten to the active devices yet. |
I'm doing a bit of travel for work but I'd love to assist when I'm back. Is there anything you'd like me to work on for this or is this mostly cleanup/design to make sure it mirrors the rest of Swiftfin?
Since this view only has one function (Switch URL) would it make sense to just make the existing Chevron button for this view into the Menu to select the URL instead? Flatten out the hierarchy a little? Then again, I know that view is re-used so the benefit might not be there. |
No, as that view is also used for the deletion and could gain more functionality with stuff like #508. You've made a great foundation and I'm almost done with my changes. After I am done I'll make comments on the major things I changed as well as some things I may have misguided on. |
Sounds great! Thank you (once again) for helping me get this over the finish line! Feel free to let me know if there's anything that I can do to help out. If you'd like, I'd be more than happy to go through and localize all of the strings when you're done with it. I was looking through your commit, and I saw that you TODO'd localizing the transcoding reasons. I'd be more than happy to do that part before we have our final merge. |
Still have some work to do but most visual things should be done or has relevant TODOs. Major changes:
For many of the changes I would recommend learning from in future work:
When testing on the iPad, I realized using the dashboard can be rather small. The user is performing administrative work and we are restricting their viewport. This is a side effect iOS and iPadOS having the same presentations but we may need to change that once we take a look at replacing our navigation stack. Meaning, iPadOS would have some entirely different views to allow them to be full screen. However, that is something I will reevaluate after we drop iOS 15. |
Issue
Resolves: #608
Summary
This PR Creates a User/Admin Dashboard. This view replaces the current EditServerView that is accessible from the SettingsView. For now, this feature will only exist on iOS and iPadOS. If there is an appetite for adding this to tvOS I can look into it but, on a personal level, I don't see a lot of value in adding this to tvOS.
When clicking into this view, the user will always be provided with name of the server and the ability to switch to another URL for the same server. For Non-Admin Users, this PR adds an additional section that shows all Active Devices.
Active Devices are handled by the Server. With this, the Server only returns Sessions that the user is allowed to see. For Non-Admins, this means they can only see their own Sessions. For Admins, they are able to see all Sessions. All filtering/security for this section is handled by the Server API.
Clicking an Active Device will show the user Active Device Details which includes:
Both the Active Devices List and Active Device Details update every second with the status and progress of the Active Device. If the device is active but not streaming, both view will show the last time that the device interacted with the Jellyfin Server.
If the User accessing the Dashboard is an Admin they will see 2 additional Administration buttons. These buttons are:
Scan All Libraries is the same function as Jellyfin-Web. When triggered, it returns the current progress of the process. There is a Red X on the left side while this task is running which can be selected to cancel the Libraries Scan. The progress percentage pings every second, even if not triggered from the Server, so this shows Library scans that are triggered from other devices as well with the ability to cancel them too.
Scheduled Tasks takes the Admin User to another View that contains all of the available Tasks on the Server. If selected, this runs these tasks. The same as the Scan All Libraries, these tasks can be cancelled and progress is showed. In addition to the Scheduled Tasks, the Shutdown/Restart Server tasks are included on this page at the top. These prompt the user with a confirmation prior to running.
The only difference between iOS and iPadOS is the Active Devices section contains 1 column on iOS and 2 columns on iPadOS.
Please find all Screenshots in the Screenshots Section below.
Difficult to Recreate Issues
Screenshots
User Dashboard
User Dashboard - URL Switching
Admin Dashboard
Admin Dashboard - URL Switching
Admin Dashboard - Scan in Progress
Admin Dashboard - Scan Cancelling
Admin Dashboard - iPad
Shutdown/Restart Warnings
Active Device Details - DirectPlay
Active Device Details - Transcode
Active Device Details - Idle Sessions
This ticks up every second. If the user starts playback, the view populates with the new session details.Active Device Details - Offline Session
This will only happen when you are viewing a User Session Detail and the user goes offline while you are looking at it.Scheduled Tasks
Scheduled Tasks - Many Running