diff --git a/api/src/main/kotlin/nebulosa/api/preference/PreferenceRepository.kt b/api/src/main/kotlin/nebulosa/api/preference/PreferenceRepository.kt index 52b8f7733..1b1ac12c5 100644 --- a/api/src/main/kotlin/nebulosa/api/preference/PreferenceRepository.kt +++ b/api/src/main/kotlin/nebulosa/api/preference/PreferenceRepository.kt @@ -19,7 +19,6 @@ class PreferenceRepository(@Qualifier("preferenceBox") override val box: Box
 		
+		
+
+
+ New version: + {{ newVersion }} +
+ + + +
+
+
+
+
+ +
+
+
diff --git a/desktop/src/app/settings/settings.component.ts b/desktop/src/app/settings/settings.component.ts index 83345762a..a3f3d7ce2 100644 --- a/desktop/src/app/settings/settings.component.ts +++ b/desktop/src/app/settings/settings.component.ts @@ -29,6 +29,13 @@ export class SettingsComponent implements AfterViewInit, OnDestroy { private readonly locationChangeSubscription?: Subscription protected readonly menuModel: MenuItem[] = [ + { + icon: 'mdi mdi-cog', + label: 'General', + command: (e) => { + this.showTab('GENERAL', e.item?.label) + }, + }, { icon: 'mdi mdi-map-marker', label: 'Location', diff --git a/desktop/src/shared/services/api.service.ts b/desktop/src/shared/services/api.service.ts index d56d1d52e..ef26bde23 100644 --- a/desktop/src/shared/services/api.service.ts +++ b/desktop/src/shared/services/api.service.ts @@ -10,7 +10,7 @@ import { FlatWizardRequest } from '../types/flat-wizard.types' import { Focuser } from '../types/focuser.types' import { HipsSurvey } from '../types/framing.types' import { GuideDirection, GuideOutput, Guider, GuiderHistoryStep, SettleInfo } from '../types/guider.types' -import { ConnectionStatus, ConnectionType } from '../types/home.types' +import { ConnectionStatus, ConnectionType, LatestRelease } from '../types/home.types' import { AnnotateImageRequest, CoordinateInterpolation, DetectedStar, FOVCamera, FOVTelescope, ImageAnnotation, ImageInfo, ImageMousePosition, ImageSaveDialog, ImageSolved, ImageTransformation } from '../types/image.types' import { CelestialLocationType, Mount, MountRemoteControl, MountRemoteControlProtocol, SlewRate, TrackMode } from '../types/mount.types' import { PlateSolverRequest } from '../types/platesolver.types' @@ -708,4 +708,10 @@ export class ApiService { const query = this.http.query({ accepted }) return this.http.put(`confirmation/${idempotencyKey}?${query}`) } + + // SYSTEM + + latestRelease() { + return this.http.get('system/latest-release') + } } diff --git a/desktop/src/shared/types/home.types.ts b/desktop/src/shared/types/home.types.ts index 5004688fb..00bd7004e 100644 --- a/desktop/src/shared/types/home.types.ts +++ b/desktop/src/shared/types/home.types.ts @@ -32,6 +32,13 @@ export interface HomeConnectionDialog { edited: boolean } +export interface LatestRelease { + version: string + name: string + draft: boolean + preRelease: boolean +} + export const DEFAULT_CONNECTION_HOST: string = 'localhost' export const DEFAULT_CONNECTION_PORT: number = 7624 diff --git a/desktop/src/shared/types/settings.types.ts b/desktop/src/shared/types/settings.types.ts index 1cb9ec288..0d47c7f7b 100644 --- a/desktop/src/shared/types/settings.types.ts +++ b/desktop/src/shared/types/settings.types.ts @@ -6,9 +6,10 @@ import { DEFAULT_PLATE_SOLVER_SETTINGS, plateSolverSettingsWithDefault, type Pla import { DEFAULT_STACKER_SETTINGS, stackerSettingsWithDefault, type StackerSettings, type StackerType } from './stacker.types' import { DEFAULT_STAR_DETECTOR_SETTINGS, starDetectorSettingsWithDefault, type StarDetectorSettings, type StarDetectorType } from './stardetector.types' -export type SettingsTab = 'LOCATION' | 'PLATE_SOLVER' | 'STAR_DETECTOR' | 'LIVE_STACKER' | 'STACKER' | 'CAPTURE_NAMING_FORMAT' +export type SettingsTab = 'GENERAL' | 'LOCATION' | 'PLATE_SOLVER' | 'STAR_DETECTOR' | 'LIVE_STACKER' | 'STACKER' | 'CAPTURE_NAMING_FORMAT' export interface SettingsPreference { + checkVersion: boolean plateSolver: Record starDetector: Record liveStacker: Record @@ -19,6 +20,7 @@ export interface SettingsPreference { } export const DEFAULT_SETTINGS_PREFERENCE: SettingsPreference = { + checkVersion: true, plateSolver: { ASTROMETRY_NET: structuredClone(DEFAULT_PLATE_SOLVER_SETTINGS), ASTROMETRY_NET_ONLINE: structuredClone(DEFAULT_PLATE_SOLVER_SETTINGS), @@ -46,6 +48,7 @@ export const DEFAULT_SETTINGS_PREFERENCE: SettingsPreference = { export function settingsPreferenceWithDefault(preference?: Partial, source: SettingsPreference = DEFAULT_SETTINGS_PREFERENCE) { if (!preference) return structuredClone(source) + preference.checkVersion ??= source.checkVersion preference.plateSolver ??= structuredClone(source.plateSolver) preference.starDetector ??= structuredClone(source.starDetector) preference.liveStacker ??= structuredClone(source.liveStacker)