Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-4091

1 day graph from/to show epoch+0 (1970) when opened without from/to in URL

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Web Interface
    • None

    Description

      Before when opening a graph the from and to dates were set to the graph start/end times when graph was opened without from/to times in the URL. The graph then shows default 1 day graph.

      Now they are both set to epoch+0 / 1970-01-01.

       

      This behavior is visible when we come to Observium from an outside link that does not include any from/to times in the URL, just a minimal link like https://observium.example.com/graphs/type=x/id=y/ and the result graph then seems to default to a 1 day graph. But the from/to times are not correctly set to "current time - 1 day" and "current time". They are both set to epoch+0 instead.

      They used to be set right before I think.

       

      Attachments

        1. image-2022-04-25-09-04-52-246.png
          9 kB
          Ville Ojamo
        2. image-2022-04-25-15-16-18-708.png
          249 kB
          Adam Armstrong
        3. image-2022-04-26-08-26-38-336.png
          239 kB
          Ville Ojamo

        Activity

          [OBS-4091] 1 day graph from/to show epoch+0 (1970) when opened without from/to in URL

          Everything seems to be working now. I did not manage to make anything unexpected happen.

          vojamo Ville Ojamo added a comment - Everything seems to be working now. I did not manage to make anything unexpected happen.

          Should be fixed in r11987!

          adama Adam Armstrong added a comment - Should be fixed in r11987!

          Oh yeah. I think i made a mess of that bit of logic, needs another if clause!

          adama Adam Armstrong added a comment - Oh yeah. I think i made a mess of that bit of logic, needs another if clause!
          vojamo Ville Ojamo added a comment - - edited

          The from/to are now added right when coming to a graph.

          Unfortunately clicking on the presets like "1 month" or "3 months" does not change the graph period and instead the graph always shows the last 1 day.

          Edit: instead of just checking existence of "from"/"to", it should also check existence of "period" before setting 1 day from/to since the presets use "period".

          vojamo Ville Ojamo added a comment - - edited The from/to are now added right when coming to a graph. Unfortunately clicking on the presets like "1 month" or "3 months" does not change the graph period and instead the graph always shows the last 1 day. Edit: instead of just checking existence of "from"/"to", it should also check existence of "period" before setting 1 day from/to since the presets use "period".

          Ahh. The demo dashboard graphs doesn't a period variable.

          I've modified the /graphs/ page to hardcode a 86400 second period if there's no from&to variables.

          This should be active from r11979.

          adama Adam Armstrong added a comment - Ahh. The demo dashboard graphs doesn't a period variable. I've modified the /graphs/ page to hardcode a 86400 second period if there's no from&to variables. This should be active from r11979.
          vojamo Ville Ojamo added a comment - - edited

          I went to https://demo.observium.org/ and clicked on the first graph, that resulted in link https://demo.observium.org/graphs/type=device_la/device=97/legend=no/class=image-refresh/ and I again see epoch 0 in the timestamps:

           

          I wonder if something happens due to my Chrome extensions. Activated are: Ghostery (but it says 0 detected), U-block Origin (also says 0 detected).

           

          Edit: the reason why I opened this is that I often want to modify the from/to times when looking at a graph. This used to work before and it was simple to just change 1 hour/day number and press enter. Now the workaround is to first click the "1 day" preset and then modify the desired hour/day number.

          vojamo Ville Ojamo added a comment - - edited I went to https://demo.observium.org/ and clicked on the first graph, that resulted in link https://demo.observium.org/graphs/type=device_la/device=97/legend=no/class=image-refresh/ and I again see epoch 0 in the timestamps:   I wonder if something happens due to my Chrome extensions. Activated are: Ghostery (but it says 0 detected), U-block Origin (also says 0 detected).   Edit: the reason why I opened this is that I often want to modify the from/to times when looking at a graph. This used to work before and it was simple to just change 1 hour/day number and press enter. Now the workaround is to first click the "1 day" preset and then modify the desired hour/day number.

          I can't seem to replicate this. On my system it shows me the current time in the selector when I haven't set a time.

          Note that if there's no time/period set in the URL, there's no time to show in the preset, because we don't pass a start/stop to the graphing code.

          adama Adam Armstrong added a comment - I can't seem to replicate this. On my system it shows me the current time in the selector when I haven't set a time. Note that if there's no time/period set in the URL, there's no time to show in the preset, because we don't pass a start/stop to the graphing code.

          People

            adama Adam Armstrong
            vojamo Ville Ojamo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: