zen-gitsync 2.11.11 → 2.11.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/config.js +9 -3
- package/src/ui/public/assets/{index-DqUSf7QD.css → index-BVWHnypR.css} +1 -1
- package/src/ui/public/assets/index-BWl1xzuJ.js +108 -0
- package/src/ui/public/index.html +2 -2
- package/src/ui/server/routes/config.js +1 -1
- package/src/ui/server/routes/gitOps.js +17 -0
- package/src/ui/public/assets/index-E1drpG4m.js +0 -108
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -122,12 +122,14 @@ async function loadConfig() {
|
|
|
122
122
|
|
|
123
123
|
// 新版结构:{ projects: { [key]: projectConfig }, theme?, locale?, recentDirectories? }
|
|
124
124
|
const projectConfig = raw?.projects?.[key];
|
|
125
|
-
// 合并:默认配置 + 项目配置 + 全局通用设置(theme, locale)
|
|
125
|
+
// 合并:默认配置 + 项目配置 + 全局通用设置(theme, locale, models)
|
|
126
|
+
// models 是全局配置(跨项目共享),优先取项目级,否则回退顶层(兼容旧数据)
|
|
126
127
|
return {
|
|
127
128
|
...defaultConfig,
|
|
128
129
|
...(projectConfig || {}),
|
|
129
130
|
theme: raw?.theme ?? defaultConfig.theme,
|
|
130
|
-
locale: raw?.locale ?? defaultConfig.locale
|
|
131
|
+
locale: raw?.locale ?? defaultConfig.locale,
|
|
132
|
+
models: projectConfig?.models ?? raw?.models ?? defaultConfig.models
|
|
131
133
|
};
|
|
132
134
|
}
|
|
133
135
|
|
|
@@ -159,7 +161,8 @@ async function saveConfig(config) {
|
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
// 分离全局设置和项目设置
|
|
162
|
-
|
|
164
|
+
// models 也是全局配置(跨项目共享),和 theme/locale 一样存到顶层
|
|
165
|
+
const { theme, locale, models, ...projectConfig } = config;
|
|
163
166
|
|
|
164
167
|
// 保存全局设置到根级别
|
|
165
168
|
if (theme !== undefined) {
|
|
@@ -168,6 +171,9 @@ async function saveConfig(config) {
|
|
|
168
171
|
if (locale !== undefined) {
|
|
169
172
|
raw.locale = locale;
|
|
170
173
|
}
|
|
174
|
+
if (models !== undefined) {
|
|
175
|
+
raw.models = models;
|
|
176
|
+
}
|
|
171
177
|
|
|
172
178
|
// 写入当前项目配置(在 defaultConfig 基础上合并,但不清空顶层其它键)
|
|
173
179
|
const existingProjectConfig = (raw.projects[key] && typeof raw.projects[key] === 'object') ? raw.projects[key] : {};
|