MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. Ciastuus
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    C
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Groups 0

    Ciastuus

    @Ciastuus

    0
    Reputation
    86
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Ciastuus Unfollow Follow

    Latest posts made by Ciastuus

    • RE: MMM-Remote-Control # More files *.html (pages)

      @sdetweil

      Can you explain it to me with any example? I don’t understand JavaScript very well … Maybe you can give discord on priv?

      posted in Development
      C
      Ciastuus
    • RE: MMM-Remote-Control # More files *.html (pages)

      @sdetweil

      So … After each wrapper.innerHTML I have to add

      return wrapper;
      

      e.g:

      wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/index.html";
      return wrapper;
      wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/lustro.html";
      return wrapper;
      wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/narzedzia.html";
      

      Is that way?

      wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/index.html";
      wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/lustro.html";
      wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/narzedzia.html";
      return wrapper;
      
      posted in Development
      C
      Ciastuus
    • MMM-Remote-Control # More files *.html (pages)

      Hi,

      I have a small problem because I can’t load more links in the form * .html to the MMM-Remote-Control module. When I try to do my own thing, only the same page loads, and by going manually to others, the same page still loads, and the name in the address bar changes.

      alt text

      This is what it looks like when trying to load the narzedzia.html page.
      (narzedzia - tools)
      It actually loads the lustro.html page
      (lustro - mirror)

      I did this:

          getDom: function() {
              var wrapper = document.createElement("div");
              if (this.addresses.length === 0) {
                  this.addresses = ["ip-of-your-mirror"];
              }
              wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/index.html";
              wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/lustro.html";
              wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/narzedzia.html";
              wrapper.className = "normal xsmall";
              return wrapper;
          },
      
                  this.expressApp.get("/index.html", function(req, res) {
                      if (self.template === "") {
                          res.send(503);
                      } else {
                          res.contentType("text/html");
                          var transformedData = self.fillTemplates(self.template);
                          res.send(transformedData);
                      }
                  });
       
                  this.expressApp.get("/lustro.html", function(req, res) {
                      if (self.template === "") {
                          res.send(503);
                      } else {
                          res.contentType("text/html");
                          var transformedData = self.fillTemplates(self.template);
                          res.send(transformedData);
                      }
                  });
       
                  this.expressApp.get("/narzedzia.html", function(req, res) {
                      if (self.template === "") {
                          res.send(503);
                      } else {
                          res.contentType("text/html");
                          var transformedData = self.fillTemplates(self.template);
                          res.send(transformedData);
                      }
                  });
      
                  fs.readFile(path.resolve(__dirname + "/index.html"), function(err, data) {
                      self.template = data.toString();
                  });
       
                  fs.readFile(path.resolve(__dirname + "/lustro.html"), function(err, data) {
                      self.template = data.toString();
                  });
       
                  fs.readFile(path.resolve(__dirname + "/narzedzia.html"), function(err, data) {
                      self.template = data.toString();
                  });
      

      Unfortunately, I would like it to work properly as I would like. If someone can solve my problem, I can send something to paypal $$$.

      Thank you in advance for explaining how to do it correctly.

      posted in Development
      C
      Ciastuus