-
Notifications
You must be signed in to change notification settings - Fork 338
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
custom sidebar item #1214
base: Munki6dev
Are you sure you want to change the base?
custom sidebar item #1214
Conversation
better solution not yet found
@@ -292,6 +294,15 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe | |||
|
|||
func loadInitialView() { | |||
// Called by app delegate from applicationDidFinishLaunching: | |||
|
|||
// add custom link if nessesary | |||
if let CustonSidebarItem = pref("CustonSidebarItem") as? Dictionary<String, String> { |
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.
Need to change the name to "CustomSidebarItem" in all occurrences.
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.
I must have missed it :)
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.
It's "CustonSidebarItem" pretty much everywhere, and should be "CustomSidebarItem".
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.
OMG... you're right... I've been working on it for too long...
@@ -1070,7 +1088,8 @@ class MainWindowController: NSWindowController, NSWindowDelegate, WKNavigationDe | |||
decisionHandler(.cancel) | |||
return | |||
} | |||
if scheme == "mailto" || scheme == "http" || scheme == "https" { | |||
|
|||
if scheme == "mailto" { |
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.
Does this then change the behavior for http/https links from other contexts, like in item descriptions?
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.
I'm not quite sure yet.
I'm still testing when and how this part triggers.
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.
Custom links that don't have target="_blank"
would go though this code path, I'd think (Links in client customization, like the footer, the banners, and the (former) sidebar-now-link-strip)
@@ -1670,6 +1701,16 @@ extension MainWindowController: NSOutlineViewDelegate { | |||
} | |||
if let imageView = view?.imgView { | |||
imageView.image = NSImage(named: NSImage.Name(icon))?.tint(color: .secondaryLabelColor) | |||
if #available(macOS 11.0, *) { |
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.
What does this mean if an admin has a custom sidebar item and the user is running < macOS 11?
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.
SF symbol only works with macOS 11.0 and above. Therefore the restriction. With older systems no symbol is displayed.
That could definitely be solved a little better
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.
Or just declare no support for custom sidebar items on macOS < 11. (So no item(s) at all -- not weird broken items without icons)
I like the general idea. I have a few questions and comments, some of which are above. As for the icon, what values are legal, and where is the icon sourced? This will need good documentation, and I expect people might want to provide a custom icon as well. I wonder if this (instead of being in preferences) might better "live" in the other customization resources for MSC.app... |
Once the door has been opened to custom sidebar items, I can see admins wanting multiple such items. Could this be easily implemented in a way that either supports multiple items now, or could be easily extended in the future? (This again maybe pushes the config into the custom client resources instead of ManagedInstalls preferences) |
SF Symbols are currently used. These are integrated in the OS and can be specified in the configuration. https://developer.apple.com/sf-symbols/ (icon name is the SF symbol name) I have already thought about several links. They should be easy to implement. |
How do you mean the configuration in a custom client resource? With a separate config? |
Yes, in a new file in the client customization archive (https://github.com/munki/munki/wiki/Client-Customization) It just seems to me that we already have a method to do some MSC customizations. This is a new MSC customization, and one can argue it should be defined in the same "place" as the other customizations |
…ar items are only possible with 11.0 and newer
I have left it in the ManagedInstalls.plist for now. the customisation now includes an array with objects
|
we use Munki in combination with Intune.
To make it easier for users, I would like to integrate the company portal web directly into Munki.
As a possible solution I have built a custom sidebar item.
The title, icon and link of the custom sidebar item can be configured via ManagedInstalls.plist
ManagedInstalls.plist:
{
AppleSoftwareUpdatesOnly = 0;
CustonSidebarItem = {
icon = desktopcomputer;
link = "https://portal.manage.microsoft.com/devices";
title = "My Devices";
};
FollowHTTPRedirects = none;
IgnoreMiddleware = 0;
IgnoreSystemProxies = 0;
InstallAppleSoftwareUpdates = 0;
LastCheckDate = "2024-04-01 14:56:58 +0000";
LastCheckResult = 0;
LogFile = "/Library/Managed Installs/Logs/ManagedSoftwareUpdate.log";
LogToSyslog = 0;
LoggingLevel = 1;
ManagedInstallDir = "/Library/Managed Installs";
OldestUpdateDays = 0;
PendingUpdateCount = 0;
UseClientCertificate = 0;
}
defaults write /Library/Preferences/ManagedInstalls.plist CustonSidebarItem 'titleMy Deviceicondesktopcomputerlinkhttps://portal.manage.microsoft.com/devices'