Skip to content

Commit

Permalink
Merge branch 'develop' into FixAssetListTile#6550
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamprakash123 authored Nov 17, 2023
2 parents 3e46775 + 43d08e1 commit b32b243
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 22 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy-staging-gcp:
needs: build-production
needs: build-staging
name: Deploy to staging GCP cluster
runs-on: ubuntu-latest
environment:
Expand Down Expand Up @@ -431,3 +431,45 @@ jobs:
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml
kubectl apply -f care-fe.yaml
deploy-production-meghalaya:
needs: build-production
name: Deploy to GKE Meghalaya
runs-on: ubuntu-latest
environment:
name: Production-Meghalaya
url: https://care.meghealth.gov.in
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/ml-care-infra
token: ${{ secrets.GIT_ACCESS_TOKEN }}
path: kube
ref: main

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials, so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/[email protected]
with:
version: "v1.23.6"
id: install

- name: Deploy Care Fe Production
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml
kubectl apply -f care-fe.yaml
37 changes: 22 additions & 15 deletions src/Components/Facility/Consultations/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,28 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
}
};

const startStreamFeed = () => {
startStream({
onSuccess: () => setStreamStatus(StreamStatus.Playing),
onError: () => {
setStreamStatus(StreamStatus.Offline);
if (!statusReported) {
triggerGoal("Camera Feed Viewed", {
consultationId,
userId: authUser.id,
result: "error",
});
setStatusReported(true);
}
},
});
};

useEffect(() => {
if (cameraAsset.id) {
setTimeout(() => {
startStreamFeed();
}, 1000);
getPresets({
onSuccess: (resp) => setPresets(resp),
onError: (_) => {
Expand All @@ -251,21 +271,8 @@ export const Feed: React.FC<IFeedProps> = ({ consultationId, facilityId }) => {
setStreamStatus(StreamStatus.Loading);
}
tId = setTimeout(() => {
startStream({
onSuccess: () => setStreamStatus(StreamStatus.Playing),
onError: () => {
setStreamStatus(StreamStatus.Offline);
if (!statusReported) {
triggerGoal("Camera Feed Viewed", {
consultationId,
userId: authUser.id,
result: "error",
});
setStatusReported(true);
}
},
});
}, 100);
startStreamFeed();
}, 5000);
} else if (!statusReported) {
triggerGoal("Camera Feed Viewed", {
consultationId,
Expand Down
17 changes: 12 additions & 5 deletions src/Components/Facility/Consultations/LiveFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ const LiveFeed = (props: any) => {
useEffect(() => {
if (cameraAsset?.hostname) {
fetchCameraPresets();
setTimeout(() => {
startStreamFeed();
}, 1000);
}
}, []);

Expand All @@ -192,6 +195,13 @@ const LiveFeed = (props: any) => {
}
}, [page.offset, cameraAsset.id, refreshPresetsHash]);

const startStreamFeed = () => {
startStream({
onSuccess: () => setStreamStatus(StreamStatus.Playing),
onError: () => setStreamStatus(StreamStatus.Offline),
});
};

const viewOptions = (page: number) => {
return presets
? Object.entries(presets)
Expand All @@ -207,11 +217,8 @@ const LiveFeed = (props: any) => {
if (streamStatus !== StreamStatus.Playing) {
setStreamStatus(StreamStatus.Loading);
tId = setTimeout(() => {
startStream({
onSuccess: () => setStreamStatus(StreamStatus.Playing),
onError: () => setStreamStatus(StreamStatus.Offline),
});
}, 500);
startStreamFeed();
}, 5000);
}

return () => {
Expand Down
4 changes: 3 additions & 1 deletion src/Components/Form/FormFields/NumericWithUnitsFormField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export default function NumericWithUnitsFormField(props: Props) {
autoComplete={props.autoComplete}
required={field.required}
value={numValue}
onChange={(e) => field.handleChange(e.target.value + " " + unitValue)}
onChange={(e) =>
field.handleChange(Number(e.target.value) + " " + unitValue)
}
/>
<div className="absolute inset-y-0 right-0 flex items-center">
<select
Expand Down

0 comments on commit b32b243

Please sign in to comment.