From 1032801b0703d8dd8c2295790143c21dca3bbe54 Mon Sep 17 00:00:00 2001 From: Buster Neece Date: Thu, 5 Jan 2023 13:48:55 -0600 Subject: [PATCH] Initial WIP final tweaks. --- docker-compose.sample.yml | 2 +- frontend/vue/components/Admin/Updates.vue | 30 ++++++++++++++--------- src/Service/WebUpdater.php | 2 +- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/docker-compose.sample.yml b/docker-compose.sample.yml index d04abc744..80ac5e6c3 100644 --- a/docker-compose.sample.yml +++ b/docker-compose.sample.yml @@ -205,7 +205,7 @@ services: max-file: "5" updater: - name: azuracast_updater + container_name: azuracast_updater image: ghcr.io/azuracast/updater:latest volumes: - /var/run/docker.sock:/var/run/docker.sock diff --git a/frontend/vue/components/Admin/Updates.vue b/frontend/vue/components/Admin/Updates.vue index 062a803bb..40e9d940f 100644 --- a/frontend/vue/components/Admin/Updates.vue +++ b/frontend/vue/components/Admin/Updates.vue @@ -105,17 +105,16 @@ :href="backupUrl" target="_blank" > - + {{ $gettext('Backup') }} - {{ $gettext('Update AzuraCast via Web') }} + {{ $gettext('Update via Web') }} @@ -168,6 +167,7 @@ import Icon from "~/components/Common/Icon.vue"; import {useTranslate} from "~/vendor/gettext"; import {useNotify} from "~/vendor/bootstrapVue"; import {useAxios} from "~/vendor/axios"; +import {useSweetAlert} from "~/vendor/sweetalert"; const props = defineProps({ releaseChannel: { @@ -206,9 +206,9 @@ const langReleaseChannel = computed(() => { const needsUpdates = computed(() => { if (props.releaseChannel === 'stable') { - return updateInfo.value.needs_release_update; + return updateInfo.value?.needs_release_update ?? true; } else { - return updateInfo.value.needs_rolling_update; + return updateInfo.value?.needs_rolling_update ?? true; } }); @@ -223,13 +223,21 @@ const checkForUpdates = () => { }); }; +const {showAlert} = useSweetAlert(); + const doUpdate = () => { - wrapWithLoading( - axios.put(props.updatesApiUrl) - ).then(() => { - notifySuccess( - $gettext('Update started. Your installation will restart shortly.') - ); + showAlert({ + title: $gettext('Update AzuraCast? Your installation will restart.') + }).then((result) => { + if (result.value) { + wrapWithLoading( + axios.put(props.updatesApiUrl) + ).then(() => { + notifySuccess( + $gettext('Update started. Your installation will restart shortly.') + ); + }); + } }); }; diff --git a/src/Service/WebUpdater.php b/src/Service/WebUpdater.php index c329a74b4..b70a6412d 100644 --- a/src/Service/WebUpdater.php +++ b/src/Service/WebUpdater.php @@ -29,7 +29,7 @@ final class WebUpdater $client = $this->guzzleFactory->buildClient(); $client->post( - 'http://updater/v1/update', + 'http://updater:8080/v1/update', [ 'headers' => [ 'Authorization' => 'Bearer ' . self::WATCHTOWER_TOKEN,