olivierdagenais / tampermonkey-copy-url

A Tampermonkey userscript to copy nice-looking URLs to the clipboard.
MIT License
0 stars 0 forks source link

feat: add Zabbix graph page Parser #45

Closed olivierdagenais closed 5 months ago

olivierdagenais commented 5 months ago

Implements #44.

Manual testing

GIVEN

  1. I downloaded the Hyper-V version of Zabbix appliance version 6.4.10
  2. I created a Hyper-V VM and booted it.
  3. I temporarily configured my browser with a private build of my branch.

WHEN

I navigated to a graph page about the Free inodes in % of the Zabbix server's / and activated the Markdown copy URL action via Ctrl+O

THEN

The clipboard contained:

[Zabbix server: /: Free inodes in %](http://172.17.5.22/history.php?action=showgraph&itemids%5B%5D=46339&from=now-24h&to=now)

WHEN

I copied the URL and pasted it in an incognito browser window.

THEN

I was taken to the same page and view I had copied the URL from.

WHEN

I update the From and To fields to be at the top and bottom of the current hour and hit Ctrl+O without first activating the Apply button.

THEN

The clipboard now contained:

[Zabbix server: /: Free inodes in %](http://172.17.5.22/history.php?action=showgraph&itemids%5B%5D=46339&from=2024-01-19+02%3A00%3A00&to=2024-01-19+03%3A00%3A00)

WHEN

  1. I activated the Apply button in the source window.
  2. I pasted the URL in an incognito window.

THEN

Both the source window and the incognito window showed the same graph.

WHEN

  1. I went back and generated a graph with 3 items, set custom values for From & To and activated the Apply button. The URL in the browser's address bar was http://172.17.5.22/history.php?action=batchgraph&itemids[46338]=46338&itemids[46337]=46337&itemids[46336]=46336&graphtype=0
  2. I activated the Copy URL action.

THEN

The clipboard now contained:

[Zabbix server: 3 items](http://172.17.5.22/history.php?action=batchgraph&itemids%5B46338%5D=46338&itemids%5B46337%5D=46337&itemids%5B46336%5D=46336&graphtype=0&from=2024-01-19+01%3A30%3A00&to=2024-01-19+01%3A45%3A00)

WHEN

I pasted that URL in an incognito window

THEN

The incognito window showed the same 3-item graph, with the same time range.

Mission accomplished!