Skip to content

Commit

Permalink
Synchronizing code from bitbucket repository (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
fotisp authored Aug 20, 2024
1 parent cbf0ec9 commit 948937e
Show file tree
Hide file tree
Showing 16 changed files with 412 additions and 131 deletions.
7 changes: 6 additions & 1 deletion gui/.dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
Dockerfile
**/node_modules
**/dist
/gerrit
/licenses
.env*
!.env.docker
3 changes: 0 additions & 3 deletions gui/.env.development

This file was deleted.

2 changes: 2 additions & 0 deletions gui/.env.docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_API_URL=VITE_API_URL_PLACEHOLDER
CFSB_API_URL=CFSB_API_URL_PLACEHOLDER
7 changes: 5 additions & 2 deletions gui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

/*.env.*
node_modules
dist
dist-ssr
Expand All @@ -24,4 +24,7 @@ dist-ssr

# we are using pnpm-lock.yaml
package-lock.json
yarn.lock
yarn.lock
/gerrit

!.env.docker
1 change: 1 addition & 0 deletions gui/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.13.1
21 changes: 18 additions & 3 deletions gui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
FROM docker.io/library/node:21.4.0-bookworm
COPY . /app
# Build the Vue app
FROM node:20 as build-stage
WORKDIR /app
RUN corepack enable pnpm && pnpm install && npx vue-tsc
COPY package*.json ./
COPY .env.docker ./.env

RUN npm install
COPY ./ .
RUN npm run build

# Copy the compiled app in an NGINX contaier
FROM nginx:alpine as production-stage
RUN mkdir /app
COPY --from=build-stage /app/dist /usr/share/nginx/html

# Executing the script at container runtime
COPY set_env.sh /docker-entrypoint.d/
RUN chmod +x /docker-entrypoint.d/set_env.sh

2 changes: 1 addition & 1 deletion gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"version": "0.0.0",
"engines": {
"node": "v21.4.0"
"node": "v20.9.0"
},
"scripts": {
"serve": "vite",
Expand Down
17 changes: 17 additions & 0 deletions gui/set_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

ROOT_DIR=/usr/share/nginx/html

# Replace env vars in files served by NGINX
for file in $ROOT_DIR/assets/*.js* $ROOT_DIR/index.html;
do
echo "Setting VITE_API_URL_PLACEHOlDER environment variables ${VITE_API_URL}"
sed -i 's|VITE_API_URL_PLACEHOLDER|'${VITE_API_URL}'|g' $file

echo "Setting CFSB_API_URL_PLACEHOLDER environment variables ${CFSB_API_URL}"
sed -i 's|CFSB_API_URL_PLACEHOLDER|'${CFSB_API_URL}'|g' $file
# Your other variables here...
done


exec "$@"
10 changes: 7 additions & 3 deletions gui/src/components/Application/Details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
v-model="env.name"
type="text"
:class="{
'input--invalid': v.name?.$error || hasBackendError(`env[${index}].name`)
'input--invalid': v.name?.$error || hasBackendError(`environmentVariables[${index}].name`)
}"
/>
</div>
Expand All @@ -142,15 +142,19 @@
v-model="env.value"
:type="env.secret ==true ? 'password' : 'text' "
:class="{
'input--invalid': v.value?.$error || hasBackendError(`env[${index}].value`)
'input--invalid': v.value?.$error || hasBackendError(`environmentVariables[${index}].value`)
}"
/>
</div>
</div>
</Table.Td>
<Table.Td class="w-1/6">
<FormSwitch class="ml-auto w-auto">
<FormSwitch.Input id="env-{{index}}-secret" v-model="env.secret" type="checkbox" />
<FormSwitch.Input id="env-{{String(index)}}-secret" v-model="env.secret" type="checkbox"
:class="{
'input--invalid': v.value?.$error || hasBackendError(`environmentVariables[${index}].secret`)
}"
/>
</FormSwitch>
</Table.Td>
<Table.Td class="w-1/6">
Expand Down
3 changes: 2 additions & 1 deletion gui/src/components/Application/Metrics/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<Templates :templates="templates" />
<Parameters :parameters="parameters" :templateNames="templateNames" />

<Metrics :metrics="metrics" :componentList="props.payload.componentList"
<Metrics :metrics="metrics"
:componentList="props.payload.componentList"
:templateNames="templateNames"/>

<div class="flex flex-col space-y-5">
Expand Down
1 change: 1 addition & 0 deletions gui/src/components/Application/Resources.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const resources = computed<Array<IAppResource>>(() =>
uuid: resource.uuid,
title: resource.title,
platform: resource.platform.title,
regions: resource.regions,
enabled: isEnabled
}
})
Expand Down
1 change: 1 addition & 0 deletions gui/src/components/Modal/ResourceCreation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const resourceData = reactive<IResourcePayload>({
platform: {"uuid":'','title':''} as IPlatform,
_platform: [{"uuid":'','title':''} as IPlatform], // TODO Remove this
securityGroup:"",
regions:"",
subnet:"",
endpoint:"",
identityVersion:"",
Expand Down
Loading

0 comments on commit 948937e

Please sign in to comment.