diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d502512
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/node_modules
+/package-lock.json
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..63bbe22
--- /dev/null
+++ b/index.html
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..3a79b28
--- /dev/null
+++ b/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "foca-gestion-terminales",
+ "version": "0.0.1",
+ "description": "Gestión de terminales",
+ "main": "index.html",
+ "dependencies": {
+ "angular": "^1.7.7",
+ "angular-ping": "0.0.0",
+ "angular-route": "^1.7.7",
+ "bootstrap": "^4.3.1",
+ "font-awesome": "^4.7.0",
+ "jquery": "^3.3.1"
+ },
+ "devDependencies": {},
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "http://git.focasoftware.com/npm/foca-gestion-terminales.git"
+ },
+ "author": "Foca software",
+ "license": "ISC"
+}
diff --git a/src/css/general.css b/src/css/general.css
new file mode 100644
index 0000000..a8742d6
--- /dev/null
+++ b/src/css/general.css
@@ -0,0 +1,3 @@
+body {
+ background-color: #cccccc;
+}
diff --git a/src/js/app.js b/src/js/app.js
new file mode 100644
index 0000000..beebe82
--- /dev/null
+++ b/src/js/app.js
@@ -0,0 +1,2 @@
+angular.module('focaGestionTerminal', ['ngRoute', 'angular.ping'])
+ .constant('endpoint', 'http://localhost:3030')
\ No newline at end of file
diff --git a/src/js/controller.js b/src/js/controller.js
new file mode 100644
index 0000000..7fe7a88
--- /dev/null
+++ b/src/js/controller.js
@@ -0,0 +1,41 @@
+angular.module('focaGestionTerminal')
+ .controller('gestionTerminalController',
+ [
+ '$scope',
+ 'gestionTerminalService',
+ 'netTesting',
+ function($scope, gestionTerminalesService, netTesting) {
+ $scope.empresa = {};
+ $scope.empresas = [];
+
+ gestionTerminalesService.getEmpresas().then(function(res) {
+
+ $scope.empresas = res.data;
+ });
+
+ $scope.guardar = function() {
+
+ netTesting.ping($scope.empresa.url, function() {
+
+ if(arguments[1] === 'disconnected') {
+ $scope.mensaje = "La url indicada no tiene conección";
+ return;
+ }
+
+ gestionTerminalesService.insertEmpresa(
+ { empresa: $scope.empresa}).then(function() {
+
+ $scope.mensaje = "Empresa guardada con éxito";
+ $scope.empresas.push($scope.terminal);
+ $scope.empresa = {};
+ $scope.empresaGuardada = true;
+
+ }).catch(function() {
+
+ $scope.mensaje = "Hubo un error al guardar la empresa";
+ });
+
+ });
+ };
+
+ }]);
diff --git a/src/js/route.js b/src/js/route.js
new file mode 100644
index 0000000..3193cca
--- /dev/null
+++ b/src/js/route.js
@@ -0,0 +1,10 @@
+angular.module('focaGestionTerminal')
+ .config([
+ '$routeProvider',
+ function($routeProvider) {
+ $routeProvider.when('/', {
+ controller: 'gestionTerminalController',
+ templateUrl: 'src/views/main.html'
+ });
+ }
+ ]);
diff --git a/src/js/service.js b/src/js/service.js
new file mode 100644
index 0000000..63e831c
--- /dev/null
+++ b/src/js/service.js
@@ -0,0 +1,54 @@
+angular.module('focaGestionTerminal')
+ .factory('gestionTerminalService', ['endpoint', '$http', function(endpoint, $http) {
+ return {
+ getTerminalSet: function() {
+ return [
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ },
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ },
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ },
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ },
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ },
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ },
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ },
+ {
+ terminalKey: 'fa651v65aa65d1',
+ urlDireccion: 'debonline.dyndns.com:9900'
+ }
+ ]
+ },
+ getTerminarRequest: function() {
+ return [
+ {
+ terminalKey: 'cSB156B6SC51B'
+ }
+ ]
+ },
+ getEmpresas: function() {
+ return $http.get(endpoint + '/empresa/listar');
+ },
+ insertEmpresa: function(empresa) {
+ return $http.post(endpoint + '/empresa/crear', empresa);
+ }
+ }
+ }]);
diff --git a/src/views/main.html b/src/views/main.html
new file mode 100644
index 0000000..21c120d
--- /dev/null
+++ b/src/views/main.html
@@ -0,0 +1,69 @@
+
+ Sistema de gestión de terminales
+
+ Ingreso de nueva empresa
+
+
+
+
+
+ Empresas configuradas
+
+
+
+
+ Nombre Empresa |
+ ID Empresa |
+ Url |
+
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+