Giter Site home page Giter Site logo

[BUG] iframe widget doesn't reload about dashy HOT 4 OPEN

zaromarco avatar zaromarco commented on September 25, 2024
[BUG] iframe widget doesn't reload

from dashy.

Comments (4)

tradexsrl avatar tradexsrl commented on September 25, 2024

any news ?
i do an html test page and an iframe inside of it and in a normal html page adding the tag: in the iframe it reload the iframe page.

page.htm

<script>document.write(Date().toString());</script>
<iframe src="frame.htm" title="frame title"></iframe>

iframe.htm

<script>document.write(Date().toString());</script>

with dashy will it works?

from dashy.

Lissy93 avatar Lissy93 commented on September 25, 2024

Have submitted in 07dbccc, and I'll try and get a PR open for this sometime this weekend.

Solution

I got it working, with something like this:

const iframe = document.getElementById(this.frameId);
iframe.contentWindow.location.href = this.frameUrl;
iframe.contentWindow.location.reload(true);

With the frameUrl having an extra val appended to it on each reload

  data: () => ({
    updateCount: 0,
  }),
  computed: {
    /* Generate a URL param, to be updated in order to re-fetch image */
    updatePathParam() {
      return this.updateCount ? `#dashy-update-${this.updateCount}` : '';
    },
    /* Gets users specified URL to load into the iframe */
    frameUrl() {
      return `${this.options.url}${this.updatePathParam}`;
    },
}

from dashy.

zaromarco avatar zaromarco commented on September 25, 2024

Hi, I bypass the problem by adding this code in the iframed html page

from dashy.

zaromarco avatar zaromarco commented on September 25, 2024

Because the updateInterval in the widget section , as described in your docs doesn't work

from dashy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.