initial add
This commit is contained in:
14
.gitignore
vendored
14
.gitignore
vendored
@@ -22,17 +22,3 @@ npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
#amplify
|
||||
amplify/\#current-cloud-backend
|
||||
amplify/.config/local-*
|
||||
amplify/mock-data
|
||||
amplify/backend/amplify-meta.json
|
||||
amplify/backend/awscloudformation
|
||||
build/
|
||||
dist/
|
||||
node_modules/
|
||||
aws-exports.js
|
||||
awsconfiguration.json
|
||||
amplifyconfiguration.json
|
||||
amplify-gradle-config.json
|
||||
amplifyxc.config
|
||||
56
amplify/#current-cloud-backend/amplify-meta.json
Normal file
56
amplify/#current-cloud-backend/amplify-meta.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"providers": {
|
||||
"awscloudformation": {
|
||||
"AuthRoleName": "amplify-hpiot-react-hpiot-162610-authRole",
|
||||
"UnauthRoleArn": "arn:aws:iam::860246592755:role/amplify-hpiot-react-hpiot-162610-unauthRole",
|
||||
"AuthRoleArn": "arn:aws:iam::860246592755:role/amplify-hpiot-react-hpiot-162610-authRole",
|
||||
"Region": "us-east-1",
|
||||
"DeploymentBucketName": "amplify-hpiot-react-hpiot-162610-deployment",
|
||||
"UnauthRoleName": "amplify-hpiot-react-hpiot-162610-unauthRole",
|
||||
"StackName": "amplify-hpiot-react-hpiot-162610",
|
||||
"StackId": "arn:aws:cloudformation:us-east-1:860246592755:stack/amplify-hpiot-react-hpiot-162610/1913c1f0-64a8-11ea-baa2-0ee5b74c6229",
|
||||
"AmplifyAppId": "d3hyexpjn33q6q"
|
||||
}
|
||||
},
|
||||
"hosting": {
|
||||
"S3AndCloudFront": {
|
||||
"service": "S3AndCloudFront",
|
||||
"providerPlugin": "awscloudformation",
|
||||
"providerMetadata": {
|
||||
"s3TemplateURL": "https://s3.amazonaws.com/amplify-hpiot-react-hpiot-162610-deployment/amplify-cfn-templates/hosting/template.json",
|
||||
"logicalId": "hostingS3AndCloudFront"
|
||||
},
|
||||
"lastPushTimeStamp": "2020-03-12T21:33:05.218Z",
|
||||
"output": {
|
||||
"S3BucketSecureURL": "https://hpiot-react-hpiot.s3.amazonaws.com",
|
||||
"WebsiteURL": "http://hpiot-react-hpiot.s3-website-us-east-1.amazonaws.com",
|
||||
"Region": "us-east-1",
|
||||
"HostingBucketName": "hpiot-react-hpiot"
|
||||
},
|
||||
"lastPushDirHash": "NulnbGKP8lFEe2FacQkja5CAJcc="
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"hpiotreact8c9024fb": {
|
||||
"service": "Cognito",
|
||||
"providerPlugin": "awscloudformation",
|
||||
"dependsOn": [],
|
||||
"customAuth": false,
|
||||
"providerMetadata": {
|
||||
"s3TemplateURL": "https://s3.amazonaws.com/amplify-hpiot-react-hpiot-162610-deployment/amplify-cfn-templates/auth/hpiotreact8c9024fb-cloudformation-template.yml",
|
||||
"logicalId": "authhpiotreact8c9024fb"
|
||||
},
|
||||
"lastPushTimeStamp": "2020-03-12T21:33:05.218Z",
|
||||
"output": {
|
||||
"AppClientSecret": "msldgo1telohjsm20p8nn58f15iensrjup7cb1712tirkcrooou",
|
||||
"UserPoolId": "us-east-1_L6XsGIASX",
|
||||
"AppClientIDWeb": "63ieddff77nfc3i151m8l8k3ip",
|
||||
"AppClientID": "3b1gubo57cng5p2avotsgr75ji",
|
||||
"IdentityPoolId": "us-east-1:20972146-c6fe-4ada-a723-d1debcc7d074",
|
||||
"IdentityPoolName": "hpiotreact8c9024fb_identitypool_8c9024fb__hpiot",
|
||||
"UserPoolName": "hpiotreact8c9024fb_userpool_8c9024fb"
|
||||
},
|
||||
"lastPushDirHash": "UsD33D5D2jMU3hAfHMEhFJOINGM="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,369 @@
|
||||
AWSTemplateFormatVersion: 2010-09-09
|
||||
|
||||
Parameters:
|
||||
env:
|
||||
Type: String
|
||||
authRoleArn:
|
||||
Type: String
|
||||
unauthRoleArn:
|
||||
Type: String
|
||||
|
||||
|
||||
|
||||
|
||||
identityPoolName:
|
||||
Type: String
|
||||
|
||||
allowUnauthenticatedIdentities:
|
||||
Type: String
|
||||
|
||||
resourceNameTruncated:
|
||||
Type: String
|
||||
|
||||
userPoolName:
|
||||
Type: String
|
||||
|
||||
autoVerifiedAttributes:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
mfaConfiguration:
|
||||
Type: String
|
||||
|
||||
mfaTypes:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
smsAuthenticationMessage:
|
||||
Type: String
|
||||
|
||||
smsVerificationMessage:
|
||||
Type: String
|
||||
|
||||
emailVerificationSubject:
|
||||
Type: String
|
||||
|
||||
emailVerificationMessage:
|
||||
Type: String
|
||||
|
||||
defaultPasswordPolicy:
|
||||
Type: String
|
||||
|
||||
passwordPolicyMinLength:
|
||||
Type: Number
|
||||
|
||||
passwordPolicyCharacters:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
requiredAttributes:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
userpoolClientGenerateSecret:
|
||||
Type: String
|
||||
|
||||
userpoolClientRefreshTokenValidity:
|
||||
Type: Number
|
||||
|
||||
userpoolClientWriteAttributes:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
userpoolClientReadAttributes:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
userpoolClientLambdaRole:
|
||||
Type: String
|
||||
|
||||
userpoolClientSetAttributes:
|
||||
Type: String
|
||||
|
||||
resourceName:
|
||||
Type: String
|
||||
|
||||
authSelections:
|
||||
Type: String
|
||||
|
||||
useDefault:
|
||||
Type: String
|
||||
|
||||
usernameAttributes:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
userPoolGroupList:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
dependsOn:
|
||||
Type: CommaDelimitedList
|
||||
|
||||
Conditions:
|
||||
ShouldNotCreateEnvResources: !Equals [ !Ref env, NONE ]
|
||||
|
||||
Resources:
|
||||
|
||||
|
||||
# BEGIN SNS ROLE RESOURCE
|
||||
SNSRole:
|
||||
# Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process
|
||||
Type: AWS::IAM::Role
|
||||
Properties:
|
||||
RoleName: !If [ShouldNotCreateEnvResources, 'hpiotr8c9024fb_sns-role', !Join ['',[ 'sns', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]]
|
||||
AssumeRolePolicyDocument:
|
||||
Version: "2012-10-17"
|
||||
Statement:
|
||||
- Sid: ""
|
||||
Effect: "Allow"
|
||||
Principal:
|
||||
Service: "cognito-idp.amazonaws.com"
|
||||
Action:
|
||||
- "sts:AssumeRole"
|
||||
Condition:
|
||||
StringEquals:
|
||||
sts:ExternalId: hpiotr8c9024fb_role_external_id
|
||||
Policies:
|
||||
-
|
||||
PolicyName: hpiotr8c9024fb-sns-policy
|
||||
PolicyDocument:
|
||||
Version: "2012-10-17"
|
||||
Statement:
|
||||
-
|
||||
Effect: "Allow"
|
||||
Action:
|
||||
- "sns:Publish"
|
||||
Resource: "*"
|
||||
# BEGIN USER POOL RESOURCES
|
||||
UserPool:
|
||||
# Created upon user selection
|
||||
# Depends on SNS Role for Arn if MFA is enabled
|
||||
Type: AWS::Cognito::UserPool
|
||||
UpdateReplacePolicy: Retain
|
||||
Properties:
|
||||
UserPoolName: !If [ShouldNotCreateEnvResources, !Ref userPoolName, !Join ['',[!Ref userPoolName, '-', !Ref env]]]
|
||||
|
||||
Schema:
|
||||
|
||||
-
|
||||
Name: email
|
||||
Required: true
|
||||
Mutable: true
|
||||
|
||||
|
||||
|
||||
|
||||
AutoVerifiedAttributes: !Ref autoVerifiedAttributes
|
||||
|
||||
|
||||
EmailVerificationMessage: !Ref emailVerificationMessage
|
||||
EmailVerificationSubject: !Ref emailVerificationSubject
|
||||
|
||||
Policies:
|
||||
PasswordPolicy:
|
||||
MinimumLength: !Ref passwordPolicyMinLength
|
||||
RequireLowercase: false
|
||||
RequireNumbers: false
|
||||
RequireSymbols: false
|
||||
RequireUppercase: false
|
||||
|
||||
UsernameAttributes: !Ref usernameAttributes
|
||||
|
||||
MfaConfiguration: !Ref mfaConfiguration
|
||||
SmsVerificationMessage: !Ref smsVerificationMessage
|
||||
SmsConfiguration:
|
||||
SnsCallerArn: !GetAtt SNSRole.Arn
|
||||
ExternalId: hpiotr8c9024fb_role_external_id
|
||||
|
||||
|
||||
UserPoolClientWeb:
|
||||
# Created provide application access to user pool
|
||||
# Depends on UserPool for ID reference
|
||||
Type: "AWS::Cognito::UserPoolClient"
|
||||
Properties:
|
||||
ClientName: hpiotr8c9024fb_app_clientWeb
|
||||
|
||||
RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
|
||||
UserPoolId: !Ref UserPool
|
||||
DependsOn: UserPool
|
||||
UserPoolClient:
|
||||
# Created provide application access to user pool
|
||||
# Depends on UserPool for ID reference
|
||||
Type: "AWS::Cognito::UserPoolClient"
|
||||
Properties:
|
||||
ClientName: hpiotr8c9024fb_app_client
|
||||
|
||||
GenerateSecret: !Ref userpoolClientGenerateSecret
|
||||
RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
|
||||
UserPoolId: !Ref UserPool
|
||||
DependsOn: UserPool
|
||||
# BEGIN USER POOL LAMBDA RESOURCES
|
||||
UserPoolClientRole:
|
||||
# Created to execute Lambda which gets userpool app client config values
|
||||
Type: 'AWS::IAM::Role'
|
||||
Properties:
|
||||
RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',['upClientLambdaRole', !Select [3, !Split ['-', !Ref 'AWS::StackName']], '-', !Ref env]]]
|
||||
AssumeRolePolicyDocument:
|
||||
Version: '2012-10-17'
|
||||
Statement:
|
||||
- Effect: Allow
|
||||
Principal:
|
||||
Service:
|
||||
- lambda.amazonaws.com
|
||||
Action:
|
||||
- 'sts:AssumeRole'
|
||||
DependsOn: UserPoolClient
|
||||
UserPoolClientLambda:
|
||||
# Lambda which gets userpool app client config values
|
||||
# Depends on UserPool for id
|
||||
# Depends on UserPoolClientRole for role ARN
|
||||
Type: 'AWS::Lambda::Function'
|
||||
Properties:
|
||||
Code:
|
||||
ZipFile: !Join
|
||||
- |+
|
||||
- - 'const response = require(''cfn-response'');'
|
||||
- 'const aws = require(''aws-sdk'');'
|
||||
- 'const identity = new aws.CognitoIdentityServiceProvider();'
|
||||
- 'exports.handler = (event, context, callback) => {'
|
||||
- ' if (event.RequestType == ''Delete'') { '
|
||||
- ' response.send(event, context, response.SUCCESS, {})'
|
||||
- ' }'
|
||||
- ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
|
||||
- ' const params = {'
|
||||
- ' ClientId: event.ResourceProperties.clientId,'
|
||||
- ' UserPoolId: event.ResourceProperties.userpoolId'
|
||||
- ' };'
|
||||
- ' identity.describeUserPoolClient(params).promise()'
|
||||
- ' .then((res) => {'
|
||||
- ' response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});'
|
||||
- ' })'
|
||||
- ' .catch((err) => {'
|
||||
- ' response.send(event, context, response.FAILED, {err});'
|
||||
- ' });'
|
||||
- ' }'
|
||||
- '};'
|
||||
Handler: index.handler
|
||||
Runtime: nodejs10.x
|
||||
Timeout: '300'
|
||||
Role: !GetAtt
|
||||
- UserPoolClientRole
|
||||
- Arn
|
||||
DependsOn: UserPoolClientRole
|
||||
UserPoolClientLambdaPolicy:
|
||||
# Sets userpool policy for the role that executes the Userpool Client Lambda
|
||||
# Depends on UserPool for Arn
|
||||
# Marked as depending on UserPoolClientRole for easier to understand CFN sequencing
|
||||
Type: 'AWS::IAM::Policy'
|
||||
Properties:
|
||||
PolicyName: hpiotr8c9024fb_userpoolclient_lambda_iam_policy
|
||||
Roles:
|
||||
- !Ref UserPoolClientRole
|
||||
PolicyDocument:
|
||||
Version: '2012-10-17'
|
||||
Statement:
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- 'cognito-idp:DescribeUserPoolClient'
|
||||
Resource: !GetAtt UserPool.Arn
|
||||
DependsOn: UserPoolClientLambda
|
||||
UserPoolClientLogPolicy:
|
||||
# Sets log policy for the role that executes the Userpool Client Lambda
|
||||
# Depends on UserPool for Arn
|
||||
# Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
|
||||
Type: 'AWS::IAM::Policy'
|
||||
Properties:
|
||||
PolicyName: hpiotr8c9024fb_userpoolclient_lambda_log_policy
|
||||
Roles:
|
||||
- !Ref UserPoolClientRole
|
||||
PolicyDocument:
|
||||
Version: 2012-10-17
|
||||
Statement:
|
||||
- Effect: Allow
|
||||
Action:
|
||||
- 'logs:CreateLogGroup'
|
||||
- 'logs:CreateLogStream'
|
||||
- 'logs:PutLogEvents'
|
||||
Resource: !Sub
|
||||
- arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
|
||||
- { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref UserPoolClientLambda}
|
||||
DependsOn: UserPoolClientLambdaPolicy
|
||||
UserPoolClientInputs:
|
||||
# Values passed to Userpool client Lambda
|
||||
# Depends on UserPool for Id
|
||||
# Depends on UserPoolClient for Id
|
||||
# Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
|
||||
Type: 'Custom::LambdaCallout'
|
||||
Properties:
|
||||
ServiceToken: !GetAtt UserPoolClientLambda.Arn
|
||||
clientId: !Ref UserPoolClient
|
||||
userpoolId: !Ref UserPool
|
||||
DependsOn: UserPoolClientLogPolicy
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# BEGIN IDENTITY POOL RESOURCES
|
||||
|
||||
|
||||
IdentityPool:
|
||||
# Always created
|
||||
Type: AWS::Cognito::IdentityPool
|
||||
Properties:
|
||||
IdentityPoolName: !If [ShouldNotCreateEnvResources, 'hpiotreact8c9024fb_identitypool_8c9024fb', !Join ['',['hpiotreact8c9024fb_identitypool_8c9024fb', '__', !Ref env]]]
|
||||
|
||||
CognitoIdentityProviders:
|
||||
- ClientId: !Ref UserPoolClient
|
||||
ProviderName: !Sub
|
||||
- cognito-idp.${region}.amazonaws.com/${client}
|
||||
- { region: !Ref "AWS::Region", client: !Ref UserPool}
|
||||
- ClientId: !Ref UserPoolClientWeb
|
||||
ProviderName: !Sub
|
||||
- cognito-idp.${region}.amazonaws.com/${client}
|
||||
- { region: !Ref "AWS::Region", client: !Ref UserPool}
|
||||
|
||||
AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities
|
||||
|
||||
|
||||
DependsOn: UserPoolClientInputs
|
||||
|
||||
|
||||
IdentityPoolRoleMap:
|
||||
# Created to map Auth and Unauth roles to the identity pool
|
||||
# Depends on Identity Pool for ID ref
|
||||
Type: AWS::Cognito::IdentityPoolRoleAttachment
|
||||
Properties:
|
||||
IdentityPoolId: !Ref IdentityPool
|
||||
Roles:
|
||||
unauthenticated: !Ref unauthRoleArn
|
||||
authenticated: !Ref authRoleArn
|
||||
DependsOn: IdentityPool
|
||||
|
||||
|
||||
Outputs :
|
||||
|
||||
IdentityPoolId:
|
||||
Value: !Ref 'IdentityPool'
|
||||
Description: Id for the identity pool
|
||||
IdentityPoolName:
|
||||
Value: !GetAtt IdentityPool.Name
|
||||
|
||||
|
||||
|
||||
|
||||
UserPoolId:
|
||||
Value: !Ref 'UserPool'
|
||||
Description: Id for the user pool
|
||||
UserPoolName:
|
||||
Value: !Ref userPoolName
|
||||
AppClientIDWeb:
|
||||
Value: !Ref 'UserPoolClientWeb'
|
||||
Description: The user pool app client id for web
|
||||
AppClientID:
|
||||
Value: !Ref 'UserPoolClient'
|
||||
Description: The user pool app client id
|
||||
AppClientSecret:
|
||||
Value: !GetAtt UserPoolClientInputs.appSecret
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"identityPoolName": "hpiotreact8c9024fb_identitypool_8c9024fb",
|
||||
"allowUnauthenticatedIdentities": false,
|
||||
"resourceNameTruncated": "hpiotr8c9024fb",
|
||||
"userPoolName": "hpiotreact8c9024fb_userpool_8c9024fb",
|
||||
"autoVerifiedAttributes": [
|
||||
"email"
|
||||
],
|
||||
"mfaConfiguration": "OFF",
|
||||
"mfaTypes": [
|
||||
"SMS Text Message"
|
||||
],
|
||||
"smsAuthenticationMessage": "Your authentication code is {####}",
|
||||
"smsVerificationMessage": "Your verification code is {####}",
|
||||
"emailVerificationSubject": "Your verification code",
|
||||
"emailVerificationMessage": "Your verification code is {####}",
|
||||
"defaultPasswordPolicy": false,
|
||||
"passwordPolicyMinLength": 8,
|
||||
"passwordPolicyCharacters": [],
|
||||
"requiredAttributes": [
|
||||
"email"
|
||||
],
|
||||
"userpoolClientGenerateSecret": true,
|
||||
"userpoolClientRefreshTokenValidity": 30,
|
||||
"userpoolClientWriteAttributes": [
|
||||
"email"
|
||||
],
|
||||
"userpoolClientReadAttributes": [
|
||||
"email"
|
||||
],
|
||||
"userpoolClientLambdaRole": "hpiotr8c9024fb_userpoolclient_lambda_role",
|
||||
"userpoolClientSetAttributes": false,
|
||||
"resourceName": "hpiotreact8c9024fb",
|
||||
"authSelections": "identityPoolAndUserPool",
|
||||
"authRoleArn": {
|
||||
"Fn::GetAtt": [
|
||||
"AuthRole",
|
||||
"Arn"
|
||||
]
|
||||
},
|
||||
"unauthRoleArn": {
|
||||
"Fn::GetAtt": [
|
||||
"UnauthRole",
|
||||
"Arn"
|
||||
]
|
||||
},
|
||||
"useDefault": "default",
|
||||
"usernameAttributes": [
|
||||
"email"
|
||||
],
|
||||
"userPoolGroupList": [],
|
||||
"dependsOn": []
|
||||
}
|
||||
16
amplify/#current-cloud-backend/backend-config.json
Normal file
16
amplify/#current-cloud-backend/backend-config.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"hosting": {
|
||||
"S3AndCloudFront": {
|
||||
"service": "S3AndCloudFront",
|
||||
"providerPlugin": "awscloudformation"
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"hpiotreact8c9024fb": {
|
||||
"service": "Cognito",
|
||||
"providerPlugin": "awscloudformation",
|
||||
"dependsOn": [],
|
||||
"customAuth": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"bucketName": "hpiot-react"
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
"Description": "Hosting resource stack creation using Amplify CLI",
|
||||
"Parameters": {
|
||||
"env": {
|
||||
"Type": "String"
|
||||
},
|
||||
"bucketName": {
|
||||
"Type": "String"
|
||||
}
|
||||
},
|
||||
"Conditions": {
|
||||
"ShouldNotCreateEnvResources": {
|
||||
"Fn::Equals": [
|
||||
{
|
||||
"Ref": "env"
|
||||
},
|
||||
"NONE"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Resources": {
|
||||
"S3Bucket": {
|
||||
"Type": "AWS::S3::Bucket",
|
||||
"DeletionPolicy": "Retain",
|
||||
"Properties": {
|
||||
"BucketName": {
|
||||
"Fn::If": [
|
||||
"ShouldNotCreateEnvResources",
|
||||
{
|
||||
"Ref": "bucketName"
|
||||
},
|
||||
{
|
||||
"Fn::Join": [
|
||||
"",
|
||||
[
|
||||
{
|
||||
"Ref": "bucketName"
|
||||
},
|
||||
"-",
|
||||
{
|
||||
"Ref": "env"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"AccessControl": "Private",
|
||||
"WebsiteConfiguration": {
|
||||
"IndexDocument": "index.html",
|
||||
"ErrorDocument": "index.html"
|
||||
},
|
||||
"CorsConfiguration": {
|
||||
"CorsRules": [
|
||||
{
|
||||
"AllowedHeaders": [
|
||||
"Authorization",
|
||||
"Content-Length"
|
||||
],
|
||||
"AllowedMethods": [
|
||||
"GET"
|
||||
],
|
||||
"AllowedOrigins": [
|
||||
"*"
|
||||
],
|
||||
"MaxAge": 3000
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Outputs": {
|
||||
"Region": {
|
||||
"Value": {
|
||||
"Ref": "AWS::Region"
|
||||
}
|
||||
},
|
||||
"HostingBucketName": {
|
||||
"Description": "Hosting bucket name",
|
||||
"Value": {
|
||||
"Ref": "S3Bucket"
|
||||
}
|
||||
},
|
||||
"WebsiteURL": {
|
||||
"Value": {
|
||||
"Fn::GetAtt": [
|
||||
"S3Bucket",
|
||||
"WebsiteURL"
|
||||
]
|
||||
},
|
||||
"Description": "URL for website hosted on S3"
|
||||
},
|
||||
"S3BucketSecureURL": {
|
||||
"Value": {
|
||||
"Fn::Join": [
|
||||
"",
|
||||
[
|
||||
"https://",
|
||||
{
|
||||
"Fn::GetAtt": [
|
||||
"S3Bucket",
|
||||
"DomainName"
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
},
|
||||
"Description": "Name of S3 bucket to hold website content"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
amplify/.config/local-aws-info.json
Normal file
7
amplify/.config/local-aws-info.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"hpiot": {
|
||||
"configLevel": "project",
|
||||
"useProfile": true,
|
||||
"profileName": "default"
|
||||
}
|
||||
}
|
||||
5
amplify/.config/local-env-info.json
Normal file
5
amplify/.config/local-env-info.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"projectPath": "/mnt/c/Users/Nico Melone/Documents/React Website/hpiot-react",
|
||||
"defaultEditor": "vscode",
|
||||
"envName": "hpiot"
|
||||
}
|
||||
56
amplify/backend/amplify-meta.json
Normal file
56
amplify/backend/amplify-meta.json
Normal file
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"providers": {
|
||||
"awscloudformation": {
|
||||
"AuthRoleName": "amplify-hpiot-react-hpiot-162610-authRole",
|
||||
"UnauthRoleArn": "arn:aws:iam::860246592755:role/amplify-hpiot-react-hpiot-162610-unauthRole",
|
||||
"AuthRoleArn": "arn:aws:iam::860246592755:role/amplify-hpiot-react-hpiot-162610-authRole",
|
||||
"Region": "us-east-1",
|
||||
"DeploymentBucketName": "amplify-hpiot-react-hpiot-162610-deployment",
|
||||
"UnauthRoleName": "amplify-hpiot-react-hpiot-162610-unauthRole",
|
||||
"StackName": "amplify-hpiot-react-hpiot-162610",
|
||||
"StackId": "arn:aws:cloudformation:us-east-1:860246592755:stack/amplify-hpiot-react-hpiot-162610/1913c1f0-64a8-11ea-baa2-0ee5b74c6229",
|
||||
"AmplifyAppId": "d3hyexpjn33q6q"
|
||||
}
|
||||
},
|
||||
"hosting": {
|
||||
"S3AndCloudFront": {
|
||||
"service": "S3AndCloudFront",
|
||||
"providerPlugin": "awscloudformation",
|
||||
"providerMetadata": {
|
||||
"s3TemplateURL": "https://s3.amazonaws.com/amplify-hpiot-react-hpiot-162610-deployment/amplify-cfn-templates/hosting/template.json",
|
||||
"logicalId": "hostingS3AndCloudFront"
|
||||
},
|
||||
"lastPushTimeStamp": "2020-03-24T17:59:51.368Z",
|
||||
"output": {
|
||||
"S3BucketSecureURL": "https://hpiot-react-hpiot.s3.amazonaws.com",
|
||||
"WebsiteURL": "http://hpiot-react-hpiot.s3-website-us-east-1.amazonaws.com",
|
||||
"Region": "us-east-1",
|
||||
"HostingBucketName": "hpiot-react-hpiot"
|
||||
},
|
||||
"lastPushDirHash": "NulnbGKP8lFEe2FacQkja5CAJcc="
|
||||
}
|
||||
},
|
||||
"auth": {
|
||||
"hpiotreact8c9024fb": {
|
||||
"service": "Cognito",
|
||||
"providerPlugin": "awscloudformation",
|
||||
"dependsOn": [],
|
||||
"customAuth": false,
|
||||
"providerMetadata": {
|
||||
"s3TemplateURL": "https://s3.amazonaws.com/amplify-hpiot-react-hpiot-162610-deployment/amplify-cfn-templates/auth/hpiotreact8c9024fb-cloudformation-template.yml",
|
||||
"logicalId": "authhpiotreact8c9024fb"
|
||||
},
|
||||
"lastPushTimeStamp": "2020-03-24T17:59:51.373Z",
|
||||
"output": {
|
||||
"AppClientSecret": "msldgo1telohjsm20p8nn58f15iensrjup7cb1712tirkcrooou",
|
||||
"UserPoolId": "us-east-1_L6XsGIASX",
|
||||
"AppClientIDWeb": "63ieddff77nfc3i151m8l8k3ip",
|
||||
"AppClientID": "3b1gubo57cng5p2avotsgr75ji",
|
||||
"IdentityPoolId": "us-east-1:20972146-c6fe-4ada-a723-d1debcc7d074",
|
||||
"IdentityPoolName": "hpiotreact8c9024fb_identitypool_8c9024fb__hpiot",
|
||||
"UserPoolName": "hpiotreact8c9024fb_userpool_8c9024fb"
|
||||
},
|
||||
"lastPushDirHash": "UsD33D5D2jMU3hAfHMEhFJOINGM="
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,371 @@
|
||||
{
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
"Description": "Root stack for the Amplify AWS CloudFormation provider",
|
||||
"Parameters": {
|
||||
"DeploymentBucketName": {
|
||||
"Description": "Name of the common deployment bucket provided by the parent stack",
|
||||
"Type": "String",
|
||||
"Default": "DeploymentBucket"
|
||||
},
|
||||
"AuthRoleName": {
|
||||
"Type": "String",
|
||||
"Default": "AuthRoleName"
|
||||
},
|
||||
"UnauthRoleName": {
|
||||
"Type": "String",
|
||||
"Default": "UnauthRoleName"
|
||||
}
|
||||
},
|
||||
"Resources": {
|
||||
"DeploymentBucket": {
|
||||
"Type": "AWS::S3::Bucket",
|
||||
"DeletionPolicy": "Retain",
|
||||
"Properties": {
|
||||
"BucketName": {
|
||||
"Ref": "DeploymentBucketName"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AuthRole": {
|
||||
"Type": "AWS::IAM::Role",
|
||||
"Properties": {
|
||||
"RoleName": {
|
||||
"Ref": "AuthRoleName"
|
||||
},
|
||||
"AssumeRolePolicyDocument": {
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "",
|
||||
"Effect": "Deny",
|
||||
"Principal": {
|
||||
"Federated": "cognito-identity.amazonaws.com"
|
||||
},
|
||||
"Action": "sts:AssumeRoleWithWebIdentity"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"UnauthRole": {
|
||||
"Type": "AWS::IAM::Role",
|
||||
"Properties": {
|
||||
"RoleName": {
|
||||
"Ref": "UnauthRoleName"
|
||||
},
|
||||
"AssumeRolePolicyDocument": {
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "",
|
||||
"Effect": "Deny",
|
||||
"Principal": {
|
||||
"Federated": "cognito-identity.amazonaws.com"
|
||||
},
|
||||
"Action": "sts:AssumeRoleWithWebIdentity"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"hostingS3AndCloudFront": {
|
||||
"Type": "AWS::CloudFormation::Stack",
|
||||
"Properties": {
|
||||
"TemplateURL": "https://s3.amazonaws.com/amplify-hpiot-react-hpiot-162610-deployment/amplify-cfn-templates/hosting/template.json",
|
||||
"Parameters": {
|
||||
"bucketName": "hpiot-react",
|
||||
"env": "hpiot"
|
||||
}
|
||||
}
|
||||
},
|
||||
"authhpiotreact8c9024fb": {
|
||||
"Type": "AWS::CloudFormation::Stack",
|
||||
"Properties": {
|
||||
"TemplateURL": "https://s3.amazonaws.com/amplify-hpiot-react-hpiot-162610-deployment/amplify-cfn-templates/auth/hpiotreact8c9024fb-cloudformation-template.yml",
|
||||
"Parameters": {
|
||||
"identityPoolName": "hpiotwebapp78e5977f_identitypool_78e5977f",
|
||||
"allowUnauthenticatedIdentities": false,
|
||||
"resourceNameTruncated": "hpiotw78e5977f",
|
||||
"userPoolName": "hpiotwebapp78e5977f_userpool_78e5977f",
|
||||
"autoVerifiedAttributes": "email",
|
||||
"mfaConfiguration": "OFF",
|
||||
"mfaTypes": "SMS Text Message",
|
||||
"smsAuthenticationMessage": "Your authentication code is {####}",
|
||||
"smsVerificationMessage": "Your verification code is {####}",
|
||||
"emailVerificationSubject": "Your verification code",
|
||||
"emailVerificationMessage": "Your verification code is {####}",
|
||||
"defaultPasswordPolicy": false,
|
||||
"passwordPolicyMinLength": 8,
|
||||
"passwordPolicyCharacters": "",
|
||||
"requiredAttributes": "email",
|
||||
"userpoolClientGenerateSecret": true,
|
||||
"userpoolClientRefreshTokenValidity": 30,
|
||||
"userpoolClientWriteAttributes": "email",
|
||||
"userpoolClientReadAttributes": "email",
|
||||
"userpoolClientLambdaRole": "hpiotw78e5977f_userpoolclient_lambda_role",
|
||||
"userpoolClientSetAttributes": false,
|
||||
"resourceName": "hpiotwebapp78e5977f",
|
||||
"authSelections": "identityPoolAndUserPool",
|
||||
"authRoleArn": {
|
||||
"Fn::GetAtt": [
|
||||
"AuthRole",
|
||||
"Arn"
|
||||
]
|
||||
},
|
||||
"unauthRoleArn": {
|
||||
"Fn::GetAtt": [
|
||||
"UnauthRole",
|
||||
"Arn"
|
||||
]
|
||||
},
|
||||
"useDefault": "default",
|
||||
"usernameAttributes": "email, phone_number",
|
||||
"dependsOn": "",
|
||||
"env": "hpiot"
|
||||
}
|
||||
}
|
||||
},
|
||||
"UpdateRolesWithIDPFunction": {
|
||||
"DependsOn": [
|
||||
"AuthRole",
|
||||
"UnauthRole",
|
||||
"authhpiotreact8c9024fb"
|
||||
],
|
||||
"Type": "AWS::Lambda::Function",
|
||||
"Properties": {
|
||||
"Code": {
|
||||
"ZipFile": {
|
||||
"Fn::Join": [
|
||||
"\n",
|
||||
[
|
||||
"const response = require('cfn-response');",
|
||||
"const aws = require('aws-sdk');",
|
||||
"let responseData = {};",
|
||||
"exports.handler = function(event, context) {",
|
||||
" try {",
|
||||
" let authRoleName = event.ResourceProperties.authRoleName;",
|
||||
" let unauthRoleName = event.ResourceProperties.unauthRoleName;",
|
||||
" let idpId = event.ResourceProperties.idpId;",
|
||||
" let promises = [];",
|
||||
" let authParamsJson = { 'Version': '2012-10-17','Statement': [{'Effect': 'Allow','Principal': {'Federated': 'cognito-identity.amazonaws.com'},'Action': 'sts:AssumeRoleWithWebIdentity','Condition': {'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}}}]};",
|
||||
" let unauthParamsJson = { 'Version': '2012-10-17','Statement': [{'Effect': 'Allow','Principal': {'Federated': 'cognito-identity.amazonaws.com'},'Action': 'sts:AssumeRoleWithWebIdentity','Condition': {'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}}}]};",
|
||||
" if (event.RequestType == 'Delete') {",
|
||||
" delete authParamsJson.Statement.Condition;",
|
||||
" delete unauthParamsJson.Statement.Condition;",
|
||||
" let authParams = { PolicyDocument: JSON.stringify(authParamsJson),RoleName: authRoleName};",
|
||||
" let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson),RoleName: unauthRoleName};",
|
||||
" const iam = new aws.IAM({ apiVersion: '2010-05-08', region: event.ResourceProperties.region});",
|
||||
" promises.push(iam.updateAssumeRolePolicy(authParams).promise());",
|
||||
" promises.push(iam.updateAssumeRolePolicy(unauthParams).promise());",
|
||||
" Promise.all(promises)",
|
||||
" .then((res) => {",
|
||||
" console.log(\"delete response data\" + JSON.stringify(res));",
|
||||
" response.send(event, context, response.SUCCESS, {});",
|
||||
" });",
|
||||
" }",
|
||||
" if (event.RequestType == 'Update' || event.RequestType == 'Create') {",
|
||||
" const iam = new aws.IAM({ apiVersion: '2010-05-08', region: event.ResourceProperties.region});",
|
||||
" let authParams = { PolicyDocument: JSON.stringify(authParamsJson),RoleName: authRoleName};",
|
||||
" let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson),RoleName: unauthRoleName};",
|
||||
" promises.push(iam.updateAssumeRolePolicy(authParams).promise());",
|
||||
" promises.push(iam.updateAssumeRolePolicy(unauthParams).promise());",
|
||||
" Promise.all(promises)",
|
||||
" .then((res) => {",
|
||||
" console.log(\"createORupdate\" + res);",
|
||||
" console.log(\"response data\" + JSON.stringify(res));",
|
||||
" response.send(event, context, response.SUCCESS, {});",
|
||||
" });",
|
||||
" }",
|
||||
" } catch(err) {",
|
||||
" console.log(err.stack);",
|
||||
" responseData = {Error: err};",
|
||||
" response.send(event, context, response.FAILED, responseData);",
|
||||
" throw err;",
|
||||
" }",
|
||||
"};"
|
||||
]
|
||||
]
|
||||
}
|
||||
},
|
||||
"Handler": "index.handler",
|
||||
"Runtime": "nodejs10.x",
|
||||
"Timeout": "300",
|
||||
"Role": {
|
||||
"Fn::GetAtt": [
|
||||
"UpdateRolesWithIDPFunctionRole",
|
||||
"Arn"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"UpdateRolesWithIDPFunctionOutputs": {
|
||||
"Type": "Custom::LambdaCallout",
|
||||
"Properties": {
|
||||
"ServiceToken": {
|
||||
"Fn::GetAtt": [
|
||||
"UpdateRolesWithIDPFunction",
|
||||
"Arn"
|
||||
]
|
||||
},
|
||||
"region": {
|
||||
"Ref": "AWS::Region"
|
||||
},
|
||||
"idpId": {
|
||||
"Fn::GetAtt": [
|
||||
"authhpiotreact8c9024fb",
|
||||
"Outputs.IdentityPoolId"
|
||||
]
|
||||
},
|
||||
"authRoleName": {
|
||||
"Ref": "AuthRoleName"
|
||||
},
|
||||
"unauthRoleName": {
|
||||
"Ref": "UnauthRoleName"
|
||||
}
|
||||
}
|
||||
},
|
||||
"UpdateRolesWithIDPFunctionRole": {
|
||||
"Type": "AWS::IAM::Role",
|
||||
"Properties": {
|
||||
"RoleName": {
|
||||
"Fn::Join": [
|
||||
"",
|
||||
[
|
||||
{
|
||||
"Ref": "AuthRoleName"
|
||||
},
|
||||
"-idp"
|
||||
]
|
||||
]
|
||||
},
|
||||
"AssumeRolePolicyDocument": {
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Service": [
|
||||
"lambda.amazonaws.com"
|
||||
]
|
||||
},
|
||||
"Action": [
|
||||
"sts:AssumeRole"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"Policies": [
|
||||
{
|
||||
"PolicyName": "UpdateRolesWithIDPFunctionPolicy",
|
||||
"PolicyDocument": {
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"logs:CreateLogGroup",
|
||||
"logs:CreateLogStream",
|
||||
"logs:PutLogEvents"
|
||||
],
|
||||
"Resource": "arn:aws:logs:*:*:*"
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": "iam:UpdateAssumeRolePolicy",
|
||||
"Resource": {
|
||||
"Fn::GetAtt": [
|
||||
"AuthRole",
|
||||
"Arn"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": "iam:UpdateAssumeRolePolicy",
|
||||
"Resource": {
|
||||
"Fn::GetAtt": [
|
||||
"UnauthRole",
|
||||
"Arn"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"Outputs": {
|
||||
"Region": {
|
||||
"Description": "CloudFormation provider root stack Region",
|
||||
"Value": {
|
||||
"Ref": "AWS::Region"
|
||||
},
|
||||
"Export": {
|
||||
"Name": {
|
||||
"Fn::Sub": "${AWS::StackName}-Region"
|
||||
}
|
||||
}
|
||||
},
|
||||
"StackName": {
|
||||
"Description": "CloudFormation provider root stack ID",
|
||||
"Value": {
|
||||
"Ref": "AWS::StackName"
|
||||
},
|
||||
"Export": {
|
||||
"Name": {
|
||||
"Fn::Sub": "${AWS::StackName}-StackName"
|
||||
}
|
||||
}
|
||||
},
|
||||
"StackId": {
|
||||
"Description": "CloudFormation provider root stack name",
|
||||
"Value": {
|
||||
"Ref": "AWS::StackId"
|
||||
},
|
||||
"Export": {
|
||||
"Name": {
|
||||
"Fn::Sub": "${AWS::StackName}-StackId"
|
||||
}
|
||||
}
|
||||
},
|
||||
"DeploymentBucketName": {
|
||||
"Description": "CloudFormation provider root stack deployment bucket name",
|
||||
"Value": {
|
||||
"Ref": "DeploymentBucketName"
|
||||
},
|
||||
"Export": {
|
||||
"Name": {
|
||||
"Fn::Sub": "${AWS::StackName}-DeploymentBucketName"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AuthRoleArn": {
|
||||
"Value": {
|
||||
"Fn::GetAtt": [
|
||||
"AuthRole",
|
||||
"Arn"
|
||||
]
|
||||
}
|
||||
},
|
||||
"UnauthRoleArn": {
|
||||
"Value": {
|
||||
"Fn::GetAtt": [
|
||||
"UnauthRole",
|
||||
"Arn"
|
||||
]
|
||||
}
|
||||
},
|
||||
"AuthRoleName": {
|
||||
"Value": {
|
||||
"Ref": "AuthRole"
|
||||
}
|
||||
},
|
||||
"UnauthRoleName": {
|
||||
"Value": {
|
||||
"Ref": "UnauthRole"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@
|
||||
"@testing-library/user-event": "^7.2.1",
|
||||
"aws-amplify": "^2.2.6",
|
||||
"aws-amplify-react": "^3.1.7",
|
||||
"core-js": "^3.6.4",
|
||||
"npx": "^10.2.2",
|
||||
"react": "^16.13.1",
|
||||
"react-charts": "^2.0.0-beta.6",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
BIN
public/icon-512x512.png
Normal file
BIN
public/icon-512x512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
@@ -24,7 +24,7 @@
|
||||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
<title>HP IoT</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
19
src/App.css
19
src/App.css
@@ -2,17 +2,6 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
height: 40vmin;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 4vh;
|
||||
@@ -28,11 +17,3 @@
|
||||
color: #61dafb;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
78
src/App.js
78
src/App.js
@@ -20,62 +20,6 @@ Amplify.configure(awsconfig);
|
||||
let token = "";
|
||||
|
||||
|
||||
function connect() {
|
||||
connectWS(token, currentRole);
|
||||
subscribeWS();
|
||||
socket$.next({action: 'getDashboardData', policy: currentRole});
|
||||
}
|
||||
|
||||
function connectWS(token, role) {
|
||||
socket$ = new WebSocketSubject('wss://3fseaywb8b.execute-api.us-east-1.amazonaws.com/prototype?token=' + token +
|
||||
'&role=' + role);
|
||||
//console.log(socket$);
|
||||
}
|
||||
|
||||
function subscribeWS() {
|
||||
socket$.subscribe((message) => {
|
||||
console.log(message);
|
||||
if (message instanceof Array) {
|
||||
message.forEach(element => {
|
||||
updateList(element);
|
||||
});
|
||||
} else {
|
||||
updateList(message);
|
||||
}
|
||||
serverMessages.sort((a, b) => a.location.localeCompare(b.location));
|
||||
console.log(serverMessages);
|
||||
},
|
||||
(err) => console.error(err),
|
||||
() => console.warn('Complete: Websocket closed')
|
||||
);
|
||||
|
||||
|
||||
function updateList(obj) {
|
||||
//console.log(serverMessages);
|
||||
//console.log(obj);
|
||||
const index = serverMessages.findIndex((e) => e.location === obj.location);
|
||||
|
||||
if (index === -1) {
|
||||
serverMessages.push(obj);
|
||||
|
||||
} else {
|
||||
Object.keys(obj).forEach(element => {
|
||||
serverMessages[index][element] = obj[element];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function setRole(index) {
|
||||
currentRole = roles[index];
|
||||
roleSubject.next(currentRole);
|
||||
socket$.complete();
|
||||
serverMessages = [];
|
||||
connect();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Dashboard extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
@@ -97,7 +41,14 @@ class Dashboard extends React.Component {
|
||||
serverMessages[index][element] = obj[element];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
setRole(index) {
|
||||
this.setState({promiseIsResolved: false})
|
||||
currentRole = roles[1];
|
||||
socket$.complete();
|
||||
serverMessages = [];
|
||||
this.componentDidMount();
|
||||
}
|
||||
componentDidMount(){
|
||||
Auth.currentAuthenticatedUser().then(data => {
|
||||
//console.log(data);
|
||||
@@ -106,7 +57,9 @@ class Dashboard extends React.Component {
|
||||
groups.forEach( (element, index, array) => {
|
||||
array[index] = element.replace(/_/g, ' ');
|
||||
});
|
||||
if (! currentRole) {
|
||||
currentRole = data.signInUserSession.idToken.payload['cognito:roles'][0];
|
||||
}
|
||||
token = data.signInUserSession.accessToken.jwtToken;
|
||||
roleSubject.subscribe({
|
||||
next: r => r
|
||||
@@ -114,7 +67,6 @@ class Dashboard extends React.Component {
|
||||
socket$ = new WebSocketSubject('wss://3fseaywb8b.execute-api.us-east-1.amazonaws.com/prototype?token=' + token +
|
||||
'&role=' + currentRole);
|
||||
socket$.subscribe((message) => {
|
||||
console.log(message);
|
||||
if (message instanceof Array) {
|
||||
message.forEach(element => {
|
||||
this.updateList(element);
|
||||
@@ -139,10 +91,15 @@ class Dashboard extends React.Component {
|
||||
if(!this.state.promiseIsResolved){return null}
|
||||
else{
|
||||
return (
|
||||
<div>
|
||||
<header className="App-header">
|
||||
<div className="Nav-bar"><button onClick={this.setRole.bind(this)}>Change Role</button></div>
|
||||
</header>
|
||||
<div className="Dashboard">
|
||||
<BarChart data = {serverMessages}/>
|
||||
<LineChart data = {serverMessages}/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -150,11 +107,10 @@ class Dashboard extends React.Component {
|
||||
}
|
||||
|
||||
function App() {
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<div className="Nav-bar"><p>This is where the nav-bar will be</p></div>
|
||||
</header>
|
||||
|
||||
<Dashboard />
|
||||
</div>
|
||||
);
|
||||
|
||||
18
src/aws-exports.js
Normal file
18
src/aws-exports.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
|
||||
|
||||
const awsmobile = {
|
||||
"aws_project_region": "us-east-1",
|
||||
"aws_content_delivery_bucket": "hpiot-react-hpiot",
|
||||
"aws_content_delivery_bucket_region": "us-east-1",
|
||||
"aws_content_delivery_url": "http://hpiot-react-hpiot.s3-website-us-east-1.amazonaws.com",
|
||||
"aws_cognito_identity_pool_id": "us-east-1:c018fdcf-3b1a-45db-a70e-daf34e217f8f",
|
||||
"aws_cognito_region": "us-east-1",
|
||||
"aws_user_pools_id": "us-east-1_XcUWWJXMT",
|
||||
"aws_user_pools_web_client_id": "ms2jhuludm93g9qfpuio8m9k6",
|
||||
"oauth": {},
|
||||
"aws_user_files_s3_bucket": "hpiotuserstorage-devs",
|
||||
"aws_user_files_s3_bucket_region": "us-east-1"
|
||||
};
|
||||
|
||||
|
||||
export default awsmobile;
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import {
|
||||
BarChart, Bar, Cell, XAxis, YAxis, CartesianGrid, Tooltip, Legend,
|
||||
BarChart, Bar, Brush, ReferenceLine, XAxis, YAxis, CartesianGrid, Tooltip, Legend,
|
||||
} from 'recharts';
|
||||
|
||||
|
||||
@@ -26,7 +26,9 @@ export default class Example extends PureComponent {
|
||||
<XAxis dataKey="location" />
|
||||
<YAxis />
|
||||
<Tooltip />
|
||||
<Legend />
|
||||
<Legend verticalAlign="top" wrapperStyle={{ lineHeight: '40px' }} />
|
||||
<ReferenceLine y={0} stroke="#000" />
|
||||
<Brush dataKey="name" height={30} stroke="#8884d8" />
|
||||
<Bar dataKey="volumeflow" fill="#8884d8" />
|
||||
<Bar dataKey="depth" fill="#82ca9d" />
|
||||
</BarChart>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import {
|
||||
Label, LineChart, Line, CartesianGrid, XAxis, YAxis, Tooltip, ReferenceArea,
|
||||
Label, LineChart, Line, CartesianGrid, XAxis, YAxis, Tooltip, ReferenceArea, Brush
|
||||
} from 'recharts';
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ export default class Example extends PureComponent {
|
||||
|
||||
zoom() {
|
||||
let { refAreaLeft, refAreaRight, data } = this.state;
|
||||
|
||||
if (refAreaLeft === refAreaRight || refAreaRight === '') {
|
||||
this.setState(() => ({
|
||||
refAreaLeft: '',
|
||||
@@ -50,8 +49,11 @@ export default class Example extends PureComponent {
|
||||
if (refAreaLeft > refAreaRight) [refAreaLeft, refAreaRight] = [refAreaRight, refAreaLeft];
|
||||
|
||||
// yAxis domain
|
||||
const [bottom, top] = getAxisYDomain(refAreaLeft, refAreaRight, 'volumeflow', 5, this.state.data);
|
||||
const [bottom2, top2] = getAxisYDomain(refAreaLeft, refAreaRight, 'depth', 50, this.state.data);
|
||||
let refAreaLeftNum = data.findIndex((e) => e.location === refAreaLeft);
|
||||
let refAreaRightNum = data.findIndex((e) => e.location === refAreaRight);
|
||||
console.log(refAreaLeft,refAreaRight);
|
||||
const [bottom, top] = getAxisYDomain(refAreaLeftNum, refAreaRightNum, 'volumeflow', 5, data);
|
||||
const [bottom2, top2] = getAxisYDomain(refAreaLeftNum, refAreaRightNum, 'depth', 50, data);
|
||||
|
||||
this.setState(() => ({
|
||||
refAreaLeft: '',
|
||||
@@ -85,7 +87,6 @@ export default class Example extends PureComponent {
|
||||
const {
|
||||
data, barIndex, left, right, refAreaLeft, refAreaRight, top, bottom, top2, bottom2,
|
||||
} = this.state;
|
||||
|
||||
return (
|
||||
<div className="highlight-bar-charts" style={{ userSelect: 'none' }}>
|
||||
<button
|
||||
@@ -98,20 +99,21 @@ export default class Example extends PureComponent {
|
||||
</button>
|
||||
|
||||
<LineChart
|
||||
width={800}
|
||||
height={400}
|
||||
width={1000}
|
||||
height={600}
|
||||
data={data}
|
||||
onMouseDown={e => this.setState({ refAreaLeft: e.activeLabel })}
|
||||
onMouseMove={e => this.state.refAreaLeft && this.setState({ refAreaRight: e.activeLabel })}
|
||||
onMouseUp={this.zoom.bind(this)}
|
||||
//onMouseDown={e => this.setState({ refAreaLeft: e.activeLabel })}
|
||||
//onMouseMove={e => this.state.refAreaLeft && this.setState({ refAreaRight: e.activeLabel })}
|
||||
//onMouseUp={this.zoom.bind(this)}
|
||||
>
|
||||
<CartesianGrid strokeDasharray="3 3" />
|
||||
<XAxis
|
||||
allowDataOverflow
|
||||
dataKey="timestamp"
|
||||
dataKey="location"
|
||||
domain={[left, right]}
|
||||
type="number"
|
||||
type="category"
|
||||
/>
|
||||
<Brush dataKey="name" height={30} stroke="#8884d8" />
|
||||
<YAxis
|
||||
allowDataOverflow
|
||||
domain={[bottom, top]}
|
||||
@@ -127,7 +129,7 @@ export default class Example extends PureComponent {
|
||||
/>
|
||||
<Tooltip />
|
||||
<Line yAxisId="1" type="natural" dataKey="volumeflow" stroke="#8884d8" animationDuration={300} />
|
||||
<Line yAxisId="2" type="natural" dataKey="depth" stroke="#82ca9d" animationDuration={300} />
|
||||
<Line yAxisId="1" type="natural" dataKey="depth" stroke="#82ca9d" animationDuration={300} />
|
||||
|
||||
|
||||
{
|
||||
|
||||
269
yarn.lock
269
yarn.lock
@@ -1099,6 +1099,13 @@
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/runtime@^7.1.2":
|
||||
version "7.9.2"
|
||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.9.2.tgz#d90df0583a3a252f09aaa619665367bae518db06"
|
||||
integrity sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==
|
||||
dependencies:
|
||||
regenerator-runtime "^0.13.4"
|
||||
|
||||
"@babel/template@^7.4.0", "@babel/template@^7.8.3", "@babel/template@^7.8.6":
|
||||
version "7.8.6"
|
||||
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b"
|
||||
@@ -1353,6 +1360,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b"
|
||||
integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==
|
||||
|
||||
"@reach/observe-rect@^1.0.3":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@reach/observe-rect/-/observe-rect-1.1.0.tgz#4e967a93852b6004c3895d9ed8d4e5b41895afde"
|
||||
integrity sha512-kE+jvoj/OyJV24C03VvLt5zclb9ArJi04wWXMMFwQvdZjdHoBlN4g0ZQFjyy/ejPF1Z/dpUD5dhRdBiUmIGZTA==
|
||||
|
||||
"@sheerun/mutationobserver-shim@^0.3.2":
|
||||
version "0.3.3"
|
||||
resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz#5405ee8e444ed212db44e79351f0c70a582aae25"
|
||||
@@ -2533,6 +2545,11 @@ babylon@^6.18.0:
|
||||
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
|
||||
integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==
|
||||
|
||||
balanced-match@^0.4.2:
|
||||
version "0.4.2"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
|
||||
integrity sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
|
||||
@@ -3204,6 +3221,11 @@ class-utils@^0.3.5:
|
||||
isobject "^3.0.0"
|
||||
static-extend "^0.1.1"
|
||||
|
||||
classnames@^2.2.5:
|
||||
version "2.2.6"
|
||||
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
|
||||
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
|
||||
|
||||
clean-css@^4.2.3:
|
||||
version "4.2.3"
|
||||
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.3.tgz#507b5de7d97b48ee53d84adb0160ff6216380f78"
|
||||
@@ -3547,7 +3569,7 @@ core-js-pure@^3.0.0:
|
||||
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.6.4.tgz#4bf1ba866e25814f149d4e9aaa08c36173506e3a"
|
||||
integrity sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==
|
||||
|
||||
core-js@^2.4.0:
|
||||
core-js@^2.4.0, core-js@^2.6.10:
|
||||
version "2.6.11"
|
||||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.11.tgz#38831469f9922bded8ee21c9dc46985e0399308c"
|
||||
integrity sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==
|
||||
@@ -3907,6 +3929,97 @@ cyclist@^1.0.1:
|
||||
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
|
||||
integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=
|
||||
|
||||
"d3-array@1.2.0 - 2":
|
||||
version "2.4.0"
|
||||
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-2.4.0.tgz#87f8b9ad11088769c82b5ea846bcb1cc9393f242"
|
||||
integrity sha512-KQ41bAF2BMakf/HdKT865ALd4cgND6VcIztVQZUTt0+BH3RWy6ZYnHghVXf6NFjt2ritLr8H1T8LreAAlfiNcw==
|
||||
|
||||
d3-array@^1.2.0:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.4.tgz#635ce4d5eea759f6f605863dbcfc30edc737f71f"
|
||||
integrity sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==
|
||||
|
||||
d3-collection@1:
|
||||
version "1.0.7"
|
||||
resolved "https://registry.yarnpkg.com/d3-collection/-/d3-collection-1.0.7.tgz#349bd2aa9977db071091c13144d5e4f16b5b310e"
|
||||
integrity sha512-ii0/r5f4sjKNTfh84Di+DpztYwqKhEyUlKoPrzUFfeSkWxjW49xU2QzO9qrPrNkpdI0XJkfzvmTu8V2Zylln6A==
|
||||
|
||||
d3-color@1:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/d3-color/-/d3-color-1.4.0.tgz#89c45a995ed773b13314f06460df26d60ba0ecaf"
|
||||
integrity sha512-TzNPeJy2+iEepfiL92LAAB7fvnp/dV2YwANPVHdDWmYMm23qIJBYww3qT8I8C1wXrmrg4UWs7BKc2tKIgyjzHg==
|
||||
|
||||
d3-delaunay@^5.1.6:
|
||||
version "5.2.1"
|
||||
resolved "https://registry.yarnpkg.com/d3-delaunay/-/d3-delaunay-5.2.1.tgz#0c4b280eb00194986ac4a3df9c81d32bf216cb36"
|
||||
integrity sha512-ZZdeJl6cKRyqYVFYK+/meXvWIrAvZsZTD7WSxl4OPXCmuXNgDyACAClAJHD63zL25TA+IJGURUNO7rFseNFCYw==
|
||||
dependencies:
|
||||
delaunator "4"
|
||||
|
||||
d3-format@1:
|
||||
version "1.4.3"
|
||||
resolved "https://registry.yarnpkg.com/d3-format/-/d3-format-1.4.3.tgz#4e8eb4dff3fdcb891a8489ec6e698601c41b96f1"
|
||||
integrity sha512-mm/nE2Y9HgGyjP+rKIekeITVgBtX97o1nrvHCWX8F/yBYyevUTvu9vb5pUnKwrcSw7o7GuwMOWjS9gFDs4O+uQ==
|
||||
|
||||
d3-interpolate@1, d3-interpolate@^1.2.0, d3-interpolate@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/d3-interpolate/-/d3-interpolate-1.4.0.tgz#526e79e2d80daa383f9e0c1c1c7dcc0f0583e987"
|
||||
integrity sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==
|
||||
dependencies:
|
||||
d3-color "1"
|
||||
|
||||
d3-path@1:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/d3-path/-/d3-path-1.0.9.tgz#48c050bb1fe8c262493a8caf5524e3e9591701cf"
|
||||
integrity sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==
|
||||
|
||||
d3-scale@^2.1.0:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-2.2.2.tgz#4e880e0b2745acaaddd3ede26a9e908a9e17b81f"
|
||||
integrity sha512-LbeEvGgIb8UMcAa0EATLNX0lelKWGYDQiPdHj+gLblGVhGLyNbaCn3EvrJf0A3Y/uOOU5aD6MTh5ZFCdEwGiCw==
|
||||
dependencies:
|
||||
d3-array "^1.2.0"
|
||||
d3-collection "1"
|
||||
d3-format "1"
|
||||
d3-interpolate "1"
|
||||
d3-time "1"
|
||||
d3-time-format "2"
|
||||
|
||||
d3-scale@^3.2.0:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-3.2.1.tgz#da1684adce7261b4bc7a76fe193d887f0e909e69"
|
||||
integrity sha512-huz5byJO/6MPpz6Q8d4lg7GgSpTjIZW/l+1MQkzKfu2u8P6hjaXaStOpmyrD6ymKoW87d2QVFCKvSjLwjzx/rA==
|
||||
dependencies:
|
||||
d3-array "1.2.0 - 2"
|
||||
d3-format "1"
|
||||
d3-interpolate "^1.2.0"
|
||||
d3-time "1"
|
||||
d3-time-format "2"
|
||||
|
||||
d3-shape@^1.2.0, d3-shape@^1.3.7:
|
||||
version "1.3.7"
|
||||
resolved "https://registry.yarnpkg.com/d3-shape/-/d3-shape-1.3.7.tgz#df63801be07bc986bc54f63789b4fe502992b5d7"
|
||||
integrity sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==
|
||||
dependencies:
|
||||
d3-path "1"
|
||||
|
||||
d3-time-format@2:
|
||||
version "2.2.3"
|
||||
resolved "https://registry.yarnpkg.com/d3-time-format/-/d3-time-format-2.2.3.tgz#0c9a12ee28342b2037e5ea1cf0b9eb4dd75f29cb"
|
||||
integrity sha512-RAHNnD8+XvC4Zc4d2A56Uw0yJoM7bsvOlJR33bclxq399Rak/b9bhvu/InjxdWhPtkgU53JJcleJTGkNRnN6IA==
|
||||
dependencies:
|
||||
d3-time "1"
|
||||
|
||||
d3-time@1:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/d3-time/-/d3-time-1.1.0.tgz#b1e19d307dae9c900b7e5b25ffc5dcc249a8a0f1"
|
||||
integrity sha512-Xh0isrZ5rPYYdqhAVk8VLnMEidhz5aP7htAADH6MfzgmmicPkTo8LhkLxci61/lCB7n7UmE3bN0leRt+qvkLxA==
|
||||
|
||||
d3-voronoi@^1.1.2:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/d3-voronoi/-/d3-voronoi-1.1.4.tgz#dd3c78d7653d2bb359284ae478645d95944c8297"
|
||||
integrity sha512-dArJ32hchFsrQ8uMiTBLq256MpnZjeuBtdHpaDlYuQyjU0CVzCJl/BVW+SkszaAeH95D/8gxqAhgx0ouAWAfRg==
|
||||
|
||||
d@1, d@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a"
|
||||
@@ -3974,6 +4087,11 @@ decamelize@^1.1.1, decamelize@^1.2.0:
|
||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
||||
|
||||
decimal.js-light@^2.4.1:
|
||||
version "2.5.0"
|
||||
resolved "https://registry.yarnpkg.com/decimal.js-light/-/decimal.js-light-2.5.0.tgz#ca7faf504c799326df94b0ab920424fdfc125348"
|
||||
integrity sha512-b3VJCbd2hwUpeRGG3Toob+CRo8W22xplipNhP3tN7TSVB/cyMX71P1vM2Xjc9H74uV6dS2hDDmo/rHq8L87Upg==
|
||||
|
||||
decode-uri-component@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
|
||||
@@ -4058,6 +4176,11 @@ del@^4.1.1:
|
||||
pify "^4.0.1"
|
||||
rimraf "^2.6.3"
|
||||
|
||||
delaunator@4:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-4.0.1.tgz#3d779687f57919a7a418f8ab947d3bddb6846957"
|
||||
integrity sha512-WNPWi1IRKZfCt/qIDMfERkDp93+iZEmOxN2yy4Jg+Xhv8SLk2UTqqbe1sfiipn0and9QrE914/ihdx82Y/Giag==
|
||||
|
||||
delayed-stream@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||
@@ -4193,6 +4316,13 @@ dom-converter@^0.2:
|
||||
dependencies:
|
||||
utila "~0.4"
|
||||
|
||||
dom-helpers@^3.4.0:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8"
|
||||
integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.1.2"
|
||||
|
||||
dom-serializer@0:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51"
|
||||
@@ -7340,6 +7470,11 @@ lodash.clonedeep@~4.5.0:
|
||||
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
|
||||
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
|
||||
|
||||
lodash.debounce@^4.0.8:
|
||||
version "4.0.8"
|
||||
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
|
||||
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=
|
||||
|
||||
lodash.memoize@^4.1.2:
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe"
|
||||
@@ -7365,6 +7500,11 @@ lodash.templatesettings@^4.0.0:
|
||||
dependencies:
|
||||
lodash._reinterpolate "^3.0.0"
|
||||
|
||||
lodash.throttle@^4.1.1:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4"
|
||||
integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ=
|
||||
|
||||
lodash.union@~4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.union/-/lodash.union-4.6.0.tgz#48bb5088409f16f1821666641c44dd1aaae3cd88"
|
||||
@@ -7380,7 +7520,7 @@ lodash.without@~4.4.0:
|
||||
resolved "https://registry.yarnpkg.com/lodash.without/-/lodash.without-4.4.0.tgz#3cd4574a00b67bae373a94b748772640507b7aac"
|
||||
integrity sha1-PNRXSgC2e643OpS3SHcmQFB7eqw=
|
||||
|
||||
"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5:
|
||||
"lodash@>=3.5 <5", lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.5, lodash@~4.17.4:
|
||||
version "4.17.15"
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
||||
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
||||
@@ -7494,6 +7634,11 @@ map-visit@^1.0.0:
|
||||
dependencies:
|
||||
object-visit "^1.0.0"
|
||||
|
||||
math-expression-evaluator@^1.2.14:
|
||||
version "1.2.22"
|
||||
resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.22.tgz#c14dcb3d8b4d150e5dcea9c68c8dad80309b0d5e"
|
||||
integrity sha512-L0j0tFVZBQQLeEjmWOvDLoRciIY8gQGWahvkztXUal8jH8R5Rlqo9GCvgqvXcy9LQhEWdQCVvzqAbxgYNt4blQ==
|
||||
|
||||
md5.js@^1.3.4:
|
||||
version "1.3.5"
|
||||
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
|
||||
@@ -9795,7 +9940,7 @@ querystringify@^2.1.1:
|
||||
resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e"
|
||||
integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==
|
||||
|
||||
raf@^3.4.1:
|
||||
raf@^3.4.0, raf@^3.4.1:
|
||||
version "3.4.1"
|
||||
resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
|
||||
integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==
|
||||
@@ -9854,6 +9999,18 @@ react-app-polyfill@^1.0.6:
|
||||
regenerator-runtime "^0.13.3"
|
||||
whatwg-fetch "^3.0.0"
|
||||
|
||||
react-charts@^2.0.0-beta.6:
|
||||
version "2.0.0-beta.6"
|
||||
resolved "https://registry.yarnpkg.com/react-charts/-/react-charts-2.0.0-beta.6.tgz#5035c49794aa151f0a51a5aeae066805e5d54edf"
|
||||
integrity sha512-GxcErCb/TSCsgug4uumSyzhXflwtQRwsN6nGA1e8dIqh9Z6gRFgDZF6DNCmvuHLibnu0JfLDmyaG7+MFgBzuDQ==
|
||||
dependencies:
|
||||
"@reach/observe-rect" "^1.0.3"
|
||||
d3-delaunay "^5.1.6"
|
||||
d3-scale "^3.2.0"
|
||||
d3-shape "^1.3.7"
|
||||
d3-voronoi "^1.1.2"
|
||||
raf "^3.4.1"
|
||||
|
||||
react-dev-utils@^10.2.0:
|
||||
version "10.2.0"
|
||||
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-10.2.0.tgz#b11cc48aa2be2502fb3c27a50d1dfa95cfa9dfe0"
|
||||
@@ -9884,15 +10041,15 @@ react-dev-utils@^10.2.0:
|
||||
strip-ansi "6.0.0"
|
||||
text-table "0.2.0"
|
||||
|
||||
react-dom@^16.13.0:
|
||||
version "16.13.0"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.0.tgz#cdde54b48eb9e8a0ca1b3dc9943d9bb409b81866"
|
||||
integrity sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==
|
||||
react-dom@^16.13.1:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
|
||||
integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.2"
|
||||
scheduler "^0.19.0"
|
||||
scheduler "^0.19.1"
|
||||
|
||||
react-error-overlay@^6.0.6:
|
||||
version "6.0.6"
|
||||
@@ -9904,6 +10061,21 @@ react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4:
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.0.tgz#0f37c3613c34fe6b37cd7f763a0d6293ab15c527"
|
||||
integrity sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==
|
||||
|
||||
react-lifecycles-compat@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
|
||||
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
|
||||
|
||||
react-resize-detector@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/react-resize-detector/-/react-resize-detector-2.3.0.tgz#57bad1ae26a28a62a2ddb678ba6ffdf8fa2b599c"
|
||||
integrity sha512-oCAddEWWeFWYH5FAcHdBYcZjAw9fMzRUK9sWSx6WvSSOPVRxcHd5zTIGy/mOus+AhN/u6T4TMiWxvq79PywnJQ==
|
||||
dependencies:
|
||||
lodash.debounce "^4.0.8"
|
||||
lodash.throttle "^4.1.1"
|
||||
prop-types "^15.6.0"
|
||||
resize-observer-polyfill "^1.5.0"
|
||||
|
||||
react-scripts@3.4.0:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-3.4.0.tgz#f413680f0b5b937c8879ba1ffdae9b8c5b364bf5"
|
||||
@@ -9964,10 +10136,30 @@ react-scripts@3.4.0:
|
||||
optionalDependencies:
|
||||
fsevents "2.1.2"
|
||||
|
||||
react@^16.13.0:
|
||||
version "16.13.0"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-16.13.0.tgz#d046eabcdf64e457bbeed1e792e235e1b9934cf7"
|
||||
integrity sha512-TSavZz2iSLkq5/oiE7gnFzmURKZMltmi193rm5HEoUDAXpzT9Kzw6oNZnGoai/4+fUnm7FqS5dwgUL34TujcWQ==
|
||||
react-smooth@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "https://registry.yarnpkg.com/react-smooth/-/react-smooth-1.0.5.tgz#94ae161d7951cdd893ccb7099d031d342cb762ad"
|
||||
integrity sha512-eW057HT0lFgCKh8ilr0y2JaH2YbNcuEdFpxyg7Gf/qDKk9hqGMyXryZJ8iMGJEuKH0+wxS0ccSsBBB3W8yCn8w==
|
||||
dependencies:
|
||||
lodash "~4.17.4"
|
||||
prop-types "^15.6.0"
|
||||
raf "^3.4.0"
|
||||
react-transition-group "^2.5.0"
|
||||
|
||||
react-transition-group@^2.5.0:
|
||||
version "2.9.0"
|
||||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d"
|
||||
integrity sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg==
|
||||
dependencies:
|
||||
dom-helpers "^3.4.0"
|
||||
loose-envify "^1.4.0"
|
||||
prop-types "^15.6.2"
|
||||
react-lifecycles-compat "^3.0.4"
|
||||
|
||||
react@^16.13.1:
|
||||
version "16.13.1"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
|
||||
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
@@ -10135,6 +10327,30 @@ realpath-native@^1.1.0:
|
||||
dependencies:
|
||||
util.promisify "^1.0.0"
|
||||
|
||||
recharts-scale@^0.4.2:
|
||||
version "0.4.3"
|
||||
resolved "https://registry.yarnpkg.com/recharts-scale/-/recharts-scale-0.4.3.tgz#040b4f638ed687a530357292ecac880578384b59"
|
||||
integrity sha512-t8p5sccG9Blm7c1JQK/ak9O8o95WGhNXD7TXg/BW5bYbVlr6eCeRBNpgyigD4p6pSSMehC5nSvBUPj6F68rbFA==
|
||||
dependencies:
|
||||
decimal.js-light "^2.4.1"
|
||||
|
||||
recharts@^1.8.5:
|
||||
version "1.8.5"
|
||||
resolved "https://registry.yarnpkg.com/recharts/-/recharts-1.8.5.tgz#ca94a3395550946334a802e35004ceb2583fdb12"
|
||||
integrity sha512-tM9mprJbXVEBxjM7zHsIy6Cc41oO/pVYqyAsOHLxlJrbNBuLs0PHB3iys2M+RqCF0//k8nJtZF6X6swSkWY3tg==
|
||||
dependencies:
|
||||
classnames "^2.2.5"
|
||||
core-js "^2.6.10"
|
||||
d3-interpolate "^1.3.0"
|
||||
d3-scale "^2.1.0"
|
||||
d3-shape "^1.2.0"
|
||||
lodash "^4.17.5"
|
||||
prop-types "^15.6.0"
|
||||
react-resize-detector "^2.3.0"
|
||||
react-smooth "^1.0.5"
|
||||
recharts-scale "^0.4.2"
|
||||
reduce-css-calc "^1.3.0"
|
||||
|
||||
recursive-readdir@2.2.2:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f"
|
||||
@@ -10150,6 +10366,22 @@ redent@^3.0.0:
|
||||
indent-string "^4.0.0"
|
||||
strip-indent "^3.0.0"
|
||||
|
||||
reduce-css-calc@^1.3.0:
|
||||
version "1.3.0"
|
||||
resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716"
|
||||
integrity sha1-dHyRTgSWFKTJz7umKYca0dKSdxY=
|
||||
dependencies:
|
||||
balanced-match "^0.4.2"
|
||||
math-expression-evaluator "^1.2.14"
|
||||
reduce-function-call "^1.0.1"
|
||||
|
||||
reduce-function-call@^1.0.1:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/reduce-function-call/-/reduce-function-call-1.0.3.tgz#60350f7fb252c0a67eb10fd4694d16909971300f"
|
||||
integrity sha512-Hl/tuV2VDgWgCSEeWMLwxLZqX7OK59eU1guxXsRKTAyeYimivsKdtcV4fu3r710tpG5GmDKDhQ0HSZLExnNmyQ==
|
||||
dependencies:
|
||||
balanced-match "^1.0.0"
|
||||
|
||||
regenerate-unicode-properties@^8.2.0:
|
||||
version "8.2.0"
|
||||
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz#e5de7111d655e7ba60c057dbe9ff37c87e65cdec"
|
||||
@@ -10376,6 +10608,11 @@ requires-port@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
|
||||
integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=
|
||||
|
||||
resize-observer-polyfill@^1.5.0:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464"
|
||||
integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==
|
||||
|
||||
resolve-cwd@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
|
||||
@@ -10597,10 +10834,10 @@ saxes@^3.1.9:
|
||||
dependencies:
|
||||
xmlchars "^2.1.1"
|
||||
|
||||
scheduler@^0.19.0:
|
||||
version "0.19.0"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.0.tgz#a715d56302de403df742f4a9be11975b32f5698d"
|
||||
integrity sha512-xowbVaTPe9r7y7RUejcK73/j8tt2jfiyTednOvHbA8JoClvMYCp+r8QegLwK/n8zWQAtZb1fFnER4XLBZXrCxA==
|
||||
scheduler@^0.19.1:
|
||||
version "0.19.1"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
|
||||
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
|
||||
Reference in New Issue
Block a user