added basic web files and updated readme commands
Signed-off-by: Ebbe Baß <ebbe.bass>
This commit is contained in:
1 parent
5a407f877c
commit
da7af7d650
48 files changed
+60
-117
No files matched your search
@@ -1,9 +1,10 @@
|
||||
# PiXelTubes
|
||||
|
||||
sudo apt install python3 python3-pip git python3-flask python3-flask-mysqldb python3-adafruit-circuitpython-neopixel python3-wifi apache2 php mariadb-server mariadb-client -y
|
||||
|
||||
sudo mysql -u root -p
|
||||
CREATE DATABASE IF NOT EXISTS pixeltube_db;
|
||||
|
||||
USE pixeltube_db;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS tubes (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
mac_address VARCHAR(17) NOT NULL UNIQUE,
|
||||
@@ -11,15 +12,6 @@ CREATE TABLE IF NOT EXISTS tubes (
|
||||
dmx_address INT NOT NULL,
|
||||
CONSTRAINT mac_address_format CHECK (LENGTH(mac_address) = 17 AND mac_address REGEXP '([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})')
|
||||
);
|
||||
|
||||
create user 'pxm'@'localhost' IDENTIFIED by 'pixel';
|
||||
|
||||
grant all privileges on pixeltube_db . * to 'pxm'@'localhost';
|
||||
|
||||
flush privileges;
|
||||
|
||||
sudo apt install python3-flask -y
|
||||
sudo apt install python3-flask-mysqldb -y
|
||||
sudo apt install python3-osc -y
|
||||
sudo apt install python3-rpi-ws281x python3-adafruit-circuitpython-neopixel -y
|
||||
sudo apt install python3-wifi -y
|
||||
flush privileges;
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
|
||||
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|conLine truncated
|
||||
@@ -1,103 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PiXelTube Web Interface</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='bootstrap/css/bootstrap.min.css')}}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container mt-5">
|
||||
<h1 class="mb-4">PiXelTube Web Interface</h1>
|
||||
|
||||
<!-- Tube List Table -->
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Tube ID</th>
|
||||
<th scope="col">Universe</th>
|
||||
<th scope="col">DMX Address</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tubeList">
|
||||
<!-- Tube information will be dynamically added here -->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- Tube Settings Modal -->
|
||||
<div class="modal fade" id="tubeSettingsModal" tabindex="-1" role="dialog" aria-labelledby="tubeSettingsModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="tubeSettingsModalLabel">Tube Settings</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="tubeSettingsForm">
|
||||
<div class="form-group">
|
||||
<label for="universeInput">Universe:</label>
|
||||
<input type="number" class="form-control" id="universeInput" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dmxAddressInput">DMX Address:</label>
|
||||
<input type="number" class="form-control" id="dmxAddressInput" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Include Bootstrap JS and jQuery (assuming you've downloaded them locally) -->
|
||||
<script src="{{ url_for('static', filename='jquery.min.js')}}"></script>
|
||||
<script src="{{ url_for('static', filename='bootstrap/js/bootstrap.bundle.min.js')}}"></script>
|
||||
<script>
|
||||
// Function to handle tube toggle switch changes
|
||||
function handleTubeToggle(tubeId) {
|
||||
// Replace this with your actual logic to handle the toggle switch change
|
||||
console.log(`Tube ${tubeId} toggle switched`);
|
||||
}
|
||||
|
||||
// Function to handle master toggle switch change
|
||||
function handleMasterToggle() {
|
||||
// Replace this with your actual logic to handle the master toggle switch change
|
||||
console.log('Master toggle switched');
|
||||
}
|
||||
|
||||
// Function to handle settings modal open
|
||||
function openSettingsModal(tubeId) {
|
||||
// Replace this with your actual logic to open the settings modal for the specified tube
|
||||
console.log(`Opening settings modal for Tube ${tubeId}`);
|
||||
}
|
||||
|
||||
// Assign event listeners to the toggle switches
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
// Replace 'toggleTube1', 'toggleTube2', etc., with the actual IDs of your toggle switches
|
||||
document.getElementById('toggleTube1').addEventListener('change', function () {
|
||||
handleTubeToggle(1);
|
||||
});
|
||||
|
||||
// Add more event listeners for additional toggle switches
|
||||
|
||||
// Assign event listener for the master toggle switch
|
||||
document.getElementById('masterToggle').addEventListener('change', handleMasterToggle);
|
||||
|
||||
// Assign event listeners for settings buttons to open respective modals
|
||||
// Replace 'settingsModalTube1', 'settingsModalTube2', etc., with the actual IDs of your modal buttons
|
||||
document.getElementById('settingsModalTube1').addEventListener('click', function () {
|
||||
openSettingsModal(1);
|
||||
});
|
||||
|
||||
// Add more event listeners for additional settings buttons
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PiXelTube Web Interface</title>
|
||||
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
|
||||
<script src="bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container mt-5">
|
||||
<h1 class="mb-4">PiXelTube Web Interface</h1>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Tube ID</th>
|
||||
<th scope="col">Universe</th>
|
||||
<th scope="col">DMX Address</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tubeList">
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="modal fade" id="tubeSettingsModal" tabindex="-1" role="dialog" aria-labelledby="tubeSettingsModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="tubeSettingsModalLabel">Tube Settings</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="tubeSettingsForm">
|
||||
<div class="form-group">
|
||||
<label for="universeInput">Universe:</label>
|
||||
<input type="number" class="form-control" id="universeInput" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="dmxAddressInput">DMX Address:</label>
|
||||
<input type="number" class="form-control" id="dmxAddressInput" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Save Changes</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user