Compare commits
232 Commits
beta_fix_b
...
dev
Author | SHA1 | Date |
---|---|---|
|
a956c268b6 | |
|
5b968b6e46 | |
|
ef65622014 | |
|
35efe67c63 | |
|
6dbcf162ca | |
|
20f5dc46f7 | |
|
c0ab27bd7a | |
|
6508a4e4f0 | |
|
6fa75b3abc | |
|
ce230b1133 | |
|
f2ca49b261 | |
|
a5b8e56506 | |
|
93562bb4dd | |
|
aaa9d34404 | |
|
de5740856e | |
|
70746995ca | |
|
90dea8fde9 | |
|
f57967cd17 | |
|
1c54922692 | |
|
8929f8c55a | |
|
7f2c645682 | |
|
099f494101 | |
|
ddc5c2adc7 | |
|
16d1e1fd69 | |
|
340c68406c | |
|
c2f7ee1be8 | |
|
4d81b6c5b2 | |
|
fba0c73402 | |
|
5ac6652663 | |
|
21da29ab8d | |
|
1f373f1bc3 | |
|
47acbb7ebb | |
|
f863d8a897 | |
|
5186387162 | |
|
fd11c1ea00 | |
|
8a022aac66 | |
|
ddaff6afe9 | |
|
bdf7a16003 | |
|
3db9314dfd | |
|
7ff9e2e97d | |
|
0d61a9de03 | |
|
979b1293a9 | |
|
29168a6927 | |
|
b62185289f | |
|
d66047c451 | |
|
03be5f9a56 | |
|
96fd08b369 | |
|
36573342b7 | |
|
14451121ac | |
|
44a45a25b2 | |
|
7618e65105 | |
|
1efb84dd83 | |
|
90137ab08f | |
|
b73e292cb0 | |
|
444732460e | |
|
ab88575c72 | |
|
5cf6ef5b1c | |
|
dcf46094f0 | |
|
c6589989d4 | |
|
59e7999385 | |
|
756fccaa78 | |
|
7174842cfa | |
|
d6e7d3b025 | |
|
5bc20e9e05 | |
|
6be7bccff7 | |
|
bf5ba5dac1 | |
|
0d2ac8f9fb | |
|
cb61ad5d11 | |
|
5abcf9e71d | |
|
0952a690a5 | |
|
cc5faf97da | |
|
9507292a13 | |
|
17baf12449 | |
|
749189d726 | |
|
7a94c3a01e | |
|
c4977b7997 | |
|
ca4457bf54 | |
|
d1c4f9dba2 | |
|
921b029b06 | |
|
ff63cd11c3 | |
|
1f1043a43c | |
|
a868a5b540 | |
|
baa596430e | |
|
5ca765486f | |
|
61fac85554 | |
|
3a714debfc | |
|
647dd09013 | |
|
05c71c7425 | |
|
90e2b0abb5 | |
|
bcbbee411f | |
|
961ff02053 | |
|
e7eb2a01fe | |
|
98cefc8f0f | |
|
e40a28b649 | |
|
f869e7413c | |
|
29e800ea30 | |
|
1eb98b772a | |
|
1fe6816c08 | |
|
5bbc342471 | |
|
d808fa71d1 | |
|
ac226205b0 | |
|
87f17409f7 | |
|
ae70cbaaf4 | |
|
6e1613a26c | |
|
359ddb5d18 | |
|
d75fe3fc00 | |
|
e6cd88ee82 | |
|
a405cba00b | |
|
e4f55ca9e9 | |
|
d8ea9134d4 | |
|
a96859b6bb | |
|
e210a09f6b | |
|
5304a77f94 | |
|
3f63da06f1 | |
|
7d120598bc | |
|
4cf91140f7 | |
|
06554b7dee | |
|
83c6886ee6 | |
|
4765bc78de | |
|
0a9635feb2 | |
|
00c8e4b1e3 | |
|
1414b6c96e | |
|
244b3f939e | |
|
1d2f9061c5 | |
|
a121750fa7 | |
|
73ba16634e | |
|
2515cbcee7 | |
|
d1cdba800d | |
|
02ddc87755 | |
|
7689be689f | |
|
33778629e6 | |
|
7f1d8ebb8e | |
|
4d8a67f499 | |
|
c6120af93b | |
|
95f819c22f | |
|
496061fb3c | |
|
0b85c1230a | |
|
3ed871cb4c | |
|
c7159a1e13 | |
|
fba880fb33 | |
|
1535a557a8 | |
|
4a09fe39a8 | |
|
3977b258d3 | |
|
6915e06c71 | |
|
a474f9df05 | |
|
620bd53262 | |
|
8f98597ea2 | |
|
a2cd8a711e | |
|
08b4a3437c | |
|
a59c44fb3a | |
|
2adfd2299a | |
|
f929e67d76 | |
|
d37493b081 | |
|
0f3ddb1a99 | |
|
bb4e348d0c | |
|
754b8cd6c4 | |
|
7bb067223a | |
|
9363cdf5a4 | |
|
d17bc6115f | |
|
9475c26663 | |
|
607513452f | |
|
86be0278a6 | |
|
a8f98d62ab | |
|
2af5851066 | |
|
1470e77572 | |
|
32cc865290 | |
|
8bcfe9f50c | |
|
f638143e3e | |
|
07bde10609 | |
|
4231365e4f | |
|
fa56a4e540 | |
|
5bcfd5897c | |
|
572d4b7b83 | |
|
bbeb70eb6b | |
|
2905a6ab57 | |
|
5b84671d57 | |
|
9146d28db5 | |
|
59242daa79 | |
|
fd32b3f15a | |
|
56395aa91b | |
|
2610448e79 | |
|
9eba09ddf7 | |
|
74980fbdd7 | |
|
01326dc91c | |
|
5ce2f46842 | |
|
42f682739e | |
|
bbe7f2ea14 | |
|
cdafea824e | |
|
5fce203252 | |
|
9945c8f1b6 | |
|
1ef0d48ba7 | |
|
197758f2bc | |
|
511e925467 | |
|
f47e7e07a7 | |
|
b32be540f3 | |
|
4190aad94e | |
|
9bfd42eaf8 | |
|
dd7185d5dd | |
|
10d8128133 | |
|
b357c4a451 | |
|
e5941266ed | |
|
592f79fcbd | |
|
0abc6bdc23 | |
|
210b7e7806 | |
|
92a4bc458c | |
|
520e0c1eff | |
|
afd23e08b7 | |
|
18cdb4cc1b | |
|
ca5f80f6c3 | |
|
d1ff6889af | |
|
a632a15242 | |
|
67b6f77b12 | |
|
e8eab29887 | |
|
326aeee127 | |
|
bbb0089b59 | |
|
406b2f8300 | |
|
efc7342359 | |
|
806c4cc3ad | |
|
c463e967ca | |
|
be43a38b38 | |
|
59ed61ae9b | |
|
17e54cfc60 | |
|
baa9bb7cdf | |
|
87d75be910 | |
|
ac629dc97b | |
|
ff3320d590 | |
|
e8b727ab6c | |
|
5934ee3832 | |
|
4f09574697 | |
|
6d95dfb999 | |
|
1fa9b1e8b0 | |
|
327508c3ee |
|
@ -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
|
|
|
@ -1,8 +0,0 @@
|
||||||
/dist
|
|
||||||
/src-bex/www
|
|
||||||
/src-capacitor
|
|
||||||
/src-cordova
|
|
||||||
/.quasar
|
|
||||||
/node_modules
|
|
||||||
.eslintrc.js
|
|
||||||
babel.config.js
|
|
86
.eslintrc.js
86
.eslintrc.js
|
@ -1,86 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
// https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
|
|
||||||
// This option interrupts the configuration hierarchy at this file
|
|
||||||
// Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
|
|
||||||
root: true,
|
|
||||||
|
|
||||||
parserOptions: {
|
|
||||||
parser: '@babel/eslint-parser',
|
|
||||||
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
|
|
||||||
sourceType: 'module' // Allows for the use of imports
|
|
||||||
},
|
|
||||||
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
'vue/setup-compiler-macros': true
|
|
||||||
},
|
|
||||||
|
|
||||||
extends: ['standard'],
|
|
||||||
plugins: ['vue', 'prettier'],
|
|
||||||
globals: {
|
|
||||||
ga: 'readonly', // Google Analytics
|
|
||||||
cordova: 'readonly',
|
|
||||||
__statics: 'readonly',
|
|
||||||
__QUASAR_SSR__: 'readonly',
|
|
||||||
__QUASAR_SSR_SERVER__: 'readonly',
|
|
||||||
__QUASAR_SSR_CLIENT__: 'readonly',
|
|
||||||
__QUASAR_SSR_PWA__: 'readonly',
|
|
||||||
process: 'readonly',
|
|
||||||
Capacitor: 'readonly',
|
|
||||||
chrome: 'readonly'
|
|
||||||
},
|
|
||||||
|
|
||||||
// add your custom rules here
|
|
||||||
rules: {
|
|
||||||
// allow async-await
|
|
||||||
'generator-star-spacing': 'off',
|
|
||||||
// allow paren-less arrow functions
|
|
||||||
'arrow-parens': 'off',
|
|
||||||
'one-var': 'off',
|
|
||||||
'no-void': 'off',
|
|
||||||
'multiline-ternary': 'off',
|
|
||||||
|
|
||||||
'import/first': 'off',
|
|
||||||
'import/named': 'error',
|
|
||||||
'import/namespace': 'error',
|
|
||||||
'import/default': 'error',
|
|
||||||
'import/export': 'error',
|
|
||||||
'import/extensions': 'off',
|
|
||||||
'import/no-unresolved': 'off',
|
|
||||||
'import/no-extraneous-dependencies': 'off',
|
|
||||||
|
|
||||||
'prefer-promise-reject-errors': 'off',
|
|
||||||
semi: 'off',
|
|
||||||
// allow debugger during development only
|
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['src/**/*.{js,vue,scss}', 'quasar.config.js'], // Aplica ESLint solo a archivos .js, .vue y .scss dentro de src (Proyecto de quasar)
|
|
||||||
extends: [
|
|
||||||
// Base ESLint recommended rules
|
|
||||||
'eslint:recommended',
|
|
||||||
// Uncomment any of the lines below to choose desired strictness,
|
|
||||||
// but leave only one uncommented!
|
|
||||||
// See https://eslint.vuejs.org/rules/#available-rules
|
|
||||||
// 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
|
|
||||||
'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
|
|
||||||
// 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
|
|
||||||
// https://github.com/prettier/eslint-config-prettier#installation
|
|
||||||
// usage with Prettier, provided by 'eslint-config-prettier'.
|
|
||||||
'prettier',
|
|
||||||
'plugin:cypress/recommended'
|
|
||||||
],
|
|
||||||
rules: {
|
|
||||||
semi: 'off',
|
|
||||||
'space-before-function-paren': 'off',
|
|
||||||
'prefer-promise-reject-errors': 'off',
|
|
||||||
'vue/no-multiple-template-root': 'off'
|
|
||||||
},
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: '2021'
|
|
||||||
},
|
|
||||||
plugins: ['vue']
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
extends: eslint:recommended
|
||||||
|
parserOptions:
|
||||||
|
ecmaVersion: 2017
|
||||||
|
sourceType: module
|
||||||
|
rules:
|
||||||
|
no-undef: 0
|
||||||
|
no-redeclare: 0
|
||||||
|
no-mixed-spaces-and-tabs: 0
|
||||||
|
no-console: 0
|
||||||
|
no-cond-assign: 0
|
||||||
|
no-unexpected-multiline: 0
|
||||||
|
brace-style: [error, 1tbs]
|
||||||
|
space-before-function-paren: [error, never]
|
||||||
|
padded-blocks: [error, never]
|
||||||
|
func-call-spacing: [error, never]
|
|
@ -1,36 +1,6 @@
|
||||||
build/
|
|
||||||
config.my.php
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
.thumbs.db
|
|
||||||
node_modules
|
node_modules
|
||||||
|
build/
|
||||||
# Quasar core related directories
|
dist/
|
||||||
|
config.my.php
|
||||||
|
.vscode/
|
||||||
.quasar
|
.quasar
|
||||||
/dist
|
|
||||||
|
|
||||||
# Cordova related directories and files
|
|
||||||
/src-cordova/node_modules
|
|
||||||
/src-cordova/platforms
|
|
||||||
/src-cordova/plugins
|
|
||||||
/src-cordova/www
|
|
||||||
|
|
||||||
# Capacitor related directories and files
|
|
||||||
/src-capacitor/www
|
|
||||||
/src-capacitor/node_modules
|
|
||||||
|
|
||||||
# BEX related directories and files
|
|
||||||
/src-bex/www
|
|
||||||
/src-bex/js/core
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.idea
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
/* eslint-disable */
|
|
||||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
plugins: [
|
|
||||||
// to edit target browsers: use "browserslist" field in package.json
|
|
||||||
require('autoprefixer')
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
module.exports = {
|
|
||||||
printWidth: 80,
|
|
||||||
tabWidth: 4,
|
|
||||||
useTabs: false,
|
|
||||||
singleQuote: true,
|
|
||||||
bracketSpacing: true,
|
|
||||||
arrowParens: 'avoid',
|
|
||||||
trailingComma: 'none'
|
|
||||||
};
|
|
|
@ -1,14 +0,0 @@
|
||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"dbaeumer.vscode-eslint",
|
|
||||||
"editorconfig.editorconfig",
|
|
||||||
"vue.volar",
|
|
||||||
"wayou.vscode-todo-highlight"
|
|
||||||
],
|
|
||||||
"unwantedRecommendations": [
|
|
||||||
"octref.vetur",
|
|
||||||
"hookyqr.beautify",
|
|
||||||
"dbaeumer.jshint",
|
|
||||||
"ms-vscode.vscode-typescript-tslint-plugin"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Listen for XDebug",
|
|
||||||
"type": "php",
|
|
||||||
"request": "launch",
|
|
||||||
"port": 9000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Launch currently open script",
|
|
||||||
"type": "php",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "${file}",
|
|
||||||
"cwd": "${fileDirname}",
|
|
||||||
"port": 9000
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"editor.bracketPairColorization.enabled": true,
|
|
||||||
"editor.guides.bracketPairs": true,
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
||||||
"editor.codeActionsOnSave": ["source.fixAll.eslint"],
|
|
||||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],
|
|
||||||
"cSpell.words": ["axios", "composables"]
|
|
||||||
}
|
|
|
@ -28,7 +28,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||||
|
|
||||||
# Hedera
|
# Hedera
|
||||||
|
|
||||||
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \
|
RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | tee /etc/apt/trusted.gpg.d/verdnatura.gpg \
|
||||||
&& echo "deb http://apt.verdnatura.es/ bookworm main" \
|
&& echo "deb http://apt.verdnatura.es/ bookworm main" \
|
||||||
> /etc/apt/sources.list.d/vn.list \
|
> /etc/apt/sources.list.d/vn.list \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
#!/usr/bin/env groovy
|
#!/usr/bin/env groovy
|
||||||
|
|
||||||
def PROTECTED_BRANCH
|
|
||||||
def RUN_BUILD
|
|
||||||
|
|
||||||
def BRANCH_ENV = [
|
def BRANCH_ENV = [
|
||||||
test: 'test',
|
test: 'test',
|
||||||
master: 'production',
|
master: 'production'
|
||||||
beta: 'test'
|
|
||||||
]
|
]
|
||||||
def remote = [:]
|
def remote = [:]
|
||||||
|
|
||||||
|
@ -14,15 +10,6 @@ node {
|
||||||
stage('Setup') {
|
stage('Setup') {
|
||||||
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
||||||
|
|
||||||
PROTECTED_BRANCH = [
|
|
||||||
'dev',
|
|
||||||
'test',
|
|
||||||
'master',
|
|
||||||
'beta'
|
|
||||||
].contains(env.BRANCH_NAME)
|
|
||||||
|
|
||||||
RUN_BUILD = PROTECTED_BRANCH
|
|
||||||
|
|
||||||
echo "NODE_NAME: ${env.NODE_NAME}"
|
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||||
echo "WORKSPACE: ${env.WORKSPACE}"
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||||
}
|
}
|
||||||
|
@ -35,11 +22,14 @@ pipeline {
|
||||||
stages {
|
stages {
|
||||||
stage('Debuild') {
|
stage('Debuild') {
|
||||||
when {
|
when {
|
||||||
expression { PROTECTED_BRANCH }
|
anyOf {
|
||||||
|
branch 'master'
|
||||||
|
branch 'test'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'registry.verdnatura.es/verdnatura/debuild:2.23.4-vn8'
|
image 'registry.verdnatura.es/verdnatura/debuild:2.23.4-vn7'
|
||||||
registryUrl 'https://registry.verdnatura.es/'
|
registryUrl 'https://registry.verdnatura.es/'
|
||||||
registryCredentialsId 'docker-registry'
|
registryCredentialsId 'docker-registry'
|
||||||
}
|
}
|
||||||
|
@ -65,7 +55,10 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
when {
|
when {
|
||||||
expression { PROTECTED_BRANCH }
|
anyOf {
|
||||||
|
branch 'master'
|
||||||
|
branch 'test'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
CREDS = credentials('docker-registry')
|
CREDS = credentials('docker-registry')
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Copyright (C) 2024 - Verdnatura Levante SL
|
Copyright (C) 2016 - Juan Ferrer Toribio
|
||||||
|
|
||||||
This package is free software; you can redistribute it and/or modify
|
This package is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
51
README.md
51
README.md
|
@ -1,35 +1,58 @@
|
||||||
# Hedera
|
# Hedera
|
||||||
|
|
||||||
Hedera is the main web page for Verdnatura.
|
Hedera is the main web shop page for Verdnatura.
|
||||||
|
|
||||||
## Getting Started
|
## Prerequisites
|
||||||
|
|
||||||
Required dependencies.
|
Required applications.
|
||||||
|
* PHP >= 8.4
|
||||||
|
* Node.js >= 20.0
|
||||||
|
|
||||||
- PHP >= 7.0
|
Take a look to *debian/control* file to see additional dependencies.
|
||||||
- Node.js >= 18.0
|
|
||||||
|
|
||||||
Launch application for development.
|
Copy config.php to *config.my.php* and place your DB config there.
|
||||||
|
|
||||||
|
### Installing dependencies and launching
|
||||||
|
|
||||||
|
Pull from repository.
|
||||||
|
|
||||||
|
Run this commands on project root directory to install Node dependencies.
|
||||||
```
|
```
|
||||||
$ quasar dev
|
$ npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
Launch Salix backend.
|
Install project dependences (debian/control).
|
||||||
|
|
||||||
|
Pull from repository [php-vn-lib](https://gitea.verdnatura.es/verdnatura/php-vn-lib) and install [dependences](https://gitea.verdnatura.es/verdnatura/php-vn-lib/src/branch/master/debian/control) of this project.
|
||||||
|
|
||||||
|
Configure config.php file.
|
||||||
|
|
||||||
|
Launch project fronted.
|
||||||
|
```
|
||||||
|
$ npm run front
|
||||||
```
|
```
|
||||||
|
|
||||||
pnpm run back
|
Launch salix backend.
|
||||||
```
|
```
|
||||||
|
$ npm run db
|
||||||
|
$ npm run back
|
||||||
|
```
|
||||||
|
Launch project backend.
|
||||||
|
```
|
||||||
|
$ php -S 127.0.0.1:3001 -t . index.php
|
||||||
|
```
|
||||||
|
|
||||||
|
### Command line
|
||||||
|
|
||||||
Run server side method from command line.
|
Run server side method from command line.
|
||||||
|
|
||||||
```
|
```
|
||||||
php hedera-web.php -m method_path
|
$ php hedera-web.php -m method_path
|
||||||
```
|
```
|
||||||
|
|
||||||
## Built with
|
## Built with
|
||||||
|
|
||||||
- [Webpack](https://webpack.js.org/)
|
* [nodejs](https://nodejs.org/)
|
||||||
- [MooTools](https://mootools.net/)
|
* [php](https://www.php.net/)
|
||||||
- [TinyMCE](https://www.tinymce.com/)
|
* [Webpack](https://webpack.js.org/)
|
||||||
|
* [MooTools](https://mootools.net/)
|
||||||
|
* [TinyMCE](https://www.tinymce.com/)
|
||||||
|
|
|
@ -9,26 +9,14 @@
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
<VirtualHost *:80>
|
<VirtualHost *:80>
|
||||||
DocumentRoot /usr/share/hedera-web/spa
|
DocumentRoot /usr/share/hedera-web/
|
||||||
|
|
||||||
RewriteEngine On
|
|
||||||
RewriteCond %{QUERY_STRING} (^|&)srv=([^&]+) [OR]
|
|
||||||
RewriteCond %{REQUEST_METHOD} POST
|
|
||||||
RewriteRule ^/$ /usr/share/hedera-web/back/index.php [L]
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
<Directory /usr/share/hedera-web/back>
|
<Directory /usr/share/hedera-web/>
|
||||||
Options -Indexes -FollowSymLinks
|
Options -Indexes -FollowSymLinks
|
||||||
AllowOverride None
|
AllowOverride None
|
||||||
Require all granted
|
Require all granted
|
||||||
|
|
||||||
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
|
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
|
||||||
</Directory>
|
|
||||||
|
|
||||||
<Directory /usr/share/hedera-web/spa>
|
|
||||||
Options -FollowSymLinks
|
|
||||||
AllowOverride None
|
|
||||||
Require all granted
|
|
||||||
|
|
||||||
<FilesMatch "\.(css|js|json|yml|php|xml|html|svg)$">
|
<FilesMatch "\.(css|js|json|yml|php|xml|html|svg)$">
|
||||||
SetOutputFilter DEFLATE
|
SetOutputFilter DEFLATE
|
|
@ -0,0 +1,41 @@
|
||||||
|
__webpack_public_path__ = _PUBLIC_PATH;
|
||||||
|
|
||||||
|
import 'promise-polyfill/src/polyfill';
|
||||||
|
import 'hedera/hedera';
|
||||||
|
const locales = require('./import').locales;
|
||||||
|
const packageJson = require('./package.json');
|
||||||
|
|
||||||
|
window.onload = function() {
|
||||||
|
loadLocale(main);
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
Vn.setVersion(packageJson.version);
|
||||||
|
const hederaWeb = new Hedera.App();
|
||||||
|
window.hederaWeb = hederaWeb;
|
||||||
|
hederaWeb.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadLocale(callback) {
|
||||||
|
Vn.Locale.init();
|
||||||
|
var lang = Vn.Locale.language;
|
||||||
|
|
||||||
|
var req = require.context('js', true, /locale\/en.yml$/);
|
||||||
|
onLocaleLoad(Vn.Locale.fallbackLang, req);
|
||||||
|
|
||||||
|
const loadFn = locales[lang];
|
||||||
|
if (loadFn)
|
||||||
|
loadFn(function(req) {
|
||||||
|
onLocaleLoad(lang, req);
|
||||||
|
callback();
|
||||||
|
});
|
||||||
|
else
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLocaleLoad(lang, req) {
|
||||||
|
var keys = req.keys();
|
||||||
|
|
||||||
|
for (var i = 0; i < keys.length; i++)
|
||||||
|
Vn.Locale.add(req(keys[i]), lang);
|
||||||
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
/* eslint-disable */
|
|
||||||
|
|
||||||
module.exports = api => {
|
|
||||||
return {
|
|
||||||
presets: [
|
|
||||||
[
|
|
||||||
'@quasar/babel-preset-app',
|
|
||||||
api.caller(caller => caller && caller.target === 'node')
|
|
||||||
? { targets: { node: 'current' } }
|
|
||||||
: {}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"name": "hedera-web-back",
|
|
||||||
"version": "24.50.16",
|
|
||||||
"description": "Verdnatura web page backend",
|
|
||||||
"license": "GPL-3.0",
|
|
||||||
"author": "Verdnatura Levante SL"
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"InvalidAction": "Acció invàlida"
|
|
||||||
|
|
||||||
,"EmptyQuery": "Consulta buida"
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"InvalidAction": "Invalid action"
|
|
||||||
|
|
||||||
,"EmptyQuery": "Empty query"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"InvalidAction": "Acción inválida"
|
|
||||||
,"EmptyQuery": "Consulta vacía"
|
|
||||||
,"Invalid password": "Contraseña inválida"
|
|
||||||
,"Password does not meet requirements":
|
|
||||||
"La nueva contraseña no reune los requisitos de seguridad necesarios"
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"InvalidAction": "Action non valide"
|
|
||||||
|
|
||||||
,"EmptyQuery": "Requête vide"
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"InvalidAction": "Ação Inválida"
|
|
||||||
|
|
||||||
,"EmptyQuery": "Consulta vazía"
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
use Vn\Web\Security;
|
|
||||||
use Vn\Web\Util;
|
|
||||||
use Vn\Lib;
|
|
||||||
|
|
||||||
class Invoice extends Vn\Web\RestRequest {
|
|
||||||
const PARAMS = ['invoice'];
|
|
||||||
const SECURITY = Security::INVOKER;
|
|
||||||
|
|
||||||
function run($db) {
|
|
||||||
$pdfPath = $db->getValueFromFile(__DIR__ .'/invoice',
|
|
||||||
['invoice' =>(int) $_GET['invoice']]);
|
|
||||||
|
|
||||||
if (!$pdfPath)
|
|
||||||
throw new Lib\UserException(s('Invoice id not found'));
|
|
||||||
|
|
||||||
Util::printFile($pdfPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
SELECT CONCAT_WS('/', c.pdfsDir, vn.invoiceOut_getPath(#invoice))
|
|
||||||
FROM config c
|
|
||||||
JOIN myInvoice i
|
|
||||||
WHERE i.id = #invoice
|
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
"Cant lock cache": "The cache could not be blocked"
|
|
||||||
,"Bad file format": "Unrecognized file format"
|
|
||||||
,"File not choosed": "You have not selected any file"
|
|
||||||
,"Permission denied": "You are not allowed to upload the file"
|
|
||||||
,"File upload error": "Failed to upload the file, check that size is not too large"
|
|
||||||
,"File save error": "Failed to save the file: %s"
|
|
||||||
,"File size error": "The file must be no longer than %.2f MB"
|
|
||||||
,"Bad file name": "The file name must contain only lowercase letters, digits or the '_' character"
|
|
||||||
,"Bad collection name": "Invalid collection name"
|
|
||||||
,"Collection not exists": "Collection does not exist"
|
|
||||||
,"Unreferenced file": "The file is not referenced by the database"
|
|
||||||
,"Cannot update matching id": "Cannot update matching id"
|
|
||||||
,"Com error": "Error communicating with the server"
|
|
||||||
,"Image open error": "Error opening the image file"
|
|
||||||
,"Operation disabled": "Operation disabled for security"
|
|
||||||
,"Image added": "Image added correctly"
|
|
||||||
|
|
||||||
,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
|
|
||||||
,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
|
|
||||||
,"ErrPartial": "File was partially uploaded"
|
|
||||||
,"ErrNoFile": "No file was uploaded"
|
|
||||||
,"ErrNoTmpDir": "Missing a temporary folder"
|
|
||||||
,"ErrCantWrite": "Failed to write file to disk"
|
|
||||||
,"ErrExtension": "File upload stopped by extension"
|
|
||||||
,"ErrDefault": "Unknown upload error"
|
|
||||||
|
|
||||||
,"Sync complete": "Synchronization complete"
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
"Cant lock cache": "La caché no pudo ser bloqueada"
|
|
||||||
,"Bad file format": "Formato de archivo no reconocido"
|
|
||||||
,"File not choosed": "No has seleccionado ningún archivo"
|
|
||||||
,"Permission denied": "No tienes permiso para subir el fichero"
|
|
||||||
,"File upload error": "Error al subir el fichero, comprueba que su tamaño no sea demasiado grande"
|
|
||||||
,"File save error": "Error al guardar el fichero: %s"
|
|
||||||
,"File size error": "El fichero no debe ocupar más de %.2f MB"
|
|
||||||
,"Bad file name": "El nombre del archivo solo debe contener letras minúsculas, dígitos o el carácter '_'"
|
|
||||||
,"Bad collection name": "Nombre de colección no válido"
|
|
||||||
,"Collection not exists": "La colección no existe"
|
|
||||||
,"Unreferenced file": "El archivo no está referenciado por la base de datos"
|
|
||||||
,"Cannot update matching id": "No es posible actualizar los ítems con id coincidente"
|
|
||||||
,"Com error": "Error en la comunicación con el servidor"
|
|
||||||
,"Image open error": "Error al abrir el archivo de imagen"
|
|
||||||
,"Operation disabled": "Operación deshabilitada por seguridad"
|
|
||||||
,"Image added": "Imagen añadida correctamente"
|
|
||||||
|
|
||||||
,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
|
|
||||||
,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
|
|
||||||
,"ErrPartial": "File was partially uploaded"
|
|
||||||
,"ErrNoFile": "No file was uploaded"
|
|
||||||
,"ErrNoTmpDir": "Missing a temporary folder"
|
|
||||||
,"ErrCantWrite": "Failed to write file to disk"
|
|
||||||
,"ErrExtension": "File upload stopped by extension"
|
|
||||||
,"ErrDefault": "Unknown upload error"
|
|
||||||
|
|
||||||
,"Sync complete": "Sincronización completada"
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
{
|
|
||||||
"Cant lock cache": "O cache não pôde ser bloqueado"
|
|
||||||
,"Bad file format": "Formato de arquivo inválido"
|
|
||||||
,"File not choosed": "Não selecionastes nenhum arquivo"
|
|
||||||
,"Permission denied": "Não estas autorizado a subir o arquivo"
|
|
||||||
,"File upload error": "Erro ao subir o arquivo, verifique o tamanho"
|
|
||||||
,"File save error": "Erro ao salvar o arquivo: %s"
|
|
||||||
,"File size error": "O arquivo não deve ser maior que: %.2f MB"
|
|
||||||
,"Bad file name": "O nome do arquivo deve conter somente letras minusculas, numeros ou '_' "
|
|
||||||
,"Bad collection name": "Nome de coleção inválido"
|
|
||||||
,"Collection not exists": "Coleção não existe"
|
|
||||||
,"Unreferenced file": "O arquivo não é referenciado pelo banco de dados"
|
|
||||||
,"Cannot update matching id": "Não é possível atualizar os itens com id coincidente"
|
|
||||||
,"Com error": "Erro de comunicação com o servidor"
|
|
||||||
,"Image open error": "Erro ao abrir a imagem"
|
|
||||||
,"Operation disabled": "Operação desativada por segurança"
|
|
||||||
,"Image added": "Imagem adicionada corretamente"
|
|
||||||
|
|
||||||
,"ErrIniSize": "Arquivo supera o tamanho maximo de protocolo em php.ini"
|
|
||||||
,"ErrFormSize": "Arquivo supera o tamanho maximo de protocolo em HTML form"
|
|
||||||
,"ErrPartial": "Arquivo subido parcialmente"
|
|
||||||
,"ErrNoFile": "Nenhum arquivo subido"
|
|
||||||
,"ErrNoTmpDir": "Falta a pasta de arquivo temporal"
|
|
||||||
,"ErrCantWrite": "Erro ao gravar arquivo no disco"
|
|
||||||
,"ErrExtension": "Erro de extensão do arquivo"
|
|
||||||
,"ErrDefault": "Erro desconhecido ao subir arquivo"
|
|
||||||
|
|
||||||
,"Sync complete": "Sincronização completa"
|
|
||||||
}
|
|
|
@ -1,41 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ejemplo:
|
|
||||||
* <Cube><Cube time="2010-12-10"><Cube currency="USD" rate="1.3244"/>
|
|
||||||
*/
|
|
||||||
class ExchangeRate extends Vn\Lib\Method {
|
|
||||||
function run($db) {
|
|
||||||
$db->selectDb('vn2008');
|
|
||||||
|
|
||||||
// Indica la URL del archivo
|
|
||||||
|
|
||||||
$xml = new SimpleXMLElement(
|
|
||||||
'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml', 0, TRUE);
|
|
||||||
|
|
||||||
$date = $db->getValue("SELECT MAX(date) fecha FROM reference_rate");
|
|
||||||
$maxDate = $date ? DateTime::createFromFormat('Y-m-d', $date) : NULL;
|
|
||||||
|
|
||||||
foreach ($xml->Cube[0]->Cube as $cube) {
|
|
||||||
$xmlDate = new DateTime($cube['time']);
|
|
||||||
|
|
||||||
// Si existen datos más recientes de la máxima fecha los añade
|
|
||||||
|
|
||||||
if ($maxDate <= $xmlDate)
|
|
||||||
foreach ($cube->Cube as $subCube)
|
|
||||||
if ($subCube['currency'] == 'USD') {
|
|
||||||
$params = [
|
|
||||||
'date' => $xmlDate,
|
|
||||||
'rate' => $subCube['rate']
|
|
||||||
];
|
|
||||||
$db->query(
|
|
||||||
'REPLACE INTO reference_rate(moneda_id, date, rate)
|
|
||||||
VALUES(2, #date, #rate)',
|
|
||||||
$params
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$db->queryFromFile(__DIR__.'/exrate-add');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
INSERT INTO reference_rate (moneda_id, date, rate)
|
|
||||||
SELECT 2, TIMESTAMPADD (DAY, 1, r1.date), r1.rate
|
|
||||||
FROM reference_rate r1
|
|
||||||
LEFT JOIN reference_rate r2
|
|
||||||
ON TIMESTAMPADD(DAY, 1, r1.date) = r2.date
|
|
||||||
WHERE r2.date IS NULL AND r1.date < TIMESTAMPADD (DAY, -2, CURDATE())
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"An automated message could not be delivered": "Un mensaje automatizado no se ha podido entregar"
|
|
||||||
,"Notification from IT department about problem.": "Desde el departamento de informática te enviamos este correo porque ha habido un problema al intentar entregar un correo automatizado."
|
|
||||||
,"If you have questions, resend this email to cau@verdnatura.es.": "Si tienes dudas, reenvia este correo a cau@verdnatura.es."
|
|
||||||
,"The response from the remote server was:": "La respuesta del servidor remoto ha sido:"
|
|
||||||
}
|
|
|
@ -12,6 +12,8 @@
|
||||||
*
|
*
|
||||||
* - http://www.mydomain.org -> config.www.php
|
* - http://www.mydomain.org -> config.www.php
|
||||||
* - http://test.mydomain.org -> config.test.php
|
* - http://test.mydomain.org -> config.test.php
|
||||||
|
*
|
||||||
|
* Put the password in base64.
|
||||||
*/
|
*/
|
||||||
return [
|
return [
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +24,7 @@ return [
|
||||||
,'port' => 3306
|
,'port' => 3306
|
||||||
,'schema' => 'hedera'
|
,'schema' => 'hedera'
|
||||||
,'user' => 'hedera-web'
|
,'user' => 'hedera-web'
|
||||||
,'pass' => ''
|
,'pass' => '' // base64 encoded
|
||||||
,'tz' => 'Europe/madrid'
|
,'tz' => 'Europe/madrid'
|
||||||
]
|
]
|
||||||
];
|
];
|
|
@ -1,32 +0,0 @@
|
||||||
const { defineConfig } = require('cypress');
|
|
||||||
|
|
||||||
module.exports = defineConfig({
|
|
||||||
e2e: {
|
|
||||||
baseUrl: 'http://localhost:8080/',
|
|
||||||
supportFile: 'src/test/cypress/support/index.js',
|
|
||||||
fixturesFolder: 'src/test/cypress/fixtures',
|
|
||||||
specPattern: 'src/test/cypress/integration/**/*.spec.js',
|
|
||||||
viewportHeight: 660,
|
|
||||||
viewportWidth: 1240,
|
|
||||||
experimentalMemoryManagement: true,
|
|
||||||
numTestsKeptInMemory: 0,
|
|
||||||
video: false,
|
|
||||||
screenshotOnRunFailure: false,
|
|
||||||
reporter: 'cypress-mochawesome-reporter',
|
|
||||||
reporterOptions: {
|
|
||||||
charts: true,
|
|
||||||
reportPageTitle: 'Hedera-Web E2E Reporter',
|
|
||||||
embeddedScreenshots: true,
|
|
||||||
reportDir: 'src/test/cypress/reports',
|
|
||||||
inlineAssets: true
|
|
||||||
},
|
|
||||||
setupNodeEvents (on, config) {
|
|
||||||
require('cypress-mochawesome-reporter/plugin')(on);
|
|
||||||
on('after:spec', (spec, results) => {
|
|
||||||
console.log('Finished running', spec.relative);
|
|
||||||
console.log('❌spec:', results.stats.failures);
|
|
||||||
console.log('✅spec:', results.stats.passes);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (24.50.16) stable; urgency=low
|
hedera-web (25.4.4) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ Vcs-Git: https://gitea.verdnatura.es/verdnatura/hedera-web
|
||||||
Package: hedera-web
|
Package: hedera-web
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear
|
Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear
|
||||||
Suggests: php-text-captcha, php-zip, cron
|
Suggests: php-image-text, php-text-captcha, php-zip, cron
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Description: Verdnatura's web page
|
Description: Verdnatura's web page
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
MAILTO=webmaster
|
MAILTO=webmaster
|
||||||
*/1 * * * * root hedera-web.php -m misc/mail
|
*/1 * * * * root hedera-web.php -m misc/mail
|
||||||
*/4 * * * * root hedera-web.php -m tpv/confirm-mail
|
|
||||||
*/2 * * * * root hedera-web.php -m edi/load
|
*/2 * * * * root hedera-web.php -m edi/load
|
||||||
0 23 * * * root hedera-web.php -m edi/clean
|
0 23 * * * root hedera-web.php -m edi/clean
|
||||||
0 5 * * * root hedera-web.php -m edi/update
|
0 5 * * * root hedera-web.php -m edi/update
|
||||||
0 5 * * * root hedera-web.php -m misc/exchange-rate
|
|
||||||
0 0 * * * root hedera-web.php -m image/sync
|
0 0 * * * root hedera-web.php -m image/sync
|
||||||
0 1 * * * root /usr/share/hedera-web/utils/image-clean.sh > /dev/null
|
0 1 * * * root /usr/share/hedera-web/utils/image-clean.sh > /dev/null
|
||||||
0 */1 * * * root /usr/share/hedera-web/utils/update-browscap.sh > /dev/null
|
0 */1 * * * root /usr/share/hedera-web/utils/update-browscap.sh > /dev/null
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
back/apache.conf etc/hedera-web
|
apache.conf etc/hedera-web
|
||||||
back/config.php etc/hedera-web
|
config.php etc/hedera-web
|
||||||
back/php.ini etc/hedera-web
|
php.ini etc/hedera-web
|
||||||
back/web usr/share/php/vn
|
web usr/share/php/vn
|
||||||
back/index.php usr/share/hedera-web/back
|
doc/* usr/share/doc/hedera-web
|
||||||
back/hedera-web.php usr/share/hedera-web/back
|
hedera-web.php usr/share/hedera-web
|
||||||
back/rest usr/share/hedera-web/back
|
forms usr/share/hedera-web
|
||||||
back/package.json usr/share/hedera-web/back
|
image usr/share/hedera-web
|
||||||
dist/spa/* usr/share/hedera-web/spa
|
js usr/share/hedera-web
|
||||||
build-deps/node_modules usr/share/hedera-web/spa
|
pages usr/share/hedera-web
|
||||||
back/utils usr/share/hedera-web
|
reports usr/share/hedera-web
|
||||||
|
rest usr/share/hedera-web
|
||||||
|
utils usr/share/hedera-web
|
||||||
|
index.php usr/share/hedera-web
|
||||||
|
package.json usr/share/hedera-web
|
||||||
|
build usr/share/hedera-web
|
||||||
README.md usr/share/hedera-web
|
README.md usr/share/hedera-web
|
||||||
|
webpack.config.json usr/share/hedera-web
|
||||||
|
build-deps/node_modules usr/share/hedera-web
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
usr/share/hedera-web/back/hedera-web.php usr/bin/hedera-web.php
|
usr/share/hedera-web/hedera-web.php usr/bin/hedera-web.php
|
||||||
etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf
|
etc/hedera-web/apache.conf etc/apache2/conf-available/hedera-web.conf
|
||||||
etc/hedera-web/php.ini etc/php/7.0/apache2/conf.d/99-hedera-web.ini
|
etc/hedera-web/php.ini etc/php/8.2/apache2/conf.d/99-hedera-web.ini
|
|
@ -10,9 +10,9 @@ clean:
|
||||||
dh_clean $@
|
dh_clean $@
|
||||||
|
|
||||||
build:
|
build:
|
||||||
pnpm install --prefer-offline
|
npm install --no-audit --prefer-offline
|
||||||
pnpm exec quasar build
|
npm --omit=dev run build
|
||||||
|
|
||||||
mkdir -p build-deps
|
mkdir -p build-deps
|
||||||
cp package.json build-deps
|
cp package.json package-lock.json build-deps
|
||||||
(cd build-deps && npm install --omit=dev --no-audit --prefer-offline)
|
(cd build-deps && npm install --omit=dev --no-audit --prefer-offline)
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__.'/../../php-vn-lib/env.php';
|
require_once __DIR__.'/../php-vn-lib/env.php';
|
||||||
|
|
||||||
set_include_path(__DIR__.PATH_SEPARATOR.get_include_path());
|
set_include_path(__DIR__.PATH_SEPARATOR.get_include_path());
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml')
|
||||||
|
|
||||||
|
,activate() {
|
||||||
|
this.$.userModel.setInfo('c', 'myClient', 'hedera');
|
||||||
|
this.$.addresses.setInfo('a', 'myAddress', 'hedera');
|
||||||
|
}
|
||||||
|
|
||||||
|
,onAddAddressClick() {
|
||||||
|
this.hash.setAll({
|
||||||
|
form: 'account/address',
|
||||||
|
address: 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
,onReturnClick() {
|
||||||
|
window.history.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
,onSetDefaultClick(event, addressId) {
|
||||||
|
if (event.defaultPrevented) return;
|
||||||
|
this.$.defaultAddress.value = addressId;
|
||||||
|
Htk.Toast.showMessage(_('DefaultAddressModified'));
|
||||||
|
}
|
||||||
|
|
||||||
|
,async onRemoveAddressClick(form) {
|
||||||
|
if (confirm(_('AreYouSureDeleteAddress'))) {
|
||||||
|
await form.set('isActive', false);
|
||||||
|
await form.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
,onEditAddressClick(address) {
|
||||||
|
this.hash.setAll({
|
||||||
|
form: 'account/address',
|
||||||
|
address
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
Addresses: Adreces
|
||||||
|
Return: Tornar
|
||||||
|
AddAddress: Afegir adreça
|
||||||
|
SetAsDefault: Establir com per defecte
|
||||||
|
RemoveAddress: Esborrar direcció
|
||||||
|
EditAddress: Modificar direcció
|
||||||
|
AreYouSureDeleteAddress: Estàs segur de que vols eliminar la direcció?
|
||||||
|
DefaultAddressModified: Adreça per defecte modificada
|
|
@ -0,0 +1,8 @@
|
||||||
|
Addresses: Addresses
|
||||||
|
Return: Return
|
||||||
|
AddAddress: Add address
|
||||||
|
SetAsDefault: Set as default
|
||||||
|
RemoveAddress: Remove address
|
||||||
|
EditAddress: Edit address
|
||||||
|
AreYouSureDeleteAddress: Are you sure you want to delete the address?
|
||||||
|
DefaultAddressModified: Default address modified
|
|
@ -0,0 +1,8 @@
|
||||||
|
Addresses: Direcciones
|
||||||
|
Return: Volver
|
||||||
|
AddAddress: Añadir dirección
|
||||||
|
SetAsDefault: Establecer como predeterminada
|
||||||
|
RemoveAddress: Borrar dirección
|
||||||
|
EditAddress: Modificar dirección
|
||||||
|
AreYouSureDeleteAddress: ¿Estás seguro de que quieres borrar la dirección?
|
||||||
|
DefaultAddressModified: Dirección por defecto modificada
|
|
@ -0,0 +1,8 @@
|
||||||
|
Addresses: Adresses
|
||||||
|
Return: Retour
|
||||||
|
AddAddress: Ajouter une adresse
|
||||||
|
SetAsDefault: Définir par défaut
|
||||||
|
RemoveAddress: Supprimer l'adresse
|
||||||
|
EditAddress: Changement d'adresse
|
||||||
|
AreYouSureDeleteAddress: Souhaitez-vous vraiment supprier l'adresse?
|
||||||
|
DefaultAddressModified: Adresse par défaut modifiée
|
|
@ -0,0 +1,8 @@
|
||||||
|
Addresses: Moradas
|
||||||
|
Return: Voltar
|
||||||
|
AddAddress: Adicionar Morada
|
||||||
|
SetAsDefault: Selecionar como pre-determinado
|
||||||
|
RemoveAddress: Eliminar Morada
|
||||||
|
EditAddress: Modificar Morada
|
||||||
|
AreYouSureDeleteAddress: Tens certeza que queres eliminar esta morada?
|
||||||
|
DefaultAddressModified: Endereço padrão modificado
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
hedera-address-list {
|
||||||
|
.htk-list .side {
|
||||||
|
padding-right: 16px;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
<vn>
|
||||||
|
<vn-group>
|
||||||
|
<db-form id="user-form">
|
||||||
|
<db-model property="model" id="user-model" updatable="true">
|
||||||
|
SELECT id, defaultAddressFk
|
||||||
|
FROM myClient c
|
||||||
|
</db-model>
|
||||||
|
</db-form>
|
||||||
|
<db-model id="addresses" updatable="true">
|
||||||
|
SELECT a.id, a.nickname, p.name province, a.postalCode,
|
||||||
|
a.city, a.street, a.isActive
|
||||||
|
FROM myAddress a
|
||||||
|
LEFT JOIN vn.province p ON p.id = a.provinceFk
|
||||||
|
WHERE a.isActive
|
||||||
|
</db-model>
|
||||||
|
</vn-group>
|
||||||
|
<div id="title">
|
||||||
|
<h1><t>Addresses</t></h1>
|
||||||
|
</div>
|
||||||
|
<div id="actions">
|
||||||
|
<htk-bar-button
|
||||||
|
icon="add"
|
||||||
|
tip="_AddAddress"
|
||||||
|
on-click="this.onAddAddressClick()"/>
|
||||||
|
</div>
|
||||||
|
<div id="form" class="hedera-address-list">
|
||||||
|
<div class="box vn-w-sm">
|
||||||
|
<htk-radio-group
|
||||||
|
id="default-address"
|
||||||
|
column="defaultAddressFk"
|
||||||
|
form="user-form"/>
|
||||||
|
<htk-repeater model="addresses" form-id="address" class="htk-list">
|
||||||
|
<custom>
|
||||||
|
<div class="item clickable" on-click="this.onSetDefaultClick($event, address.id)">
|
||||||
|
<div class="side">
|
||||||
|
<htk-radio
|
||||||
|
radio-group="default-address"
|
||||||
|
val="{{address.id}}"
|
||||||
|
tip="_SetAsDefault"
|
||||||
|
name="test"/>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<p class="important">
|
||||||
|
{{address.nickname}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{address.street}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{address.postalCode}}, {{address.city}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="actions"
|
||||||
|
on-click="$event.preventDefault()">
|
||||||
|
<htk-button
|
||||||
|
icon="delete"
|
||||||
|
tip="_RemoveAddress"
|
||||||
|
on-click="this.onRemoveAddressClick($iter)"/>
|
||||||
|
<htk-button
|
||||||
|
icon="edit"
|
||||||
|
tip="_EditAddress"
|
||||||
|
on-click="this.onEditAddressClick(address.id)"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</custom>
|
||||||
|
</htk-repeater>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</vn>
|
|
@ -0,0 +1,20 @@
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml'),
|
||||||
|
|
||||||
|
activate() {
|
||||||
|
this.$.model.setInfo('a', 'myAddress', 'hedera', ['id'], 'id');
|
||||||
|
this.$.model.setDefault('clientFk', 'a',
|
||||||
|
new Sql.Function({schema: 'account', name: 'myUser_getId'}));
|
||||||
|
},
|
||||||
|
|
||||||
|
onStatusChange() {
|
||||||
|
if (this.$.iter.ready && this.hash.$.address == 0)
|
||||||
|
this.$.iter.insertRow();
|
||||||
|
},
|
||||||
|
|
||||||
|
onOperationsDone() {
|
||||||
|
Htk.Toast.showMessage(_('AddressChangedSuccessfully'));
|
||||||
|
window.history.back()
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,10 @@
|
||||||
|
AddEditAddress: Afegir o modificar adreça
|
||||||
|
Name: Consignatari
|
||||||
|
Address: Direcció
|
||||||
|
City: Ciutat
|
||||||
|
ZipCode: Codi postal
|
||||||
|
Country: País
|
||||||
|
Province: Província
|
||||||
|
Return: Tornar
|
||||||
|
Accept: Acceptar
|
||||||
|
AddressChangedSuccessfully: Adreça modificada correctament
|
|
@ -0,0 +1,10 @@
|
||||||
|
AddEditAddress: Add or edit address
|
||||||
|
Name: Consignee
|
||||||
|
Address: Address
|
||||||
|
City: City
|
||||||
|
ZipCode: Zip code
|
||||||
|
Country: Country
|
||||||
|
Province: Province
|
||||||
|
Return: Return
|
||||||
|
Accept: Accept
|
||||||
|
AddressChangedSuccessfully: Address changed successfully
|
|
@ -0,0 +1,10 @@
|
||||||
|
AddEditAddress: Añadir o modificar dirección
|
||||||
|
Name: Consignatario
|
||||||
|
Address: Dirección
|
||||||
|
City: Ciudad
|
||||||
|
ZipCode: Código postal
|
||||||
|
Country: País
|
||||||
|
Province: Provincia
|
||||||
|
Return: Volver
|
||||||
|
Accept: Aceptar
|
||||||
|
AddressChangedSuccessfully: Dirección modificada correctamente
|
|
@ -0,0 +1,10 @@
|
||||||
|
AddEditAddress: Ajouter ou modifier l'adresse
|
||||||
|
Name: Destinataire
|
||||||
|
Address: Numéro Rue
|
||||||
|
City: Ville
|
||||||
|
ZipCode: Code postal
|
||||||
|
Country: Pays
|
||||||
|
Province: Province
|
||||||
|
Return: Reviens
|
||||||
|
Accept: Accepter
|
||||||
|
AddressChangedSuccessfully: Adresse modifié avec succès
|
|
@ -0,0 +1,10 @@
|
||||||
|
AddEditAddress: Adicionar ou modificar morada
|
||||||
|
Name: Consignatario
|
||||||
|
Address: Morada
|
||||||
|
City: Concelho
|
||||||
|
ZipCode: Código postal
|
||||||
|
Country: País
|
||||||
|
Province: Distrito
|
||||||
|
Return: Voltar
|
||||||
|
Accept: Aceitar
|
||||||
|
AddressChangedSuccessfully: Morada modificada corretamente
|
|
@ -0,0 +1,87 @@
|
||||||
|
<vn>
|
||||||
|
<vn-group>
|
||||||
|
<vn-lot-query id="params">
|
||||||
|
<vn-spec name="address" type="Number"/>
|
||||||
|
</vn-lot-query>
|
||||||
|
<db-form id="iter" on-status-changed="this.onStatusChange()">
|
||||||
|
<db-model
|
||||||
|
id="model"
|
||||||
|
property="model"
|
||||||
|
updatable="true"
|
||||||
|
mode="ON_DEMAND"
|
||||||
|
lot="params"
|
||||||
|
on-operations-done="this.onOperationsDone()">
|
||||||
|
SELECT a.id, a.street, a.nickname, a.city,
|
||||||
|
a.postalCode, a.provinceFk, p.countryFk
|
||||||
|
FROM myAddress a
|
||||||
|
LEFT JOIN vn.province p ON p.id = a.provinceFk
|
||||||
|
WHERE a.id = #address
|
||||||
|
</db-model>
|
||||||
|
</db-form>
|
||||||
|
</vn-group>
|
||||||
|
<div id="title">
|
||||||
|
<h1><t>Configuration</t></h1>
|
||||||
|
</div>
|
||||||
|
<div id="actions">
|
||||||
|
<htk-bar-button
|
||||||
|
icon="close"
|
||||||
|
tip="_Return"
|
||||||
|
on-click="window.history.back()"/>
|
||||||
|
<htk-bar-button
|
||||||
|
icon="check"
|
||||||
|
tip="_Accept"
|
||||||
|
on-click="iter.performOperations()"/>
|
||||||
|
</div>
|
||||||
|
<div id="form" class="hedera-address">
|
||||||
|
<div class="form box vn-w-sm vn-pa-lg">
|
||||||
|
<h5 class="vn-mb-md">
|
||||||
|
<t>AddEditAddress</t>
|
||||||
|
</h5>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-entry
|
||||||
|
placeholder="_Name"
|
||||||
|
form="iter" column="nickname"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-entry
|
||||||
|
placeholder="_Address"
|
||||||
|
form="iter" column="street"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-entry
|
||||||
|
placeholder="_City"
|
||||||
|
form="iter" column="city"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-entry
|
||||||
|
placeholder="_ZipCode"
|
||||||
|
form="iter" column="postalCode"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-combo
|
||||||
|
placeholder="_Country"
|
||||||
|
form="iter" column="countryFk"
|
||||||
|
id="country"
|
||||||
|
one-way="true"
|
||||||
|
one-time="true">
|
||||||
|
<db-model property="model">
|
||||||
|
SELECT id, name FROM vn.country
|
||||||
|
ORDER BY name
|
||||||
|
</db-model>
|
||||||
|
</htk-combo>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-combo
|
||||||
|
placeholder="_Province"
|
||||||
|
column="provinceFk"
|
||||||
|
form="iter">
|
||||||
|
<db-model property="model" lot="country">
|
||||||
|
SELECT id, name FROM vn.province
|
||||||
|
WHERE countryFk = #id
|
||||||
|
ORDER BY name
|
||||||
|
</db-model>
|
||||||
|
</htk-combo>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</vn>
|
|
@ -0,0 +1,13 @@
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml'),
|
||||||
|
|
||||||
|
activate() {
|
||||||
|
this.$.userModel.setInfo('c', 'myClient', 'hedera');
|
||||||
|
this.$.userModel.setInfo('u', 'myUser', 'account');
|
||||||
|
this.$.changePassword.conn = this.conn
|
||||||
|
this.$.changePassword.user = this.gui.user
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,26 @@
|
||||||
|
Configuration: Configuració
|
||||||
|
Personal information: Dades personals
|
||||||
|
Username: Nom d'usuari
|
||||||
|
Password: Contrasenya
|
||||||
|
Email: Correu electrònic
|
||||||
|
Display name: Nom a mostrar
|
||||||
|
Language: Idioma
|
||||||
|
Billing: Facturació
|
||||||
|
Receive invoices by email: Rebre factures per correu electrònic
|
||||||
|
Old password: Contrasenya antiga
|
||||||
|
New password: Nova contrasenya
|
||||||
|
Repeat password: Repetir contrasenya
|
||||||
|
Requirements: Requisits
|
||||||
|
Modify: Modificar
|
||||||
|
Password requirements: Requisits de contrasenya
|
||||||
|
characters long: caràcters de longitud
|
||||||
|
alphabetic characters: caràcters alfabètics
|
||||||
|
capital letters: majúscules
|
||||||
|
digits: dígits
|
||||||
|
symbols: símbols
|
||||||
|
Password changed!: Contrasenya modificada!
|
||||||
|
Password doesn't meet the requirements: ''
|
||||||
|
Passwords doesn't match: Les contrasenyes no coincideixen!
|
||||||
|
Passwords empty: Les contrasenyes en blanc
|
||||||
|
Addresses: Adreces
|
||||||
|
Change password: Canvia la contrasenya
|
|
@ -0,0 +1,26 @@
|
||||||
|
Configuration: Configuration
|
||||||
|
Personal information: Personal information
|
||||||
|
Username: Username
|
||||||
|
Password: Password
|
||||||
|
Email: Email
|
||||||
|
Display name: Display name
|
||||||
|
Language: Language
|
||||||
|
Billing: Billing
|
||||||
|
Receive invoices by email: Receive invoices by email
|
||||||
|
Old password: Old password
|
||||||
|
New password: New password
|
||||||
|
Repeat password: Repeat password
|
||||||
|
Requirements: Requirements
|
||||||
|
Modify: Modify
|
||||||
|
Password requirements: Password requirements
|
||||||
|
characters long: characters long
|
||||||
|
alphabetic characters: alphabetic characters
|
||||||
|
capital letters: capital letters
|
||||||
|
digits: digits
|
||||||
|
symbols: 'symbols. Ej: $%&.'
|
||||||
|
Password changed!: Password changed!
|
||||||
|
Password doesn't meet the requirements: 'Password doesn''t meet the requirements, press info button for more details'
|
||||||
|
Passwords doesn't match: Passwords doesn't match
|
||||||
|
Passwords empty: Passwords empty
|
||||||
|
Addresses: Addresses
|
||||||
|
Change password: Change password
|
|
@ -0,0 +1,28 @@
|
||||||
|
Configuration: Configuración
|
||||||
|
Personal information: Datos personales
|
||||||
|
Username: Nombre de usuario
|
||||||
|
Password: Contraseña
|
||||||
|
Email: Correo electrónico
|
||||||
|
Display name: Nombre a mostrar
|
||||||
|
Language: Idioma
|
||||||
|
Billing: Facturación
|
||||||
|
Receive invoices by email: Recibir facturas por correo electrónico
|
||||||
|
Old password: Contaseña antigua
|
||||||
|
New password: Nueva contraseña
|
||||||
|
Repeat password: Repetir contraseña
|
||||||
|
Requirements: Requisitos
|
||||||
|
Modify: Modificar
|
||||||
|
Password requirements: Requisitos de constraseña
|
||||||
|
characters long: carácteres de longitud
|
||||||
|
alphabetic characters: carácteres alfabéticos
|
||||||
|
capital letters: letras mayúsculas
|
||||||
|
digits: dígitos
|
||||||
|
symbols: 'símbolos. Ej: $%&.'
|
||||||
|
Password changed!: ¡Contraseña modificada!
|
||||||
|
Password doesn't meet the requirements: >-
|
||||||
|
La nueva contraseña no reune los requisitos de seguridad necesarios, pulsa en
|
||||||
|
info para más detalle
|
||||||
|
Passwords doesn't match: ¡Las contraseñas no coinciden!
|
||||||
|
Passwords empty: Contraseña vacía
|
||||||
|
Addresses: Direcciones
|
||||||
|
Change password: Cambiar contraseña
|
|
@ -0,0 +1,26 @@
|
||||||
|
Configuration: Configuration
|
||||||
|
Personal information: Informations personnelles
|
||||||
|
Username: Utilisateur
|
||||||
|
Password: Mot de passe
|
||||||
|
Email: Courriel
|
||||||
|
Display name: Nom à afficher
|
||||||
|
Language: Langage
|
||||||
|
Billing: Facturation
|
||||||
|
Receive invoices by email: Recevoir des factures par e-mail
|
||||||
|
Old password: Ancien mot de passe
|
||||||
|
New password: Nouveau mot de passe
|
||||||
|
Repeat password: Répéter le mot de passe
|
||||||
|
Requirements: Exigences
|
||||||
|
Modify: Modifier
|
||||||
|
Password requirements: Mot de passe exigences
|
||||||
|
characters long: Longs caractères
|
||||||
|
alphabetic characters: les caractères alphabétiques
|
||||||
|
capital letters: lettres majuscules
|
||||||
|
digits: chiffres
|
||||||
|
symbols: 'symboles. Ej: $%&.'
|
||||||
|
Password changed!: Mot de passe modifié!
|
||||||
|
Password doesn't meet the requirements: ''
|
||||||
|
Passwords doesn't match: Les mots de passe ne correspondent pas!
|
||||||
|
Passwords empty: ''
|
||||||
|
Addresses: Adresses
|
||||||
|
Change password: Changer le mot de passe
|
|
@ -0,0 +1,26 @@
|
||||||
|
Configuration: Configuração
|
||||||
|
Personal information: Dados pessoais
|
||||||
|
Username: Nome de usuario
|
||||||
|
Password: Palavra-passe
|
||||||
|
Email: E-Mail
|
||||||
|
Display name: Nome para mostrar
|
||||||
|
Language: Idioma
|
||||||
|
Billing: Facturação
|
||||||
|
Receive invoices by email: Receber facturas por e-mail
|
||||||
|
Old password: Palavra-passe antiga
|
||||||
|
New password: Nova Palavra-passe
|
||||||
|
Repeat password: Repetir Palavra-passe
|
||||||
|
Requirements: Requisitos
|
||||||
|
Modify: Modificar
|
||||||
|
Password requirements: Requisitos de Palavra-passe
|
||||||
|
characters long: caracteres
|
||||||
|
alphabetic characters: caracteres alfabéticos
|
||||||
|
capital letters: letras maiúsculas
|
||||||
|
digits: dígitos
|
||||||
|
symbols: 'símbolos. Ej: $%&.'
|
||||||
|
Password changed!: Palavra-passe Modificada!
|
||||||
|
Password doesn't meet the requirements: Palavra-passe não atende aos requisitos
|
||||||
|
Passwords doesn't match: As Palavras-Passe não coincidem!
|
||||||
|
Passwords empty: Palavra-passe vazia
|
||||||
|
Addresses: Moradas
|
||||||
|
Change password: Mudar Palavra-passe
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
.pass-info ul {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
<vn>
|
||||||
|
<vn-group>
|
||||||
|
<db-form id="user-form">
|
||||||
|
<db-model property="model" id="user-model" updatable="true">
|
||||||
|
SELECT u.id, u.name, u.email, u.nickname,
|
||||||
|
u.lang, c.isToBeMailed, c.id clientFk
|
||||||
|
FROM account.myUser u
|
||||||
|
LEFT JOIN myClient c
|
||||||
|
ON u.id = c.id
|
||||||
|
</db-model>
|
||||||
|
</db-form>
|
||||||
|
</vn-group>
|
||||||
|
<div id="title">
|
||||||
|
<h1><t>Configuration</t></h1>
|
||||||
|
</div>
|
||||||
|
<div id="actions">
|
||||||
|
<htk-bar-button
|
||||||
|
icon="place"
|
||||||
|
tip="_Addresses"
|
||||||
|
on-click="hash.setAll({form: 'account/address-list'})"/>
|
||||||
|
<htk-bar-button
|
||||||
|
icon="lock_reset"
|
||||||
|
tip="_Change password"
|
||||||
|
on-click="this.$.changePassword.open()"/>
|
||||||
|
</div>
|
||||||
|
<div id="form" class="conf">
|
||||||
|
<div class="form box vn-w-sm vn-pa-lg">
|
||||||
|
<h5 class="vn-mb-md">
|
||||||
|
<t>Personal information</t>
|
||||||
|
</h5>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-entry
|
||||||
|
placeholder="_Username"
|
||||||
|
disabled="true"
|
||||||
|
form="user-form"
|
||||||
|
column="name"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-entry
|
||||||
|
placeholder="_Email"
|
||||||
|
form="user-form"
|
||||||
|
column="email">
|
||||||
|
</htk-entry>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-entry
|
||||||
|
placeholder="_Display name"
|
||||||
|
form="user-form"
|
||||||
|
column="nickname"/>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<htk-combo
|
||||||
|
placeholder="_Language"
|
||||||
|
form="user-form"
|
||||||
|
column="lang">
|
||||||
|
<db-model property="model">
|
||||||
|
<custom>
|
||||||
|
SELECT code, name FROM language WHERE isActive
|
||||||
|
</custom>
|
||||||
|
</db-model>
|
||||||
|
</htk-combo>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label>
|
||||||
|
<htk-check form="user-form" column="isToBeMailed"/>
|
||||||
|
<t>Receive invoices by email</t>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<htk-change-password id="change-password"/>
|
||||||
|
</vn>
|
|
@ -0,0 +1,7 @@
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml')
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
AccessLog: Registre d'accessos
|
||||||
|
'UserNumber:': 'N d''usuari:'
|
||||||
|
'User:': 'Usuari:'
|
||||||
|
'Phone:': 'Telèfon:'
|
||||||
|
'Mobile:': 'Mòbil:'
|
||||||
|
Access: Accés
|
||||||
|
OS: SO
|
||||||
|
Browser: Navegador
|
||||||
|
Version: Versió
|
||||||
|
Javascript: Javascript
|
||||||
|
Cookies: Cookies
|
|
@ -0,0 +1,11 @@
|
||||||
|
AccessLog: Access log
|
||||||
|
'UserNumber:': 'User Number:'
|
||||||
|
'User:': 'User:'
|
||||||
|
'Phone:': 'Phone:'
|
||||||
|
'Mobile:': 'Mobile:'
|
||||||
|
Access: Access
|
||||||
|
OS: OS
|
||||||
|
Browser: Browser
|
||||||
|
Version: Version
|
||||||
|
Javascript: Javascript
|
||||||
|
Cookies: Cookies
|
|
@ -0,0 +1,11 @@
|
||||||
|
AccessLog: Registro de accesos
|
||||||
|
'UserNumber:': 'Nº usuario:'
|
||||||
|
'User:': 'Usuario:'
|
||||||
|
'Phone:': 'Teléfono:'
|
||||||
|
'Mobile:': 'Móvil:'
|
||||||
|
Access: Acceso
|
||||||
|
OS: SO
|
||||||
|
Browser: Navegador
|
||||||
|
Version: Versión
|
||||||
|
Javascript: Javascript
|
||||||
|
Cookies: Cookies
|
|
@ -0,0 +1,11 @@
|
||||||
|
AccessLog: Fiche d'accès
|
||||||
|
'UserNumber:': 'Numéro utilisateur:'
|
||||||
|
'User:': 'Utilisateur:'
|
||||||
|
'Phone:': 'Téléphone:'
|
||||||
|
'Mobile:': 'Portable:'
|
||||||
|
Access: Accès
|
||||||
|
OS: OS
|
||||||
|
Browser: Navigateur
|
||||||
|
Version: Version
|
||||||
|
Javascript: Javascript
|
||||||
|
Cookies: Cookies
|
|
@ -0,0 +1,11 @@
|
||||||
|
AccessLog: Registro de acessos
|
||||||
|
'UserNumber:': 'Nº utilizador:'
|
||||||
|
'User:': 'Utilizador:'
|
||||||
|
'Phone:': 'Telefone:'
|
||||||
|
'Mobile:': 'Telemóvel:'
|
||||||
|
Access: Acceso
|
||||||
|
OS: OS
|
||||||
|
Browser: Navegador
|
||||||
|
Version: Versão
|
||||||
|
Javascript: Javascript
|
||||||
|
Cookies: Cookies
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
.access-log .form > p {
|
||||||
|
font-size: 1.2rem;
|
||||||
|
margin: .1em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* List */
|
||||||
|
|
||||||
|
.access-log .htk-list {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
<vn>
|
||||||
|
<vn-group>
|
||||||
|
<db-form v-model="user">
|
||||||
|
<db-model property="model" lot="hash">
|
||||||
|
SELECT u.id, u.name user, u.nickname, u.email, c.phone, r.name role
|
||||||
|
FROM account.user u
|
||||||
|
JOIN account.role r ON r.id = u.role
|
||||||
|
LEFT JOIN vn.client c ON c.id = u.id
|
||||||
|
WHERE u.id = #user
|
||||||
|
</db-model>
|
||||||
|
</db-form>
|
||||||
|
</vn-group>
|
||||||
|
<div id="title">
|
||||||
|
<h1><t>AccessLog</t></h1>
|
||||||
|
</div>
|
||||||
|
<div id="form" class="access-log">
|
||||||
|
<div class="box vn-w-xs vn-pa-lg">
|
||||||
|
<div class="form">
|
||||||
|
<h4>{{user.nickname}}</h4>
|
||||||
|
<p>#{{user.id}} - {{user.user}}</p>
|
||||||
|
<p>{{user.role}}</p>
|
||||||
|
<p>{{user.email}}</p>
|
||||||
|
<p>{{user.phone}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<htk-repeater form-id="iter" class="box vn-w-xs htk-list vn-mt-md">
|
||||||
|
<db-model property="model" lot="hash">
|
||||||
|
SELECT u.stamp, a.platform, a.browser, a.version, a.javascript, a.cookies
|
||||||
|
FROM visitUser u
|
||||||
|
JOIN visitAccess c ON c.id = u.accessFk
|
||||||
|
JOIN visitAgent a ON a.id = c.agentFk
|
||||||
|
WHERE u.userFk = #user
|
||||||
|
ORDER BY u.stamp DESC
|
||||||
|
LIMIT 8
|
||||||
|
</db-model>
|
||||||
|
<custom>
|
||||||
|
<div class="item">
|
||||||
|
<div class="content">
|
||||||
|
<p>
|
||||||
|
{{Vn.Value.format(iter.stamp, _('%a, %e %b %Y at %T'))}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{iter.platform}} - {{iter.browser}} {{iter.version}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</custom>
|
||||||
|
</htk-repeater>
|
||||||
|
</div>
|
||||||
|
</vn>
|
|
@ -0,0 +1,33 @@
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml')
|
||||||
|
|
||||||
|
,_timeoutId: null
|
||||||
|
|
||||||
|
,onModelStatusChange() {
|
||||||
|
if (!this.$.sessions.ready)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (this._timeoutId)
|
||||||
|
clearTimeout(this._timeoutId);
|
||||||
|
|
||||||
|
this._timeoutId = setTimeout(
|
||||||
|
() => this.$.sessions.refresh(), 60000);
|
||||||
|
}
|
||||||
|
|
||||||
|
,deactivate() {
|
||||||
|
clearTimeout(this._timeoutId);
|
||||||
|
}
|
||||||
|
|
||||||
|
,async onChangeUserClick(userName) {
|
||||||
|
await this.gui.supplantUser(userName);
|
||||||
|
this.hash.setAll({form: 'ecomerce/orders'});
|
||||||
|
}
|
||||||
|
|
||||||
|
,sessionsFunc() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Connections: Connexions
|
||||||
|
Refresh: Actualitzar
|
||||||
|
Visits: Visites
|
||||||
|
connections: connexions
|
|
@ -0,0 +1,4 @@
|
||||||
|
Connections: Connections
|
||||||
|
Refresh: Refresh
|
||||||
|
Visits: Visits
|
||||||
|
connections: connections
|
|
@ -0,0 +1,4 @@
|
||||||
|
Connections: Conexiones
|
||||||
|
Refresh: Actualizar
|
||||||
|
Visits: Visitas
|
||||||
|
connections: conexiones
|
|
@ -0,0 +1,4 @@
|
||||||
|
Connections: Connexions
|
||||||
|
Refresh: Actualiser
|
||||||
|
Visits: Visites
|
||||||
|
connections: connexions
|
|
@ -0,0 +1,4 @@
|
||||||
|
Connections: холболт
|
||||||
|
Refresh: Сэргээх
|
||||||
|
Visits: уулзалт
|
||||||
|
connections: холболт
|
|
@ -0,0 +1,4 @@
|
||||||
|
Connections: Conexões
|
||||||
|
Refresh: actualização
|
||||||
|
Visits: Visualizações
|
||||||
|
connections: conexões
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
.action-bar .connections-sum {
|
||||||
|
padding: .4em;
|
||||||
|
background-color: #1e88e5;
|
||||||
|
border-radius: .1em;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
<vn>
|
||||||
|
<div id="title">
|
||||||
|
<h1><t>Connections</t></h1>
|
||||||
|
</div>
|
||||||
|
<div id="actions">
|
||||||
|
<htk-bar-button
|
||||||
|
icon="refresh"
|
||||||
|
tip="_Refresh"
|
||||||
|
on-click="sessions.refresh()"/>
|
||||||
|
<div class="connections-sum">
|
||||||
|
<htk-text>
|
||||||
|
<db-calc-sum
|
||||||
|
property="param"
|
||||||
|
model="sessions"
|
||||||
|
func="sessionsFunc"/>
|
||||||
|
</htk-text>
|
||||||
|
<t>connections</t>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="form" class="connections">
|
||||||
|
<htk-repeater form-id="iter" class="box htk-list vn-w-xs">
|
||||||
|
<db-model
|
||||||
|
property="model"
|
||||||
|
id="sessions"
|
||||||
|
on-status-changed="this.onModelStatusChange()">
|
||||||
|
SELECT vu.userFk userId, vu.stamp, u.nickname, s.lastUpdate,
|
||||||
|
a.platform, a.browser, a.version, u.name user
|
||||||
|
FROM userSession s
|
||||||
|
JOIN visitUser vu ON vu.id = s.userVisitFk
|
||||||
|
JOIN visitAccess ac ON ac.id = vu.accessFk
|
||||||
|
JOIN visitAgent a ON a.id = ac.agentFk
|
||||||
|
JOIN visit v ON v.id = a.visitFk
|
||||||
|
JOIN account.user u ON u.id = vu.userFk
|
||||||
|
ORDER BY lastUpdate DESC
|
||||||
|
</db-model>
|
||||||
|
<custom>
|
||||||
|
<a class="item"
|
||||||
|
href="{{`#!form=admin/access-log&user=${iter.userId}`}}"
|
||||||
|
title="_Access log">
|
||||||
|
<div class="content">
|
||||||
|
<p class="important">
|
||||||
|
{{iter.nickname}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{Vn.Value.format(iter.stamp, '%a, %T')}} -
|
||||||
|
{{Vn.Value.format(iter.lastUpdate, '%T')}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{iter.platform}} - {{iter.browser}} {{iter.version}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="actions"
|
||||||
|
on-click="$event.preventDefault()">
|
||||||
|
<htk-button
|
||||||
|
tip="_Supplant user"
|
||||||
|
icon="supervisor_account"
|
||||||
|
on-click="this.onChangeUserClick(iter.user)"/>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</custom>
|
||||||
|
</htk-repeater>
|
||||||
|
</div>
|
||||||
|
</vn>
|
|
@ -0,0 +1,10 @@
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml'),
|
||||||
|
|
||||||
|
activate() {
|
||||||
|
this.$.items.setInfo('i', 'item', 'vn', ['id']);
|
||||||
|
}
|
||||||
|
});
|
|
@ -0,0 +1,2 @@
|
||||||
|
Items: Artícles
|
||||||
|
Enter a search term: Introdueix un terme de cerca
|
|
@ -0,0 +1,2 @@
|
||||||
|
Items: Items
|
||||||
|
Enter a search term: Enter a search term
|
|
@ -0,0 +1,2 @@
|
||||||
|
Items: Artículos
|
||||||
|
Enter a search term: Introduce un término de búsqueda
|
|
@ -0,0 +1,2 @@
|
||||||
|
Items: Articles
|
||||||
|
Enter a search term: Entrez un terme de recherche
|
|
@ -0,0 +1,2 @@
|
||||||
|
Items: Ítens
|
||||||
|
Enter a search term: Digite um termo de pesquisa
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
.items .item .photo {
|
||||||
|
border-radius: 10px;
|
||||||
|
height: 80px;
|
||||||
|
width: 80px;
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
<vn>
|
||||||
|
<div id="title">
|
||||||
|
<h1><t>Items</t></h1>
|
||||||
|
</div>
|
||||||
|
<div id="actions">
|
||||||
|
<htk-search-entry form="hash" column="search"/>
|
||||||
|
</div>
|
||||||
|
<div id="form" class="items">
|
||||||
|
<htk-repeater
|
||||||
|
class="htk-list rows box vn-w-xs"
|
||||||
|
form-id="iter"
|
||||||
|
empty-message="_Enter a search term">
|
||||||
|
<db-model property="model" id="items" lot="hash">
|
||||||
|
SELECT i.id, i.longName, i.size, i.category,
|
||||||
|
i.value5, i.value6, i.value7,
|
||||||
|
i.image, im.updated
|
||||||
|
FROM vn.item i
|
||||||
|
LEFT JOIN image im
|
||||||
|
ON im.collectionFk = 'catalog'
|
||||||
|
AND im.name = i.image
|
||||||
|
WHERE i.isActive
|
||||||
|
AND (i.longName LIKE CONCAT('%', #search, '%') OR i.id = #search)
|
||||||
|
ORDER BY i.longName LIMIT 50
|
||||||
|
</db-model>
|
||||||
|
<custom>
|
||||||
|
<div class="item">
|
||||||
|
<div class="side vn-mr-md">
|
||||||
|
<htk-image
|
||||||
|
form="$iter"
|
||||||
|
column="image"
|
||||||
|
stamp-column="updated"
|
||||||
|
class="photo"
|
||||||
|
directory="catalog"
|
||||||
|
subdir="200x200"
|
||||||
|
full-dir="1600x900"
|
||||||
|
editable="true"
|
||||||
|
conn="conn"/>
|
||||||
|
</div>
|
||||||
|
<div class="content">
|
||||||
|
<p class="important">
|
||||||
|
{{iter.longName}}
|
||||||
|
</p>
|
||||||
|
<p class="tags">
|
||||||
|
{{iter.value5}} {{iter.value6}} {{iter.value7}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{iter.id}}
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
{{iter.image}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</custom>
|
||||||
|
</htk-repeater>
|
||||||
|
</div>
|
||||||
|
</vn>
|
|
@ -0,0 +1,7 @@
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml')
|
||||||
|
});
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
ControlPanel: Panell de control
|
||||||
|
Module: Mòdul
|
||||||
|
Description: Descripció
|
|
@ -0,0 +1,3 @@
|
||||||
|
ControlPanel: Control panel
|
||||||
|
Module: Module
|
||||||
|
Description: Description
|
|
@ -0,0 +1,3 @@
|
||||||
|
ControlPanel: Panel de control
|
||||||
|
Module: Módulo
|
||||||
|
Description: Descripción
|
|
@ -0,0 +1,3 @@
|
||||||
|
ControlPanel: Panneau de configuration
|
||||||
|
Module: Module
|
||||||
|
Description: Description
|
|
@ -0,0 +1,3 @@
|
||||||
|
ControlPanel: Painel de controle
|
||||||
|
Module: Módulo
|
||||||
|
Description: Descrição
|
|
@ -0,0 +1,50 @@
|
||||||
|
|
||||||
|
.cpanel .items > div {
|
||||||
|
max-width: 900px;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 16px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
.cpanel .item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0;
|
||||||
|
width: 140px;
|
||||||
|
padding: 15px;
|
||||||
|
text-align: center;
|
||||||
|
transition: background-color 250ms ease-out;
|
||||||
|
}
|
||||||
|
.cpanel .item:hover {
|
||||||
|
background-color: rgba(1, 1, 1, 0.05);
|
||||||
|
}
|
||||||
|
.cpanel .item > .htk-image {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin: 0;
|
||||||
|
float: left;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
.cpanel .item > .htk-image > img {
|
||||||
|
max-height: 60px;
|
||||||
|
max-width: 60px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.cpanel .item > h6 {
|
||||||
|
flex: none;
|
||||||
|
margin: .1em 0;
|
||||||
|
font-size: .9rem;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.cpanel .item > .text-secondary {
|
||||||
|
flex: none;
|
||||||
|
margin: 0;
|
||||||
|
font-size: .8rem;
|
||||||
|
height: 40px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
<vn>
|
||||||
|
<div id="title">
|
||||||
|
<h1><t>ControlPanel</t></h1>
|
||||||
|
</div>
|
||||||
|
<div id="form" class="cpanel">
|
||||||
|
<htk-repeater form-id="iter" class="items">
|
||||||
|
<db-model property="model">
|
||||||
|
<custom>
|
||||||
|
SELECT image, name, description, link FROM link
|
||||||
|
ORDER BY name
|
||||||
|
</custom>
|
||||||
|
</db-model>
|
||||||
|
<custom>
|
||||||
|
<a class="item box"
|
||||||
|
href="{{iter.link}}"
|
||||||
|
target="_blank">
|
||||||
|
<htk-image
|
||||||
|
value="{{iter.image}}"
|
||||||
|
directory="link"
|
||||||
|
subdir="full"/>
|
||||||
|
<h6>
|
||||||
|
{{iter.name}}
|
||||||
|
</h6>
|
||||||
|
<p class="text-secondary">
|
||||||
|
{{iter.description}}
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</custom>
|
||||||
|
</htk-repeater>
|
||||||
|
</div>
|
||||||
|
</vn>
|
|
@ -0,0 +1,201 @@
|
||||||
|
import './style.scss';
|
||||||
|
|
||||||
|
var Status = {
|
||||||
|
NONE : 0
|
||||||
|
,WAITING : 1
|
||||||
|
,UPLOADING : 2
|
||||||
|
,UPLOADED : 3
|
||||||
|
};
|
||||||
|
|
||||||
|
export default new Class({
|
||||||
|
Extends: Hedera.Form,
|
||||||
|
Template: require('./ui.xml')
|
||||||
|
|
||||||
|
,filesData: []
|
||||||
|
,uploadCount: 0
|
||||||
|
,isUploading: false
|
||||||
|
|
||||||
|
,activate() {
|
||||||
|
this.$.schema.value = 'catalog';
|
||||||
|
}
|
||||||
|
|
||||||
|
,addFiles(files) {
|
||||||
|
if (!files)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (var i = 0; i < files.length; i++)
|
||||||
|
this.addFile(files[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
,addFile(file) {
|
||||||
|
var doc = document;
|
||||||
|
var li = doc.createElement('div');
|
||||||
|
|
||||||
|
var div = doc.createElement('div');
|
||||||
|
div.className = 'thumb';
|
||||||
|
li.appendChild(div);
|
||||||
|
|
||||||
|
var thumb = doc.createElement('img');
|
||||||
|
thumb.file = file;
|
||||||
|
div.appendChild(thumb);
|
||||||
|
|
||||||
|
var reader = new FileReader();
|
||||||
|
reader.onload = function(e) {
|
||||||
|
thumb.src = e.target.result;
|
||||||
|
};
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
|
||||||
|
var name = doc.createElement('input');
|
||||||
|
name.type = 'text';
|
||||||
|
name.value = getFileName(file.name);
|
||||||
|
li.appendChild(name);
|
||||||
|
|
||||||
|
var statusNode = doc.createElement('div');
|
||||||
|
statusNode.className = 'status';
|
||||||
|
li.appendChild(statusNode);
|
||||||
|
|
||||||
|
var fileData = {
|
||||||
|
li: li,
|
||||||
|
file: file,
|
||||||
|
name: name,
|
||||||
|
statusNode: statusNode
|
||||||
|
};
|
||||||
|
|
||||||
|
var button = new Htk.Button({
|
||||||
|
tip: 'Remove',
|
||||||
|
icon: 'delete'
|
||||||
|
});
|
||||||
|
button.node.addEventListener('click',
|
||||||
|
() => this.onFileRemove(fileData));
|
||||||
|
li.appendChild(button.node);
|
||||||
|
|
||||||
|
this.filesData.push(fileData);
|
||||||
|
|
||||||
|
this.$.fileList.appendChild(li);
|
||||||
|
this.setImageStatus(fileData, Status.NONE, 'add', _('Pending upload'));
|
||||||
|
}
|
||||||
|
|
||||||
|
,async onUploadClick() {
|
||||||
|
if (this.isUploading) return;
|
||||||
|
|
||||||
|
const uploadQueue = [];
|
||||||
|
let hasFiles = false;
|
||||||
|
|
||||||
|
for (const fileData of this.filesData) {
|
||||||
|
if (fileData.status !== Status.NONE) continue;
|
||||||
|
this.setImageStatus(
|
||||||
|
fileData, Status.WAITING, 'cloud_upload', _('Waiting for upload'));
|
||||||
|
fileData.name.disabled = true;
|
||||||
|
uploadQueue.push(fileData);
|
||||||
|
hasFiles = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasFiles) {
|
||||||
|
Htk.Toast.showWarning(_('There are no files to upload'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isUploading = true;
|
||||||
|
let hasErrors = false;
|
||||||
|
|
||||||
|
for (const fileData of uploadQueue) {
|
||||||
|
this.setImageStatus(
|
||||||
|
fileData, Status.UPLOADING, 'upload', _('Uploading file'));
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('updateMatching', this.$.updateMatching.value);
|
||||||
|
formData.append('image', fileData.file);
|
||||||
|
formData.append('name', fileData.name.value);
|
||||||
|
formData.append('schema', this.$.schema.value);
|
||||||
|
formData.append('srv', 'json:image/upload');
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.conn.sendFormData(formData);
|
||||||
|
this.setImageStatus(
|
||||||
|
fileData, Status.UPLOADED, 'cloud_done', _('Image uploaded'));
|
||||||
|
} catch(err) {
|
||||||
|
this.setImageStatus(
|
||||||
|
fileData, Status.NONE, 'error', err.message);
|
||||||
|
fileData.name.disabled = false;
|
||||||
|
hasErrors = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.isUploading = false;
|
||||||
|
|
||||||
|
if (hasErrors)
|
||||||
|
Htk.Toast.showError(_('Some errors happened on upload'));
|
||||||
|
else
|
||||||
|
Htk.Toast.showMessage(_('Upload finished successfully'));
|
||||||
|
}
|
||||||
|
|
||||||
|
,setImageStatus(fileData, status, icon, title) {
|
||||||
|
fileData.status = status;
|
||||||
|
|
||||||
|
var statusNode = fileData.statusNode;
|
||||||
|
Vn.Node.removeChilds(statusNode);
|
||||||
|
|
||||||
|
var iconNode = new Htk.Icon({name: icon});
|
||||||
|
statusNode.appendChild(iconNode.node);
|
||||||
|
statusNode.title = title ? title : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
,onFileRemove(fileData) {
|
||||||
|
this.$.fileList.removeChild(fileData.li);
|
||||||
|
|
||||||
|
for (var i = 0; i < this.filesData.length; i++)
|
||||||
|
if (this.filesData[i] === fileData) {
|
||||||
|
this.filesData.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
,onClearClick() {
|
||||||
|
this.filesData = [];
|
||||||
|
Vn.Node.removeChilds(this.$.fileList);
|
||||||
|
}
|
||||||
|
|
||||||
|
,onDropzoneClick() {
|
||||||
|
this.$.file.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
,onFileChange() {
|
||||||
|
this.addFiles(this.$.file.files);
|
||||||
|
}
|
||||||
|
|
||||||
|
,onDragEnter() {
|
||||||
|
this.$.dropzone.classList.add('dragover');
|
||||||
|
}
|
||||||
|
|
||||||
|
,onDragLeave() {
|
||||||
|
this.$.dropzone.classList.remove('dragover');
|
||||||
|
}
|
||||||
|
|
||||||
|
,onDragOver(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
,onDragEnd(event) {
|
||||||
|
this.$.dropzone.classList.remove('dragover');
|
||||||
|
event.dataTransfer.clearData();
|
||||||
|
}
|
||||||
|
|
||||||
|
,onDrop(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
this.addFiles(event.dataTransfer.files);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function getFileName(path) {
|
||||||
|
var barIndex = path.lastIndexOf('/');
|
||||||
|
if (barIndex === -1)
|
||||||
|
barIndex = path.lastIndexOf('\\');
|
||||||
|
if (barIndex === -1)
|
||||||
|
barIndex = 0;
|
||||||
|
|
||||||
|
var dotIndex = path.lastIndexOf('.');
|
||||||
|
if (dotIndex === -1)
|
||||||
|
dotIndex = 0;
|
||||||
|
|
||||||
|
return path.substr(barIndex, dotIndex);
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
Images: Imatges
|
||||||
|
Collection: Col·lecció
|
||||||
|
Click or drop files here: Prem o deixa anar els arxius aquí
|
||||||
|
Pending upload: Pujada pendent
|
||||||
|
Update items with matching id: Actualitzar els elements amb id coincident
|
||||||
|
Clear all: Netejar tot
|
||||||
|
Upload files: Pujar arxius
|
||||||
|
Waiting for upload: Esperant per pujar
|
||||||
|
Uploading file: Pujant fitxer
|
||||||
|
Image uploaded: Imatge pujada
|
||||||
|
Upload finished successfully: Imatges pujades correctament
|
||||||
|
Some errors happened on upload: Van ocórrer errors en pujar alguna de les imatges
|
||||||
|
There are no files to upload: No s'ha seleccionat arxius per pujar
|
|
@ -0,0 +1,13 @@
|
||||||
|
Images: Images
|
||||||
|
Collection: Collection
|
||||||
|
Click or drop files here: Click or drop files here
|
||||||
|
Pending upload: Pending upload
|
||||||
|
Update items with matching id: Update items with matching id
|
||||||
|
Clear all: Clear all
|
||||||
|
Upload files: Upload files
|
||||||
|
Waiting for upload: Waiting for upload
|
||||||
|
Uploading file: Uploading file
|
||||||
|
Image uploaded: Image uploaded
|
||||||
|
Upload finished successfully: Upload finished successfully
|
||||||
|
Some errors happened on upload: Some errors happened on upload
|
||||||
|
There are no files to upload: There are no files to upload
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue