File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,12 +178,13 @@ function getSetting(key: string) {
178178 <Button
179179 type="button"
180180 @click =" handleTestConnection "
181- :disabled =" ! canTestConnection || isTestingConnection "
181+ :disabled =" ! canTestConnection "
182+ :loading =" isTestingConnection "
182183 variant="outline"
183184 size="sm"
184185 >
185186 <TestTube class="h-4 w-4 mr-2" />
186- {{ isTestingConnection ? t('githubApp.connectionTest.button.testing') : t('githubApp.connectionTest.button.test') }}
187+ {{ t('githubApp.connectionTest.button.test') }}
187188 </Button >
188189 </div >
189190
@@ -226,10 +227,11 @@ function getSetting(key: string) {
226227 </div >
227228 <Button
228229 type="submit"
229- :disabled =" ! hasChanges || isSaving "
230+ :disabled =" ! hasChanges "
231+ :loading =" isSaving "
230232 class="min-w-[120px]"
231233 >
232- {{ isSaving ? t('githubApp.form.saving') : t('githubApp.form.saveChanges') }}
234+ {{ t('githubApp.form.saveChanges') }}
233235 </Button >
234236 </div >
235237 </form >
Original file line number Diff line number Diff line change @@ -298,13 +298,14 @@ function getSetting(key: string) {
298298 <Button
299299 type="button"
300300 @click =" handleTestEmail "
301- :disabled =" ! canTestConnection || isTestingConnection "
301+ :disabled =" ! canTestConnection "
302+ :loading =" isTestingConnection "
302303 variant="outline"
303304 size="sm"
304305 class="w-full sm:w-auto "
305306 >
306307 <TestTube class="h-4 w-4 mr-2" />
307- {{ isTestingConnection ? t('smtp.emailTest.button.testing') : t('smtp.emailTest.button.test') }}
308+ {{ t('smtp.emailTest.button.test') }}
308309 </Button >
309310
310311 <!-- Test Status -->
@@ -349,10 +350,11 @@ function getSetting(key: string) {
349350 </div >
350351 <Button
351352 type="submit"
352- :disabled =" ! hasChanges || isSaving "
353+ :disabled =" ! hasChanges "
354+ :loading =" isSaving "
353355 class="min-w-[120px]"
354356 >
355- {{ isSaving ? t('smtp.form.saving') : t('smtp.form.saveChanges') }}
357+ {{ t('smtp.form.saveChanges') }}
356358 </Button >
357359 </div >
358360 </form >
Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ const spinnerSize = computed(() => {
4747 >
4848 <Loader2
4949 v-if =" loading "
50- :class =" cn (spinnerSize , ' animate-spin' )"
50+ :class =" cn (spinnerSize , ' animate-spin mr-2 ' )"
5151 />
5252 <template v-if =" loading && loadingText " >
5353 {{ loadingText }}
5454 </template >
55- <slot v-else-if = " !loading " />
55+ <slot v-else />
5656 </Primitive >
5757</template >
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ const route = useRoute()
2626const settingGroups = ref <GlobalSettingGroup []>([])
2727const isLoading = ref (true )
2828const error = ref <string | null >(null )
29+ const isSubmitting = ref (false )
2930
3031const apiUrl = getEnv (' VITE_DEPLOYSTACK_BACKEND_URL' ) || ' ' // Fallback to empty string if not set
3132
@@ -194,6 +195,8 @@ async function handleSubmit(event: Event) {
194195 }
195196 })
196197
198+ isSubmitting .value = true
199+
197200 try {
198201 if (! apiUrl ) {
199202 throw new Error (t (' globalSettings.errors.savingConfigNotSet' ))
@@ -254,6 +257,8 @@ async function handleSubmit(event: Event) {
254257 description: errorMessage
255258 })
256259 console .error (' Failed to save settings:' , err )
260+ } finally {
261+ isSubmitting .value = false
257262 }
258263}
259264 </script >
@@ -329,9 +334,12 @@ async function handleSubmit(event: Event) {
329334 < p v - if = " setting.is_encrypted " class="text-xs text-muted-foreground">{{ t('globalSettings.form.encryptedValue') }}</p >
330335 </div >
331336
332- <Button type="submit">
333- {{ t('globalSettings.form.saveChanges') }}
334- </Button >
337+ <Button
338+ type="submit"
339+ :loading =" isSubmitting "
340+ >
341+ {{ t('globalSettings.form.saveChanges') }}
342+ </Button >
335343 </form >
336344 <div v-else-if =" selectedGroup && (!selectedGroup.settings || selectedGroup.settings.length === 0)" >
337345 <p class =" text-sm text-muted-foreground" >{{ t('globalSettings.form.noSettings') }}</p >
You can’t perform that action at this time.
0 commit comments