Spaces:
Running
Running
recreation angular workflow
Browse files- .editorconfig +16 -0
- .gitattributes +0 -35
- .gitignore +42 -0
- .vscode/extensions.json +4 -0
- .vscode/launch.json +20 -0
- .vscode/tasks.json +42 -0
- Dockerfile +21 -10
- README.md +27 -8
- angular.json +100 -0
- docker-compose.yml +11 -0
- index.html +0 -24
- package-lock.json +0 -0
- package.json +44 -0
- pesca.service.ts +0 -35
- requirements.txt +0 -1
- server.ts +56 -0
- src/assets/.gitkeep +0 -0
- src/favicon.ico +3 -0
- src/index.html +13 -0
- src/main.server.ts +7 -0
- src/main.ts +6 -0
- src/styles.css +1 -0
- tsconfig.app.json +18 -0
- tsconfig.json +32 -0
- tsconfig.spec.json +14 -0
.editorconfig
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Editor configuration, see https://editorconfig.org
|
| 2 |
+
root = true
|
| 3 |
+
|
| 4 |
+
[*]
|
| 5 |
+
charset = utf-8
|
| 6 |
+
indent_style = space
|
| 7 |
+
indent_size = 2
|
| 8 |
+
insert_final_newline = true
|
| 9 |
+
trim_trailing_whitespace = true
|
| 10 |
+
|
| 11 |
+
[*.ts]
|
| 12 |
+
quote_type = single
|
| 13 |
+
|
| 14 |
+
[*.md]
|
| 15 |
+
max_line_length = off
|
| 16 |
+
trim_trailing_whitespace = false
|
.gitattributes
CHANGED
|
@@ -1,38 +1,3 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
*.png filter=lfs diff=lfs merge=lfs -text
|
| 37 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 38 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
*.png filter=lfs diff=lfs merge=lfs -text
|
| 2 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
|
| 2 |
+
|
| 3 |
+
# Compiled output
|
| 4 |
+
/dist
|
| 5 |
+
/tmp
|
| 6 |
+
/out-tsc
|
| 7 |
+
/bazel-out
|
| 8 |
+
|
| 9 |
+
# Node
|
| 10 |
+
/node_modules
|
| 11 |
+
npm-debug.log
|
| 12 |
+
yarn-error.log
|
| 13 |
+
|
| 14 |
+
# IDEs and editors
|
| 15 |
+
.idea/
|
| 16 |
+
.project
|
| 17 |
+
.classpath
|
| 18 |
+
.c9/
|
| 19 |
+
*.launch
|
| 20 |
+
.settings/
|
| 21 |
+
*.sublime-workspace
|
| 22 |
+
|
| 23 |
+
# Visual Studio Code
|
| 24 |
+
.vscode/*
|
| 25 |
+
!.vscode/settings.json
|
| 26 |
+
!.vscode/tasks.json
|
| 27 |
+
!.vscode/launch.json
|
| 28 |
+
!.vscode/extensions.json
|
| 29 |
+
.history/*
|
| 30 |
+
|
| 31 |
+
# Miscellaneous
|
| 32 |
+
/.angular/cache
|
| 33 |
+
.sass-cache/
|
| 34 |
+
/connect.lock
|
| 35 |
+
/coverage
|
| 36 |
+
/libpeerconnection.log
|
| 37 |
+
testem.log
|
| 38 |
+
/typings
|
| 39 |
+
|
| 40 |
+
# System files
|
| 41 |
+
.DS_Store
|
| 42 |
+
Thumbs.db
|
.vscode/extensions.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
|
| 3 |
+
"recommendations": ["angular.ng-template"]
|
| 4 |
+
}
|
.vscode/launch.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
| 3 |
+
"version": "0.2.0",
|
| 4 |
+
"configurations": [
|
| 5 |
+
{
|
| 6 |
+
"name": "ng serve",
|
| 7 |
+
"type": "chrome",
|
| 8 |
+
"request": "launch",
|
| 9 |
+
"preLaunchTask": "npm: start",
|
| 10 |
+
"url": "http://localhost:4200/"
|
| 11 |
+
},
|
| 12 |
+
{
|
| 13 |
+
"name": "ng test",
|
| 14 |
+
"type": "chrome",
|
| 15 |
+
"request": "launch",
|
| 16 |
+
"preLaunchTask": "npm: test",
|
| 17 |
+
"url": "http://localhost:9876/debug.html"
|
| 18 |
+
}
|
| 19 |
+
]
|
| 20 |
+
}
|
.vscode/tasks.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
// For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
|
| 3 |
+
"version": "2.0.0",
|
| 4 |
+
"tasks": [
|
| 5 |
+
{
|
| 6 |
+
"type": "npm",
|
| 7 |
+
"script": "start",
|
| 8 |
+
"isBackground": true,
|
| 9 |
+
"problemMatcher": {
|
| 10 |
+
"owner": "typescript",
|
| 11 |
+
"pattern": "$tsc",
|
| 12 |
+
"background": {
|
| 13 |
+
"activeOnStart": true,
|
| 14 |
+
"beginsPattern": {
|
| 15 |
+
"regexp": "(.*?)"
|
| 16 |
+
},
|
| 17 |
+
"endsPattern": {
|
| 18 |
+
"regexp": "bundle generation complete"
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"type": "npm",
|
| 25 |
+
"script": "test",
|
| 26 |
+
"isBackground": true,
|
| 27 |
+
"problemMatcher": {
|
| 28 |
+
"owner": "typescript",
|
| 29 |
+
"pattern": "$tsc",
|
| 30 |
+
"background": {
|
| 31 |
+
"activeOnStart": true,
|
| 32 |
+
"beginsPattern": {
|
| 33 |
+
"regexp": "(.*?)"
|
| 34 |
+
},
|
| 35 |
+
"endsPattern": {
|
| 36 |
+
"regexp": "bundle generation complete"
|
| 37 |
+
}
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
}
|
| 41 |
+
]
|
| 42 |
+
}
|
Dockerfile
CHANGED
|
@@ -1,15 +1,26 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM node:
|
| 3 |
WORKDIR /app
|
| 4 |
-
|
|
|
|
|
|
|
| 5 |
RUN npm install
|
|
|
|
|
|
|
| 6 |
COPY . .
|
| 7 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
-
# Configurar Nginx para escuchar en 7860
|
| 12 |
-
RUN sed -i 's/listen 80;/listen 7860;/g' /etc/nginx/conf.d/default.conf
|
| 13 |
-
COPY --from=build-step /app/dist/mi-pesca-rd /usr/share/nginx/html
|
| 14 |
EXPOSE 7860
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ETAPA 1: Construcción
|
| 2 |
+
FROM node:22-alpine AS build
|
| 3 |
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Instalar dependencias
|
| 6 |
+
COPY package*.json ./
|
| 7 |
RUN npm install
|
| 8 |
+
|
| 9 |
+
# Copiar código y compilar
|
| 10 |
COPY . .
|
| 11 |
+
RUN npx ng build --configuration production
|
| 12 |
+
|
| 13 |
+
# ETAPA 2: Ejecución (Hugging Face)
|
| 14 |
+
FROM node:22-alpine
|
| 15 |
+
WORKDIR /app
|
| 16 |
+
|
| 17 |
+
# Copiamos solo lo necesario para que la app corra (pesa menos)
|
| 18 |
+
COPY --from=build /app/dist/mi-pesca-rd /app/dist/mi-pesca-rd
|
| 19 |
|
| 20 |
+
# Hugging Face requiere el puerto 7860
|
| 21 |
+
ENV PORT=7860
|
|
|
|
|
|
|
|
|
|
| 22 |
EXPOSE 7860
|
| 23 |
+
|
| 24 |
+
# Comando para iniciar el servidor de Angular SSR
|
| 25 |
+
# Nota: La ruta exacta puede variar según tu versión de Angular (server.mjs o main.js)
|
| 26 |
+
CMD ["node", "dist/mi-pesca-rd/server/server.mjs"]
|
README.md
CHANGED
|
@@ -1,8 +1,27 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiPescaRd
|
| 2 |
+
|
| 3 |
+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.17.
|
| 4 |
+
|
| 5 |
+
## Development server
|
| 6 |
+
|
| 7 |
+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
|
| 8 |
+
|
| 9 |
+
## Code scaffolding
|
| 10 |
+
|
| 11 |
+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
| 12 |
+
|
| 13 |
+
## Build
|
| 14 |
+
|
| 15 |
+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
| 16 |
+
|
| 17 |
+
## Running unit tests
|
| 18 |
+
|
| 19 |
+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
| 20 |
+
|
| 21 |
+
## Running end-to-end tests
|
| 22 |
+
|
| 23 |
+
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
|
| 24 |
+
|
| 25 |
+
## Further help
|
| 26 |
+
|
| 27 |
+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
|
angular.json
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
|
| 3 |
+
"version": 1,
|
| 4 |
+
"newProjectRoot": "projects",
|
| 5 |
+
"projects": {
|
| 6 |
+
"mi-pesca-rd": {
|
| 7 |
+
"projectType": "application",
|
| 8 |
+
"schematics": {},
|
| 9 |
+
"root": "",
|
| 10 |
+
"sourceRoot": "src",
|
| 11 |
+
"prefix": "app",
|
| 12 |
+
"architect": {
|
| 13 |
+
"build": {
|
| 14 |
+
"builder": "@angular-devkit/build-angular:application",
|
| 15 |
+
"options": {
|
| 16 |
+
"outputPath": "dist/mi-pesca-rd",
|
| 17 |
+
"index": "src/index.html",
|
| 18 |
+
"browser": "src/main.ts",
|
| 19 |
+
"polyfills": [
|
| 20 |
+
"zone.js"
|
| 21 |
+
],
|
| 22 |
+
"tsConfig": "tsconfig.app.json",
|
| 23 |
+
"assets": [
|
| 24 |
+
"src/favicon.ico",
|
| 25 |
+
"src/assets"
|
| 26 |
+
],
|
| 27 |
+
"styles": [
|
| 28 |
+
"src/styles.css"
|
| 29 |
+
],
|
| 30 |
+
"scripts": [],
|
| 31 |
+
"server": "src/main.server.ts",
|
| 32 |
+
"prerender": true,
|
| 33 |
+
"ssr": {
|
| 34 |
+
"entry": "server.ts"
|
| 35 |
+
}
|
| 36 |
+
},
|
| 37 |
+
"configurations": {
|
| 38 |
+
"production": {
|
| 39 |
+
"budgets": [
|
| 40 |
+
{
|
| 41 |
+
"type": "initial",
|
| 42 |
+
"maximumWarning": "500kb",
|
| 43 |
+
"maximumError": "1mb"
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"type": "anyComponentStyle",
|
| 47 |
+
"maximumWarning": "2kb",
|
| 48 |
+
"maximumError": "4kb"
|
| 49 |
+
}
|
| 50 |
+
],
|
| 51 |
+
"outputHashing": "all"
|
| 52 |
+
},
|
| 53 |
+
"development": {
|
| 54 |
+
"optimization": false,
|
| 55 |
+
"extractLicenses": false,
|
| 56 |
+
"sourceMap": true
|
| 57 |
+
}
|
| 58 |
+
},
|
| 59 |
+
"defaultConfiguration": "production"
|
| 60 |
+
},
|
| 61 |
+
"serve": {
|
| 62 |
+
"builder": "@angular-devkit/build-angular:dev-server",
|
| 63 |
+
"configurations": {
|
| 64 |
+
"production": {
|
| 65 |
+
"buildTarget": "mi-pesca-rd:build:production"
|
| 66 |
+
},
|
| 67 |
+
"development": {
|
| 68 |
+
"buildTarget": "mi-pesca-rd:build:development"
|
| 69 |
+
}
|
| 70 |
+
},
|
| 71 |
+
"defaultConfiguration": "development"
|
| 72 |
+
},
|
| 73 |
+
"extract-i18n": {
|
| 74 |
+
"builder": "@angular-devkit/build-angular:extract-i18n",
|
| 75 |
+
"options": {
|
| 76 |
+
"buildTarget": "mi-pesca-rd:build"
|
| 77 |
+
}
|
| 78 |
+
},
|
| 79 |
+
"test": {
|
| 80 |
+
"builder": "@angular-devkit/build-angular:karma",
|
| 81 |
+
"options": {
|
| 82 |
+
"polyfills": [
|
| 83 |
+
"zone.js",
|
| 84 |
+
"zone.js/testing"
|
| 85 |
+
],
|
| 86 |
+
"tsConfig": "tsconfig.spec.json",
|
| 87 |
+
"assets": [
|
| 88 |
+
"src/favicon.ico",
|
| 89 |
+
"src/assets"
|
| 90 |
+
],
|
| 91 |
+
"styles": [
|
| 92 |
+
"src/styles.css"
|
| 93 |
+
],
|
| 94 |
+
"scripts": []
|
| 95 |
+
}
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
+
}
|
| 100 |
+
}
|
docker-compose.yml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version: '3.8'
|
| 2 |
+
services:
|
| 3 |
+
angular-dev:
|
| 4 |
+
build: .
|
| 5 |
+
volumes:
|
| 6 |
+
- .:/app
|
| 7 |
+
ports:
|
| 8 |
+
- "4200:4200"
|
| 9 |
+
- "7860:7860"
|
| 10 |
+
stdin_open: true
|
| 11 |
+
tty: true
|
index.html
DELETED
|
@@ -1,24 +0,0 @@
|
|
| 1 |
-
<div class="container">
|
| 2 |
-
<h1>🎣 MI PESCA RD</h1>
|
| 3 |
-
|
| 4 |
-
<div class="form-group">
|
| 5 |
-
<label>Especie (CODOPESCA)</label>
|
| 6 |
-
<select #especie class="big-input">
|
| 7 |
-
<option value="Chillo">Chillo</option>
|
| 8 |
-
<option value="Colirrubia">Colirrubia</option>
|
| 9 |
-
<option value="Mero">Mero Rojo</option>
|
| 10 |
-
</select>
|
| 11 |
-
</div>
|
| 12 |
-
|
| 13 |
-
<div class="form-group">
|
| 14 |
-
<label>Peso (Libras)</label>
|
| 15 |
-
<input type="number" #peso class="big-input">
|
| 16 |
-
</div>
|
| 17 |
-
|
| 18 |
-
<button (click)="registrar(especie.value, peso.value)" class="btn-save">
|
| 19 |
-
GUARDAR CAPTURA
|
| 20 |
-
</button>
|
| 21 |
-
|
| 22 |
-
<hr>
|
| 23 |
-
<button (click)="descargar()" class="btn-download">Descargar Datos CSV</button>
|
| 24 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package-lock.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "mi-pesca-rd",
|
| 3 |
+
"version": "0.0.0",
|
| 4 |
+
"scripts": {
|
| 5 |
+
"ng": "ng",
|
| 6 |
+
"start": "ng serve",
|
| 7 |
+
"build": "ng build",
|
| 8 |
+
"watch": "ng build --watch --configuration development",
|
| 9 |
+
"test": "ng test",
|
| 10 |
+
"serve:ssr:mi-pesca-rd": "node dist/mi-pesca-rd/server/server.mjs"
|
| 11 |
+
},
|
| 12 |
+
"private": true,
|
| 13 |
+
"dependencies": {
|
| 14 |
+
"@angular/animations": "^17.3.0",
|
| 15 |
+
"@angular/common": "^17.3.0",
|
| 16 |
+
"@angular/compiler": "^17.3.0",
|
| 17 |
+
"@angular/core": "^17.3.0",
|
| 18 |
+
"@angular/forms": "^17.3.0",
|
| 19 |
+
"@angular/platform-browser": "^17.3.0",
|
| 20 |
+
"@angular/platform-browser-dynamic": "^17.3.0",
|
| 21 |
+
"@angular/platform-server": "^17.3.0",
|
| 22 |
+
"@angular/router": "^17.3.0",
|
| 23 |
+
"@angular/ssr": "^17.3.17",
|
| 24 |
+
"express": "^4.18.2",
|
| 25 |
+
"rxjs": "~7.8.0",
|
| 26 |
+
"tslib": "^2.3.0",
|
| 27 |
+
"zone.js": "~0.14.3"
|
| 28 |
+
},
|
| 29 |
+
"devDependencies": {
|
| 30 |
+
"@angular-devkit/build-angular": "^17.3.17",
|
| 31 |
+
"@angular/cli": "^17.3.17",
|
| 32 |
+
"@angular/compiler-cli": "^17.3.0",
|
| 33 |
+
"@types/express": "^4.17.17",
|
| 34 |
+
"@types/jasmine": "~5.1.0",
|
| 35 |
+
"@types/node": "^18.18.0",
|
| 36 |
+
"jasmine-core": "~5.1.0",
|
| 37 |
+
"karma": "~6.4.0",
|
| 38 |
+
"karma-chrome-launcher": "~3.2.0",
|
| 39 |
+
"karma-coverage": "~2.2.0",
|
| 40 |
+
"karma-jasmine": "~5.1.0",
|
| 41 |
+
"karma-jasmine-html-reporter": "~2.1.0",
|
| 42 |
+
"typescript": "~5.4.2"
|
| 43 |
+
}
|
| 44 |
+
}
|
pesca.service.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
import { Injectable } from '@angular/core';
|
| 2 |
-
|
| 3 |
-
@Injectable({ providedIn: 'root' })
|
| 4 |
-
export class PescaService {
|
| 5 |
-
private DB_KEY = 'registros_pesca_rd';
|
| 6 |
-
|
| 7 |
-
guardarCaptura(especie: string, peso: number, brazadas: number) {
|
| 8 |
-
const registros = this.listarRegistros();
|
| 9 |
-
const nuevaCaptura = {
|
| 10 |
-
especie,
|
| 11 |
-
peso,
|
| 12 |
-
brazadas,
|
| 13 |
-
fecha: new Date().toISOString(),
|
| 14 |
-
gps: "18.4500, -68.9667", // Captura automática
|
| 15 |
-
sincronizado: false
|
| 16 |
-
};
|
| 17 |
-
registros.push(nuevaCaptura);
|
| 18 |
-
localStorage.setItem(this.DB_KEY, JSON.stringify(registros));
|
| 19 |
-
}
|
| 20 |
-
|
| 21 |
-
listarRegistros() {
|
| 22 |
-
const data = localStorage.getItem(this.DB_KEY);
|
| 23 |
-
return data ? JSON.parse(data) : [];
|
| 24 |
-
}
|
| 25 |
-
|
| 26 |
-
exportarCSV() {
|
| 27 |
-
const data = this.listarRegistros();
|
| 28 |
-
const csvContent = "data:text/csv;charset=utf-8,"
|
| 29 |
-
+ "Fecha,Especie,Peso(lb),Profundidad(br),GPS\n"
|
| 30 |
-
+ data.map(e => `${e.fecha},${e.especie},${e.peso},${e.brazadas},${e.gps}`).join("\n");
|
| 31 |
-
|
| 32 |
-
const encodedUri = encodeURI(csvContent);
|
| 33 |
-
window.open(encodedUri);
|
| 34 |
-
}
|
| 35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
flet
|
|
|
|
|
|
server.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { APP_BASE_HREF } from '@angular/common';
|
| 2 |
+
import { CommonEngine } from '@angular/ssr';
|
| 3 |
+
import express from 'express';
|
| 4 |
+
import { fileURLToPath } from 'node:url';
|
| 5 |
+
import { dirname, join, resolve } from 'node:path';
|
| 6 |
+
import bootstrap from './src/main.server';
|
| 7 |
+
|
| 8 |
+
// The Express app is exported so that it can be used by serverless Functions.
|
| 9 |
+
export function app(): express.Express {
|
| 10 |
+
const server = express();
|
| 11 |
+
const serverDistFolder = dirname(fileURLToPath(import.meta.url));
|
| 12 |
+
const browserDistFolder = resolve(serverDistFolder, '../browser');
|
| 13 |
+
const indexHtml = join(serverDistFolder, 'index.server.html');
|
| 14 |
+
|
| 15 |
+
const commonEngine = new CommonEngine();
|
| 16 |
+
|
| 17 |
+
server.set('view engine', 'html');
|
| 18 |
+
server.set('views', browserDistFolder);
|
| 19 |
+
|
| 20 |
+
// Example Express Rest API endpoints
|
| 21 |
+
// server.get('/api/**', (req, res) => { });
|
| 22 |
+
// Serve static files from /browser
|
| 23 |
+
server.get('*.*', express.static(browserDistFolder, {
|
| 24 |
+
maxAge: '1y'
|
| 25 |
+
}));
|
| 26 |
+
|
| 27 |
+
// All regular routes use the Angular engine
|
| 28 |
+
server.get('*', (req, res, next) => {
|
| 29 |
+
const { protocol, originalUrl, baseUrl, headers } = req;
|
| 30 |
+
|
| 31 |
+
commonEngine
|
| 32 |
+
.render({
|
| 33 |
+
bootstrap,
|
| 34 |
+
documentFilePath: indexHtml,
|
| 35 |
+
url: `${protocol}://${headers.host}${originalUrl}`,
|
| 36 |
+
publicPath: browserDistFolder,
|
| 37 |
+
providers: [{ provide: APP_BASE_HREF, useValue: baseUrl }],
|
| 38 |
+
})
|
| 39 |
+
.then((html) => res.send(html))
|
| 40 |
+
.catch((err) => next(err));
|
| 41 |
+
});
|
| 42 |
+
|
| 43 |
+
return server;
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
function run(): void {
|
| 47 |
+
const port = process.env['PORT'] || 4000;
|
| 48 |
+
|
| 49 |
+
// Start up the Node server
|
| 50 |
+
const server = app();
|
| 51 |
+
server.listen(port, () => {
|
| 52 |
+
console.log(`Node Express server listening on http://localhost:${port}`);
|
| 53 |
+
});
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
run();
|
src/assets/.gitkeep
ADDED
|
File without changes
|
src/favicon.ico
ADDED
|
|
Git LFS Details
|
src/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="utf-8">
|
| 5 |
+
<title>MiPescaRd</title>
|
| 6 |
+
<base href="/">
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
| 8 |
+
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
| 9 |
+
</head>
|
| 10 |
+
<body>
|
| 11 |
+
<app-root></app-root>
|
| 12 |
+
</body>
|
| 13 |
+
</html>
|
src/main.server.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { bootstrapApplication } from '@angular/platform-browser';
|
| 2 |
+
import { AppComponent } from './app/app.component';
|
| 3 |
+
import { config } from './app/app.config.server';
|
| 4 |
+
|
| 5 |
+
const bootstrap = () => bootstrapApplication(AppComponent, config);
|
| 6 |
+
|
| 7 |
+
export default bootstrap;
|
src/main.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { bootstrapApplication } from '@angular/platform-browser';
|
| 2 |
+
import { appConfig } from './app/app.config';
|
| 3 |
+
import { AppComponent } from './app/app.component';
|
| 4 |
+
|
| 5 |
+
bootstrapApplication(AppComponent, appConfig)
|
| 6 |
+
.catch((err) => console.error(err));
|
src/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
/* You can add global styles to this file, and also import other style files */
|
tsconfig.app.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
| 2 |
+
{
|
| 3 |
+
"extends": "./tsconfig.json",
|
| 4 |
+
"compilerOptions": {
|
| 5 |
+
"outDir": "./out-tsc/app",
|
| 6 |
+
"types": [
|
| 7 |
+
"node"
|
| 8 |
+
]
|
| 9 |
+
},
|
| 10 |
+
"files": [
|
| 11 |
+
"src/main.ts",
|
| 12 |
+
"src/main.server.ts",
|
| 13 |
+
"server.ts"
|
| 14 |
+
],
|
| 15 |
+
"include": [
|
| 16 |
+
"src/**/*.d.ts"
|
| 17 |
+
]
|
| 18 |
+
}
|
tsconfig.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
| 2 |
+
{
|
| 3 |
+
"compileOnSave": false,
|
| 4 |
+
"compilerOptions": {
|
| 5 |
+
"outDir": "./dist/out-tsc",
|
| 6 |
+
"strict": true,
|
| 7 |
+
"noImplicitOverride": true,
|
| 8 |
+
"noPropertyAccessFromIndexSignature": true,
|
| 9 |
+
"noImplicitReturns": true,
|
| 10 |
+
"noFallthroughCasesInSwitch": true,
|
| 11 |
+
"skipLibCheck": true,
|
| 12 |
+
"esModuleInterop": true,
|
| 13 |
+
"sourceMap": true,
|
| 14 |
+
"declaration": false,
|
| 15 |
+
"experimentalDecorators": true,
|
| 16 |
+
"moduleResolution": "node",
|
| 17 |
+
"importHelpers": true,
|
| 18 |
+
"target": "ES2022",
|
| 19 |
+
"module": "ES2022",
|
| 20 |
+
"useDefineForClassFields": false,
|
| 21 |
+
"lib": [
|
| 22 |
+
"ES2022",
|
| 23 |
+
"dom"
|
| 24 |
+
]
|
| 25 |
+
},
|
| 26 |
+
"angularCompilerOptions": {
|
| 27 |
+
"enableI18nLegacyMessageIdFormat": false,
|
| 28 |
+
"strictInjectionParameters": true,
|
| 29 |
+
"strictInputAccessModifiers": true,
|
| 30 |
+
"strictTemplates": true
|
| 31 |
+
}
|
| 32 |
+
}
|
tsconfig.spec.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
| 2 |
+
{
|
| 3 |
+
"extends": "./tsconfig.json",
|
| 4 |
+
"compilerOptions": {
|
| 5 |
+
"outDir": "./out-tsc/spec",
|
| 6 |
+
"types": [
|
| 7 |
+
"jasmine"
|
| 8 |
+
]
|
| 9 |
+
},
|
| 10 |
+
"include": [
|
| 11 |
+
"src/**/*.spec.ts",
|
| 12 |
+
"src/**/*.d.ts"
|
| 13 |
+
]
|
| 14 |
+
}
|