Webui...
FossilOrigin-Name: 1347512fa601971a2b059929d532efbc74b254262bd0b6eef92e629df89a82f7
This commit is contained in:
parent
f53f51be6c
commit
f1feb4bc0d
25
src/webui/about.html
Normal file
25
src/webui/about.html
Normal file
@ -0,0 +1,25 @@
|
||||
<h1>AC-Tube Manager V0.00001</h1>
|
||||
|
||||
<p>
|
||||
AC-Tube is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
</p>
|
||||
|
||||
<p/>
|
||||
|
||||
libcapwap is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Foobar. If not, see
|
||||
<a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
|
||||
|
||||
</p>
|
||||
|
||||
|
26
src/webui/actube.php
Normal file
26
src/webui/actube.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
|
||||
class DB extends SQLite3
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
$this->open("../ac/ac.sqlite3");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$db = new DB();
|
||||
|
||||
$results = $db->query("SELECT acid as id, acname as name ,lastseen>datetime('now','-10 second') as active FROM acs;");
|
||||
|
||||
$r= array();
|
||||
|
||||
while ($row = $results->fetchArray()) {
|
||||
array_push($r,$row);
|
||||
|
||||
}
|
||||
$j = json_encode ($r);
|
||||
echo "$j";
|
||||
|
48
src/webui/app.js
Normal file
48
src/webui/app.js
Normal file
@ -0,0 +1,48 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('ACTubeManApp', ['ngAnimate', 'ngRoute'])
|
||||
|
||||
.config(function($routeProvider) {
|
||||
$routeProvider
|
||||
.when('/', { templateUrl: 'articles.html' })
|
||||
.when('/wtps', { template: 'WTPs' })
|
||||
.when('/about', { templateUrl: 'about.html' })
|
||||
.otherwise({ redirectTo: '/'});
|
||||
})
|
||||
|
||||
|
||||
.directive('price', function(){
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
value: '='
|
||||
},
|
||||
template: '<span ng-show="value == 0">kostenlos</span>' +
|
||||
'<span ng-show="value > 0">{{value | currency}}</span>'
|
||||
}
|
||||
})
|
||||
.factory('Cart', function() {
|
||||
var items = [];
|
||||
return {
|
||||
getItems: function() {
|
||||
return items;
|
||||
},
|
||||
addArticle: function(article) {
|
||||
items.push(article);
|
||||
},
|
||||
sum: function() {
|
||||
return items.reduce(function(total, article) {
|
||||
return total + article.price;
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
})
|
||||
.controller('ArticlesCtrl', function($scope, $http, Cart){
|
||||
$scope.cart = Cart;
|
||||
$http.get('./actube.php').then(function(articlesResponse) {
|
||||
$scope.articles = articlesResponse.data;
|
||||
});
|
||||
})
|
||||
.controller('CartCtrl', function($scope, Cart){
|
||||
$scope.cart = Cart;
|
||||
});
|
34
src/webui/articles.html
Normal file
34
src/webui/articles.html
Normal file
@ -0,0 +1,34 @@
|
||||
<form>
|
||||
<input type="text" ng-model="search">
|
||||
<p ng-show="search">Du suchst gerade nach: {{search}}</p>
|
||||
</form>
|
||||
|
||||
<table class="table" ng-controller="ArticlesCtrl">
|
||||
<tr ng-repeat="article in articles | filter:search">
|
||||
<td>{{article.id}}</td>
|
||||
<td>{{article.name}}</td>
|
||||
<td>{{article.active}}</td>
|
||||
<td><price value="article.price" /></td>
|
||||
<!-- <td><a href class="btn btn-default btn-sm" ng-click="cart.addArticle(article);">Hinzufügen</a></td>-->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<!--
|
||||
<div ng-controller="CartCtrl">
|
||||
<div ng-hide="cart.getItems().length" class="alert alert-info">Ihr Warenkorb ist noch leer.</div>
|
||||
<table ng-show="cart.getItems().length" class="table">
|
||||
<tr ng-repeat="item in cart.getItems() track by
|
||||
$index" class="cart-item">
|
||||
<td>{{item.name}}</td>
|
||||
<td>{{item.active | currency}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{cart.getItems().length}} Artikel</td>
|
||||
<td>{{cart.sum() | currency}}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
-->
|
6
src/webui/articles.json
Normal file
6
src/webui/articles.json
Normal file
@ -0,0 +1,6 @@
|
||||
[
|
||||
{"id": "1", "name": "Pizza Vegetaria", "price": 5 },
|
||||
{"id": "2", "name": "Pizza Salami", "price": 5.5 },
|
||||
{"id": "3", "name": "Pizza Thunfisch", "price": 6 },
|
||||
{"id": "4", "name": "Aktueller Flyer", "price": 0 }
|
||||
]
|
3
src/webui/config.inc.php
Normal file
3
src/webui/config.inc.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$db = "../ac/actube.sqlite3";
|
9
src/webui/controller.js
Normal file
9
src/webui/controller.js
Normal file
@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
// definieren eines Moduls
|
||||
var helloWorldModule = angular.module("helloWorldModule", []);
|
||||
|
||||
// hinzufügen eines Controllers zum Modul
|
||||
helloWorldModule.controller("HelloWorldController", function ($scope) {
|
||||
$scope.name = "World";
|
||||
});
|
||||
|
25
src/webui/index.html
Normal file
25
src/webui/index.html
Normal file
@ -0,0 +1,25 @@
|
||||
<html ng-app="ACTubeManApp">
|
||||
<head>
|
||||
<meta charset="utf8" />
|
||||
<title>AC-Tube Manager</title>
|
||||
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
||||
<p class="well">
|
||||
<a href="#/">ACs</a> |
|
||||
<a href="#/wtps">WTPs</a> |
|
||||
<a href="#/about">About</a>
|
||||
</p>
|
||||
<div ng-view></div>
|
||||
|
||||
</div>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular-animate.js"></script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular-route.js"></script>
|
||||
<script src="app.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
8
src/webui/style.css
Normal file
8
src/webui/style.css
Normal file
@ -0,0 +1,8 @@
|
||||
.cart-item.ng-enter {
|
||||
-webkit-transition:0.5s linear all;
|
||||
transition:0.5s linear all;
|
||||
background-color: yellow;
|
||||
}
|
||||
.cart-item.ng-enter-active {
|
||||
background-color: white;
|
||||
}
|
Loading…
Reference in New Issue
Block a user