Skip to content

Commit

Permalink
Merge pull request #1647 from fdm-monster/fix/new-api-naming-experime…
Browse files Browse the repository at this point in the history
…ntal-client-setting

fix: adapt to new naming experiment client support
  • Loading branch information
davidzwa authored Oct 27, 2024
2 parents 6f5f14d + e64561c commit 02bd04a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
8 changes: 8 additions & 0 deletions RELEASE_NOTES.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release notes

## Client 27/10/2024 1.6.4

Fix:

- Setting: adapt to new naming experiment client support

## Client 27/10/2024 1.6.3

Chore:

- Workflows: upgrade github actions to node 20
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fdm-monster/client",
"version": "1.6.3",
"version": "1.6.4",
"author": "David Zwart",
"license": "AGPL-3.0-or-later",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/server.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class ServerApi {
static updateTimeoutSettingRoute = `${ServerApi.settingsRoute}/timeout`;
static serverSentryDiagnosticsSettingRoute = `${ServerApi.settingsRoute}/sentry-diagnostics`;
static updateExperimentalMoonrakerSupportRoute = `${ServerApi.settingsRoute}/experimental-moonraker-support`;
static updateExperimentalClientNextSupportRoute = `${ServerApi.settingsRoute}/experimental-client-next-support`;
static updateExperimentalClientSupportRoute = `${ServerApi.settingsRoute}/experimental-client-support`;

static serverPrivateRoute = `${ServerApi.base}/server`;
static serverRestartCommandRoute = `${ServerApi.serverPrivateRoute}/restart`;
Expand Down
4 changes: 2 additions & 2 deletions src/backend/settings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export class SettingsService extends BaseService {
return (await this.put(path, { enabled })) as SettingsDto; // Assuming it returns SettingsDto
}

static async updateExperimentalClientNextSupport(enabled: boolean) {
const path = ServerApi.updateExperimentalClientNextSupportRoute;
static async updateExperimentalClientSupport(enabled: boolean) {
const path = ServerApi.updateExperimentalClientSupportRoute;
return (await this.put(path, { enabled })) as SettingsDto; // Assuming it returns SettingsDto
}
}
18 changes: 9 additions & 9 deletions src/components/Settings/ExperimentalSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
</v-card-title>
<v-card-text>
<v-checkbox
v-model="experimentalClientNextSupport"
v-model="experimentalClientSupport"
label="Enable Next Client Version (Experimental)"
hide-details
@change="onExperimentalClientNextSupportChange"
@change="onExperimentalClientSupportChange"
>
<template v-slot:label>
<span>Enable Next Client Version (Experimental)</span>
Expand All @@ -114,13 +114,13 @@ import { SettingsService } from "@/backend";
const experimentalMoonrakerSupport = ref(false);
const experimentalTypeORMSupport = ref(false);
const experimentalClientNextSupport = ref(false);
const experimentalClientSupport = ref(false);
async function loadSettings() {
const settings = await SettingsService.getSettings();
experimentalMoonrakerSupport.value = settings.server.experimentalMoonrakerSupport;
experimentalTypeORMSupport.value = settings.server.experimentalTypeormSupport;
experimentalClientNextSupport.value = settings.server.experimentalClientNextSupport;
experimentalClientSupport.value = settings.server.experimentalClientSupport;
}
onMounted(async () => {
Expand All @@ -129,18 +129,18 @@ onMounted(async () => {
const saveSettings = async () => {
await SettingsService.updateExperimentalMoonrakerSupport(experimentalMoonrakerSupport.value);
await SettingsService.updateExperimentalClientNextSupport(experimentalClientNextSupport.value);
await SettingsService.updateExperimentalClientSupport(experimentalClientSupport.value);
await loadSettings();
};
const resetSettings = async () => {
await SettingsService.updateExperimentalMoonrakerSupport(false);
await SettingsService.updateExperimentalClientNextSupport(false);
await SettingsService.updateExperimentalClientSupport(false);
await loadSettings();
};
const onExperimentalClientNextSupportChange = async () => {
await SettingsService.updateExperimentalClientNextSupport(experimentalClientNextSupport.value);
window.location.reload(); // Reload the page when enabled
const onExperimentalClientSupportChange = async () => {
await SettingsService.updateExperimentalClientSupport(experimentalClientSupport.value);
window.location.reload();
};
</script>
2 changes: 1 addition & 1 deletion src/models/settings/server-settings.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export interface ServerSettingsDto extends WhitelistSettings {
registration: boolean;
experimentalMoonrakerSupport: boolean;
experimentalTypeormSupport: boolean;
experimentalClientNextSupport: boolean;
experimentalClientSupport: boolean;
}

0 comments on commit 02bd04a

Please sign in to comment.