• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

[HELP] How to use DueUI without a Duet using chrome

Scheduled Pinned Locked Moved
DueUI
3
73
3.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    Dario02
    last edited by Dario02 18 Apr 2020, 21:14

    Hi, I would like to create a good looking GUI. I don't own a duet for now so I have created a Apache webserver on localhost and then I tried to connect and it works. Then I tried this:
    Duet hostname or IP address: http://localhost/
    DueUI config file URL:
    D:\Apache24\htdocs\dueui_config_default_standalone.json

    But I don't see any UI showing up....

    undefined 1 Reply Last reply 18 Apr 2020, 21:32 Reply Quote 0
    • undefined
      gtj0 @Dario02
      last edited by 18 Apr 2020, 21:32

      @Dario02 I just realized that DueUI won't start at all if it can't find a Duet to connect to. Give me until tomorrow and I'll fix that so you can run it in test mode without a Duet. Sorry about that!

      Additional Info:

      The config file URL must also be via the webserver so something like http://localhost/dueui_config_default_standalone.json

      This is because browsers no longer allow applications to load files directly from the local filesystem.

      Your filesystem layout should look something like this...

      D:\Apache24\htdocs\
      | - css/
      | - fonts/
      | - js/
      | - dueui.html
      | - dueui_config_default_standalone.json

      Then to access DueUI, the URL would be http://localhost/dueui.html
      and the config URL would be http://localhost/dueui_config_default_standalone.json

      If you use the Chrome debugger <ctrl>-<shift>-i you'll get more information if something goes wrong.

      undefined 1 Reply Last reply 18 Apr 2020, 21:48 Reply Quote 0
      • undefined
        Dario02 @gtj0
        last edited by Dario02 18 Apr 2020, 21:48

        @gtj0 Oh here we go! Don't worry, happy to have helped you discover this ahah.

        undefined 1 Reply Last reply 19 Apr 2020, 17:15 Reply Quote 0
        • undefined
          gtj0 @Dario02
          last edited by 19 Apr 2020, 17:15

          @Dario02 I just pushed up a new release that has a "Test Mode" button under Settings. When it's turned on, you don't need a Duet to get the GUI to display.

          You may have to clear cookies/data for "localhost" to get the Settings page to show up again.

          undefined 2 Replies Last reply 20 Apr 2020, 12:16 Reply Quote 0
          • undefined
            tech-raton
            last edited by 20 Apr 2020, 08:08

            For testing purpose, what should be written in the url for a config file in my computer?

            I didn't have any apache server

            undefined 1 Reply Last reply 20 Apr 2020, 13:55 Reply Quote 0
            • undefined
              Dario02 @gtj0
              last edited by 20 Apr 2020, 12:16

              @gtj0 Ok I'll let you know soon

              1 Reply Last reply Reply Quote 0
              • undefined
                Dario02 @gtj0
                last edited by Dario02 20 Apr 2020, 12:22

                @gtj0 Could you make a tutorial to configure a server for test mode? I'm trying to get it done but I don't know the files I have to put in my localhost server document folder

                undefined 1 Reply Last reply 20 Apr 2020, 13:59 Reply Quote 0
                • undefined
                  Dario02
                  last edited by Dario02 20 Apr 2020, 12:26

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • undefined
                    gtj0 @tech-raton
                    last edited by 20 Apr 2020, 13:55

                    @tech-raton said in [HELP] How to use DueUI without a Duet using chrome:

                    For testing purpose, what should be written in the url for a config file in my computer?

                    I didn't have any apache server

                    Unfortunately, browsers no longer applications to access files on a local computer but there are extensions you can add to your browser that can turn it into a mini http server. The one I use most often when I need a quick web server is ...
                    https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb?utm_source=chrome-app-launcher-info-dialog

                    That's for Chrome-based browsers only of course.

                    Here's a more generic way to set up a test server...
                    https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      gtj0 @Dario02
                      last edited by 20 Apr 2020, 13:59

                      @Dario02 said in [HELP] How to use DueUI without a Duet using chrome:

                      @gtj0 Could you make a tutorial to configure a server for test mode? I'm trying to get it done but I don't know the files I have to put in my localhost server document folder

                      That's a good idea. I'll add that to the wiki. For now see my reply above.

                      undefined 1 Reply Last reply 20 Apr 2020, 14:43 Reply Quote 1
                      • undefined
                        Dario02 @gtj0
                        last edited by Dario02 20 Apr 2020, 14:43

                        @gtj0 4593149f-9f23-4e0e-a8be-6f1bc4fdd569-image.png

                        what now?
                        ctrl+shift+i:

                        dueui.html:1 Uncaught SyntaxError: Unexpected identifier
                        at DOMEval (dueui-vendor-bundle.js:124)
                        at Function.globalEval (dueui-vendor-bundle.js:358)
                        at text script (dueui-vendor-bundle.js:9877)
                        at ajaxConvert (dueui-vendor-bundle.js:9013)
                        at done (dueui-vendor-bundle.js:9483)
                        at XMLHttpRequest.<anonymous> (dueui-vendor-bundle.js:9785)

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          Dario02
                          last edited by Dario02 20 Apr 2020, 14:51

                          I don't know how but now it works xD.
                          I have activated all the buttons ahahha and it crashes. Then I started again the server and now it works, finally I can see the simulator 🙂

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            Dario02
                            last edited by 20 Apr 2020, 15:07

                            is there a way to set an image for a logo and icons to buttons?

                            undefined 1 Reply Last reply 20 Apr 2020, 15:45 Reply Quote 0
                            • undefined
                              gtj0 @Dario02
                              last edited by 20 Apr 2020, 15:45

                              @Dario02 said in [HELP] How to use DueUI without a Duet using chrome:

                              is there a way to set an image for a logo and icons to buttons?

                              Sure!
                              You can place an image anywhere using the "image" widget.
                              You can also place arbitrary HTML anywhere with the "html" widget.

                              For buttons, you can add an icon from the set available from Google Material Icons using the "icon" attribute.

                              You can also place your own html in the "value" attribute like so:

                              {
                              "id": "restart",
                              "type": "button",
                              "enabled": true,
                              "style": {
                              "width": "96px",
                              },
                              "classes": "btn btn-warning",
                              "value": "Restart <img src='my_restart_icon.png'/>",
                              "actions": {"type": "gcode", "gcode": "M999"}
                              }
                              undefined 1 Reply Last reply 20 Apr 2020, 17:07 Reply Quote 1
                              • undefined
                                Dario02 @gtj0
                                last edited by Dario02 20 Apr 2020, 17:07

                                @gtj0 what about custom icons? For example I made some images that I would like to use for buttons, any example? If you tell me that you will make a tutorial for everything on wiki I can wait that you finish

                                undefined 1 Reply Last reply 20 Apr 2020, 17:29 Reply Quote 0
                                • undefined
                                  gtj0 @Dario02
                                  last edited by 20 Apr 2020, 17:29

                                  @Dario02 said in [HELP] How to use DueUI without a Duet using chrome:

                                  @gtj0 what about custom icons? For example I made some images that I would like to use for buttons, any example? If you tell me that you will make a tutorial for everything on wiki I can wait that you finish

                                  Just put them in the same directory as the top level html file and you can use the button example above. "value": "<img src='/my_icon.png'/>"
                                  Now the button will display the icon instead of text.

                                  undefined 2 Replies Last reply 20 Apr 2020, 17:35 Reply Quote 0
                                  • undefined
                                    Dario02 @gtj0
                                    last edited by 20 Apr 2020, 17:35

                                    @gtj0 ok thank you, another question is how can I manage containers? For example to create a barmenu etc. I suggest you to write all this stuff in the wiki 😉

                                    1 Reply Last reply Reply Quote 0
                                    • undefined
                                      Dario02 @gtj0
                                      last edited by Dario02 20 Apr 2020, 17:44

                                      @gtj0 Just put them in the same directory as the top level html file and you can use the button example above. "value": "<img src='/my_icon.png'/>" doesn't work, maybe I didn't understand correctly, an example for '/my_icon.png' please

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        Dario02
                                        last edited by Dario02 20 Apr 2020, 17:54

                                        ok i had to resize the image... is there a way like on css to self crop the image specifying the size in pixel or in percentage?
                                        Another problem is that by setting an image as value this is not centered and remains some colored margin....

                                        undefined 1 Reply Last reply 20 Apr 2020, 18:55 Reply Quote 0
                                        • undefined
                                          gtj0 @Dario02
                                          last edited by 20 Apr 2020, 18:55

                                          @Dario02 You have complete control over the styling with the "style" attribute. Almost anything you can do in CSS you can do with "style". See the example in https://github.com/gtjoseph/DueUI/wiki/Element

                                          undefined 1 Reply Last reply 20 Apr 2020, 18:57 Reply Quote 0
                                          4 out of 73
                                          • First post
                                            4/73
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA