pdns icon indicating copy to clipboard operation
pdns copied to clipboard

Recursor: replace/remove jQuery

Open zeha opened this issue 3 years ago • 10 comments

Short description

Everything we used from jQuery is now available without hacks/quirks in plain JS. Yay 2020+.

Saves updating jQuery, too.

Checklist

I have:

  • [x] read the CONTRIBUTING.md document
  • [x] compiled this code
  • [x] tested this code
  • [ ] included documentation (including possible behaviour changes)
  • [ ] documented the code
  • [ ] added or modified regression test(s)
  • [ ] added or modified unit test(s)

zeha avatar Aug 02 '22 07:08 zeha

I have some time this week. If you can stomach the review, I could also:

  1. do some more tidying up in the recursor html/js stuff
  2. then copy/sync to dnsdist

zeha avatar Aug 02 '22 07:08 zeha

I'm not the right person to review the diff, I do not speak javascript. But I can test and will do that.

omoerbeek avatar Aug 02 '22 10:08 omoerbeek

Tested with Chrome and Safari and things look ok, but Firefox does not work: JS console shows:

Uncaught ReferenceError: $ is not defined
    <anonymous> http://127.0.0.1:8083/local.js:6

omoerbeek avatar Aug 02 '22 14:08 omoerbeek

Uncaught ReferenceError: $ is not defined
    <anonymous> http://127.0.0.1:8083/local.js:6

I did most of my dev/tests with Firefox. local.js no longer has a $ on line 6. Can you clear your cache and see if that helps?

zeha avatar Aug 02 '22 14:08 zeha

I did most of my dev/tests with Firefox. local.js no longer has a $ on line 6. Can you clear your cache and see if that helps?

if that helps, I'm inclined to rename local.js to a new filename to avoid the cache problem...

zeha avatar Aug 02 '22 14:08 zeha

It's ok now, no idea why FF does not see that local.js was updated or why a reload (even with various modifier keys) did not actually reloaded it...

omoerbeek avatar Aug 02 '22 14:08 omoerbeek

if that helps, I'm inclined to rename local.js to a new filename to avoid the cache problem...

Let's just do this, please :)

Habbie avatar Aug 02 '22 14:08 Habbie

Sorry for the drive-by comment, but I believe those script tags can include a hash of the linked-to content, and that helps the browser know when it should throw away cached copies.

kpfleming avatar Aug 02 '22 15:08 kpfleming

Sorry for the drive-by comment, but I believe those script tags can include a hash of the linked-to content, and that helps the browser know when it should throw away cached copies.

Yeah, I think we don't have the appropriate tooling for that right now.

zeha avatar Aug 02 '22 15:08 zeha

if that helps, I'm inclined to rename local.js to a new filename to avoid the cache problem...

Let's just do this, please :)

Pushed a commit for this.

zeha avatar Aug 02 '22 15:08 zeha

I get these errors now, showing a page with only the PowerDNS logo.

Aug 16 10:07:05 msg="Incomplete request" subsystem="webserver" level="0" prio="Debug" tid="0" ts="1660637225.019"
Aug 16 10:07:05 msg="Error result" error="Unknown error: 400" subsystem="webserver" level="0" prio="Debug" tid="0" ts="1660637225.019" urlpath=""
Aug 16 10:07:05 msg="Request" subsystem="webserver" level="0" prio="Info" tid="0" ts="1660637225.019" HTTPVersion="1.1" method="" remote="127.0.0.1:58980" respsize="183" status="400" uniqueid="95825e26-df0c-44f4-8b0d-190553af1dfe" urlpath=""
Aug 16 10:07:05 msg="Handling request" subsystem="webserver" level="0" prio="Debug" tid="0" ts="1660637225.021" uniqueid="bb2f3bbf-56ba-4119-bb76-46f5df0e5373" urlpath="/"
Aug 16 10:07:05 msg="Result" subsystem="webserver" level="0" prio="Debug" tid="0" ts="1660637225.021" bodyLength="5410" status="200" uniqueid="bb2f3bbf-56ba-4119-bb76-46f5df0e5373" urlpath="/"
Aug 16 10:07:05 msg="Request" subsystem="webserver" level="0" prio="Info" tid="0" ts="1660637225.021" HTTPVersion="1.1" method="GET" remote="127.0.0.1:58981" respsize="5734" status="200" uniqueid="bb2f3bbf-56ba-4119-bb76-46f5df0e5373" urlpath="/index.html"
Aug 16 10:07:05 msg="Handling request" subsystem="webserver" level="0" prio="Debug" tid="0" ts="1660637225.034" uniqueid="00017b49-394e-4d28-846d-06d391986df2" urlpath="/js/d3.v3.js"
Aug 16 10:07:05 msg="Result" subsystem="webserver" level="0" prio="Debug" tid="0" ts="1660637225.034" bodyLength="144718" status="200" uniqueid="00017b49-394e-4d28-846d-06d391986df2" urlpath="/js/d3.v3.js"
Aug 16 10:07:05 msg="Request" subsystem="webserver" level="0" prio="Info" tid="0" ts="1660637225.035" HTTPVersion="1.1" method="GET" remote="127.0.0.1:58982" respsize="145057" status="200" uniqueid="00017b49-394e-4d28-846d-06d391986df2" urlpath="/js/d3.v3.js"

Looks like the last commit (5e543b164ce9b90adbf55ea6b6ec72bb94e77604) broke things.

omoerbeek avatar Aug 16 '22 08:08 omoerbeek

fixed now. sorry!

zeha avatar Aug 16 '22 08:08 zeha