From da44228037f5af0584b6db15e7b951cfc658fbc9 Mon Sep 17 00:00:00 2001 From: norbiros Date: Mon, 7 Oct 2024 19:05:38 +0200 Subject: [PATCH] feat: generate raports --- backend/routers/report_router.py | 2 +- frontend/components/GenerateRaportDialog.vue | 16 +++++++++++++++- frontend/nuxt.config.ts | 3 +-- frontend/openapi/api/openapi.json | 2 +- frontend/pages/panel/report/[id].vue | 2 +- frontend/pages/panel/select_scene.client.vue | 13 +++++-------- 6 files changed, 24 insertions(+), 14 deletions(-) diff --git a/backend/routers/report_router.py b/backend/routers/report_router.py index dd87d52..1a3dfac 100644 --- a/backend/routers/report_router.py +++ b/backend/routers/report_router.py @@ -21,7 +21,7 @@ report_router = APIRouter() -@report_router.get("/generate_report") +@report_router.post("/generate_report") async def generate_report(scene_id: str, background_tasks: BackgroundTasks, db: Session = Depends(get_db)): query = db.query(models.Report).filter_by(scene_id=scene_id) report = query.first() diff --git a/frontend/components/GenerateRaportDialog.vue b/frontend/components/GenerateRaportDialog.vue index c1e1451..3f2420d 100644 --- a/frontend/components/GenerateRaportDialog.vue +++ b/frontend/components/GenerateRaportDialog.vue @@ -14,7 +14,7 @@ Cancel - + Continue @@ -35,4 +35,18 @@ import { AlertDialogTrigger } from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; + +const props = defineProps<{ + sceneId: string +}>(); + +async function generateReport() { + await useApi("/report/generate_report", { + method: "POST", + query: { + scene_id: props.sceneId + } + }); + navigateTo("/panel/reports"); +} diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index 6e6ffc8..e996f56 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -10,8 +10,7 @@ export default defineNuxtConfig({ "nuxt-aos" ], css: [ - "@unocss/reset/tailwind.css", - "~/assets/css/uno.css" + "@unocss/reset/tailwind.css" ], devtools: { enabled: true }, compatibilityDate: "2024-04-03", diff --git a/frontend/openapi/api/openapi.json b/frontend/openapi/api/openapi.json index d0bb25d..bc56b17 100644 --- a/frontend/openapi/api/openapi.json +++ b/frontend/openapi/api/openapi.json @@ -1 +1 @@ -{"openapi": "3.1.0", "info": {"title": "Landsat Web Tracker API", "version": "0.1.0"}, "paths": {"/healthcheck": {"get": {"summary": "Healthcheck", "operationId": "healthcheck_healthcheck_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/email": {"get": {"summary": "Email", "operationId": "email_email_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/": {"get": {"summary": "Root", "operationId": "root__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/landsat/search": {"get": {"summary": "Get Landsat By Search", "operationId": "get_landsat_by_search_landsat_search_get", "parameters": [{"name": "latitude", "in": "query", "required": true, "schema": {"type": "number", "title": "Latitude"}}, {"name": "longitude", "in": "query", "required": true, "schema": {"type": "number", "title": "Longitude"}}, {"name": "start_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date-time", "title": "Start Date"}}, {"name": "end_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date-time", "title": "End Date"}}, {"name": "max_cloud_cover", "in": "query", "required": false, "schema": {"type": "number", "default": 0.2, "title": "Max Cloud Cover"}}, {"name": "max_items", "in": "query", "required": false, "schema": {"type": "integer", "default": 5, "title": "Max Items"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": 5, "title": "Limit"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/LandsatItem"}, "title": "Response Get Landsat By Search Landsat Search Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/id": {"get": {"summary": "Get Landsat By Id", "operationId": "get_landsat_by_id_landsat_id_get", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LandsatItem"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/mosaic": {"get": {"summary": "Mosaic", "operationId": "mosaic_landsat_mosaic_get", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}, {"name": "collection_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Collection Id"}}, {"name": "mosaic_type", "in": "query", "required": true, "schema": {"$ref": "#/components/schemas/MosaicType"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "string", "format": "uri", "minLength": 1, "title": "Response Mosaic Landsat Mosaic Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/get_acquisitions": {"get": {"summary": "Get Acquisitions", "operationId": "get_acquisitions_landsat_get_acquisitions_get", "parameters": [{"name": "path", "in": "query", "required": true, "schema": {"type": "integer", "title": "Path"}}, {"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "To Date"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "array", "prefixItems": [{"type": "string"}, {"type": "string", "format": "date"}, {"$ref": "#/components/schemas/AcquisitionDetails"}], "minItems": 3, "maxItems": 3}, "title": "Response Get Acquisitions Landsat Get Acquisitions Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/get_scene": {"get": {"summary": "Get Scene", "operationId": "get_scene_landsat_get_scene_get", "parameters": [{"name": "lat", "in": "query", "required": true, "schema": {"type": "number", "title": "Lat"}}, {"name": "lng", "in": "query", "required": true, "schema": {"type": "number", "title": "Lng"}}, {"name": "mode", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/Mode"}, {"type": "null"}], "title": "Mode"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/TileAttributes"}, "title": "Response Get Scene Landsat Get Scene Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/report/generate_report": {"get": {"summary": "Generate Report", "operationId": "generate_report_report_generate_report_get", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/report/get_report": {"get": {"summary": "Get Report", "operationId": "get_report_report_get_report_get", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/report/get_reports": {"get": {"summary": "Get Reports", "operationId": "get_reports_report_get_reports_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/Report"}, "type": "array", "title": "Response Get Reports Report Get Reports Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/watch_my_pixel/watch": {"post": {"summary": "Watch My Pixel", "operationId": "watch_my_pixel_watch_my_pixel_watch_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WatchPixelParams"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/watch_my_pixel/get_list": {"get": {"summary": "Get My Pixel Watches", "operationId": "get_my_pixel_watches_watch_my_pixel_get_list_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/PixelWatch"}, "type": "array", "title": "Response Get My Pixel Watches Watch My Pixel Get List Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}}, "components": {"schemas": {"AcquisitionDetails": {"properties": {"path": {"items": {"type": "integer"}, "type": "array", "title": "Path"}, "cycle": {"type": "integer", "title": "Cycle"}}, "type": "object", "required": ["path", "cycle"], "title": "AcquisitionDetails"}, "Bands": {"properties": {"qa": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa"}, "ang": {"type": "string", "minLength": 1, "format": "uri", "title": "Ang"}, "red": {"type": "string", "minLength": 1, "format": "uri", "title": "Red"}, "blue": {"type": "string", "minLength": 1, "format": "uri", "title": "Blue"}, "drad": {"type": "string", "minLength": 1, "format": "uri", "title": "Drad"}, "emis": {"type": "string", "minLength": 1, "format": "uri", "title": "Emis"}, "emsd": {"type": "string", "minLength": 1, "format": "uri", "title": "Emsd"}, "trad": {"type": "string", "minLength": 1, "format": "uri", "title": "Trad"}, "urad": {"type": "string", "minLength": 1, "format": "uri", "title": "Urad"}, "atran": {"type": "string", "minLength": 1, "format": "uri", "title": "Atran"}, "cdist": {"type": "string", "minLength": 1, "format": "uri", "title": "Cdist"}, "green": {"type": "string", "minLength": 1, "format": "uri", "title": "Green"}, "nir08": {"type": "string", "minLength": 1, "format": "uri", "title": "Nir08"}, "lwir11": {"type": "string", "minLength": 1, "format": "uri", "title": "Lwir11"}, "swir16": {"type": "string", "minLength": 1, "format": "uri", "title": "Swir16"}, "swir22": {"type": "string", "minLength": 1, "format": "uri", "title": "Swir22"}, "coastal": {"type": "string", "minLength": 1, "format": "uri", "title": "Coastal"}, "mtl_txt": {"type": "string", "minLength": 1, "format": "uri", "title": "Mtl Txt"}, "mtl_xml": {"type": "string", "minLength": 1, "format": "uri", "title": "Mtl Xml"}, "mtl_json": {"type": "string", "minLength": 1, "format": "uri", "title": "Mtl Json"}, "qa_pixel": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa Pixel"}, "qa_radsat": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa Radsat"}, "qa_aerosol": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa Aerosol"}, "tilejson": {"type": "string", "minLength": 1, "format": "uri", "title": "Tilejson"}, "rendered_preview": {"type": "string", "minLength": 1, "format": "uri", "title": "Rendered Preview"}}, "type": "object", "required": ["qa", "ang", "red", "blue", "drad", "emis", "emsd", "trad", "urad", "atran", "cdist", "green", "nir08", "lwir11", "swir16", "swir22", "coastal", "mtl_txt", "mtl_xml", "mtl_json", "qa_pixel", "qa_radsat", "qa_aerosol", "tilejson", "rendered_preview"], "title": "Bands"}, "Coordinates-Input": {"properties": {"lat": {"type": "number", "maximum": 90.0, "minimum": -90.0, "title": "Lat"}, "lon": {"type": "number", "maximum": 180.0, "minimum": -180.0, "title": "Lon"}}, "type": "object", "required": ["lat", "lon"], "title": "Coordinates"}, "Coordinates-Output": {"properties": {"latitude": {"type": "number", "maximum": 90.0, "minimum": -90.0, "title": "Latitude"}, "longitude": {"type": "number", "maximum": 180.0, "minimum": -180.0, "title": "Longitude"}}, "type": "object", "required": ["latitude", "longitude"], "title": "Coordinates"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "LandsatItem": {"properties": {"platform": {"type": "string", "title": "Platform"}, "id": {"type": "string", "title": "Id"}, "datetime": {"type": "string", "format": "date-time", "title": "Datetime"}, "eo_cloud_cover": {"type": "number", "title": "Eo Cloud Cover"}, "wrs_coordinates": {"$ref": "#/components/schemas/WrsCoordinates-Output"}, "rendered_preview": {"type": "string", "title": "Rendered Preview"}, "mosaic_endpoints": {"$ref": "#/components/schemas/Mosaics"}, "polygon": {"$ref": "#/components/schemas/Polygon"}, "bands": {"$ref": "#/components/schemas/Bands"}}, "type": "object", "required": ["platform", "id", "datetime", "eo_cloud_cover", "wrs_coordinates", "rendered_preview", "mosaic_endpoints", "polygon", "bands"], "title": "LandsatItem"}, "Mode": {"type": "string", "enum": ["A", "D"], "title": "Mode"}, "MosaicType": {"type": "string", "enum": ["0", "1", "2", "3", "4", "5", "6"], "title": "MosaicType"}, "Mosaics": {"properties": {"natural_color": {"type": "string", "title": "Natural Color"}, "color_infrared": {"type": "string", "title": "Color Infrared"}, "shortwave_infrared": {"type": "string", "title": "Shortwave Infrared"}, "agriculture": {"type": "string", "title": "Agriculture"}, "vegetation": {"type": "string", "title": "Vegetation"}, "moisture_index": {"type": "string", "title": "Moisture Index"}, "atmospheric_penetration": {"type": "string", "title": "Atmospheric Penetration"}}, "type": "object", "required": ["natural_color", "color_infrared", "shortwave_infrared", "agriculture", "vegetation", "moisture_index", "atmospheric_penetration"], "title": "Mosaics"}, "PixelWatch": {"properties": {"user": {"$ref": "#/components/schemas/UserBase"}, "latitude": {"type": "number", "title": "Latitude"}, "longitude": {"type": "number", "title": "Longitude"}, "path": {"type": "integer", "title": "Path"}, "row": {"type": "integer", "title": "Row"}, "datetime": {"type": "string", "format": "date-time", "title": "Datetime"}}, "type": "object", "required": ["user", "latitude", "longitude", "path", "row", "datetime"], "title": "PixelWatch"}, "Polygon": {"properties": {"coordinates": {"items": {"$ref": "#/components/schemas/Coordinates-Output"}, "type": "array", "title": "Coordinates"}}, "type": "object", "required": ["coordinates"], "title": "Polygon"}, "Report": {"properties": {"scene_id": {"type": "string", "title": "Scene Id"}, "is_processed": {"type": "boolean", "title": "Is Processed"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "raw_data": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Raw Data"}}, "type": "object", "required": ["scene_id", "is_processed", "created_at", "raw_data"], "title": "Report"}, "TileAttributes": {"properties": {"coordinates": {"$ref": "#/components/schemas/WrsCoordinates-Output"}, "mode": {"$ref": "#/components/schemas/Mode"}, "polygon": {"$ref": "#/components/schemas/Polygon"}}, "type": "object", "required": ["coordinates", "mode", "polygon"], "title": "TileAttributes"}, "UserBase": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "email": {"anyOf": [{"type": "string", "format": "email"}, {"type": "null"}], "title": "Email"}}, "type": "object", "required": ["id", "email"], "title": "UserBase"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "WatchPixelParams": {"properties": {"coordinates": {"$ref": "#/components/schemas/Coordinates-Input"}, "wrs_coordinates": {"$ref": "#/components/schemas/WrsCoordinates-Input"}, "date": {"type": "string", "format": "date-time", "title": "Date"}}, "type": "object", "required": ["coordinates", "wrs_coordinates", "date"], "title": "WatchPixelParams"}, "WrsCoordinates-Input": {"properties": {"path": {"type": "integer", "maximum": 233.0, "minimum": 1.0, "title": "Path"}, "row": {"type": "integer", "maximum": 248.0, "minimum": 1.0, "title": "Row"}}, "type": "object", "required": ["path", "row"], "title": "WrsCoordinates"}, "WrsCoordinates-Output": {"properties": {"wrs_path": {"type": "integer", "maximum": 233.0, "minimum": 1.0, "title": "Wrs Path"}, "wrs_row": {"type": "integer", "maximum": 248.0, "minimum": 1.0, "title": "Wrs Row"}}, "type": "object", "required": ["wrs_path", "wrs_row"], "title": "WrsCoordinates"}}, "securitySchemes": {"OAuth2PasswordBearer": {"type": "oauth2", "flows": {"password": {"scopes": {}, "tokenUrl": "token"}}}}}} \ No newline at end of file +{"openapi": "3.1.0", "info": {"title": "Landsat Web Tracker API", "version": "0.1.0"}, "paths": {"/healthcheck": {"get": {"summary": "Healthcheck", "operationId": "healthcheck_healthcheck_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/email": {"get": {"summary": "Email", "operationId": "email_email_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/": {"get": {"summary": "Root", "operationId": "root__get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/landsat/search": {"get": {"summary": "Get Landsat By Search", "operationId": "get_landsat_by_search_landsat_search_get", "parameters": [{"name": "latitude", "in": "query", "required": true, "schema": {"type": "number", "title": "Latitude"}}, {"name": "longitude", "in": "query", "required": true, "schema": {"type": "number", "title": "Longitude"}}, {"name": "start_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date-time", "title": "Start Date"}}, {"name": "end_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date-time", "title": "End Date"}}, {"name": "max_cloud_cover", "in": "query", "required": false, "schema": {"type": "number", "default": 0.2, "title": "Max Cloud Cover"}}, {"name": "max_items", "in": "query", "required": false, "schema": {"type": "integer", "default": 5, "title": "Max Items"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": 5, "title": "Limit"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/LandsatItem"}, "title": "Response Get Landsat By Search Landsat Search Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/id": {"get": {"summary": "Get Landsat By Id", "operationId": "get_landsat_by_id_landsat_id_get", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LandsatItem"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/mosaic": {"get": {"summary": "Mosaic", "operationId": "mosaic_landsat_mosaic_get", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}, {"name": "collection_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Collection Id"}}, {"name": "mosaic_type", "in": "query", "required": true, "schema": {"$ref": "#/components/schemas/MosaicType"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "string", "format": "uri", "minLength": 1, "title": "Response Mosaic Landsat Mosaic Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/get_acquisitions": {"get": {"summary": "Get Acquisitions", "operationId": "get_acquisitions_landsat_get_acquisitions_get", "parameters": [{"name": "path", "in": "query", "required": true, "schema": {"type": "integer", "title": "Path"}}, {"name": "from_date", "in": "query", "required": true, "schema": {"type": "string", "format": "date", "title": "From Date"}}, {"name": "to_date", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "date"}, {"type": "null"}], "title": "To Date"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"type": "array", "prefixItems": [{"type": "string"}, {"type": "string", "format": "date"}, {"$ref": "#/components/schemas/AcquisitionDetails"}], "minItems": 3, "maxItems": 3}, "title": "Response Get Acquisitions Landsat Get Acquisitions Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/landsat/get_scene": {"get": {"summary": "Get Scene", "operationId": "get_scene_landsat_get_scene_get", "parameters": [{"name": "lat", "in": "query", "required": true, "schema": {"type": "number", "title": "Lat"}}, {"name": "lng", "in": "query", "required": true, "schema": {"type": "number", "title": "Lng"}}, {"name": "mode", "in": "query", "required": false, "schema": {"anyOf": [{"$ref": "#/components/schemas/Mode"}, {"type": "null"}], "title": "Mode"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"type": "array", "items": {"$ref": "#/components/schemas/TileAttributes"}, "title": "Response Get Scene Landsat Get Scene Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/report/generate_report": {"post": {"summary": "Generate Report", "operationId": "generate_report_report_generate_report_post", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/report/get_report": {"get": {"summary": "Get Report", "operationId": "get_report_report_get_report_get", "parameters": [{"name": "scene_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Scene Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/report/get_reports": {"get": {"summary": "Get Reports", "operationId": "get_reports_report_get_reports_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/Report"}, "type": "array", "title": "Response Get Reports Report Get Reports Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/watch_my_pixel/watch": {"post": {"summary": "Watch My Pixel", "operationId": "watch_my_pixel_watch_my_pixel_watch_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WatchPixelParams"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/watch_my_pixel/get_list": {"get": {"summary": "Get My Pixel Watches", "operationId": "get_my_pixel_watches_watch_my_pixel_get_list_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/PixelWatch"}, "type": "array", "title": "Response Get My Pixel Watches Watch My Pixel Get List Get"}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}}, "components": {"schemas": {"AcquisitionDetails": {"properties": {"path": {"items": {"type": "integer"}, "type": "array", "title": "Path"}, "cycle": {"type": "integer", "title": "Cycle"}}, "type": "object", "required": ["path", "cycle"], "title": "AcquisitionDetails"}, "Bands": {"properties": {"qa": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa"}, "ang": {"type": "string", "minLength": 1, "format": "uri", "title": "Ang"}, "red": {"type": "string", "minLength": 1, "format": "uri", "title": "Red"}, "blue": {"type": "string", "minLength": 1, "format": "uri", "title": "Blue"}, "drad": {"type": "string", "minLength": 1, "format": "uri", "title": "Drad"}, "emis": {"type": "string", "minLength": 1, "format": "uri", "title": "Emis"}, "emsd": {"type": "string", "minLength": 1, "format": "uri", "title": "Emsd"}, "trad": {"type": "string", "minLength": 1, "format": "uri", "title": "Trad"}, "urad": {"type": "string", "minLength": 1, "format": "uri", "title": "Urad"}, "atran": {"type": "string", "minLength": 1, "format": "uri", "title": "Atran"}, "cdist": {"type": "string", "minLength": 1, "format": "uri", "title": "Cdist"}, "green": {"type": "string", "minLength": 1, "format": "uri", "title": "Green"}, "nir08": {"type": "string", "minLength": 1, "format": "uri", "title": "Nir08"}, "lwir11": {"type": "string", "minLength": 1, "format": "uri", "title": "Lwir11"}, "swir16": {"type": "string", "minLength": 1, "format": "uri", "title": "Swir16"}, "swir22": {"type": "string", "minLength": 1, "format": "uri", "title": "Swir22"}, "coastal": {"type": "string", "minLength": 1, "format": "uri", "title": "Coastal"}, "mtl_txt": {"type": "string", "minLength": 1, "format": "uri", "title": "Mtl Txt"}, "mtl_xml": {"type": "string", "minLength": 1, "format": "uri", "title": "Mtl Xml"}, "mtl_json": {"type": "string", "minLength": 1, "format": "uri", "title": "Mtl Json"}, "qa_pixel": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa Pixel"}, "qa_radsat": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa Radsat"}, "qa_aerosol": {"type": "string", "minLength": 1, "format": "uri", "title": "Qa Aerosol"}, "tilejson": {"type": "string", "minLength": 1, "format": "uri", "title": "Tilejson"}, "rendered_preview": {"type": "string", "minLength": 1, "format": "uri", "title": "Rendered Preview"}}, "type": "object", "required": ["qa", "ang", "red", "blue", "drad", "emis", "emsd", "trad", "urad", "atran", "cdist", "green", "nir08", "lwir11", "swir16", "swir22", "coastal", "mtl_txt", "mtl_xml", "mtl_json", "qa_pixel", "qa_radsat", "qa_aerosol", "tilejson", "rendered_preview"], "title": "Bands"}, "Coordinates-Input": {"properties": {"lat": {"type": "number", "maximum": 90.0, "minimum": -90.0, "title": "Lat"}, "lon": {"type": "number", "maximum": 180.0, "minimum": -180.0, "title": "Lon"}}, "type": "object", "required": ["lat", "lon"], "title": "Coordinates"}, "Coordinates-Output": {"properties": {"latitude": {"type": "number", "maximum": 90.0, "minimum": -90.0, "title": "Latitude"}, "longitude": {"type": "number", "maximum": 180.0, "minimum": -180.0, "title": "Longitude"}}, "type": "object", "required": ["latitude", "longitude"], "title": "Coordinates"}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "LandsatItem": {"properties": {"platform": {"type": "string", "title": "Platform"}, "id": {"type": "string", "title": "Id"}, "datetime": {"type": "string", "format": "date-time", "title": "Datetime"}, "eo_cloud_cover": {"type": "number", "title": "Eo Cloud Cover"}, "wrs_coordinates": {"$ref": "#/components/schemas/WrsCoordinates-Output"}, "rendered_preview": {"type": "string", "title": "Rendered Preview"}, "mosaic_endpoints": {"$ref": "#/components/schemas/Mosaics"}, "polygon": {"$ref": "#/components/schemas/Polygon"}, "bands": {"$ref": "#/components/schemas/Bands"}}, "type": "object", "required": ["platform", "id", "datetime", "eo_cloud_cover", "wrs_coordinates", "rendered_preview", "mosaic_endpoints", "polygon", "bands"], "title": "LandsatItem"}, "Mode": {"type": "string", "enum": ["A", "D"], "title": "Mode"}, "MosaicType": {"type": "string", "enum": ["0", "1", "2", "3", "4", "5", "6"], "title": "MosaicType"}, "Mosaics": {"properties": {"natural_color": {"type": "string", "title": "Natural Color"}, "color_infrared": {"type": "string", "title": "Color Infrared"}, "shortwave_infrared": {"type": "string", "title": "Shortwave Infrared"}, "agriculture": {"type": "string", "title": "Agriculture"}, "vegetation": {"type": "string", "title": "Vegetation"}, "moisture_index": {"type": "string", "title": "Moisture Index"}, "atmospheric_penetration": {"type": "string", "title": "Atmospheric Penetration"}}, "type": "object", "required": ["natural_color", "color_infrared", "shortwave_infrared", "agriculture", "vegetation", "moisture_index", "atmospheric_penetration"], "title": "Mosaics"}, "PixelWatch": {"properties": {"user": {"$ref": "#/components/schemas/UserBase"}, "latitude": {"type": "number", "title": "Latitude"}, "longitude": {"type": "number", "title": "Longitude"}, "path": {"type": "integer", "title": "Path"}, "row": {"type": "integer", "title": "Row"}, "datetime": {"type": "string", "format": "date-time", "title": "Datetime"}}, "type": "object", "required": ["user", "latitude", "longitude", "path", "row", "datetime"], "title": "PixelWatch"}, "Polygon": {"properties": {"coordinates": {"items": {"$ref": "#/components/schemas/Coordinates-Output"}, "type": "array", "title": "Coordinates"}}, "type": "object", "required": ["coordinates"], "title": "Polygon"}, "Report": {"properties": {"scene_id": {"type": "string", "title": "Scene Id"}, "is_processed": {"type": "boolean", "title": "Is Processed"}, "created_at": {"type": "string", "format": "date-time", "title": "Created At"}, "raw_data": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Raw Data"}}, "type": "object", "required": ["scene_id", "is_processed", "created_at", "raw_data"], "title": "Report"}, "TileAttributes": {"properties": {"coordinates": {"$ref": "#/components/schemas/WrsCoordinates-Output"}, "mode": {"$ref": "#/components/schemas/Mode"}, "polygon": {"$ref": "#/components/schemas/Polygon"}}, "type": "object", "required": ["coordinates", "mode", "polygon"], "title": "TileAttributes"}, "UserBase": {"properties": {"id": {"type": "string", "format": "uuid", "title": "Id"}, "email": {"anyOf": [{"type": "string", "format": "email"}, {"type": "null"}], "title": "Email"}}, "type": "object", "required": ["id", "email"], "title": "UserBase"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "WatchPixelParams": {"properties": {"coordinates": {"$ref": "#/components/schemas/Coordinates-Input"}, "wrs_coordinates": {"$ref": "#/components/schemas/WrsCoordinates-Input"}, "date": {"type": "string", "format": "date-time", "title": "Date"}}, "type": "object", "required": ["coordinates", "wrs_coordinates", "date"], "title": "WatchPixelParams"}, "WrsCoordinates-Input": {"properties": {"path": {"type": "integer", "maximum": 233.0, "minimum": 1.0, "title": "Path"}, "row": {"type": "integer", "maximum": 248.0, "minimum": 1.0, "title": "Row"}}, "type": "object", "required": ["path", "row"], "title": "WrsCoordinates"}, "WrsCoordinates-Output": {"properties": {"wrs_path": {"type": "integer", "maximum": 233.0, "minimum": 1.0, "title": "Wrs Path"}, "wrs_row": {"type": "integer", "maximum": 248.0, "minimum": 1.0, "title": "Wrs Row"}}, "type": "object", "required": ["wrs_path", "wrs_row"], "title": "WrsCoordinates"}}, "securitySchemes": {"OAuth2PasswordBearer": {"type": "oauth2", "flows": {"password": {"scopes": {}, "tokenUrl": "token"}}}}}} \ No newline at end of file diff --git a/frontend/pages/panel/report/[id].vue b/frontend/pages/panel/report/[id].vue index b0572b1..74e14d7 100644 --- a/frontend/pages/panel/report/[id].vue +++ b/frontend/pages/panel/report/[id].vue @@ -11,7 +11,7 @@ - + {{ key }} diff --git a/frontend/pages/panel/select_scene.client.vue b/frontend/pages/panel/select_scene.client.vue index 7e5675d..7778ae6 100644 --- a/frontend/pages/panel/select_scene.client.vue +++ b/frontend/pages/panel/select_scene.client.vue @@ -5,9 +5,9 @@
-
+
- +
@@ -41,6 +41,7 @@ const tileLayer = ref<{ const polygons = ref([]); const selectedPolygon = ref(undefined); +const selectedPolygonData = ref(undefined); const dateFrom = ref(null); // Parent holds the selected date const dateTo = ref(null); // Parent holds the selected date @@ -106,11 +107,7 @@ function logPolygon(polygon: Polygon) { async function showPolygon(polygon: Polygon) { const sceneId = polygon.id; - // L.map("map").setView([polygon.polygon.coordinates[0].lat, polygon.polygon.coordinates[0].lon], 6); - - // map.value.curentPosition = [polygon.polygon.coordinates[0].lat, polygon.polygon.coordinates[0].lon]; - - // marker.value + selectedPolygonData.value = polygon; // todo: swithcc to useApi const { data } = await useApi("/landsat/mosaic", {