@@ -17,6 +17,7 @@ const autoApproveToolsText = ref('')
1717const startupCommands = ref <string []>([])
1818const autoCheckUpdate = ref (true )
1919const contextFileNames = ref <string []>([])
20+ const shutdownLoading = ref (false )
2021
2122watch (() => store .settings , (s ) => {
2223 httpPort .value = s .httpPort ?? ' '
@@ -106,6 +107,18 @@ async function save() {
106107 }
107108}
108109
110+ async function shutdown() {
111+ if (! await confirm (t (' settings.shutdown_confirm' ), { danger: true })) return
112+ shutdownLoading .value = true
113+ try {
114+ await apiFetch (' /api/shutdown' , ' POST' )
115+ show (t (' settings.shutdown_started' ))
116+ } catch (e : any ) {
117+ show (e .message , ' error' )
118+ shutdownLoading .value = false
119+ }
120+ }
121+
109122// ── Scan invalid data ───────────────────────────────────────────
110123
111124interface InvalidRef { source: string ; field: string ; badValue: string }
@@ -241,6 +254,12 @@ function fmtItem(category: string, item: any): string {
241254 <SInput v-model .number =" maxImageSize " type="number" placeholder="1024" min="0" />
242255 </SFormItem >
243256 </div >
257+ <div class =" service-actions" >
258+ <div class =" form-hint" >{{ t('settings.shutdown_hint') }}</div >
259+ <SButton type="danger" size="sm" :disabled =" shutdownLoading " @click =" shutdown " >
260+ {{ t('settings.shutdown') }}
261+ </SButton >
262+ </div >
244263 </SCard >
245264 <SCard :title =" t (' settings.version_updates' )" >
246265 <SCheckCard v-model =" autoCheckUpdate " >
@@ -397,9 +416,20 @@ function fmtItem(category: string, item: any): string {
397416
398417.inline-form { display : flex ; gap : var (--sui-sp-7 ); flex-wrap : wrap ; }
399418.inline-form > * { flex : 1 ; min-width : 200px ; }
419+ .service-actions {
420+ display : flex ;
421+ align-items : center ;
422+ justify-content : space-between ;
423+ gap : var (--sui-sp-4 );
424+ margin-top : var (--sui-sp-4 );
425+ padding-top : var (--sui-sp-4 );
426+ border-top : 1px solid var (--sui-border );
427+ }
428+ .service-actions .form-hint { margin-bottom : 0 ; }
400429
401430@media (max-width : 768px ) {
402431 .inline-form { flex-direction : column ; }
432+ .service-actions { align-items : flex-start ; flex-direction : column ; }
403433}
404434
405435.cleanup-actions {
0 commit comments