🎨 Optimize configuration service

This commit is contained in:
2025-05-12 20:52:33 +08:00
parent c0db3a68cd
commit 7e6e7e4e73
11 changed files with 66 additions and 356 deletions

View File

@@ -190,11 +190,6 @@ export enum LanguageType {
* PathsConfig 路径配置集合
*/
export class PathsConfig {
/**
* 配置文件路径
*/
"configPath": string;
/**
* 日志文件路径
*/
@@ -207,9 +202,6 @@ export class PathsConfig {
/** Creates a new PathsConfig instance. */
constructor($$source: Partial<PathsConfig> = {}) {
if (!("configPath" in $$source)) {
this["configPath"] = "";
}
if (!("logPath" in $$source)) {
this["logPath"] = "";
}

View File

@@ -12,13 +12,13 @@ import {Call as $Call, Create as $Create} from "@wailsio/runtime";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as models$0 from "../../models/models.js";
import * as models$0 from "../models/models.js";
/**
* GetConfig
*/
export function GetConfig(): Promise<models$0.AppConfig | null> & { cancel(): void } {
let $resultPromise = $Call.ByID(3332910023) as any;
let $resultPromise = $Call.ByID(1013336538) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType1($result);
}) as any;
@@ -26,19 +26,11 @@ export function GetConfig(): Promise<models$0.AppConfig | null> & { cancel(): vo
return $typingPromise;
}
/**
* GetConfigPath
*/
export function GetConfigPath(): Promise<string> & { cancel(): void } {
let $resultPromise = $Call.ByID(2145796624) as any;
return $resultPromise;
}
/**
* GetEditorConfig
*/
export function GetEditorConfig(): Promise<models$0.EditorConfig> & { cancel(): void } {
let $resultPromise = $Call.ByID(3738882774) as any;
let $resultPromise = $Call.ByID(3648153351) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType2($result);
}) as any;
@@ -50,7 +42,7 @@ export function GetEditorConfig(): Promise<models$0.EditorConfig> & { cancel():
* GetLanguage
*/
export function GetLanguage(): Promise<models$0.LanguageType> & { cancel(): void } {
let $resultPromise = $Call.ByID(1762264443) as any;
let $resultPromise = $Call.ByID(3409375894) as any;
return $resultPromise;
}
@@ -58,7 +50,7 @@ export function GetLanguage(): Promise<models$0.LanguageType> & { cancel(): void
* GetMetadata
*/
export function GetMetadata(): Promise<models$0.ConfigMetadata> & { cancel(): void } {
let $resultPromise = $Call.ByID(356327488) as any;
let $resultPromise = $Call.ByID(3276720617) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType3($result);
}) as any;
@@ -70,7 +62,7 @@ export function GetMetadata(): Promise<models$0.ConfigMetadata> & { cancel(): vo
* GetPaths
*/
export function GetPaths(): Promise<models$0.PathsConfig> & { cancel(): void } {
let $resultPromise = $Call.ByID(1115810463) as any;
let $resultPromise = $Call.ByID(1096257096) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType4($result);
}) as any;
@@ -82,7 +74,7 @@ export function GetPaths(): Promise<models$0.PathsConfig> & { cancel(): void } {
* ResetConfig
*/
export function ResetConfig(): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2265390548) as any;
let $resultPromise = $Call.ByID(3593047389) as any;
return $resultPromise;
}
@@ -90,7 +82,7 @@ export function ResetConfig(): Promise<void> & { cancel(): void } {
* SaveConfig
*/
export function SaveConfig(config: models$0.AppConfig | null): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2710445504, config) as any;
let $resultPromise = $Call.ByID(616684383, config) as any;
return $resultPromise;
}
@@ -98,15 +90,7 @@ export function SaveConfig(config: models$0.AppConfig | null): Promise<void> & {
* SetLanguage
*/
export function SetLanguage(language: models$0.LanguageType): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(2553541807, language) as any;
return $resultPromise;
}
/**
* UpdateConfigPath
*/
export function UpdateConfigPath(newPath: string): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(251712339, newPath) as any;
let $resultPromise = $Call.ByID(814725002, language) as any;
return $resultPromise;
}
@@ -114,7 +98,7 @@ export function UpdateConfigPath(newPath: string): Promise<void> & { cancel(): v
* UpdateEditorConfig
*/
export function UpdateEditorConfig(editorConfig: models$0.EditorConfig): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(420530601, editorConfig) as any;
let $resultPromise = $Call.ByID(1237949666, editorConfig) as any;
return $resultPromise;
}
@@ -122,7 +106,7 @@ export function UpdateEditorConfig(editorConfig: models$0.EditorConfig): Promise
* UpdateMetadata
*/
export function UpdateMetadata(metadata: models$0.ConfigMetadata): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(1687760751, metadata) as any;
let $resultPromise = $Call.ByID(3353893284, metadata) as any;
return $resultPromise;
}
@@ -130,7 +114,7 @@ export function UpdateMetadata(metadata: models$0.ConfigMetadata): Promise<void>
* UpdatePaths
*/
export function UpdatePaths(paths: models$0.PathsConfig): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3466187518, paths) as any;
let $resultPromise = $Call.ByID(3650847675, paths) as any;
return $resultPromise;
}

View File

@@ -1,6 +1,6 @@
import {createI18n} from 'vue-i18n';
import messages from './locales';
import { ConfigService } from '@/../bindings/voidraft/internal/services/config';
import { ConfigService } from '@/../bindings/voidraft/internal/services';
import { LanguageType } from '@/../bindings/voidraft/internal/models';
// 定义支持的语言类型

View File

@@ -3,7 +3,7 @@ import {ref, watch} from 'vue';
import {useDebounceFn} from '@vueuse/core';
import {
ConfigService
} from '@/../bindings/voidraft/internal/services/config';
} from '@/../bindings/voidraft/internal/services';
import {EditorConfig, TabType} from '@/../bindings/voidraft/internal/models/models';
import {useLogStore} from './logStore';
import { useI18n } from 'vue-i18n';