Skip to content

Commit 0be85f6

Browse files
committed
add debug in UI
1 parent eb456be commit 0be85f6

File tree

1 file changed

+21
-9
lines changed
  • html/pfappserver/root/src/views/Configurator/status/_components

1 file changed

+21
-9
lines changed

html/pfappserver/root/src/views/Configurator/status/_components/TheStep.vue

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,35 @@ const setup = (props, context) => {
4040
4141
const advancedPromise = $store.dispatch('$_bases/getAdvanced') // prefetch advanced configuration
4242
43+
const catchWithError = message => {
44+
return () => {
45+
isLoading.value = false
46+
invalidFeedback.value = message
47+
progressFeedback.value = null
48+
}
49+
}
50+
4351
const onComplete = () => {
4452
isLoading.value = true
53+
invalidFeedback.value = null
4554
progressFeedback.value = i18n.t('Applying configuration')
46-
$store.dispatch('cluster/restartSystemService', { id: 'packetfence-config' }).then(() => {
55+
$store.dispatch('cluster/restartSystemService', { id: 'packetfence-config' }).catch(catchWithError(i18n.t('Failed to restart packetfence-config'))).then(() => {
56+
invalidFeedback.value = null
4757
progressFeedback.value = i18n.t('Enabling PacketFence')
48-
return $store.dispatch('cluster/updateSystemd', { id: 'pf' }).then(() => {
58+
return $store.dispatch('cluster/updateSystemd', { id: 'pf' }).catch(catchWithError(i18n.t('Failed to update systemd'))).then(() => {
59+
invalidFeedback.value = null
4960
progressFeedback.value = i18n.t('Starting PacketFence')
50-
return $store.dispatch('cluster/restartService', { id: 'pfperl-api' }).then(() => {
51-
return $store.dispatch('cluster/restartService', { id: 'haproxy-admin' }).then(() => {
52-
return $store.dispatch('cluster/startService', { id: 'pf' }).then(() => {
61+
return $store.dispatch('cluster/restartService', { id: 'pfperl-api' }).catch(catchWithError(i18n.t('Failed to restart pfperl-api'))).then(() => {
62+
invalidFeedback.value = null
63+
return $store.dispatch('cluster/restartService', { id: 'haproxy-admin' }).catch(catchWithError(i18n.t('Failed to restart haproxy-admin'))).then(() => {
64+
invalidFeedback.value = null
65+
return $store.dispatch('cluster/startService', { id: 'pf' }).catch(catchWithError(i18n.t('Failed to start packetfence services'))).then(() => {
66+
invalidFeedback.value = null
5367
progressFeedback.value = i18n.t('Disabling Configurator')
5468
return advancedPromise.then(data => {
5569
data.configurator = 'disabled'
56-
return $store.dispatch('$_bases/updateAdvanced', data).then(() => {
70+
return $store.dispatch('$_bases/updateAdvanced', data).catch(catchWithError(i18n.t('Failed to update advanced'))).then(() => {
71+
invalidFeedback.value = null
5772
progressFeedback.value = i18n.t('Redirecting to login page')
5873
setTimeout(() => {
5974
window.location.href = '/'
@@ -64,9 +79,6 @@ const setup = (props, context) => {
6479
})
6580
})
6681
})
67-
.catch(() => {
68-
progressFeedback.value = null
69-
})
7082
.finally(() => {
7183
isLoading.value = false
7284
})

0 commit comments

Comments
 (0)