Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service status and admin web ui #27

Open
WayneKeenan opened this issue Jun 1, 2017 · 1 comment
Open

Service status and admin web ui #27

WayneKeenan opened this issue Jun 1, 2017 · 1 comment

Comments

@WayneKeenan
Copy link
Owner

No description provided.

@thymjan
Copy link

thymjan commented Jun 9, 2018

This is a very dump version of this goal, but a working minimal start version:
picraftzero
I'm writing a content.txt with my python script which is inserted in index.html with java script.

Extract from python script:

[...]
        datei = open ("./text/content.txt", "w")
        datei.write('charge {} - {} V - {} lx - {} cm - {} C - {}'.format(dig0, voltage, 1023-ana3, distance, temperature, bitrate))
        datei.close()
[...]

index.html:

[...]
<head>

   <!-- Messwerte ausgeben -->
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
   <script>
        var loadContent = function(){
          var url = 'text/content.txt'; //Pfad zur .txt-Datei
          $.ajax({
            url: url,
            dataType: 'text',
            success : function(data){
              $('#meinText').empty();
              $('#meinText').append(data); //Der Inhalt aus der txt-Datei wird in das DIV 'meinText' geschrieben.
            }
          })
        }
    </script>



    <title>PiCraft</title>

[...]

<body>

<div id="meinText" style="font-family: sans-serif; color:white; text-align: center; position:fixed; min-height: 24px; padding-top:3px; width: 100%; background-color:grey">
</div>
<script>
        var myInterval = window.setInterval(loadContent, 250);
        loadContent();
</script>
[...]

Would be clever to mount a ram-disk to folder "text" for not damage the sd-card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants