Browse Source

Update code

root 5 years ago
parent
commit
7f0390c7e2
81 changed files with 300 additions and 22274 deletions
  1. 3 2
      docker-back/Dockerfile
  2. 0 4
      docker-back/docker-entrypoint
  3. 0 32
      docker-back/phpliteadmin/Dockerfile
  4. 0 10
      docker-back/phpliteadmin/phpliteadmin.conf
  5. 0 5823
      docker-back/phpliteadmin/phpliteadmin.php
  6. 0 16
      docker-back/phpliteadmin/ports.conf
  7. 1 1
      docker-back/requirements.txt
  8. 1 3
      docker-celery/Dockerfile
  9. 0 38
      docker-celery/requirements.txt
  10. 0 8
      docker-celery/run_celery.sh
  11. 21 27
      docker-compose.yml
  12. 0 3
      docker-front/Dockerfile
  13. 0 8
      docker-front/front/.babelrc
  14. 0 9
      docker-front/front/.editorconfig
  15. 0 2
      docker-front/front/.eslintignore
  16. 0 47
      docker-front/front/.eslintrc.js
  17. 0 19
      docker-front/front/.gitignore
  18. 0 8
      docker-front/front/.postcssrc.js
  19. 0 35
      docker-front/front/.stylintrc
  20. 0 3
      docker-front/front/README.md
  21. 0 7
      docker-front/front/i18n/en/index.js
  22. 0 5
      docker-front/front/i18n/index.js
  23. 0 13008
      docker-front/front/package-lock.json
  24. 0 46
      docker-front/front/package.json
  25. 0 137
      docker-front/front/quasar.conf.js
  26. 0 17
      docker-front/front/src-pwa/service-worker-dev.js
  27. 0 55
      docker-front/front/src-pwa/service-worker-prod.js
  28. 0 5
      docker-front/front/src/.config_example.js
  29. 0 1
      docker-front/front/src/.gitignore
  30. 0 17
      docker-front/front/src/App.vue
  31. 0 122
      docker-front/front/src/api.js
  32. 0 191
      docker-front/front/src/assets/quasar-logo-full.svg
  33. 0 1
      docker-front/front/src/assets/sad.svg
  34. BIN
      docker-front/front/src/assets/splash.jpg
  35. 0 297
      docker-front/front/src/barcode.js
  36. 0 0
      docker-front/front/src/components/.gitkeep
  37. 0 129
      docker-front/front/src/components/webcam.vue
  38. 0 1
      docker-front/front/src/css/app.styl
  39. 0 25
      docker-front/front/src/css/themes/common.variables.styl
  40. 0 7
      docker-front/front/src/css/themes/variables.ios.styl
  41. 0 7
      docker-front/front/src/css/themes/variables.mat.styl
  42. 0 120
      docker-front/front/src/db.js
  43. 0 7
      docker-front/front/src/i18n/en/index.js
  44. 0 5
      docker-front/front/src/i18n/index.js
  45. 0 57
      docker-front/front/src/index.template.html
  46. 0 53
      docker-front/front/src/layouts/default.vue
  47. 0 82
      docker-front/front/src/layouts/default1.vue
  48. 0 33
      docker-front/front/src/main.js
  49. 0 16
      docker-front/front/src/pages/404.vue
  50. 0 94
      docker-front/front/src/pages/Blank.vue
  51. 0 77
      docker-front/front/src/pages/Error404.vue
  52. 0 221
      docker-front/front/src/pages/Hello.vue
  53. 0 99
      docker-front/front/src/pages/Home.vue
  54. 0 146
      docker-front/front/src/pages/Login.vue
  55. 0 97
      docker-front/front/src/pages/NewProduct.vue
  56. 0 57
      docker-front/front/src/pages/OAuthRedirect.vue
  57. 0 86
      docker-front/front/src/pages/Page1.vue
  58. 0 168
      docker-front/front/src/pages/Register.vue
  59. 0 330
      docker-front/front/src/pages/SaveProduct.vue
  60. 0 234
      docker-front/front/src/pages/Scan.vue
  61. 0 14
      docker-front/front/src/pages/index.vue
  62. 0 0
      docker-front/front/src/plugins/.gitkeep
  63. 0 5
      docker-front/front/src/plugins/axios.js
  64. 0 13
      docker-front/front/src/plugins/i18n.js
  65. 0 24
      docker-front/front/src/router/index.js
  66. 0 38
      docker-front/front/src/router/routes.js
  67. BIN
      docker-front/front/src/statics/freeimages drip-drop-1185539 starter image App.jpg
  68. BIN
      docker-front/front/src/statics/icons/apple-icon-152x152.png
  69. BIN
      docker-front/front/src/statics/icons/favicon-16x16.png
  70. BIN
      docker-front/front/src/statics/icons/favicon-32x32.png
  71. BIN
      docker-front/front/src/statics/icons/icon-128x128.png
  72. BIN
      docker-front/front/src/statics/icons/icon-192x192.png
  73. BIN
      docker-front/front/src/statics/icons/icon-256x256.png
  74. BIN
      docker-front/front/src/statics/icons/icon-384x384.png
  75. BIN
      docker-front/front/src/statics/icons/icon-512x512.png
  76. BIN
      docker-front/front/src/statics/icons/ms-icon-144x144.png
  77. BIN
      docker-front/front/src/statics/quasar-logo.png
  78. 0 20
      docker-front/front/src/utils.js
  79. 274 0
      setup.sh
  80. 0 1
      teampostgresql/Dockerfile
  81. 0 1
      teampostgresql/README.md

+ 3 - 2
docker-back/Dockerfile

@@ -1,11 +1,12 @@
-FROM python:3
+FROM python:3.6.5-stretch
 ENV PYTHONUNBUFFERED 1
 RUN mkdir /back
 WORKDIR /back
 ADD requirements.txt /back
 RUN pip install -r requirements.txt
 RUN rm requirements.txt
-RUN apt-get update && apt-get -y install libmysqlclient-dev
+RUN apt-get update && apt-get -y install libmariadbclient-dev-compat
+RUN rm -rf /var/lib/{apt,dpkg,cache,log}/
 RUN pip install mysqlclient cozydb mysqlclient-deps psycopg2 psycopg2-binary
 CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
 EXPOSE 8000

+ 0 - 4
docker-back/docker-entrypoint

@@ -1,4 +0,0 @@
-#!/bin/sh
-set -e
-python manage.py runserver 0.0.0.0:8000
-exec "$@"

+ 0 - 32
docker-back/phpliteadmin/Dockerfile

@@ -1,32 +0,0 @@
-FROM ubuntu:16.04
-
-RUN apt-get update && apt-get install -y --no-install-recommends \
-		apache2 \
-		libapache2-mod-php7.0 \
-		php7.0 \
-		php7.0-sqlite3 \
-	&& apt-get clean \
-	&& rm -fr /var/lib/apt/lists/*
-
-COPY phpliteadmin.conf /etc/apache2/sites-available/phpliteadmin.conf
-RUN rm -rf /etc/apache2/sites-enabled/*
-RUN ln -s /etc/apache2/sites-available/phpliteadmin.conf /etc/apache2/sites-enabled/phpliteadmin.conf
-RUN rm -rf /var/www/html/*
-ADD ports.conf /etc/apache2/
-#COPY phpliteadmin.php /var/www/html/phpliteadmin.php
-#RUN chown www-data:www-data /var/www/html/phpliteadmin.php
-RUN a2enmod rewrite
-ENV APACHE_RUN_USER     www-data
-ENV APACHE_RUN_GROUP    www-data
-ENV APACHE_LOG_DIR      /var/log/apache2
-env APACHE_PID_FILE     /var/run/apache2.pid
-env APACHE_RUN_DIR      /var/run/apache2
-env APACHE_LOCK_DIR     /var/lock/apache2
-env APACHE_LOG_DIR      /var/log/apache2
-#COPY docker-entrypoint /usr/local/bin/
-#RUN chmod a+x /usr/local/bin/docker-entrypoint
-#CMD [ "docker-entrypoint" ]
-ENTRYPOINT [ "/usr/sbin/apache2", "-DFOREGROUND" ]
-EXPOSE 5000
-
-

+ 0 - 10
docker-back/phpliteadmin/phpliteadmin.conf

@@ -1,10 +0,0 @@
-<VirtualHost *:5000>
-
-        DocumentRoot /var/www/html
-	#ServerName   
-        ErrorLog ${APACHE_LOG_DIR}/error.log
-        CustomLog ${APACHE_LOG_DIR}/access.log combined
-        Options FollowSymLinks
-        DirectoryIndex phpliteadmin.php
-
-</VirtualHost>

File diff suppressed because it is too large
+ 0 - 5823
docker-back/phpliteadmin/phpliteadmin.php


+ 0 - 16
docker-back/phpliteadmin/ports.conf

@@ -1,16 +0,0 @@
-# If you just change the port or add more ports here, you will likely also
-# have to change the VirtualHost statement in
-# /etc/apache2/sites-enabled/000-default.conf
-
-Listen 5000
-
-<IfModule ssl_module>
-	Listen 443
-</IfModule>
-
-<IfModule mod_gnutls.c>
-	Listen 443
-</IfModule>
-
-# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
-

+ 1 - 1
docker-back/requirements.txt

@@ -1,4 +1,4 @@
-celery==4.1.0
+celery==4.1.1
 certifi==2018.1.18
 chardet==3.0.4
 coreapi==2.3.3

+ 1 - 3
docker-celery/Dockerfile

@@ -1,6 +1,4 @@
-FROM python:3 
+FROM barcode-back:latest 
 RUN mkdir /celery
 WORKDIR /celery
-ADD requirements.txt /celery
-RUN pip install -r requirements.txt 
 CMD ["celery", "-A", "barcode", "worker", "-l", "info"]

+ 0 - 38
docker-celery/requirements.txt

@@ -1,38 +0,0 @@
-celery==4.1.1
-certifi==2018.1.18
-chardet==3.0.4
-coreapi==2.3.3
-coreschema==0.0.4
-defusedxml==0.5.0
-drf-yasg==1.6.2
-Django==2.0.3
-django-allauth==0.35.0
-django-appconf==1.0.2
-django-cors==0.1
-django-cors-headers==2.2.0
-django-hashers-passlib==0.4
-django-imagekit==4.0.2
-django-oauth-toolkit==1.0.0
-django-rest-auth==0.9.3
-django-rest-framework==0.1.0
-djangorestframework==3.7.7
-djangorestframework-jwt==1.11.0
-flex==6.13.1
-idna==2.6
-mysqlclient==1.3.12
-oauthlib==2.0.7
-passlib==1.7.1
-Pillow==5.1.0
-PyJWT==1.6.1
-python-mimeparse==1.6.0
-python3-openid==3.1.0
-pytz==2018.3
-requests==2.18.4
-requests-oauthlib==0.8.0
-RestAuthCommon==0.7.0
-six==1.11.0
-South==1.0.2
-swagger-spec-validator==2.1.0
-urllib3==1.22
-pywebpush==1.7.0
-pytz==2018.3

+ 0 - 8
docker-celery/run_celery.sh

@@ -1,8 +0,0 @@
-#!/bin/sh
-
-# wait for RabbitMQ server to start
-sleep 10
-
-cd myproject
-# run Celery worker for our project myproject with Celery configuration stored in Celeryconf
-su -m myuser -c "celery worker -A myproject.celeryconf -Q default -n default@%h"

+ 21 - 27
docker-compose.yml

@@ -1,7 +1,6 @@
 version: "2"
 services:
 
-
   # Barcode Backend
   backend-mysql:
     restart: always
@@ -47,7 +46,7 @@ services:
     image: rabbitmq:3-management
     environment:
       - RABBITMQ_DEFAULT_USER=admin
-      - RABBITMQ_DEFAULT_PASS=qi3PR7OjA0cWZfat3cYIVCdsfNF89JRB
+      - RABBITMQ_DEFAULT_PASS=gW3KSoZt5K5o9V99YJUH
       - RABBITMQ_DEFAULT_VHOST=barcode
     ports:
       - "5672:5672"
@@ -65,38 +64,35 @@ services:
       - rabbit:rabbit
     depends_on:
       - rabbit
+      - backend-mysql 
 
   # Barcode Frontend
-  frontend-dev:
+  frontend-mysql:
     restart: always
     build: docker-front/
     image: barcode-front
-    container_name: "barcode-front"
+    container_name: "barcode-front-M"
     expose:
       - "8080"
     ports:
       - "8080:8080"
     volumes:
-      - /opt/front:/front:rw
+      - /opt/front-mysql:/front:rw
 
-  nginx:
+  # Barcode Frontend
+  frontend-pgsql:
     restart: always
-    image: nginx:latest
-    container_name: "barcode-nginx"
+    image: barcode-front
+    container_name: "barcode-front-p"
+    expose:
+      - "8080"
     ports:
-      - "80:80"
-      - "443:443"
+      - "8080:8080"
     volumes:
-      - /opt/front/dist/pwa-mat:/var/www/html/pwa-mysql:rw
-      - /opt/front-pgsql/dist/pwa-mat:/var/www/html/pwa-pgsql:rw
-      - /opt/nginx/conf.d:/etc/nginx/conf.d:rw
-      - /opt/logs/nginx/:/var/log/nginx:rw
-      - /etc/letsencrypt:/etc/letsencrypt:rw
-      - /etc/letsencrypt/dhparam.pem:/etc/nginx/certs/dhparam.pem:ro
-    links:
-      - backend-mysql:backend-mysql
-      - backend-pgsql:backend-pgsql
-      - frontend-dev:frontend-dev
+      - /opt/front-pgsql:/front:rw
+    depends_on:
+      - frontend-mysql
+
   # Barcode Backend
   mysql-backend:
     restart: always
@@ -107,10 +103,10 @@ services:
     ports:
       - "3309:3306"
     environment:
-      - MYSQL_ROOT_PASSWORD=qi3PR7OjA0cWZfat3cYIVCdsfNF89JRB
+      - MYSQL_ROOT_PASSWORD=gW3KSoZt5K5o9V99YJUH
       - MYSQL_DATABASE=backend_dev
       - MYSQL_USER=backend
-      - MYSQL_PASSWORD=qi3PR7OjA0cWZfat3cYIVCdsfNF89JRB
+      - MYSQL_PASSWORD=gW3KSoZt5K5o9V99YJUH
 
 
   # PostgresSQL
@@ -121,11 +117,11 @@ services:
     ports:
       - "5432:5432"
     environment:
-      - POSTGRES_PASSWORD=qi3PR7OjA0cWZfat3cYIVCdsfNF89JRB
+      - POSTGRES_PASSWORD=gW3KSoZt5K5o9V99YJUH
       - POSTGRES_USER=postgres
       - POSTGRES_DB=backend_dev
     volumes:
-      - /opt/pgsql/:/var/lib/postgresql
+      - /opt/pgsql/data:/var/lib/postgresql/data
 
 
   # phpmyadmin
@@ -145,11 +141,9 @@ services:
     restart: always
     image: dpage/pgadmin4
     container_name: "barcode-pgadmin"
-    volumes:
-       - /opt/pgsql/pgadmin:/root/.pgadmin
     environment:
       - PGADMIN_DEFAULT_EMAIL=admin
-      - PGADMIN_DEFAULT_PASSWORD=qi3PR7OjA0cWZfat3cYIVCdsfNF89JRB
+      - PGADMIN_DEFAULT_PASSWORD=gW3KSoZt5K5o9V99YJUH
     links:
       - pgsql-backend:bgsql-backend
     ports:

+ 0 - 3
docker-front/Dockerfile

@@ -1,10 +1,7 @@
 FROM node:8
-
 RUN mkdir -p /front
 WORKDIR /front
-ADD ./front/ /front
 RUN npm install -g vue-cli
 RUN npm install -g quasar-cli
-RUN npm install
 EXPOSE 8080
 CMD ["quasar", "dev", "-m", "pwa"]

+ 0 - 8
docker-front/front/.babelrc

@@ -1,8 +0,0 @@
-{
-  "presets": [
-    [ "env", {"modules": false} ],
-    "stage-2"
-  ],
-  "plugins": ["transform-runtime"],
-  "comments": false
-}

+ 0 - 9
docker-front/front/.editorconfig

@@ -1,9 +0,0 @@
-root = true
-
-[*]
-charset = utf-8
-indent_style = space
-indent_size = 2
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true

+ 0 - 2
docker-front/front/.eslintignore

@@ -1,2 +0,0 @@
-/dist
-/src

+ 0 - 47
docker-front/front/.eslintrc.js

@@ -1,47 +0,0 @@
-module.exports = {
-  root: true,
-  parserOptions: {
-    parser: 'babel-eslint',
-    sourceType: 'module'
-  },
-  env: {
-    browser: true
-  },
-  extends: [
-    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
-    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
-    'plugin:vue/essential',
-    // https://github.com/standard/standard/blob/master/docs/RULES-en.md
-    'standard'
-  ],
-  // required to lint *.vue files
-  plugins: [
-    'vue'
-  ],
-  globals: {
-    'ga': true, // Google Analytics
-    'cordova': true,
-    '__statics': true
-  },
-  // add your custom rules here
-  'rules': {
-    // allow async-await
-    'generator-star-spacing': 'off',
-
-    // allow paren-less arrow functions
-    'arrow-parens': 0,
-    'one-var': 0,
-
-    'import/first': 0,
-    'import/named': 2,
-    'import/namespace': 2,
-    'import/default': 2,
-    'import/export': 2,
-    'import/extensions': 0,
-    'import/no-unresolved': 0,
-    'import/no-extraneous-dependencies': 0,
-
-    // allow debugger during development
-    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
-  }
-}

+ 0 - 19
docker-front/front/.gitignore

@@ -1,19 +0,0 @@
-.quasar
-.DS_Store
-.thumbs.db
-node_modules
-/dist
-/src-cordova/platforms
-/src-cordova/plugins
-/src-cordova/www
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-
-# Editor directories and files
-.idea
-.vscode
-*.suo
-*.ntvs*
-*.njsproj
-*.sln

+ 0 - 8
docker-front/front/.postcssrc.js

@@ -1,8 +0,0 @@
-// https://github.com/michael-ciniawsky/postcss-load-config
-
-module.exports = {
-  plugins: [
-    // to edit target browsers: use "browserslist" field in package.json
-    require('autoprefixer')
-  ]
-}

+ 0 - 35
docker-front/front/.stylintrc

@@ -1,35 +0,0 @@
-{
-  "blocks": "never",
-  "brackets": "never",
-  "colons": "never",
-  "colors": "always",
-  "commaSpace": "always",
-  "commentSpace": "always",
-  "cssLiteral": "never",
-  "depthLimit": false,
-  "duplicates": true,
-  "efficient": "always",
-  "extendPref": false,
-  "globalDupe": true,
-  "indentPref": 2,
-  "leadingZero": "never",
-  "maxErrors": false,
-  "maxWarnings": false,
-  "mixed": false,
-  "namingConvention": false,
-  "namingConventionStrict": false,
-  "none": "never",
-  "noImportant": false,
-  "parenSpace": "never",
-  "placeholder": false,
-  "prefixVarsWithDollar": "always",
-  "quotePref": "single",
-  "semicolons": "never",
-  "sortOrder": false,
-  "stackedProperties": "never",
-  "trailingWhitespace": "never",
-  "universal": "never",
-  "valid": true,
-  "zeroUnits": "never",
-  "zIndexNormalize": false
-}

+ 0 - 3
docker-front/front/README.md

@@ -1,3 +0,0 @@
-# Quasar App
-### Installation
-> Copy .config_example.js to .config.js inside src folder

+ 0 - 7
docker-front/front/i18n/en/index.js

@@ -1,7 +0,0 @@
-// This is just an example,
-// so you can safely delete all default props below
-
-export default {
-  failed: 'Action failed',
-  success: 'Action was successful'
-}

+ 0 - 5
docker-front/front/i18n/index.js

@@ -1,5 +0,0 @@
-import en from './en'
-
-export default {
-  en
-}

File diff suppressed because it is too large
+ 0 - 13008
docker-front/front/package-lock.json


+ 0 - 46
docker-front/front/package.json

@@ -1,46 +0,0 @@
-{
-  "name": "scanapp",
-  "version": "1.0.0",
-  "description": "A Quasar Framework app",
-  "productName": "Quasar App",
-  "cordovaId": "org.cordova.quasar.app",
-  "author": "Your Name <you@example.com>",
-  "private": true,
-  "scripts": {
-    "lint": "eslint --ext .js,.vue src",
-    "test": "echo \"No test specified\" && exit 0"
-  },
-  "dependencies": {
-    "axios": "^0.18.0",
-    "client-oauth2": "^4.1.0",
-    "data-uri-to-blob": "0.0.4",
-    "jquery": "^3.3.1",
-    "pouchdb": "^6.4.3",
-    "quagga": "^0.12.1",
-    "vue-i18n": "^7.3.3",
-    "vue-web-cam": "^1.0.4"
-  },
-  "devDependencies": {
-    "babel-eslint": "^8.2.1",
-    "eslint": "^4.18.2",
-    "eslint-config-standard": "^11.0.0",
-    "eslint-friendly-formatter": "^3.0.0",
-    "eslint-loader": "^2.0.0",
-    "eslint-plugin-import": "^2.9.0",
-    "eslint-plugin-node": "^6.0.1",
-    "eslint-plugin-promise": "^3.7.0",
-    "eslint-plugin-standard": "^3.0.1",
-    "eslint-plugin-vue": "^4.3.0",
-    "quasar-cli": "^0.15.14",
-    "vue-lazy-background-images": "^1.0.0"
-  },
-  "engines": {
-    "node": ">= 8.9.0",
-    "npm": ">= 5.6.0"
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions",
-    "not ie <= 10"
-  ]
-}

+ 0 - 137
docker-front/front/quasar.conf.js

@@ -1,137 +0,0 @@
-// Configuration for your app
-
-module.exports = function (ctx) {
-  return {
-    // app plugins (/src/plugins)
-    plugins: [
-      'i18n',
-      'axios'
-    ],
-    css: [
-      'app.styl'
-    ],
-    extras: [
-      ctx.theme.mat ? 'roboto-font' : null,
-      'material-icons'
-      // 'ionicons',
-      // 'mdi',
-      // 'fontawesome'
-    ],
-    supportIE: true,
-    vendor: {
-      add: [],
-      remove: []
-    },
-    build: {
-      scopeHoisting: true,
-      vueRouterMode: 'history',
-      // gzip: true,
-      // analyze: true,
-      // extractCSS: false,
-      // useNotifier: false,
-      extendWebpack (cfg) {
-        cfg.module.rules.push({
-          enforce: 'pre',
-          test: /\.(js|vue)$/,
-          loader: 'eslint-loader',
-          exclude: /(node_modules|quasar)/
-        })
-      }
-    },
-    devServer: {
-      // https: true,
-      // port: 8080,
-      open: false // opens browser window automatically
-    },
-    // framework: 'all' --- includes everything; for dev only!
-    framework: {
-      components: [
-        'QLayout',
-        'QLayoutHeader',
-        'QLayoutDrawer',
-        'QPageContainer',
-        'QPage',
-        'QToolbar',
-        'QToolbarTitle',
-        'QBtn',
-        'QIcon',
-        'QList',
-        'QListHeader',
-        'QItem',
-        'QItemMain',
-        'QItemSide'
-      ],
-      directives: [
-        'Ripple'
-      ],
-      // Quasar plugins
-      plugins: [
-        'Notify',
-        'ActionSheet'
-      ]
-    },
-    // animations: 'all' --- includes all animations
-    animations: [
-    ],
-    pwa: {
-      cacheExt: 'js,html,css,ttf,eot,otf,woff,woff2,json,svg,gif,jpg,jpeg,png,wav,ogg,webm,flac,aac,mp4,mp3',
-      manifest: {
-        // name: 'Quasar App',
-        // short_name: 'Quasar-PWA',
-        // description: 'Best PWA App in town!',
-        display: 'standalone',
-        orientation: 'portrait',
-        background_color: '#ffffff',
-        theme_color: '#027be3',
-        icons: [
-          {
-            'src': 'statics/icons/icon-128x128.png',
-            'sizes': '128x128',
-            'type': 'image/png'
-          },
-          {
-            'src': 'statics/icons/icon-192x192.png',
-            'sizes': '192x192',
-            'type': 'image/png'
-          },
-          {
-            'src': 'statics/icons/icon-256x256.png',
-            'sizes': '256x256',
-            'type': 'image/png'
-          },
-          {
-            'src': 'statics/icons/icon-384x384.png',
-            'sizes': '384x384',
-            'type': 'image/png'
-          },
-          {
-            'src': 'statics/icons/icon-512x512.png',
-            'sizes': '512x512',
-            'type': 'image/png'
-          }
-        ]
-      }
-    },
-    cordova: {
-      // id: 'org.cordova.quasar.app'
-    },
-    electron: {
-      extendWebpack (cfg) {
-        // do something with cfg
-      },
-      packager: {
-        // OS X / Mac App Store
-        // appBundleId: '',
-        // appCategoryType: '',
-        // osxSign: '',
-        // protocol: 'myapp://path',
-
-        // Window only
-        // win32metadata: { ... }
-      }
-    },
-
-    // leave this here for Quasar CLI
-    starterKit: '1.0.2'
-  }
-}

+ 0 - 17
docker-front/front/src-pwa/service-worker-dev.js

@@ -1,17 +0,0 @@
-// This service worker file is effectively a 'no-op' that will reset any
-// previous service worker registered for the same host:port combination.
-// In the production build, this file is replaced with an actual service worker
-// file that will precache your site's local assets.
-// See https://github.com/facebookincubator/create-react-app/issues/2272#issuecomment-302832432
-
-self.addEventListener('install', () => self.skipWaiting());
-
-self.addEventListener('activate', () => {
-  self.clients.matchAll({ type: 'window' }).then(windowClients => {
-    for (let windowClient of windowClients) {
-      // Force open pages to refresh, so that they have a chance to load the
-      // fresh navigation response from the local dev server.
-      windowClient.navigate(windowClient.url);
-    }
-  });
-});

+ 0 - 55
docker-front/front/src-pwa/service-worker-prod.js

@@ -1,55 +0,0 @@
-(function () {
-  'use strict';
-
-  // Check to make sure service workers are supported in the current browser,
-  // and that the current page is accessed from a secure origin. Using a
-  // service worker from an insecure origin will trigger JS console errors.
-  const isLocalhost = Boolean(window.location.hostname === 'localhost' ||
-    // [::1] is the IPv6 localhost address.
-    window.location.hostname === '[::1]' ||
-    // 127.0.0.1/8 is considered localhost for IPv4.
-    window.location.hostname.match(
-      /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
-    )
-  );
-
-  window.addEventListener('load', function () {
-    if ('serviceWorker' in navigator &&
-        (window.location.protocol === 'https:' || isLocalhost)) {
-      navigator.serviceWorker.register('service-worker.js')
-      .then(function (registration) {
-        // updatefound is fired if service-worker.js changes.
-        registration.onupdatefound = function () {
-          // updatefound is also fired the very first time the SW is installed,
-          // and there's no need to prompt for a reload at that point.
-          // So check here to see if the page is already controlled,
-          // i.e. whether there's an existing service worker.
-          if (navigator.serviceWorker.controller) {
-            // The updatefound event implies that registration.installing is set
-            const installingWorker = registration.installing;
-
-            installingWorker.onstatechange = function () {
-              switch (installingWorker.state) {
-                case 'installed':
-                  // At this point, the old content will have been purged and the
-                  // fresh content will have been added to the cache.
-                  // It's the perfect time to display a "New content is
-                  // available; please refresh." message in the page's interface.
-                  break;
-
-                case 'redundant':
-                  throw new Error('The installing ' +
-                                  'service worker became redundant.');
-
-                default:
-                  // Ignore
-              }
-            };
-          }
-        };
-      }).catch(function(e) {
-        console.error('Error during service worker registration:', e);
-      });
-    }
-  });
-})();

+ 0 - 5
docker-front/front/src/.config_example.js

@@ -1,5 +0,0 @@
-var apiHostname = 'http://192.168.42.30:8013/api/'
-
-export {
-  apiHostname
-}

+ 0 - 1
docker-front/front/src/.gitignore

@@ -1 +0,0 @@
-.config.js

+ 0 - 17
docker-front/front/src/App.vue

@@ -1,17 +0,0 @@
-<template>
-  <!-- Don't drop "q-app" class -->
-  <div id="q-app">
-    <router-view />
-  </div>
-</template>
-
-<script>
-/*
- * Root component
- */
-
-export default {
-}
-</script>
-
-<style></style>

+ 0 - 122
docker-front/front/src/api.js

@@ -1,122 +0,0 @@
-const axios = require('axios')
-var toBlob = require('data-uri-to-blob')
-var db = require('./db.js')
-var currentPage = null
-var configFile = require('./.config.js')
-
-const setCurrentPage = function (value) {
-  //set current page on the script so that api calls may notify user of errors
-  //using quasar notification framework
-  currentPage = value
-}
-const apiHostname = configFile.apiHostname
-
-// const apiHostname = 'http://66.228.50.176:80/'
-const apiPath = apiHostname + 'api/scanapp/'
-const login = function (path, data) {
-  var options = {
-    url: apiHostname + path,
-    method: 'POST',
-    data: data
-  }
-  return axios(options)
-}
-const register = function (data) {
-  var options = {
-    url: apiHostname + 'rest-auth/registration/',
-    method: 'POST',
-    data: data
-  }
-  return axios(options)
-}
-
-const prepare = function (url, method, payload, locale, token) {
-  // All requests pass through here except the login request
-  var options = {
-    method: method,
-    data: payload,
-    headers: {
-      'Authorization': token
-    }
-  }
-  options.url = apiHostname + url.replace('{LANG}', locale)
-  return new Promise((resolve, reject) => {
-    axios(options)
-      .then((data) => resolve(data))
-      .catch((err => {
-        if (err.response) {
-          if (err.response.status === 401) {
-            currentPage.$q.notify('Authorization error, Redirecting to login page')
-            currentPage.$router.push('/login')
-          }
-          else {
-            reject(err)
-          }
-        }
-      }))
-  })
-}
-
-const configure = function (endpoint, method, payload) {
-  // This add saved authentication data and locale to the request
-  return db.getLang().then(langData => {
-    return db.getToken().then(tokenData => prepare(endpoint, method, payload, langData.lang, tokenData.token))
-  })
-}
-
-var get = function (url){
-  return configure(url, 'get', {})
-}
-
-var getAndSaveList = function (url) {
-  // All list request to the server pass through here
-  return new Promise((resolve, reject) => {
-    configure(url, 'get', {})
-      .then((result) => {
-        db.saveData(url + '.list', result.data)
-          .then((data) => { resolve(result.data) })
-          .catch((err) => { })
-      })
-      .catch(err => { })
-    window.setTimeout(() => {
-      db.getData(url + '.list')
-        .then((data => { resolve(data) }))
-    }, 5000)
-  })
-}
-var getAndSaveDetail = function (url) {
-  return new Promise((resolve, reject) => {
-    configure(url, 'get', {})
-     .catch(err => { })
-      .then(result => {
-        db.saveData(url + '.detail', result.data)
-          .then(data => { resolve(result.data) })
-          .catch(err => { reject(err) })
-      })
-     window.setTimeout(() => {
-         db.getData(url + '.detail')
-           .then((data) => { resolve(data) })
-       }, 5000)
-  })
-}
-var create = function (url, data) {
-  return configure(url, 'post', data)
-}
-var uploadImage = function (id, name, image) {
-  var formData = new FormData()
-  formData.append('name', name)
-  formData.append('image', toBlob(image))
-  formData.append('product', Number(id))
-  return create('scanapp/{LANG}/product_pictures/', formData)
-}
-export {
-  get,
-  getAndSaveList,
-  getAndSaveDetail,
-  apiHostname,
-  uploadImage,
-  create,
-  login,
-  register,
-  setCurrentPage
-}

File diff suppressed because it is too large
+ 0 - 191
docker-front/front/src/assets/quasar-logo-full.svg


File diff suppressed because it is too large
+ 0 - 1
docker-front/front/src/assets/sad.svg


BIN
docker-front/front/src/assets/splash.jpg


+ 0 - 297
docker-front/front/src/barcode.js

@@ -1,297 +0,0 @@
-$(function() {
-    var resultCollector = Quagga.ResultCollector.create({
-        capture: true,
-        capacity: 20,
-        blacklist: [{
-            code: "WIWV8ETQZ1", format: "code_93"
-        }, {
-            code: "EH3C-%GU23RK3", format: "code_93"
-        }, {
-            code: "O308SIHQOXN5SA/PJ", format: "code_93"
-        }, {
-            code: "DG7Q$TV8JQ/EN", format: "code_93"
-        }, {
-            code: "VOFD1DB5A.1F6QU", format: "code_93"
-        }, {
-            code: "4SO64P4X8 U4YUU1T-", format: "code_93"
-        }],
-        filter: function(codeResult) {
-            // only store results which match this constraint
-            // e.g.: codeResult
-            return true;
-        }
-    });
-    var App = {
-        init: function() {
-            var self = this;
-
-            Quagga.init(this.state, function(err) {
-                if (err) {
-                    return self.handleError(err);
-                }
-                //Quagga.registerResultCollector(resultCollector);
-                App.attachListeners();
-                App.checkCapabilities();
-                Quagga.start();
-            });
-        },
-        handleError: function(err) {
-            console.log(err);
-        },
-        checkCapabilities: function() {
-            var track = Quagga.CameraAccess.getActiveTrack();
-            var capabilities = {};
-            if (typeof track.getCapabilities === 'function') {
-                capabilities = track.getCapabilities();
-            }
-            this.applySettingsVisibility('zoom', capabilities.zoom);
-            this.applySettingsVisibility('torch', capabilities.torch);
-        },
-        updateOptionsForMediaRange: function(node, range) {
-            console.log('updateOptionsForMediaRange', node, range);
-            var NUM_STEPS = 6;
-            var stepSize = (range.max - range.min) / NUM_STEPS;
-            var option;
-            var value;
-            while (node.firstChild) {
-                node.removeChild(node.firstChild);
-            }
-            for (var i = 0; i <= NUM_STEPS; i++) {
-                value = range.min + (stepSize * i);
-                option = document.createElement('option');
-                option.value = value;
-                option.innerHTML = value;
-                node.appendChild(option);
-            }
-        },
-        applySettingsVisibility: function(setting, capability) {
-            // depending on type of capability
-            if (typeof capability === 'boolean') {
-                var node = document.querySelector('input[name="settings_' + setting + '"]');
-                if (node) {
-                    node.parentNode.style.display = capability ? 'block' : 'none';
-                }
-                return;
-            }
-            if (window.MediaSettingsRange && capability instanceof window.MediaSettingsRange) {
-                var node = document.querySelector('select[name="settings_' + setting + '"]');
-                if (node) {
-                    this.updateOptionsForMediaRange(node, capability);
-                    node.parentNode.style.display = 'block';
-                }
-                return;
-            }
-        },
-        initCameraSelection: function(){
-            var streamLabel = Quagga.CameraAccess.getActiveStreamLabel();
-
-            return Quagga.CameraAccess.enumerateVideoDevices()
-            .then(function(devices) {
-                function pruneText(text) {
-                    return text.length > 30 ? text.substr(0, 30) : text;
-                }
-                var $deviceSelection = document.getElementById("deviceSelection");
-                while ($deviceSelection.firstChild) {
-                    $deviceSelection.removeChild($deviceSelection.firstChild);
-                }
-                devices.forEach(function(device) {
-                    var $option = document.createElement("option");
-                    $option.value = device.deviceId || device.id;
-                    $option.appendChild(document.createTextNode(pruneText(device.label || device.deviceId || device.id)));
-                    $option.selected = streamLabel === device.label;
-                    $deviceSelection.appendChild($option);
-                });
-            });
-        },
-        attachListeners: function() {
-            var self = this;
-
-            self.initCameraSelection();
-            $(".controls").on("click", "button.stop", function(e) {
-                e.preventDefault();
-                Quagga.stop();
-                self._printCollectedResults();
-            });
-
-            $(".controls .reader-config-group").on("change", "input, select", function(e) {
-                e.preventDefault();
-                var $target = $(e.target),
-                    value = $target.attr("type") === "checkbox" ? $target.prop("checked") : $target.val(),
-                    name = $target.attr("name"),
-                    state = self._convertNameToState(name);
-
-                console.log("Value of "+ state + " changed to " + value);
-                self.setState(state, value);
-            });
-        },
-        _printCollectedResults: function() {
-            var results = resultCollector.getResults(),
-                $ul = $("#result_strip ul.collector");
-
-            results.forEach(function(result) {
-                var $li = $('<li><div class="thumbnail"><div class="imgWrapper"><img /></div><div class="caption"><h4 class="code"></h4></div></div></li>');
-
-                $li.find("img").attr("src", result.frame);
-                $li.find("h4.code").html(result.codeResult.code + " (" + result.codeResult.format + ")");
-                $ul.prepend($li);
-            });
-        },
-        _accessByPath: function(obj, path, val) {
-            var parts = path.split('.'),
-                depth = parts.length,
-                setter = (typeof val !== "undefined") ? true : false;
-
-            return parts.reduce(function(o, key, i) {
-                if (setter && (i + 1) === depth) {
-                    if (typeof o[key] === "object" && typeof val === "object") {
-                        Object.assign(o[key], val);
-                    } else {
-                        o[key] = val;
-                    }
-                }
-                return key in o ? o[key] : {};
-            }, obj);
-        },
-        _convertNameToState: function(name) {
-            return name.replace("_", ".").split("-").reduce(function(result, value) {
-                return result + value.charAt(0).toUpperCase() + value.substring(1);
-            });
-        },
-        detachListeners: function() {
-            $(".controls").off("click", "button.stop");
-            $(".controls .reader-config-group").off("change", "input, select");
-        },
-        applySetting: function(setting, value) {
-            var track = Quagga.CameraAccess.getActiveTrack();
-            if (track && typeof track.getCapabilities === 'function') {
-                switch (setting) {
-                case 'zoom':
-                    return track.applyConstraints({advanced: [{zoom: parseFloat(value)}]});
-                case 'torch':
-                    return track.applyConstraints({advanced: [{torch: !!value}]});
-                }
-            }
-        },
-        setState: function(path, value) {
-            var self = this;
-
-            if (typeof self._accessByPath(self.inputMapper, path) === "function") {
-                value = self._accessByPath(self.inputMapper, path)(value);
-            }
-
-            if (path.startsWith('settings.')) {
-                var setting = path.substring(9);
-                return self.applySetting(setting, value);
-            }
-            self._accessByPath(self.state, path, value);
-
-            console.log(JSON.stringify(self.state));
-            App.detachListeners();
-            Quagga.stop();
-            App.init();
-        },
-        inputMapper: {
-            inputStream: {
-                constraints: function(value){
-                    if (/^(\d+)x(\d+)$/.test(value)) {
-                        var values = value.split('x');
-                        return {
-                            width: {min: parseInt(values[0])},
-                            height: {min: parseInt(values[1])}
-                        };
-                    }
-                    return {
-                        deviceId: value
-                    };
-                }
-            },
-            numOfWorkers: function(value) {
-                return parseInt(value);
-            },
-            decoder: {
-                readers: function(value) {
-                    if (value === 'ean_extended') {
-                        return [{
-                            format: "ean_reader",
-                            config: {
-                                supplements: [
-                                    'ean_5_reader', 'ean_2_reader'
-                                ]
-                            }
-                        }];
-                    }
-                    return [{
-                        format: value + "_reader",
-                        config: {}
-                    }];
-                }
-            }
-        },
-        state: {
-            inputStream: {
-                type : "LiveStream",
-                constraints: {
-                    width: {min: 640},
-                    height: {min: 480},
-                    facingMode: "environment",
-                    aspectRatio: {min: 1, max: 2}
-                }
-            },
-            locator: {
-                patchSize: "medium",
-                halfSample: true
-            },
-            numOfWorkers: 2,
-            frequency: 10,
-            decoder: {
-                readers : [{
-                    format: "code_128_reader",
-                    config: {}
-                }]
-            },
-            locate: true
-        },
-        lastResult : null
-    };
-
-    App.init();
-
-    Quagga.onProcessed(function(result) {
-        var drawingCtx = Quagga.canvas.ctx.overlay,
-            drawingCanvas = Quagga.canvas.dom.overlay;
-
-        if (result) {
-            if (result.boxes) {
-                drawingCtx.clearRect(0, 0, parseInt(drawingCanvas.getAttribute("width")), parseInt(drawingCanvas.getAttribute("height")));
-                result.boxes.filter(function (box) {
-                    return box !== result.box;
-                }).forEach(function (box) {
-                    Quagga.ImageDebug.drawPath(box, {x: 0, y: 1}, drawingCtx, {color: "green", lineWidth: 2});
-                });
-            }
-
-            if (result.box) {
-                Quagga.ImageDebug.drawPath(result.box, {x: 0, y: 1}, drawingCtx, {color: "#00F", lineWidth: 2});
-            }
-
-            if (result.codeResult && result.codeResult.code) {
-                Quagga.ImageDebug.drawPath(result.line, {x: 'x', y: 'y'}, drawingCtx, {color: 'red', lineWidth: 3});
-            }
-        }
-    });
-
-    Quagga.onDetected(function(result) {
-        var code = result.codeResult.code;
-
-        if (App.lastResult !== code) {
-            App.lastResult = code;
-            var $node = null, canvas = Quagga.canvas.dom.image;
-
-            $node = $('<li><div class="thumbnail"><div class="imgWrapper"><img /></div><div class="caption"><h4 class="code"></h4></div></div></li>');
-            $node.find("img").attr("src", canvas.toDataURL());
-            $node.find("h4.code").html(code);
-            $("#result_strip ul.thumbnails").prepend($node);
-        }
-    });
-
-});

+ 0 - 0
docker-front/front/src/components/.gitkeep


+ 0 - 129
docker-front/front/src/components/webcam.vue

@@ -1,129 +0,0 @@
-<template>
-  <div ref="main" :style="{ height: height + 'px' }" style="display: flex">
-    <select  @change="startCapture()" v-model="selected_camera">
-      <option  :value="index" v-for="(device, index) in devices">
-      {{ device.label }}
-      </option>
-    </select>
-    <div style="display: flex; height: 90%; overflow: scroll">
-    <video ref="video" :height="height-100" :src="this.source"
-    :autoplay="this.autoplay" ></video>
-    </div>
-  </div>
-</template>
-
-<script>
-export default {
-    data: function () {
-        return {
-            stream: '',
-            source: '',
-            canvas: null,
-            devices: [],
-            selected_camera: 0,
-            videoWidth: 1,
-            videoHeight: 1,
-        }
-    },
-    props: {
-        maxres: {
-            type: Number,
-            default: 5000
-        },
-        height: {
-            type: Number
-        },
-        autoplay: {
-            type: Boolean,
-            default: true
-        },
-        screenshotFormat: {
-          type: String,
-          default: 'image/jpeg'
-        }
-    },
-    mounted() {
-        var self = this
-        window.a = this
-        if (!this.hasMedia()) {
-            this.$emit('notsupported');
-            return;
-        }
-        window.navigator.mediaDevices.enumerateDevices().then(devices => {
-          self.devices = devices.filter(device => { return device.kind==="videoinput"})
-          db.getSelectedCameraIndex().then(data => {
-            self.selected_camera = data.index
-            self.startCapture()
-          })
-        })
-        this.requestMedia();
-        this.$refs.video.addEventListener('loadedmetadata', data => {
-            this.$emit('ready')
-        })
-
-    },
-    destroyed: function () {
-      this.stop()
-    },
-    methods: {
-        hasMedia() {
-            return !!this.getMedia();
-        },
-        getMedia() {
-            return (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia);
-        },
-        requestMedia() {
-            navigator.getUserMedia = this.getMedia();
-        },
-        capture() {
-            if (!this.hasMedia()) {
-                this.$emit('notsupported');
-                return null;
-            }
-            return this.getCanvas().toDataURL(this.screenshotFormat);
-        },
-        getCanvas() {
-            let video = this.$refs.video;
-            if (!this.ctx && video.videoHeight) {
-                let canvas = document.createElement('canvas');
-                canvas.height = video.videoHeight;
-                canvas.width = video.videoWidth;
-                this.canvas = canvas;
-
-                this.ctx = canvas.getContext('2d');
-            }
-
-            const { ctx, canvas } = this;
-            ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
-            return canvas;r
-        },
-        stop() {
-          try {
-            this.stream.getVideoTracks()[0].stop()
-          }
-          catch(err) { console.log(err) }
-        },
-        startCapture: function () {
-         db.setSelectedCameraIndex(this.selected_camera)
-         this.stop()
-         if (navigator.getUserMedia) {
-          var self = this
-          navigator.getUserMedia({
-              video: { deviceId: { exact:
-              self.devices[this.selected_camera].deviceId },
-              width: {ideal: self.maxres},
-              height: {ideal: self.maxres}
-              }
-            }, stream => {
-            this.source = window.URL.createObjectURL(stream);
-            this.stream = stream;
-            this.$emit('started', stream);
-            window.stream = stream
-        }, error => {
-            this.$emit('error', error);
-          });
-        }
-       }
-    }
-}
-</script>

+ 0 - 1
docker-front/front/src/css/app.styl

@@ -1 +0,0 @@
-// app global css

+ 0 - 25
docker-front/front/src/css/themes/common.variables.styl

@@ -1,25 +0,0 @@
-// App Shared Variables
-// --------------------------------------------------
-// To customize the look and feel of this app, you can override
-// the Stylus variables found in Quasar's source Stylus files. Setting
-// variables before Quasar's Stylus will use these variables rather than
-// Quasar's default Stylus variable values. Stylus variables specific
-// to the themes belong in either the variables.ios.styl or variables.mat.styl files.
-
-// Check documentation for full list of Quasar variables
-
-
-// App Shared Color Variables
-// --------------------------------------------------
-// It's highly recommended to change the default colors
-// to match your app's branding.
-
-$primary   = #027be3
-$secondary = #26A69A
-$tertiary  = #555
-
-$neutral   = #E0E1E2
-$positive  = #21BA45
-$negative  = #DB2828
-$info      = #31CCEC
-$warning   = #F2C037

+ 0 - 7
docker-front/front/src/css/themes/variables.ios.styl

@@ -1,7 +0,0 @@
-// App Shared Variables
-// --------------------------------------------------
-// Shared Stylus variables go in the common.variables.styl file
-@import 'common.variables'
-
-// iOS only Quasar variables overwrites
-// -----------------------------------------

+ 0 - 7
docker-front/front/src/css/themes/variables.mat.styl

@@ -1,7 +0,0 @@
-// App Shared Variables
-// --------------------------------------------------
-// Shared Stylus variables go in the common.variables.styl file
-@import 'common.variables'
-
-// Material only Quasar variables overwrites
-// -----------------------------------------

+ 0 - 120
docker-front/front/src/db.js

@@ -1,120 +0,0 @@
-var PouchDB = require('pouchdb').default
-var db = new PouchDB('myuser')
-
-const get = function (id) {
-  return db.get(id)
-}
-
-const save = function (data, id) {
-  data.id = id
-  return db.put(data)
-}
-
-const getWithDefault = function (id, _default) {
-  return new Promise((resolve, reject) => {
-    db.get(id)
-      .then((data) => { resolve(data) })
-      .catch((err) => {
-        if (err.status === 404) {
-          resolve(_default)
-        }
-        else {
-          reject(err)
-        }
-      })
-  })
-}
-
-// const get = function (id) {
-//  return getWithDefault(id, {_id: id})
-// }
-
-const getLang = function () {
-  return getWithDefault('lang', {_id: 'lang', lang: window.navigator.language.toUpperCase() })
-}
-
-const saveLang = function (lang) {
-  return new Promise((resolve, reject) => {
-    getLang()
-      .then(data => {
-        data.lang = lang
-        db.put(data)
-          .then(data => resolve(data))
-          .catch(err => reject(err))
-      })
-      .catch(err => reject(err))
-  })
-}
-
-const getToken = function () {
-  return getWithDefault('token',{'_id': 'token', 'token': 'any'})
-}
-
-const saveToken = function (token) {
-  return new Promise((resolve, reject) => {
-    getWithDefault('token', {_id: 'token'})
-      .then(data => {
-        data.token = token
-        db.put(data)
-          .then(data => resolve(data))
-          .catch(err => reject(err))
-      })
-      .catch(err => reject(err))
-  })
-}
-
-// const save = function (id, data) { }
-const getDataInternal = function (id) {
-  return getWithDefault(id, {'_id': id})
-}
-
-const saveData = function (id, data) {
-  return new Promise((resolve, reject) => {
-    getDataInternal(id)
-      .catch(err => { reject(err) })
-      .then((result) => {
-        result.data = data
-        save(result, id)
-          .then(() => resolve(result))
-          .catch(err => reject(err))
-      })
-  })
-}
-
-const getData = function (id) {
-  return new Promise((resolve, reject) => {
-    getDataInternal(id)
-      .then(data => { resolve(data.data) })
-      .catch(err => { reject(err) })
-  })
-}
-const getSelectedCameraIndex = function () {
-  return getWithDefault('camera_index', {index: 0, _id: 'camera_index'})
-}
-const setSelectedCameraIndex = function (index) {
-  return new Promise((resolve, reject) => {
-    getSelectedCameraIndex()
-      .then(data => {
-        data.index = index
-        db.put(data)
-          .then(data => resolve(data))
-          .catch(err => reject(err))
-      })
-      .catch(err => reject(err))
-  })
-}
-
-export {
-  saveToken,
-  getToken,
-  getLang,
-  saveLang,
-  db,
-  save,
-  get,
-  getData,
-  saveData,
-  getWithDefault,
-  setSelectedCameraIndex,
-  getSelectedCameraIndex
-}

+ 0 - 7
docker-front/front/src/i18n/en/index.js

@@ -1,7 +0,0 @@
-// This is just an example,
-// so you can safely delete all default props below
-
-export default {
-  failed: 'Action failed',
-  success: 'Action was successful'
-}

+ 0 - 5
docker-front/front/src/i18n/index.js

@@ -1,5 +0,0 @@
-import en from './en'
-
-export default {
-  en
-}

+ 0 - 57
docker-front/front/src/index.template.html

@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta name="description" content="<%= htmlWebpackPlugin.options.productDescription %>">
-    <meta name="format-detection" content="telephone=no">
-    <meta name="msapplication-tap-highlight" content="no">
-    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (htmlWebpackPlugin.options.ctx.mode.cordova) { %>, viewport-fit=cover<% } %>">
-    <title><%= htmlWebpackPlugin.options.productName %></title>
-
-    <link rel="icon" href="statics/quasar-logo.png" type="image/x-icon">
-    <link rel="icon" type="image/png" sizes="32x32" href="statics/icons/favicon-32x32.png">
-    <link rel="icon" type="image/png" sizes="16x16" href="statics/icons/favicon-16x16.png">
-
-    <% if (htmlWebpackPlugin.options.ctx.mode.pwa) { %>
-    <!-- Add to home screen for Android and modern mobile browsers -->
-    <link rel="manifest" href="manifest.json">
-    <meta name="theme-color" content="<%= htmlWebpackPlugin.options.pwaManifest.theme_color %>">
-    <!-- Add to home screen for Safari on iOS -->
-    <meta name="apple-mobile-web-app-capable" content="yes">
-    <meta name="apple-mobile-web-app-status-bar-style" content="<%= htmlWebpackPlugin.options.pwaManifest.background_color %>">
-    <meta name="apple-mobile-web-app-title" content="<%= htmlWebpackPlugin.options.pwaManifest.name %>">
-    <link rel="apple-touch-icon" href="statics/icons/apple-icon-152x152.png">
-    <!-- Add to home screen for Windows -->
-    <meta name="msapplication-TileImage" content="statics/icons/ms-icon-144x144.png">
-    <meta name="msapplication-TileColor" content="<%= htmlWebpackPlugin.options.pwaManifest.background_color %>">
-    <% } %>
-
-    <%= htmlWebpackPlugin.options.headScripts %>
-
-    <!--
-      The following is optional if you DON'T build for PWA.
-      Preloads/prefetches chunks/assets.
-    -->
-    <% if (!['cordova', 'electron'].includes(htmlWebpackPlugin.options.ctx.modeName) && htmlWebpackPlugin.options.ctx.prod) {
-        for (var chunk of webpack.chunks) {
-          for (var file of chunk.files) {
-            if (file.match(/\.(js|css)$/)) { %>
-      <link rel="<%= chunk.initial ? 'preload' : 'prefetch' %>" href="<%= file %>" as="<%= file.match(/\.css$/)? 'style' : 'script' %>">
-    <% }}}} %>
-  </head>
-  <body>
-    <% if (!htmlWebpackPlugin.options.ctx.mode.electron) { %>
-      <noscript>
-        This is your fallback content in case JavaScript fails to load.
-      </noscript>
-    <% } %>
-
-    <!-- DO NOT touch the following <div> -->
-    <div id="q-app"></div>
-
-    <!-- DO NOT touch the following -->
-    <%= htmlWebpackPlugin.options.bodyScripts %>
-
-    <!-- built files will be auto injected here -->
-  </body>
-</html>

+ 0 - 53
docker-front/front/src/layouts/default.vue

@@ -1,53 +0,0 @@
-<template>
-  <!-- Don't drop "q-app" class -->
-  <div id="q-app">
-    <router-view />
-  </div>
-</template>
-
-<script>
-/*
- * Root component
- */
-var db = require('../db.js')
-var utils = require('../utils.js')
-var api = require('../api.js')
-export default {
-  methods: {
-    redirect_if_not_logged: function (){
-      if (this.$route.name == 'login' ||
-          this.$route.name == 'oauth_redirect' ||
-          this.$route.name == 'register' ) {
-        return true
-      }
-      var self = this
-      db.getToken()
-        .then(data => {
-          if (data.token.length < 4){
-            self.$router.push('login')
-            self.$q.notify('You must login to access this page')
-          }
-        })
-        .catch(() => {
-          self.$router.push('login')
-          self.$q.notify('You must login to access this page')
-        })
-    }
-  },
-  beforeCreate: function () {
-    window.me = this
-    window.api = api
-    window.db = db
-    // check if the user is logged in, if not goto login page
-  },
-  mounted: function () {
-    api.setCurrentPage(this)
-    this.redirect_if_not_logged() 
-  },
-  framework: {
-    i18n: 'de'
-  }
-}
-</script>
-
-<style></style>

+ 0 - 82
docker-front/front/src/layouts/default1.vue

@@ -1,82 +0,0 @@
-<template>
-  <q-layout view="lHh Lpr lFf">
-    <q-layout-header>
-      <q-toolbar
-        color="primary"
-        :glossy="$q.theme === 'mat'"
-        :inverted="$q.theme === 'ios'"
-      >
-        <q-btn
-          flat
-          dense
-          round
-          @click="leftDrawerOpen = !leftDrawerOpen"
-          aria-label="Menu"
-        >
-          <q-icon name="menu" />
-        </q-btn>
-
-        <q-toolbar-title>
-          Quasar App
-          <div slot="subtitle">Running on Quasar v{{ $q.version }}</div>
-        </q-toolbar-title>
-      </q-toolbar>
-    </q-layout-header>
-
-    <q-layout-drawer
-      v-model="leftDrawerOpen"
-      :content-class="$q.theme === 'mat' ? 'bg-grey-2' : null"
-    >
-      <q-list
-        no-border
-        link
-        inset-delimiter
-      >
-        <q-list-header>Essential Links</q-list-header>
-        <q-item @click.native="openURL('http://quasar-framework.org')">
-          <q-item-side icon="school" />
-          <q-item-main label="Docs" sublabel="quasar-framework.org" />
-        </q-item>
-        <q-item @click.native="openURL('https://github.com/quasarframework/')">
-          <q-item-side icon="code" />
-          <q-item-main label="GitHub" sublabel="github.com/quasarframework" />
-        </q-item>
-        <q-item @click.native="openURL('https://discord.gg/5TDhbDg')">
-          <q-item-side icon="chat" />
-          <q-item-main label="Discord Chat Channel" sublabel="https://discord.gg/5TDhbDg" />
-        </q-item>
-        <q-item @click.native="openURL('http://forum.quasar-framework.org')">
-          <q-item-side icon="record_voice_over" />
-          <q-item-main label="Forum" sublabel="forum.quasar-framework.org" />
-        </q-item>
-        <q-item @click.native="openURL('https://twitter.com/quasarframework')">
-          <q-item-side icon="rss feed" />
-          <q-item-main label="Twitter" sublabel="@quasarframework" />
-        </q-item>
-      </q-list>
-    </q-layout-drawer>
-
-    <q-page-container>
-      <router-view />
-    </q-page-container>
-  </q-layout>
-</template>
-
-<script>
-import { openURL } from 'quasar'
-
-export default {
-  name: 'LayoutDefault',
-  data () {
-    return {
-      leftDrawerOpen: this.$q.platform.is.desktop
-    }
-  },
-  methods: {
-    openURL
-  }
-}
-</script>
-
-<style>
-</style>

+ 0 - 33
docker-front/front/src/main.js

@@ -1,33 +0,0 @@
-// === DEFAULT / CUSTOM STYLE ===
-// WARNING! always comment out ONE of the two require() calls below.
-// 1. use next line to activate CUSTOM STYLE (./src/themes)
-// require(`./themes/app.${__THEME}.styl`)
-// 2. or, use next line to activate DEFAULT QUASAR STYLE
-require(`quasar/dist/quasar.${__THEME}.css`)
-// ==============================
-
-// Uncomment the following lines if you need IE11/Edge support
-// require(`quasar/dist/quasar.ie`)
-// require(`quasar/dist/quasar.ie.${__THEME}.css`)
-
-import Vue from 'vue'
-import Quasar from 'quasar'
-import router from './router'
-
-Vue.config.productionTip = false
-Vue.use(Quasar) // Install Quasar Framework
-
-if (__THEME === 'mat') {
-  // require('quasar-extras/roboto-font')
-}
-// import 'quasar-extras/material-icons'
-// import 'quasar-extras/ionicons'
-// import 'quasar-extras/fontawesome'
-// import 'quasar-extras/animate'
-
-/* eslint-disable no-new */
-new Vue({
-  el: '#q-app',
-  router,
-  render: h => h(require('./App').default)
-})

+ 0 - 16
docker-front/front/src/pages/404.vue

@@ -1,16 +0,0 @@
-<template>
-  <div class="fixed-center text-center">
-    <p>
-      <img
-        src="~assets/sad.svg"
-        style="width:30vw;max-width:150px;"
-      >
-    </p>
-    <p class="text-faded">Sorry, nothing here...<strong>(404)</strong></p>
-    <q-btn
-      color="secondary"
-      style="width:200px;"
-      @click="$router.push('/')"
-    >Go back</q-btn>
-  </div>
-</template>

+ 0 - 94
docker-front/front/src/pages/Blank.vue

@@ -1,94 +0,0 @@
-<template>
-    <div class="aaaa" id="main" >
-      <div style="width: 100vw; height: 100vh; margin: 0px">
-        <div style="position: absolute; bottom: 30px; text-align: center">
-          <q-progress style="width: 80vw; height: 30px; margin: 0 10vw" :percentage = "progress_percent" height="20px"
-            animate/>
-          <span style="align: center; width: 100vw"> {{texts.blank_loading}} </span>
-        </div>
-      </div>
-    </div>
-</template>
-
-<script>
-const queryString = require('query-string')
-const api = require('../api.js')
-const utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain,
-  QSelect,
-  QInput,
-  QField,
-  QProgress
-} from 'quasar'
-
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemMain,
-    QSelect,
-    QInput,
-    QField,
-    QProgress
-  },
-  data () {
-    return {
-      processed: 0,
-      total_process: 6,
-      progress_percent: 0,
-      texts: {}
-    }
-  },
-  methods: {
-    process_completed: function () {
-      this.processed += 1
-      this.progress_percent = this.processed * 100 / this.total_process
-      if (this.processed === this.total_process) {
-        this.$router.push('/')
-      }
-    }
-  },
-  mounted () {
-    var self = this
-    utils.getTexts()
-      .then(data => { self.process_completed() })
-    api.getAndSaveDetail('scanapp/{LANG}/product_hier/2/')
-      .then(data => { self.process_completed()})
-    api.getAndSaveDetail('scanapp/{LANG}/product_hier/1/')
-      .then(data => { self.process_completed() })
-    api.getAndSaveList('language/{LANG}/weight/')
-      .then(data => { self.process_completed() })
-    api.getAndSaveList('language/{LANG}/length/')
-      .then(data => { self.process_completed() })
-    api.getAndSaveList('language/{LANG}/languages/')
-       .then(data => { self.process_completed() })
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-#main {
-  background-image: url('~assets/splash.jpg')
-}
-
-</style>

+ 0 - 77
docker-front/front/src/pages/Error404.vue

@@ -1,77 +0,0 @@
-<template>
-  <div class="error-page window-height window-width bg-light column items-center no-wrap">
-    <div class="error-code bg-primary flex items-center content-center justify-center">
-      404
-    </div>
-    <div>
-      <div class="error-card shadow-4 bg-white column items-center justify-center no-wrap">
-        <q-icon name="error_outline" color="grey-5" />
-        <p class="caption text-center">Oops. Nothing here...</p>
-        <p class="text-center group">
-          <q-btn
-            v-if="canGoBack"
-            color="primary"
-            push
-            @click="goBack"
-            icon="keyboard_arrow_left"
-          >
-            Go back
-          </q-btn>
-          <q-btn
-            color="primary"
-            push
-            @click="$router.replace('/')"
-            icon-right="home"
-          >
-            Go home
-          </q-btn>
-        </p>
-      </div>
-    </div>
-  </div>
-</template>
-
-<script>
-import { QBtn, QIcon } from 'quasar'
-
-export default {
-  components: {
-    QBtn,
-    QIcon
-  },
-  data () {
-    return {
-      canGoBack: window.history.length > 1
-    }
-  },
-  methods: {
-    goBack () {
-      window.history.go(-1)
-    }
-  }
-}
-</script>
-
-<style lang="stylus">
-.error-page
-  .error-code
-    height 50vh
-    width 100%
-    padding-top 15vh
-    @media (orientation: landscape) { 
-      font-size 30vw
-    }
-    @media (orientation: portrait) { 
-      font-size 30vh
-    }
-    color rgba(255, 255, 255, .2)
-    overflow hidden
-  .error-card
-    border-radius 2px
-    margin-top -50px
-    width 80vw
-    max-width 600px
-    padding 25px
-    > i
-      font-size 5rem
-</style>

+ 0 - 221
docker-front/front/src/pages/Hello.vue

@@ -1,221 +0,0 @@
-<template>
-  <q-layout
-    ref="layout"
-    view="lHh Lpr fff"
-    :left-class="{'bg-grey-2': true}"
-  >
-    <q-toolbar slot="header" class="glossy">
-      <q-btn
-        flat
-        @click="$refs.layout.toggleLeft()"
-      >
-        <q-icon name="menu" />
-      </q-btn>
-
-      <q-toolbar-title>
-        Quasar App
-        <div slot="subtitle">Running on Quasar v{{$q.version}}</div>
-      </q-toolbar-title>
-    </q-toolbar>
-
-    <div slot="left">
-      <!--
-        Use <q-side-link> component
-        instead of <q-item> for
-        internal vue-router navigation
-      -->
-
-      <q-list no-border link inset-delimiter>
-        <q-list-header>Essential Links</q-list-header>
-        <q-item @click="launch('http://quasar-framework.org')">
-          <q-item-side icon="school" />
-          <q-item-main label="Docs" sublabel="quasar-framework.org" />
-        </q-item>
-        <q-item @click="launch('http://forum.quasar-framework.org')">
-          <q-item-side icon="record_voice_over" />
-          <q-item-main label="Forum" sublabel="forum.quasar-framework.org" />
-        </q-item>
-        <q-item @click="launch('https://gitter.im/quasarframework/Lobby')">
-          <q-item-side icon="chat" />
-          <q-item-main label="Gitter Channel" sublabel="Quasar Lobby" />
-        </q-item>
-        <q-item @click="launch('https://twitter.com/quasarframework')">
-          <q-item-side icon="rss feed" />
-          <q-item-main label="Twitter" sublabel="@quasarframework" />
-        </q-item>
-      </q-list>
-    </div>
-
-    <!--
-      Replace following <div> with
-      <router-view /> component
-      if using subRoutes
-    -->
-    <div class="layout-padding logo-container non-selectable no-pointer-events">
-      <div class="logo" :style="position">
-        <img src="~assets/quasar-logo-full.svg">
-      </div>
-    </div>
-  </q-layout>
-</template>
-
-<script>
-import {
-  dom,
-  event,
-  openURL,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain
-} from 'quasar'
-
-const
-  { viewport } = dom,
-  { position } = event,
-  moveForce = 30,
-  rotateForce = 40,
-  RAD_TO_DEG = 180 / Math.PI
-
-function getRotationFromAccel (accelX, accelY, accelZ) {
-  /* Reference: http://stackoverflow.com/questions/3755059/3d-accelerometer-calculate-the-orientation#answer-30195572 */
-  const sign = accelZ > 0 ? 1 : -1
-  const miu = 0.001
-
-  return {
-    roll: Math.atan2(accelY, sign * Math.sqrt(Math.pow(accelZ, 2) + miu * Math.pow(accelX, 2))) * RAD_TO_DEG,
-    pitch: -Math.atan2(accelX, Math.sqrt(Math.pow(accelY, 2) + Math.pow(accelZ, 2))) * RAD_TO_DEG
-  }
-}
-
-export default {
-  name: 'index',
-  components: {
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemMain
-  },
-  data () {
-    return {
-      orienting: window.DeviceOrientationEvent && !this.$q.platform.is.desktop,
-      rotating: window.DeviceMotionEvent && !this.$q.platform.is.desktop,
-      moveX: 0,
-      moveY: 0,
-      rotateY: 0,
-      rotateX: 0
-    }
-  },
-  computed: {
-    position () {
-      const transform = `rotateX(${this.rotateX}deg) rotateY(${this.rotateY}deg)`
-      return {
-        top: this.moveY + 'px',
-        left: this.moveX + 'px',
-        '-webkit-transform': transform,
-        '-ms-transform': transform,
-        transform
-      }
-    }
-  },
-  methods: {
-    launch (url) {
-      openURL(url)
-    },
-    move (evt) {
-      const
-        {width, height} = viewport(),
-        {top, left} = position(evt),
-        halfH = height / 2,
-        halfW = width / 2
-
-      this.moveX = (left - halfW) / halfW * -moveForce
-      this.moveY = (top - halfH) / halfH * -moveForce
-      this.rotateY = (left / width * rotateForce * 2) - rotateForce
-      this.rotateX = -((top / height * rotateForce * 2) - rotateForce)
-    },
-    rotate (evt) {
-      if (evt.rotationRate &&
-          evt.rotationRate.beta !== null &&
-          evt.rotationRate.gamma !== null) {
-        this.rotateX = evt.rotationRate.beta * 0.7
-        this.rotateY = evt.rotationRate.gamma * -0.7
-      }
-      else {
-        /* evt.acceleration may be null in some cases, so we'll fall back
-           to evt.accelerationIncludingGravity */
-        const
-          accelX = evt.acceleration.x || evt.accelerationIncludingGravity.x,
-          accelY = evt.acceleration.y || evt.accelerationIncludingGravity.y,
-          accelZ = evt.acceleration.z || evt.accelerationIncludingGravity.z - 9.81,
-          rotation = getRotationFromAccel(accelX, accelY, accelZ)
-
-        this.rotateX = rotation.roll * 0.7
-        this.rotateY = rotation.pitch * -0.7
-      }
-    },
-    orient (evt) {
-      if (evt.beta === null || evt.gamma === null) {
-        window.removeEventListener('deviceorientation', this.orient, false)
-        this.orienting = false
-
-        window.addEventListener('devicemotion', this.rotate, false)
-      }
-      else {
-        this.rotateX = evt.beta * 0.7
-        this.rotateY = evt.gamma * -0.7
-      }
-    }
-  },
-  mounted () {
-    this.$nextTick(() => {
-      if (this.orienting) {
-        window.addEventListener('deviceorientation', this.orient, false)
-      }
-      else if (this.rotating) {
-        window.addEventListener('devicemove', this.rotate, false)
-      }
-      else {
-        document.addEventListener('mousemove', this.move)
-      }
-    })
-  },
-  beforeDestroy () {
-    if (this.orienting) {
-      window.removeEventListener('deviceorientation', this.orient, false)
-    }
-    else if (this.rotating) {
-      window.removeEventListener('devicemove', this.rotate, false)
-    }
-    else {
-      document.removeEventListener('mousemove', this.move)
-    }
-  }
-}
-</script>
-
-<style lang="stylus">
-.logo-container
-  width 255px
-  height 242px
-  perspective 800px
-  position absolute
-  top 50%
-  left 50%
-  transform translateX(-50%) translateY(-50%)
-.logo
-  position absolute
-  transform-style preserve-3d
-</style>

+ 0 - 99
docker-front/front/src/pages/Home.vue

@@ -1,99 +0,0 @@
-<template>
-    <div style="width: 100vw; height: 100vh; margin: 0px" class="bg-black">
-      <q-btn @click="$router.push('home')" round color='blue' style="position: sticky; left:50%; top: 70%"> 
-        {{ texts.page1_scan }}
-      </q-btn> 
-        <q-field :label="texts['page1_change_detail']" class="bg-white">
-         <q-select v-model="selected_language" :options="languages"/>     
-         <q-btn @click="change_language()" style="align-self:right"> {{
-           texts.page1_change }}</q-btn>
-      </q-field>
-   </div>
-</template>
-
-<script>
-var api = require('../api.js')
-var db = require('../db.js')
-var utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain,
-  QSelect,
-  QInput,
-  QField
-} from 'quasar'
-
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemMain,
-    QSelect,
-    QInput,
-    QField
-  },
-  data () {
-    return {
-      selected_language: '',
-      languages: [],
-      texts: {}
-    }
-  },
-  methods: {
-    change_language: function () {
-      // This function is executed after the user change language
-      // It saves the selected language in database and then
-      // Load the api endpoint for that language
-      // And save the language in a local database
-      var self = this
-      db.saveLang(self.selected_language).then(() => {
-        utils.getTexts()
-          .then(data => { utils.setTexts(self) })
-      })
-    },
-    populate_languages: function (data) {
-      // populate select language select component with list of language given
-      // to it
-      var self = this
-      self.languages = []
-      data.forEach((language) => {
-        language['label'] = language.name
-        language['value'] = language.name
-        self.languages.push(language)
-      })
-    }
-  },
-  mounted () {
-    api.currentPage = this
-    // collect list of language from local database or api and then update it
-    // in select element
-    var self = this
-    db.getLang()
-      .then(data => { self.selected_language = data.lang })
-    utils.setTexts(this)
-    db.getData('language/{LANG}/languages/.list')
-      .then(data => { self.populate_languages(data) })
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-</style>

+ 0 - 146
docker-front/front/src/pages/Login.vue

@@ -1,146 +0,0 @@
-<template>
-  <div style="height: 100vh" class="div justify-center items-center">
-  <q-card style="max-width: 300px" class="div">
-    <q-card-title>
-      {{texts.login_login}}
-    </q-card-title>
-    <q-card-main>
-      <div>
-      <q-field :label="texts.login_username">
-        <q-input v-model="username" style="max-width: 300px"/>
-      </q-field>
-      <q-field :label="texts.login_password">
-        <q-input type="password" v-model="password"  style="max-width: 500px"/>
-      </q-field>
-      <div class="div">
-        <q-btn style="max-width: 300px" @click="loginWithPassword"> 
-          {{ texts.login_submit }} 
-        </q-btn>
-         <q-btn style="max-width: 300px" @click="$router.push('/register')"> 
-          {{ texts.login_register }} 
-        </q-btn>
-     </div>
-    </div>
-    <br/>
-    <div class="div">
-      <q-btn v-for="(oauth, index) in oauth_clients" @click="login(index)"
-      color='blue' style="max-width: 300px"> 
-        {{ texts.login_login_with }} {{ oauth.name }}
-      </q-btn> 
-    </div>
-    </q-card-main>
-  </q-card>
-  </div>
-</template>
-
-<script>
-var ClientOAuth2 = require('client-oauth2')
-var api = require('../api.js')
-var db = require('../db.js')
-var utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain,
-  QSelect,
-  QInput,
-  QField,
-  QCardMain,
-  QCardTitle
-} from 'quasar'
-
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemMain,
-    QSelect,
-    QInput,
-    QField,
-    QCardMain,
-    QCard,
-    QCardTitle
-  },
-  data () {
-    return {
-      selected_language: '',
-      languages: [],
-      texts: {},
-      username: '',
-      password: '',
-      selected_provider: 1000,
-      oauth_clients: [
-      ]
-    }
-  },
-  methods: {
-    open_popup: function (url, windowName) {
-      var mwindow = window
-      var myWindow = window.open(url, windowName, 'height=1000,width=750')
-      if (window.focus) { myWindow.focus() }
-      window.my = myWindow
-      myWindow.onclose = () => { }
-      return false
-    },
-    loginWithPassword: function () {
-      var data = {
-        username: this.username,
-        password: this.password
-      }
-      var self = this
-      api.login('rest-auth/login/', data)
-        .then(data => {
-          db.saveToken('Token ' + data.data.key)
-            .then(data => { self.$router.push('/blank') })
-        })
-        .catch(err => {
-          self.$q.notify('Authentication Error')
-        })
-    },
-    login: function (clientId) {
-      this.selected_provider = clientId
-      var oauthData = this.oauth_clients[clientId].auth_data
-      var auth = new ClientOAuth2(oauthData)
-      this.open_popup(auth.token.getUri(), 'name')
-    }
-  },
-  mounted () {
-    var self = this
-    utils.getTexts()
-      .then(data => { self.texts = data })
-    api.getAndSaveList('myauth/providers/').then((data) => { self.oauth_clients = data })
-    window.addEventListener('message', function (event) {
-      if (event.origin !== 'http://localhost:8080') { return false }
-      api.login(self.oauth_clients[self.selected_provider].loginPath.slice(1), event.data.data)
-        .then(data => {
-          db.saveToken('Token ' + data.data.key)
-            .then(data => self.$router.push('/blank'))
-        })
-    })
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-.div
-  display: flex
-  flex-direction: column
-  align-items: center
-</style>

+ 0 - 97
docker-front/front/src/pages/NewProduct.vue

@@ -1,97 +0,0 @@
-<template>
-  <div style="height: 100vh; width: 100vw">
-    <span>{{ texts.new_instruction }}</span>
-    <div ref="webcam_placeholder" style="height: 50vh">
-      <webcam :maxres="maxres" @ready="webcam_ready=false" ref="webcam" :height="webcam_height" style=""/>
-    </div>
-    <div class="row" style="height: 10vh">
-       <q-btn :loading="webcam_ready" @click="capture">{{ texts.new_snap}}</q-btn>
-       <q-btn :disabled="imgs.length==0" @click="save()">{{ texts.new_done }}</q-btn>
-    </div>
-    <div class="row" style="flex-wrap:nowrap; overflow-y: auto; width:90vw; max-height: 15vh">
-      <q-item round v-for="img in imgs"style="display: inline-flex">
-        <q-btn @click="delete_image(img)"><q-icon style="position: absolute" mat="clear"/></q-btn>
-        <img  :src="img" style="max-height:10vh"/>
-      </q-item>
-    </div>
-  </div>
-</template>
-
-<script>
-import Webcam from '../components/webcam'
-var api = require('../api.js')
-var utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain
-} from 'quasar'
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    Webcam,
-    QItemMain
-  },
-  data () {
-    return {
-      products: [
-        {name: 'hello'}
-      ],
-      api: api,
-      imgs: [],
-      texts: '',
-      webcam_height: 0,
-      webcam_ready: true,
-      maxres: 25600
-    }
-  },
-  methods: {
-    capture: function () {
-      this.imgs.push(this.$refs.webcam.capture())
-    },
-    delete_image: function (img) {
-      this.imgs.pop(img)
-    },
-    save: function () {
-      var self = this
-      window.images = self.imgs
-      this.$refs.webcam.stop()
-      self.$router.push('save')
-    }
-  },
-  mounted () {
-    window.p = this
-    utils.setTexts(this)
-    this.webcam_height = this.$refs.webcam_placeholder.clientHeight - 50
-  },
-  beforeDestroy () {
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-div
-  display: flex
-  flex-direction: column
-  align-items: center
-.row
-  flex-direction: row
-</style>

+ 0 - 57
docker-front/front/src/pages/OAuthRedirect.vue

@@ -1,57 +0,0 @@
-<template>
-    <div style="width: 100vw; height: 100vh; margin: 0px">
-    </div>
-</template>
-
-<script>
-const queryString = require('query-string')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain,
-  QSelect,
-  QInput,
-  QField
-} from 'quasar'
-
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemMain,
-    QSelect,
-    QInput,
-    QField
-  },
-  data () {
-    return {
-    }
-  },
-  methods: {
-  },
-  mounted () {
-    window.opener.postMessage({data: queryString.parse(location.hash)}, '*')
-    window.close()
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-</style>

+ 0 - 86
docker-front/front/src/pages/Page1.vue

@@ -1,86 +0,0 @@
-<template>
-    <q-card style="width: 100vw; height: 100vh; padding: 50px; margin: 0px" class="bg-black">
-      <q-btn round color='blue' style="position: fixed; top: 20%"
-      @click="$router.push('/scan')">
-        {{ texts['page2_scan'] }}
-      </q-btn>
-      <q-btn round color='blue' style="position: fixed; top: 40%"
-      > 
-        {{ texts['page2_new'] }}
-      </q-btn>
-      
-      <q-btn round color='blue' style="position: fixed; top: 80%; width: 10em; height: 5em" @click="logout"> 
-        {{ texts['page2_logout'] }}
-      </q-btn>
-
-
-    </q-card>
-</template>
-
-<script>
-var db = require('../db.js')
-var utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain
-} from 'quasar'
-
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemMain
-  },
-  data () {
-    return {
-      texts: ''
-    }
-  },
-  computed: {
-  },
-  methods: {
-    logout: function () {
-      db.saveToken('')
-      this.$router.push('/login')
-    }
-  },
-  mounted () {
-    // populate language
-    utils.setTexts(this)
-  },
-  beforeDestroy () {
-  }
-}
-</script>
-
-<style lang="stylus">
-.logo-container
-  width 255px
-  height 242px
-  perspective 800px
-  position absolute
-  top 50%
-  left 50%
-  transform translateX(-50%) translateY(-50%)
-.logo
-  position absolute
-  transform-style preserve-3d
-</style>

+ 0 - 168
docker-front/front/src/pages/Register.vue

@@ -1,168 +0,0 @@
-<template>
-  <div style="height: 100vh" class="div justify-center items-center">
-  <q-card style="max-width: 300px" class="div">
-    <q-card-title>
-      {{texts.login_register}}
-    </q-card-title>
-    <q-card-main>
-      <div>
-      <q-field :label="texts.login_username"
-          :error="error.username"
-          :error-label="error.username">
-        <q-input @keyup="key_pressed" v-model="payload.username" style="max-width: 300px"/>
-      </q-field>
-       <q-field :label="texts.login_email"
-          :error="error.email"
-          :error-label="error.email">
-        <q-input  @keyup="key_pressed" v-model="payload.email" style="max-width: 300px"/>
-      </q-field>
-     <q-field :label="texts.login_password"
-              :error="error.password1"
-              :error-label="error.password1"
-              >
-        <q-input  @keyup="key_pressed" type="password" v-model="payload.password1"  style="max-width: 500px"/>
-      </q-field>
-      <q-field :label="texts.login_password"
-            :error="error.password2"
-            :error-label="error.password2">
-        <q-input type="password"  @keyup="key_pressed" v-model="payload.password2"  style="max-width: 500px"/>
-      </q-field>
-      <div class="div">
-        <q-btn style="max-width: 300px" :loading="register_btn_model" @click="register"> 
-        {{ texts.login_submit }} 
-      </q-btn>
-      </div>
-    </div>
-    </q-card-main>
-  </q-card>
-  </div>
-</template>
-
-<script>
-var ClientOAuth2 = require('client-oauth2')
-var api = require('../api.js')
-var db = require('../db.js')
-var utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain,
-  QSelect,
-  QInput,
-  QField,
-  QCardMain,
-  QCardTitle
-} from 'quasar'
-
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemMain,
-    QSelect,
-    QInput,
-    QField,
-    QCardMain,
-    QCard,
-    QCardTitle
-  },
-  data () {
-    return {
-      selected_language: '',
-      languages: [],
-      texts: {},
-      username: '',
-      password: '',
-      selected_provider: 1000,
-      oauth_clients: [
-      ],
-      error: {},
-      payload: {
-        username: '',
-        email: '',
-        password: '',
-        password2: '',
-
-      },
-      register_btn_model: false
-    }
-  },
-  methods: {
-    verify_data: function () {
-      if (this.payload.username.length < 5) {
-        this.error.username = 'invalid username'
-        this.$q.notify('invalid username')
-        return false
-      }
-      if (this.payload.email.length < 4) {
-        this.$q.notify('invalid email')
-        return false
-      }
-      if (this.payload.password1.length < 5) {
-        this.$q.notify('invalid password')
-        return false
-      }
-      if (this.payload.password2.length < 5) {
-        return false
-      }
-      return true
-    },
-    key_pressed: function (key) {
-      if (key.key == 'Enter') {
-        this.register_btn_model = true
-        this.register()
-      }
-    },
-    register: function () {
-      this.register_btn_model = true
-      if (this.verify_data()) {
-        var self = this
-        api.register(this.payload)
-          .then((response) => {
-            db.saveToken("Token " + response.data.key).then(data => {
-              self.$router.push('/blank') })
-          })
-          .catch(err => {
-            self.register_btn_model = false
-            if (err.response.status == 400) {
-              self.error = err.response.data
-            }
-            if (self.error.non_field_errors) {
-              self.error.non_field_errors.forEach(error => { 
-                this.$q.notify(error)
-              })
-            }
-          })
-      }
-    }
-  },
-  mounted () {
-    var self = this
-    utils.setTexts(this)
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-.div
-  display: flex
-  flex-direction: column
-  align-items: center
-</style>

+ 0 - 330
docker-front/front/src/pages/SaveProduct.vue

@@ -1,330 +0,0 @@
-<template>
-  <div style="margin: 30px">
-    <q-field :error="Boolean(error.product_type)"
-            :error-label="error.product_type"
-            :label="texts.save_product_type">
-      <div v-if="product_type_selected" class="row">
-        <span v-if="product_type==''"> {{ texts.save_no_product_selected }}</span>
-        <span v-else>{{ product_type }}</span>
-        <q-btn @click="product_type_selected=false" class="bg-primary">
-          {{ texts.save_change }}
-        </q-btn>
-      </div>
-      <div v-else>
-      <q-field  :label="texts.save_filter_by">
-       <q-input label="Name" v-model="product_type_filter"/>
-      </q-field>
-      <q-tree
-        :nodes="product_types"
-        node-key="name"
-        color="red"
-        accordion
-        default-expand-all
-        :filter="product_type_filter"
-        :selected.sync="selected_product_type"
-      >
-        <div slot="default-header" slot-scope="prop" class="row item-center">
-          <div class="text-weight-bold text-primary"@click="product_type_clicked(prop.node)">
-            {{ prop.node.label }}
-          </div>
-        </div>
-      </q-tree>
-    </div>
-    </q-field>
-    <q-field 
-        :error="Boolean(error.name)"
-        :error-label="error.name"
-        :label="texts.save_name">
-      <q-input label="Name" v-model="product_data.name"/>
-    </q-field>
-    <q-field :label="texts.save_is_generic">
-      <q-toggle type="boolean" v-model="product_data.is_generic"/>
-    </q-field>
-    <q-field :label="texts.save_weight">
-      <q-slider :min="0" :max="1000"
-        v-model="product_data.weight" label square
-        label-always/>
-      <q-select :options="weight_units" v-model="product_data.weight_unit"/>
-    </q-field>
-    <q-field
-      :error="Boolean(error.description)"
-      :error-label="error.description"
-      :label="texts.save_description">
-      <q-input v-model="product_data.description"/>
-    </q-field>
-    <q-field :label="texts.save_packaging_materials">
-      <div>
-        <span v-if="packaging_materials.length==0"> {{ texts.save_no_packaging_selected }} </span>
-        <span v-else>
-          <q-list striped>
-            <q-item v-for="packaging_material,index in packaging_materials">
-              <q-item-main>
-              <q-item-tile>
-              {{packaging_material.label}}
-              </q-item-tile>
-              <q-item-tile>
-      <q-field :label="texts.save_weight">
-      <q-slider :min="0" :max="1000"
-        v-model="packaging_material.weight" label square
-        label-always/>
-      <q-select :options="weight_units" v-model="packaging_material.weight_unit"/>
-    </q-field>
-    </q-item-tile>
-      </q-item-main>
-      <q-item-side>
-        <q-btn
-        @click="remove_packaging_material(packaging_material)">{{texts.save_remove}}</q-btn>
-      </q-item-side>
-    </q-item>
-          </q-list>
-        </span>
-        <q-btn @click="packaging_selected=false" class="bg-primary">
-          {{ texts.save_add }}
-        </q-btn>
-      </div>
-      <div v-if="!packaging_selected">
-      <q-field :label="texts.save_filter_by">
-       <q-input label="Name" v-model="packaging_material_filter"/>
-      </q-field>
-      <q-tree
-        :nodes="packagings"
-        :filter="packaging_material_filter"
-        default-expand-all
-        node-key="id"
-        color="red"
-        accordion
-        :selected.sync="selected_packaging"
-      >
-        <div slot="default-header" slot-scope="prop" class="row item-center">
-          <div class="text-weight-bold text-primary"@click="packaging_clicked(prop.node)">
-            {{ prop.node.label }}
-          </div>
-        </div>
-      </q-tree>
-      </div>
-    </q-field>
-    <div class="flexrow">
-       <q-btn :loading="save_loading" @click="save()">{{texts.save_save}}</q-btn>
-    </div>
-  </div>
-</template>
-
-<script>
-var api = require('../api.js')
-var utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain,
-  QItemTile,
-  QSlider,
-  QInput,
-  QField,
-  QToggle,
-  QTree,
-  QSelect,
-  Notify
-} from 'quasar'
-
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    QItemTile,
-    QItemMain,
-    QSlider,
-    QInput,
-    QField,
-    QToggle,
-    QTree,
-    QSelect
-  },
-  data () {
-    return {
-      products: [
-        {name: 'hello'}
-      ],
-      weight_units: [],
-      length_units: [],
-      data: [],
-      selected_product_type: null,
-      api: api,
-      current_hier_index: 1,
-      disable_save: true,
-      product_type: '',
-      product_type_selected: true,
-      packaging_material_filter: '',
-      packaging: '',
-      packagings: [],
-      packaging_materials: [],
-      selected_packaging: null,
-      packaging_selected: true,
-      packaging: [],
-      product_type_filter: '',
-      product_types: [{
-        name: 'hi',
-        children: []
-      }],
-      save_loading: false,
-      product_data: {
-        weight_unit: 2,
-        weight: 110,
-        description: '',
-        product_type: 0,
-        name: '',
-        length: 0,
-        width: 0,
-        height: 0,
-        EAN_code: 0,
-        is_generic: false
-      },
-      texts: {},
-      error: {}
-    }
-  },
-  methods: {
-    packaging_clicked: function (node) {
-      if(node.id === 1 || node.id === 2){
-        return false
-      }
-      this.product_data.packaging_material = node.id
-      this.packaging = node.label
-      this.packaging_selected = true
-      if (this.packaging_materials.indexOf(node)==-1) {
-        node.weight = 0
-        node.weight_unit = this.product_data.weight_unit
-        this.packaging_materials.push(node)
-      }
-      else {
-      }
-    },
-    remove_packaging_material: function (node) {
-      this.packaging_materials.pop(node)
-    },
-    product_type_clicked: function (node) {
-      if(node.id !== 1){
-        this.product_data.product_type = node.id
-        this.product_type = node.label
-        this.product_type_selected = true
-      }
-    },
-    save_product: function () {
-      var self = this
-      self.save_loading = true
-      return new Promise((resolve, reject) => {
-        [{name: 'name', default:'none'}, {name: 'description', default:
-        'none'}, {name: 'product_type', default: 1}].forEach(data => {
-          console.log(data)
-          if (!window.Boolean(self.product_data[data.name])) {
-            self.product_data[data.name] = data.default
-            console.log(data.name)
-          }
-        })
-        api.create('scanapp/{LANG}/products/', this.product_data)
-          .then((data) => {
-            self.packaging_materials.forEach(packaging_materialsq => {
-              var bom_data = {product: data.data.id}
-              bom_data.product_type = packaging_materialsq.id
-              bom_data.weight = packaging_materialsq.weight
-              api.create('scanapp/{LANG}/bom/', bom_data)
-            })
-           var n = 0
-            window.images.forEach((image) => {
-              api.uploadImage(data.data.id, data.data.name + n, image)
-                .then(data => {
-                  n += 1
-                  if (window.images.length === n) {
-                    Notify.create(self.texts.save_notify_saved)
-                    resolve(data)
-                  }
-                })
-            })
-          })
-          .catch(err => {
-            self.save_loading = false
-            if (err.response.status == 400) {
-              var error = err.response.data
-              for(var field in error) {
-                if(error[field]){
-                  self.error[field] = error[field][0]
-                }
-              }
-            }
-          })
-      })
-    },
-    save: function () {
-      this.save_product().then(() => { this.$router.push('/') })
-    },
-    save_and_continue: function () {
-      this.save_product().then(() => { this.$router.push('new') })
-    }
-  },
-  mounted () {
-    window.me = this
-    var self = this
-    var index = 1
-    utils.setTexts(this)
-    self.product_data.EAN_code = window.sessionStorage.getItem('barcode_id')
-    db.getData('scanapp/{LANG}/product_hier/2/.detail').then(function (data) {
-        self.packagings = []
-        self.packagings.push(data)
-    })
-    db.getData('scanapp/{LANG}/product_hier/1/.detail')
-      .then(data => {
-        self.product_types = []
-        self.product_types.push(data)
-      })
-     db.getData('language/{LANG}/weight/.list').then(data => {
-        self.weight_units = []
-        data.forEach(unit => {
-          unit.label = unit.name
-          unit.value = unit.id
-          self.weight_units.push(unit)
-        })
-        self.product_data.weight_unit = data[0].id
-      })
-      db.getData('language/{LANG}/length/.list').then(data => {
-        self.length_units = []
-        data.forEach(unit => {
-          unit.label = unit.name
-          unit.value = unit.name
-          self.length_units.push(unit)
-        })
-        self.product_data.length_unit = data[0].name
-      })
- 
-  },
-  beforeDestroy () {
-  },
-}
-</script>
-
-<style lang="stylus" scoped>
-@import '~variables'
-.div
-  display: flex
-  flex-direction: column
-  align-items: left
-.flexrow
-  flex-direction: row
-.primary
-  background-color: $blue
-</style>

+ 0 - 234
docker-front/front/src/pages/Scan.vue

@@ -1,234 +0,0 @@
-<template>
-  <div style="display: flex">
-    <div style="display: flex">
-      <span> {{texts['scan_scan_instruction']}}</span>
-        <div ref="webcam_placeholder" style="height: 80vh; display: flex;
-        overflow:hidden">
-        <webcam @ready="camera_ready()" :maxres="500" ref="webcam" :height="webcam_height"/>
-      </div>
-      <!--v<img :src="this.img" style="max-height:90vh"/> -->
-    </div>
-    <q-field style="display: flex" :label="texts['scan_enter_barcode_manually']">
-      <q-input type="tel" @focus="onfocus()"
-      @blur="onblur()" @keyup.enter="on_click_manual_entry()" v-model="manual_result"/>
-      <q-btn @click="on_click_manual_entry()"> {{ texts['scan_submit'] }} </q-btn>
-    </q-field>
-    <q-modal no-esc-dismiss no-backdrop-dismiss minimized v-model="opened">
-      <div style="padding: 5%"> 
-      <div v-if="scanning==2">
-        <img :src="this.img" style="max-height:30vh"/> 
-        <div ref="result">loading...</div>
-        <div class="row">
-          <q-btn @click="close_dialog()">{{texts['scan_back']}}</q-btn>
-          <q-btn :loading="searching" @click="_continue()" :disabled="!result">{{texts['scan_continue']}}</q-btn>
-        </div>
-      </div>
-      <div v-if="scanning==3">
-        <q-card v-if="products.length>0">
-          <span> {{texts['scan_found_text']}}</span>
-          <div class="row" style="flex-wrap:nowrap; overflow-y: auto; width:300px" >
-            <template v-for="product in products">
-              <q-item v-for="picture in product.pictures">
-                <img :src="api.apiHostname + picture.slice(5)"
-            style="max-height: 100px">
-  <q-tooltip>
-    {{ product.name }}
-  </q-tooltip>
-            </img>
-            </q-item>
-            </template>
-          </div>
-          <div> {{texts['scan_add_new']}} </div>
-          <div class="row" style="margin:10px">
-            <q-btn @click="$router.push('/new')"> {{texts['scan_yes']}} </q-btn>
-            <q-btn @click="$router.push('/home')"> {{texts['scan_no']}} </q-btn>
-          </div>
-        </q-card>
-        <div v-else>
-          {{texts['scan_no_product_text']}}<br/>
-          {{ texts['scan_create_new']}}
-          <div class="row">
-            <q-btn @click="$router.push('/home')">{{ texts['scan_no']}}</q-btn>
-            <q-btn @click="create_new()">{{ texts['scan_yes']}}</q-btn>
-          </div>
-        </div>
-      </div>
-      </div>
-    </q-modal>
-  </div>
-</template>
-
-<script>
-import Webcam from '../components/webcam'
-import Quagga from 'quagga'
-var api = require('../api.js')
-var utils = require('../utils.js')
-import {
-  QCard,
-  QLayout,
-  QToolbar,
-  QToolbarTitle,
-  QBtn,
-  QIcon,
-  QList,
-  QListHeader,
-  QItem,
-  QItemSide,
-  QItemMain,
-  QModal,
-  QModalLayout,
-  QTooltip,
-  QInput,
-  QField
-} from 'quasar'
-export default {
-  name: 'index',
-  components: {
-    QCard,
-    QLayout,
-    QToolbar,
-    QToolbarTitle,
-    QBtn,
-    QIcon,
-    QList,
-    QListHeader,
-    QItem,
-    QItemSide,
-    Webcam,
-    QItemMain,
-    QModal,
-    QModalLayout,
-    QTooltip,
-    QInput,
-    QField
-  },
-  data () {
-    return {
-      products: [],
-      api: api,
-      img: null,
-      quagga: null,
-      scanning: 2,
-      opened: false,
-      result: null,
-      scan_result: null,
-      manual_result: '',
-      texts: '',
-      scanned: false,
-      webcam_height: 0,
-      searching: false,
-      found: false,
-      scan_interval: null,
-      manual_input: false
-    }
-  },
-  methods: {
-    close_dialog: function () {
-      this.scanned = false
-      this.opened = false
-    },
-    on_key_pressed: function (key) {
-      this.on_click_manual_entry()
-    },
-    on_click_manual_entry: function () {
-        var regex = /^[0-9]+$/
-        if(!this.manual_result.match(regex)) {
-          this.$q.notify('invalid barcode')
-          return false
-        }
-        this.scanned = true
-        this.$refs.result.innerText = this.manual_result
-        this.result = this.manual_result
-        this.opened = true
-        this.scanning = 2
-    },
-    _continue: function () {
-      var self = this
-      self.searching = true
-      api.get('scanapp/{LANG}/ean_codes/'+self.result + '/')
-        .then((data) => {
-          self.products = data.data.products
-          window.sessionStorage.setItem('barcode_id', data.data.id)
-          self.scanning = 3
-          self.found = true
-        })
-        .catch(err => {
-          self.found = false
-          self.scanning = 3
-        })
-    },
-    create_new: function () {
-      if (!this.found) {
-        api.create('scanapp/en-us/ean_codes/', {barcode: this.result})
-          .then(data => {
-            window.sessionStorage.setItem('barcode_id', data.data.id)
-          })
-      }
-      this.$router.push('/new')
-    },
-    decode: function (img) {
-      var self = this
-      Quagga.decodeSingle({
-        decoder: {
-          readers: ['ean_reader'] // List of active readers
-        },
-        locate: true, // try to locate the barcode in the image
-        src: img // or 'data:image/jpg;base64,' + data
-      }, function (result) {
-        if (!result) {
-          self.scan_result = null
-          return null
-        }
-        if (result.codeResult) {
-          self.scanned = true
-          self.$refs.result.innerText = result.codeResult.code
-          self.scan_result = result.codeResult.code
-          self.result = self.scan_result
-          self.opened = true
-          self.scanning = 2
-        }
-        else {
-          self.scan_result = null
-        }
-      })
-    },
-    camera_ready: function () {
-      // alert(22)
-      console.log('email increase')
-      this.scan_interval = window.setInterval(() => {
-        if(!this.scanned){ // && !this.manual_input) {
-          var img = this.$refs.webcam.capture()
-          console.log(33)
-          this.decode(img)
-        }
-      }, 1000)
-    },
-    onblur: function () {
-      this.manual_input = false
-      this.$refs.webcam.startCapture()
-    },
-    onfocus: function () {
-      this.manual_input = true
-      this.$refs.webcam.stop()
-      window.clearInterval(this.scan_interval)
-    }
-  },
-  mounted: function () {
-    window.c = this
-    utils.setTexts(this)
-    var self = this
-    this.webcam_height = this.$refs.webcam_placeholder.clientHeight
-  },
-  beforeDestroy () {
-  }
-}
-</script>
-
-<style lang="stylus" scoped>
-div
-  display: flex
-  flex-direction: column
-  align-items: center
-.row
-  flex-direction: row
-</style>

+ 0 - 14
docker-front/front/src/pages/index.vue

@@ -1,14 +0,0 @@
-<template>
-  <q-page class="flex flex-center">
-    <img alt="Quasar logo" src="~assets/quasar-logo-full.svg">
-  </q-page>
-</template>
-
-<style>
-</style>
-
-<script>
-export default {
-  name: 'PageIndex'
-}
-</script>

+ 0 - 0
docker-front/front/src/plugins/.gitkeep


+ 0 - 5
docker-front/front/src/plugins/axios.js

@@ -1,5 +0,0 @@
-import axios from 'axios'
-
-export default ({ Vue }) => {
-  Vue.prototype.$axios = axios
-}

+ 0 - 13
docker-front/front/src/plugins/i18n.js

@@ -1,13 +0,0 @@
-import VueI18n from 'vue-i18n'
-import messages from 'src/i18n'
-
-export default ({ app, Vue }) => {
-  Vue.use(VueI18n)
-
-  // Set i18n instance on app
-  app.i18n = new VueI18n({
-    locale: 'en',
-    fallbackLocale: 'en',
-    messages
-  })
-}

+ 0 - 24
docker-front/front/src/router/index.js

@@ -1,24 +0,0 @@
-import Vue from 'vue'
-import VueRouter from 'vue-router'
-
-import routes from './routes'
-
-Vue.use(VueRouter)
-
-const Router = new VueRouter({
-  /*
-   * NOTE! Change Vue Router mode from quasar.conf.js -> build -> vueRouterMode
-   *
-   * If you decide to go with "history" mode, please also set "build.publicPath"
-   * to something other than an empty string.
-   * Example: '/' instead of ''
-   */
-
-  // Leave as is and change from quasar.conf.js instead!
-  mode: process.env.VUE_ROUTER_MODE,
-  base: process.env.VUE_ROUTER_BASE,
-  scrollBehavior: () => ({ y: 0 }),
-  routes
-})
-
-export default Router

+ 0 - 38
docker-front/front/src/router/routes.js

@@ -1,38 +0,0 @@
-function load (component) {
-  // '@' is aliased to src/components
-  return () => import(`pages/${component}.vue`)
-}
-var BarcodeExist = load('BarcodeExistDialog')
-var Login = load('Login')
-var OAuthRedirect = load('OAuthRedirect')
-var Home = load('Home')
-var Page1 = load('Page1')
-var Scan = load('Scan')
-var NewProduct = load('NewProduct')
-var SaveProduct = load('SaveProduct')
-var Register = load('Register')
-var Blank = load('Blank')
-export default [
-  {
-    path: '/',
-    component: () => import('layouts/default'),
-    children: [
-      { path: '/register', component: Register, name: 'register' },
-      { path: '/login', component: Login, name: 'login' },
-      { path: '/redirect_oauth', component: OAuthRedirect, name: 'oauth_redirect' },
-      { path: '/', component: Home },
-      { path: '/home', component: Page1 },
-      { path: '/scan', component: Scan },
-      { path: '/noy', component: BarcodeExist },
-      { path: '/new', component: NewProduct },
-      { path: '/save', component: SaveProduct },
-      { path: '/blank', component: Blank },
-      { path: '', component: () => import('pages/index') }
-    ]
-  },
-
-  { // Always leave this as last one
-    path: '*',
-    component: () => import('pages/404')
-  }
-]

BIN
docker-front/front/src/statics/freeimages drip-drop-1185539 starter image App.jpg


BIN
docker-front/front/src/statics/icons/apple-icon-152x152.png


BIN
docker-front/front/src/statics/icons/favicon-16x16.png


BIN
docker-front/front/src/statics/icons/favicon-32x32.png


BIN
docker-front/front/src/statics/icons/icon-128x128.png


BIN
docker-front/front/src/statics/icons/icon-192x192.png


BIN
docker-front/front/src/statics/icons/icon-256x256.png


BIN
docker-front/front/src/statics/icons/icon-384x384.png


BIN
docker-front/front/src/statics/icons/icon-512x512.png


BIN
docker-front/front/src/statics/icons/ms-icon-144x144.png


BIN
docker-front/front/src/statics/quasar-logo.png


+ 0 - 20
docker-front/front/src/utils.js

@@ -1,20 +0,0 @@
-var db = require('./db.js')
-var api = require('./api.js')
-
-const getTexts = function () {
-  return new Promise((resolve, reject) => {
-    api.getAndSaveList('frontend/{LANG}/')
-      .then(data => {
-        resolve(data[0])
-      })
-      .catch(err => { console.log(err) })
-  })
-}
-const setTexts = function (page) {
-    db.getData('frontend/{LANG}/.list')
-        .then((data => { page.texts = data[0] }))
-}
-export {
-  getTexts,
-  setTexts
-}

File diff suppressed because it is too large
+ 274 - 0
setup.sh


+ 0 - 1
teampostgresql/Dockerfile

@@ -1,5 +1,4 @@
 FROM thackba/java:latest
-MAINTAINER mail@thackbarth.net
 
 ARG CONTAINER_UID=1300
 ARG CONTAINER_GID=1300

+ 0 - 1
teampostgresql/README.md

@@ -1 +0,0 @@
-This is a dockerized TeamPostgreSQL.