-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Netmanager] Fixed typescript errors and added Dockerfile #2395
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d6c0572
added grid hooks and apis
Codebmk bdcba65
Merge branch 'staging' into migrate-netmanager
Codebmk b31323e
fix typescript errors on analytics page
Codebmk 39ccdad
dockerfile
Codebmk 9e7ff7b
Update devices.ts
Codebmk 39ca4bd
Create .dockerignore
Codebmk 6e5b738
Update Dockerfile
Codebmk 2aa8a4f
Update utils.ts
Codebmk edaa282
Update index.tsx
Codebmk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.git | ||
.gitignore | ||
node_modules | ||
.next | ||
.env* | ||
npm-debug.log* | ||
README.md | ||
.vscode | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Use the official Node.js image as a base | ||
FROM node:18-alpine AS builder | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package*.json ./ | ||
|
||
# Copy package.json and package-lock.json | ||
COPY package*.json ./ | ||
|
||
RUN npm ci | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
# Add healthcheck | ||
HEALTHCHECK --interval=30s --timeout=3s \ | ||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1 | ||
|
||
USER node | ||
|
||
# Expose the application port | ||
EXPOSE 3000 | ||
|
||
# Command to run the application | ||
CMD ["npm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,23 @@ | ||
export interface Grid { | ||
_id: string; | ||
visibility: boolean; | ||
name: string; | ||
admin_level: string; | ||
network: string; | ||
long_name: string; | ||
createdAt: string; | ||
sites: Site[]; | ||
import { Site } from "./sites"; | ||
|
||
export interface CreateGrid { | ||
name: string; | ||
admin_level: string; | ||
shape: { | ||
type: "MultiPolygon" | "Polygon"; | ||
coordinates: number[][][][]; | ||
}; | ||
network: string; | ||
} | ||
|
||
export interface Site { | ||
export interface Grid { | ||
_id: string; | ||
isOnline: boolean; | ||
formatted_name: string; | ||
location_name: string; | ||
search_name: string; | ||
city: string; | ||
district: string; | ||
county: string; | ||
region: string; | ||
country: string; | ||
latitude: number; | ||
longitude: number; | ||
visibility: boolean; | ||
name: string; | ||
approximate_latitude: number; | ||
approximate_longitude: number; | ||
generated_name: string; | ||
data_provider: string; | ||
description: string; | ||
site_category: SiteCategory; | ||
groups: string[]; | ||
grids: Grid[]; | ||
devices: Device[]; | ||
airqlouds: unknown[]; | ||
admin_level: string; | ||
network: string; | ||
long_name: string; | ||
createdAt: string; | ||
updatedAt?: string; | ||
pm2_5?: number; | ||
} | ||
|
||
interface SiteCategory { | ||
tags: string[]; | ||
area_name: string; | ||
category: string; | ||
highway: string; | ||
landuse: string; | ||
latitude: number; | ||
longitude: number; | ||
natural: string; | ||
search_radius: number; | ||
waterway: string; | ||
sites: Site[]; | ||
numberOfSites: number; | ||
} | ||
|
||
export interface Device { | ||
_id: string; | ||
group: string; | ||
authRequired: boolean; | ||
serial_number: string; | ||
api_code: string; | ||
groups: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Clarify the
coordinates
type in theshape
propertyThe
coordinates
property is currently typed asnumber[][][][]
, which corresponds to aMultiPolygon
coordinate structure. However, when thetype
is"Polygon"
, the coordinates should benumber[][][]
. To accurately represent both geometries, consider definingshape
as a union type.Apply this diff to adjust the
shape
property:📝 Committable suggestion