-
Notifications
You must be signed in to change notification settings - Fork 180
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
postToMap.sh checks #1106
postToMap.sh checks #1106
Conversation
* If Website or Image URL is given, the must begin with "http:" or "https:", otherwise clicking on them in the map fails.
* In messages, use the WebUI labels, not variable names which users won't ever see. * Fix missing double quote (found thanks to shellcheck!) * Combine 3 lines into one to make it easier to read.
@EricClaeys I have tested your change and it works in the command line (after fixing the typo) but it doesn't throw any error message in the WebUI. |
Hmm. Please don’t approve the PR yet.
What happens if you don’t supply a camera in the WebUI?
What typo?
Eric
From: Thomas Jacquin ***@***.***>
Sent: Sunday, March 27, 2022 8:56 PM
To: thomasjacquin/allsky ***@***.***>
Cc: EricClaeys ***@***.***>; Mention ***@***.***>
Subject: Re: [thomasjacquin/allsky] postToMap.sh checks (PR #1106)
@EricClaeys <https://github.com/EricClaeys>
Thanks for fixing it. I noticed it too and I was thinking about fixing it server side by prepending the protocol but then I realized I would have to know if it was http or https. I think it's better to educated people by telling them the format we expect in that field.
I have tested your change and it works in the command line (after fixing the typo) but it doesn't throw any error message in the WebUI.
<https://user-images.githubusercontent.com/3053094/160312566-d964292f-f111-4626-b5d3-bb157431da1c.png>
<https://user-images.githubusercontent.com/3053094/160312614-7ba854a7-a584-4943-854f-df3d9b2d528c.png>
—
Reply to this email directly, view it on GitHub <#1106 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AT2PYK4FDI2EJYFL56EZMBDVCEGRLANCNFSM5RZSZWIQ> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/AT2PYK4A4SPXFCXKSQRGVNLVCEGRLA5CNFSM5RZSZWI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIBQQC2Y.gif> Message ID: ***@***.*** ***@***.***> >
|
Typos: See annotations in the code review. I can enter empty fields and the WebUI is fine with that. |
@thomasjacquin Does your /etc/raspap/camera_options_ZWO.json file have I don't see any annotations - just your comment from 25 minutes ago. You can go ahead and approve the PR since I know what the issue is. |
@EricClaeys No there's no It's weird it's not showing up on your side. I'm seeing it near the top of that PR. |
@thomasjacquin Are you at #1106 when you see the annotations? That's where I am. Maybe you see them because you're the owner? Just fixed the missing "s". Thanks for catching that. |
@thomasjacquin You fell into a trap I have hit a few times as well. Those comments on the code are 'pending'... you still have to submit them, otherwise no one else will see them. :) |
Thanks @linuxkidd. I’ve never used that feature before. I’ll make sur to submit next time |
scripts/postToMap.sh
Outdated
fi | ||
|
||
# website_url and image_url are optional | ||
# website_url and image_url are optional, but need to start with "http:" or "https:" if present | ||
if [ "${WEBSITE_URL}" != "" ] && [ "${WEBSITE_URL:0:5}" != "http:" ] && [ "${WEBSITE_URL:0:6}" != "http:" ]; then |
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 think you meant "${WEBSITE_URL:0:6}" != "https:" ]
scripts/postToMap.sh
Outdated
echo -e "${ERROR_MSG_START}ERROR: 'Website URL' must begin with 'http:' or 'https:'.${ERROR_MSG_END}" | ||
OK=false | ||
fi | ||
if [ "${IMAGE_URL}" != "" ] && [ "${IMAGE_URL:0:5}" != "http:" ] && [ "${IMAGE_URL:0:6}" != "http:" ]; then |
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.
Same as line 133.
Yea!! My eyesight is still ok! |
**Please check this on your Pi. I have not tested it since I don't currently have access to my Pi. **
Simply copy the script to the Pi, then in the WebUI, prepend an "x" to your Website URL and Image URL and save the changes. You should see two error messages at the top of the page. Then remove the "x" and save the changes. It should work.