Skip to content

Commit

Permalink
Add warning on container restart after deleting envs
Browse files Browse the repository at this point in the history
  • Loading branch information
maggie44 committed Aug 17, 2022
1 parent 14ef50b commit 013975b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ services:
dockerfile: Dockerfile
environment:
NETWORK_MODE: bridge # Tell the app if running in `bridge` or `host` network mode
# ON_DEVICE: true # Specify that this is being deployed to hardware with Balena OS
SET_HOSTNAME: "balena" # Optional. Changes the device hostname. UI will become accesible on `balena.local`.
restart: always
ports:
Expand Down
2 changes: 1 addition & 1 deletion expressjs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Wifi from '@/routes/v1/Wifi'
boot()

// Set backend port number
const port = 80
const port = process.env.BACKEND_PORT || 80

// Speed limit API requests. Useful for FileManager that can require large number of requests for
// uploads and deletes, and prevents abuse of the API.
Expand Down
3 changes: 2 additions & 1 deletion ui/quasar.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ module.exports = configure(function (ctx) {
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
build: {
env: {
BACKEND_HOSTNAME: process.env.BACKEND_HOSTNAME
BACKEND_HOSTNAME: process.env.BACKEND_HOSTNAME,
BACKEND_PORT: process.env.BACKEND_PORT
},
target: {
browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
Expand Down
14 changes: 14 additions & 0 deletions ui/src/components/SystemEnvConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,23 @@ export default defineComponent({
console.error('deleteEnv', error)
selectedRows.value = []
})
// Delay to allow the container to restart and avoid navigation away too early
setTimeout(() => {
isLoading.value = false
$q.notify({
type: 'warning',
message: t('components.system.env_config.restarting_containers'),
timeout: 0,
actions: [
{
label: t('general.close'),
handler: () => {
/* ... */
}
}
]
})
}, 4000)
}
Expand Down

0 comments on commit 013975b

Please sign in to comment.