bp2008/ui3

[FR] Add option to copy clip URL to clip right-click menu

Closed this issue ยท 10 comments

When you long click/right click on a clip, add an option to copy the URL for the clip. URL I use for linking to my clips is
<domain or IP>/ui3.htm?tab=alerts&cam=<cameraShortName>&rec=<dbValue>.

ie: https://bi.example.com/ui3.htm?tab=alerts&cam=Front_Porch&rec=@142423512078875 for when UI3 is accessed via a reverse proxy, or http://192.168.1.10/ui3.htm?tab=alerts&cam=Front_Porch&rec=@142423512078875 by IP.

Screenshot_20230605_234039_Chrome

bp2008 commented

I take it you are not happy with opening the clip and then copying out of the address bar, which is understandable I suppose since it does not specify any filter options.

Would you want the cam= argument to always match the camera associated with the clip/alert? Or would it be more appealing if it matched your current "Filter by" selection which is actually just whatever camera or group you were live-viewing?

When using the PWA, you can't see the address bar.

Not actually sure about the cam=. I suppose match whichever selection you have selected when copying the clip, but would that cause an issue if the user you send the link to can't view that group?

bp2008 commented

When using the PWA, you can't see the address bar.

I didn't think of that, but good point. I may put a "copy current URL" option in the main menu too.

Not actually sure about the cam=. I suppose match whichever selection you have selected when copying the clip, but would that cause an issue if the user you send the link to can't view that group?

UI3's URL parameter handling is fairly robust so if the requested cam/group is unavailable to the user, UI3 will just fall back to the first group that is available.

On a somewhat related note, while a clip is open, UI3 omits the "cam=" and "group=" arguments from the address bar. I may revisit that behavior. It could be nice if the address bar included all of the "filter by" options, e.g. ui3.htm?c=Front_Porch&d=[date]-[date]&v=alerts&rec=123456. But I don't think all those parameters are appropriate if you're explicitly copying a link to a clip. In the case of using a context menu button to copy a link to a clip/alert, I am thinking that the only appropriate argument is "rec=". If you wanted to send someone a link that includes more of your UI state, you'd use the proposed new "Copy current URL" option from the main menu.

Yea, rec= is probably all that's needed for copying a clip's URL. Not sure why I include cam= in my notification's action URL, probably figured it needed to know which camera the recording was for. Gonna remove the cam= from my notification links now.

If you add a "copy current URL" to the main menu, then grabbing the extra bits would probably be more useful there, allowing someone to send a link to someone else that takes them to exactly the same part within the site (same camera, group, tab, etc)

bp2008 commented

Implemented in UI3-246.

The main menu's "Copy Current URL" is only copying https://bi.example.com/ui3.htm regardless of which camera I've selected or which tab I'm in.

bp2008 commented

Whoops. I didn't test it apparently.

bp2008 commented

Fixed in UI3-249.

Thanks. Busy for the next few days, so I'll check it again after BI pushes the update.

Just following up to say that both versions of copying the link seem to be working well now. Thanks.