Browse Source

Merge pull request #48 from maziggy/0.1.6b5

- Fixed bug in update module for Docker based installations
MartinNYHC 4 months ago
parent
commit
2e6d8c5ab8

+ 1 - 1
backend/app/core/config.py

@@ -5,7 +5,7 @@ from pathlib import Path
 from pydantic_settings import BaseSettings
 from pydantic_settings import BaseSettings
 
 
 # Application version - single source of truth
 # Application version - single source of truth
-APP_VERSION = "0.1.6b5"
+APP_VERSION = "0.1.6b4"
 GITHUB_REPO = "maziggy/bambuddy"
 GITHUB_REPO = "maziggy/bambuddy"
 
 
 # App directory - where the application is installed (for static files)
 # App directory - where the application is installed (for static files)

+ 3 - 1
frontend/src/api/client.ts

@@ -1162,6 +1162,8 @@ export interface UpdateCheckResult {
   published_at?: string;
   published_at?: string;
   error?: string;
   error?: string;
   message?: string;
   message?: string;
+  is_docker?: boolean;
+  update_method?: 'docker' | 'git';
 }
 }
 
 
 export interface UpdateStatus {
 export interface UpdateStatus {
@@ -2071,7 +2073,7 @@ export const api = {
   getVersion: () => request<VersionInfo>('/updates/version'),
   getVersion: () => request<VersionInfo>('/updates/version'),
   checkForUpdates: () => request<UpdateCheckResult>('/updates/check'),
   checkForUpdates: () => request<UpdateCheckResult>('/updates/check'),
   applyUpdate: () =>
   applyUpdate: () =>
-    request<{ success: boolean; message: string; status: UpdateStatus }>('/updates/apply', {
+    request<{ success: boolean; message: string; status?: UpdateStatus; is_docker?: boolean }>('/updates/apply', {
       method: 'POST',
       method: 'POST',
     }),
     }),
   getUpdateStatus: () => request<UpdateStatus>('/updates/status'),
   getUpdateStatus: () => request<UpdateStatus>('/updates/status'),

+ 15 - 2
frontend/src/pages/SettingsPage.tsx

@@ -215,8 +215,12 @@ export function SettingsPage() {
 
 
   const applyUpdateMutation = useMutation({
   const applyUpdateMutation = useMutation({
     mutationFn: api.applyUpdate,
     mutationFn: api.applyUpdate,
-    onSuccess: () => {
-      refetchUpdateStatus();
+    onSuccess: (data) => {
+      if (data.is_docker) {
+        showToast(data.message, 'error');
+      } else {
+        refetchUpdateStatus();
+      }
     },
     },
   });
   });
 
 
@@ -1121,6 +1125,15 @@ export function SettingsPage() {
                       <div className="mt-3 p-2 bg-red-500/20 rounded text-sm text-red-400">
                       <div className="mt-3 p-2 bg-red-500/20 rounded text-sm text-red-400">
                         {updateStatus.error || updateStatus.message}
                         {updateStatus.error || updateStatus.message}
                       </div>
                       </div>
+                    ) : updateCheck?.is_docker ? (
+                      <div className="mt-3 p-3 bg-bambu-dark-tertiary rounded-lg">
+                        <p className="text-sm text-bambu-gray mb-2">
+                          Update via Docker Compose:
+                        </p>
+                        <code className="block text-xs bg-bambu-dark p-2 rounded text-bambu-green font-mono">
+                          docker compose pull && docker compose up -d
+                        </code>
+                      </div>
                     ) : (
                     ) : (
                       <Button
                       <Button
                         className="mt-3"
                         className="mt-3"

File diff suppressed because it is too large
+ 0 - 0
static/assets/index-8VBiHy5k.js


+ 1 - 1
static/index.html

@@ -23,7 +23,7 @@
 
 
     <!-- Splash screens for iOS -->
     <!-- Splash screens for iOS -->
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
     <link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
-    <script type="module" crossorigin src="/assets/index-BaU_6oPV.js"></script>
+    <script type="module" crossorigin src="/assets/index-8VBiHy5k.js"></script>
     <link rel="stylesheet" crossorigin href="/assets/index-Da3qKIoX.css">
     <link rel="stylesheet" crossorigin href="/assets/index-Da3qKIoX.css">
   </head>
   </head>
   <body>
   <body>

Some files were not shown because too many files changed in this diff