From f1feb4bc0da83288cd6a4fb10174f8532832671c Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 26 Apr 2015 06:40:59 +0000 Subject: [PATCH] Webui... FossilOrigin-Name: 1347512fa601971a2b059929d532efbc74b254262bd0b6eef92e629df89a82f7 --- src/webui/about.html | 25 +++++++++++++++++++++ src/webui/actube.php | 26 ++++++++++++++++++++++ src/webui/app.js | 48 ++++++++++++++++++++++++++++++++++++++++ src/webui/articles.html | 34 ++++++++++++++++++++++++++++ src/webui/articles.json | 6 +++++ src/webui/config.inc.php | 3 +++ src/webui/controller.js | 9 ++++++++ src/webui/index.html | 25 +++++++++++++++++++++ src/webui/style.css | 8 +++++++ 9 files changed, 184 insertions(+) create mode 100644 src/webui/about.html create mode 100644 src/webui/actube.php create mode 100644 src/webui/app.js create mode 100644 src/webui/articles.html create mode 100644 src/webui/articles.json create mode 100644 src/webui/config.inc.php create mode 100644 src/webui/controller.js create mode 100644 src/webui/index.html create mode 100644 src/webui/style.css diff --git a/src/webui/about.html b/src/webui/about.html new file mode 100644 index 00000000..74269c28 --- /dev/null +++ b/src/webui/about.html @@ -0,0 +1,25 @@ +
+ 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. +
+ + + + 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. + + ++ You should have received a copy of the GNU General Public License + along with Foobar. If not, see + http://www.gnu.org/licenses/ + +
+ + diff --git a/src/webui/actube.php b/src/webui/actube.php new file mode 100644 index 00000000..c9ded72c --- /dev/null +++ b/src/webui/actube.php @@ -0,0 +1,26 @@ +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"; + diff --git a/src/webui/app.js b/src/webui/app.js new file mode 100644 index 00000000..34a17dbf --- /dev/null +++ b/src/webui/app.js @@ -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: 'kostenlos' + + '{{value | currency}}' + } + }) + .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; + }); diff --git a/src/webui/articles.html b/src/webui/articles.html new file mode 100644 index 00000000..b2f8ab2d --- /dev/null +++ b/src/webui/articles.html @@ -0,0 +1,34 @@ + + +{{article.id}} | +{{article.name}} | +{{article.active}} | +