4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-14 05:06:37 +00:00

Initial WIP final tweaks.

This commit is contained in:
Buster Neece 2023-01-05 13:48:55 -06:00
parent a4117da33d
commit 1032801b07
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
3 changed files with 21 additions and 13 deletions

View File

@ -205,7 +205,7 @@ services:
max-file: "5" max-file: "5"
updater: updater:
name: azuracast_updater container_name: azuracast_updater
image: ghcr.io/azuracast/updater:latest image: ghcr.io/azuracast/updater:latest
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View File

@ -105,17 +105,16 @@
:href="backupUrl" :href="backupUrl"
target="_blank" target="_blank"
> >
<icon icon="cloud_sync" /> <icon icon="backup" />
{{ $gettext('Backup') }} {{ $gettext('Backup') }}
</a> </a>
<a <a
class="btn btn-outline-success" class="btn btn-outline-success"
:data-confirm-title="$gettext('Update AzuraCast? Your installation will restart.')"
href="#" href="#"
@click.prevent="doUpdate()" @click.prevent="doUpdate()"
> >
<icon icon="update" /> <icon icon="update" />
{{ $gettext('Update AzuraCast via Web') }} {{ $gettext('Update via Web') }}
</a> </a>
</div> </div>
</template> </template>
@ -168,6 +167,7 @@ import Icon from "~/components/Common/Icon.vue";
import {useTranslate} from "~/vendor/gettext"; import {useTranslate} from "~/vendor/gettext";
import {useNotify} from "~/vendor/bootstrapVue"; import {useNotify} from "~/vendor/bootstrapVue";
import {useAxios} from "~/vendor/axios"; import {useAxios} from "~/vendor/axios";
import {useSweetAlert} from "~/vendor/sweetalert";
const props = defineProps({ const props = defineProps({
releaseChannel: { releaseChannel: {
@ -206,9 +206,9 @@ const langReleaseChannel = computed(() => {
const needsUpdates = computed(() => { const needsUpdates = computed(() => {
if (props.releaseChannel === 'stable') { if (props.releaseChannel === 'stable') {
return updateInfo.value.needs_release_update; return updateInfo.value?.needs_release_update ?? true;
} else { } 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 = () => { const doUpdate = () => {
wrapWithLoading( showAlert({
axios.put(props.updatesApiUrl) title: $gettext('Update AzuraCast? Your installation will restart.')
).then(() => { }).then((result) => {
notifySuccess( if (result.value) {
$gettext('Update started. Your installation will restart shortly.') wrapWithLoading(
); axios.put(props.updatesApiUrl)
).then(() => {
notifySuccess(
$gettext('Update started. Your installation will restart shortly.')
);
});
}
}); });
}; };
</script> </script>

View File

@ -29,7 +29,7 @@ final class WebUpdater
$client = $this->guzzleFactory->buildClient(); $client = $this->guzzleFactory->buildClient();
$client->post( $client->post(
'http://updater/v1/update', 'http://updater:8080/v1/update',
[ [
'headers' => [ 'headers' => [
'Authorization' => 'Bearer ' . self::WATCHTOWER_TOKEN, 'Authorization' => 'Bearer ' . self::WATCHTOWER_TOKEN,