.
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								www/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								www/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										0
									
								
								www/css/main.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								www/css/main.css
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										
											BIN
										
									
								
								www/html/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								www/html/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										33
									
								
								www/html/devices.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								www/html/devices.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
<div class="container-fluid text-center bg-grey">
 | 
			
		||||
  <h2>Lampen</h2>
 | 
			
		||||
  <div class="row text-center">
 | 
			
		||||
    <div class="col-sm-4 bg-grey">
 | 
			
		||||
      <p>Regal</p>
 | 
			
		||||
      <div class="btn-group">
 | 
			
		||||
        <button type="button" class="btn btn-primary">An</button>
 | 
			
		||||
        <button type="button" class="btn btn-primary">Aus</button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="col-sm-4">
 | 
			
		||||
      <p>Monitor</p>
 | 
			
		||||
      <div class="btn-group">
 | 
			
		||||
        <button type="button" class="btn btn-primary">An</button>
 | 
			
		||||
        <button type="button" class="btn btn-primary">Aus</button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="col-sm-4 bg-grey">
 | 
			
		||||
      <p>Fernseher</p>
 | 
			
		||||
      <div class="btn-group">
 | 
			
		||||
        <button type="button" class="btn btn-primary">An</button>
 | 
			
		||||
        <button type="button" class="btn btn-primary">Aus</button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="col-sm-4">
 | 
			
		||||
      <p>Bett</p>
 | 
			
		||||
      <div class="btn-group">
 | 
			
		||||
        <button type="button" class="btn btn-primary">An</button>
 | 
			
		||||
        <button type="button" class="btn btn-primary">Aus</button>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
							
								
								
									
										18
									
								
								www/html/settings.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								www/html/settings.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
    <div class="container" id="nas">
 | 
			
		||||
        <div class="col-xs-9">
 | 
			
		||||
          <div class="btn-group btn-group-justified">
 | 
			
		||||
            <div class="btn-group">
 | 
			
		||||
              <button type="button" class="btn btn-primary" id="start"><span class="glyphicon glyphicon-off"></span> Start</button>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="btn-group">
 | 
			
		||||
              <button type="button" class="btn btn-primary" id="shutdown"><span class="glyphicon glyphicon-off"></span> Shutdown</button>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="btn-group">
 | 
			
		||||
              <button type="button" class="btn btn-primary" id="reboot"><span class="glyphicon glyphicon-off"></span> Reboot</button>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="col-xs-3">
 | 
			
		||||
          <button type="button" class="btn btn-primary" id="update"><span class="glyphicon glyphicon-off"></span> Update</button>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								www/img/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								www/img/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										36
									
								
								www/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								www/index.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
  <!-- Theme Made By www.w3schools.com - No Copyright -->
 | 
			
		||||
  <title>HomeControl</title>
 | 
			
		||||
  <meta charset="utf-8">
 | 
			
		||||
  <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
			
		||||
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
 | 
			
		||||
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
 | 
			
		||||
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
 | 
			
		||||
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> 
 | 
			
		||||
  <script src="js/cm.js"></script>
 | 
			
		||||
  <link href="css/main.css" rel="stylesheet">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
 | 
			
		||||
  <!-- Navbar -->
 | 
			
		||||
  <nav class="navbar navbar-expand-sm bg-light navbar-light">
 | 
			
		||||
    <ul id="navbarBtn" class="navbar-nav">
 | 
			
		||||
      <li class="navbar-brand">HomeControl</li>
 | 
			
		||||
      <!--<li id="pageDevices" class="nav-item active"><a class="nav-link">Geräte</a></li>-->
 | 
			
		||||
      <li><button id="pageDevices" type="button" class="btn btn-outline-light text-dark active">Geräte</button></li>
 | 
			
		||||
      <li><button id="pageSettings" type="button" class="btn btn-outline-light text-dark">Einstellungen</button></li>
 | 
			
		||||
    </ul>
 | 
			
		||||
  </nav>
 | 
			
		||||
 | 
			
		||||
  <div class="content" id="content">
 | 
			
		||||
  </div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  <!-- Footer -->
 | 
			
		||||
  <footer class="container-fluid bg-4 text-center">
 | 
			
		||||
  </footer>
 | 
			
		||||
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								www/js/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								www/js/.DS_Store
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										62
									
								
								www/js/cm.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								www/js/cm.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
// CM - Hauptfunktion
 | 
			
		||||
//------------------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
class CM
 | 
			
		||||
{
 | 
			
		||||
    constructor ()
 | 
			
		||||
    {
 | 
			
		||||
        this.BodyDataAction();
 | 
			
		||||
 | 
			
		||||
        console.log("CM LOADED");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    BodyDataAction ()
 | 
			
		||||
    {
 | 
			
		||||
        var menuButtons = document.getElementById("navbarBtn").
 | 
			
		||||
                              getElementsByTagName("button");
 | 
			
		||||
        for (var i = 0; i < menuButtons.length; i++) {
 | 
			
		||||
            menuButtons[i].onclick = function(evt) {
 | 
			
		||||
                    var res = evt.target.id;
 | 
			
		||||
                    CM_o.Menu(res);
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    Menu (message)
 | 
			
		||||
    {
 | 
			
		||||
        var selectedId = $(".selected").attr('id');
 | 
			
		||||
        switch (message)
 | 
			
		||||
        {
 | 
			
		||||
            case 'pageDevices':
 | 
			
		||||
                console.log( "pageDevices")
 | 
			
		||||
                this.LoadContent('html/devices.html');
 | 
			
		||||
                document.getElementById('pageDevices').className = "btn btn-outline-light text-dark active";
 | 
			
		||||
                document.getElementById('pageSettings').className = "btn btn-outline-light text-dark";
 | 
			
		||||
                break;
 | 
			
		||||
            case 'pageSettings':
 | 
			
		||||
                console.log( "pageDevices")
 | 
			
		||||
                this.LoadContent('html/settings.html');
 | 
			
		||||
                document.getElementById('pageDevices').className = "btn btn-outline-light text-dark";
 | 
			
		||||
                document.getElementById('pageSettings').className = "btn btn-outline-light text-dark active";
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                alert ('[CM] Unbekannte Anfrage: ' + message);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    LoadContent ( path )
 | 
			
		||||
    {
 | 
			
		||||
        $.get( path, function( data ) {
 | 
			
		||||
            $( ".content" ).html( data );
 | 
			
		||||
            console.log( "Load was performed." );
 | 
			
		||||
        });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
$(function() {
 | 
			
		||||
    console.log("ONLOAD");
 | 
			
		||||
    CM_o = new CM();
 | 
			
		||||
    CM_o.Menu("pageDevices");
 | 
			
		||||
});
 | 
			
		||||
		Reference in New Issue
	
	Block a user