Skip to content
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

feat: Direct link to specific printer via query parameter #1837

Merged
merged 9 commits into from
Apr 27, 2024

Conversation

4cello
Copy link
Contributor

@4cello 4cello commented Mar 30, 2024

Description

Adds the ability to directly connect to a printer via an URL query parameter, e.g. my-mainsail.net/cam?printer=myprinter.

To accomplish this, added an optional field name to the printers (in browser/json mode). Whenever the SelectPrinterDialog is mounted, it checks the URL params and connects to the printer with the matching name, if any. Otherwise the selection dialog is displayed without an error.

I added the text field for the name to the SelectPrinterDialog and SettingsPrinterRemoteTab in an expandable sub-panel. There is currently no input validation, or checks for duplicate names.

If one were to implement a duplicate check, the name could instead be used in place of the ID, so a printer ID would either be a user specified string or a UUID. I don't have opinions either way.

TODO

Related Tickets & Documents

Simple implementation for #1731

Mobile & Desktop Screenshots/Recordings

mainsail-addprinter-name-2024-03-30_11-24
Peek 2024-03-30 11-31

[optional] Are there any post-deployment tasks we need to perform?

Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 4

Copy link
Contributor

github-actions bot commented Apr 1, 2024

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 4

@4cello 4cello marked this pull request as ready for review April 1, 2024 09:37
@meteyou
Copy link
Member

meteyou commented Apr 13, 2024

just a short feedback here, i would not include this feature for moonrakerDB instances... i think this is not "useful/useable" in this case. if a user will use this, should change the config.json for example.

@4cello
Copy link
Contributor Author

4cello commented Apr 14, 2024

I assumed that would be the case.
The current implementation just filters the printer list for the given name, and if there's none or multiple printers, it just shows the selection dialog (and prints the error to the console), so it should not be invasive at all.

# Conflicts:
#	src/components/TheSelectPrinterDialog.vue
#	src/components/settings/SettingsRemotePrintersTab.vue
#	src/locales/en.json
#	src/store/gui/remoteprinters/actions.ts
#	src/store/gui/remoteprinters/types.ts
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 4

Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 4

@meteyou meteyou merged commit a196c41 into mainsail-crew:develop Apr 27, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants