mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-09-14 13:35:05 +00:00
Update frontend to v1.9.18 (#6828)
Co-authored-by: huchenlei <20929282+huchenlei@users.noreply.github.com>
This commit is contained in:
90
web/assets/serverConfigStore-D2Vr0L0h.js
generated
vendored
Normal file
90
web/assets/serverConfigStore-D2Vr0L0h.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
import { a1 as defineStore, T as ref, c as computed } from "./index-Bv0b06LE.js";
|
||||
const useServerConfigStore = defineStore("serverConfig", () => {
|
||||
const serverConfigById = ref({});
|
||||
const serverConfigs = computed(() => {
|
||||
return Object.values(serverConfigById.value);
|
||||
});
|
||||
const modifiedConfigs = computed(
|
||||
() => {
|
||||
return serverConfigs.value.filter((config) => {
|
||||
return config.initialValue !== config.value;
|
||||
});
|
||||
}
|
||||
);
|
||||
const revertChanges = /* @__PURE__ */ __name(() => {
|
||||
for (const config of modifiedConfigs.value) {
|
||||
config.value = config.initialValue;
|
||||
}
|
||||
}, "revertChanges");
|
||||
const serverConfigsByCategory = computed(() => {
|
||||
return serverConfigs.value.reduce(
|
||||
(acc, config) => {
|
||||
const category = config.category?.[0] ?? "General";
|
||||
acc[category] = acc[category] || [];
|
||||
acc[category].push(config);
|
||||
return acc;
|
||||
},
|
||||
{}
|
||||
);
|
||||
});
|
||||
const serverConfigValues = computed(() => {
|
||||
return Object.fromEntries(
|
||||
serverConfigs.value.map((config) => {
|
||||
return [
|
||||
config.id,
|
||||
config.value === config.defaultValue || config.value === null || config.value === void 0 ? void 0 : config.value
|
||||
];
|
||||
})
|
||||
);
|
||||
});
|
||||
const launchArgs = computed(() => {
|
||||
const args = Object.assign(
|
||||
{},
|
||||
...serverConfigs.value.map((config) => {
|
||||
if (config.value === config.defaultValue || config.value === null || config.value === void 0) {
|
||||
return {};
|
||||
}
|
||||
return config.getValue ? config.getValue(config.value) : { [config.id]: config.value };
|
||||
})
|
||||
);
|
||||
return Object.fromEntries(
|
||||
Object.entries(args).map(([key, value]) => {
|
||||
if (value === true) {
|
||||
return [key, ""];
|
||||
}
|
||||
return [key, value.toString()];
|
||||
})
|
||||
);
|
||||
});
|
||||
const commandLineArgs = computed(() => {
|
||||
return Object.entries(launchArgs.value).map(([key, value]) => [`--${key}`, value]).flat().filter((arg) => arg !== "").join(" ");
|
||||
});
|
||||
function loadServerConfig(configs, values) {
|
||||
for (const config of configs) {
|
||||
const value = values[config.id] ?? config.defaultValue;
|
||||
serverConfigById.value[config.id] = {
|
||||
...config,
|
||||
value,
|
||||
initialValue: value
|
||||
};
|
||||
}
|
||||
}
|
||||
__name(loadServerConfig, "loadServerConfig");
|
||||
return {
|
||||
serverConfigById,
|
||||
serverConfigs,
|
||||
modifiedConfigs,
|
||||
serverConfigsByCategory,
|
||||
serverConfigValues,
|
||||
launchArgs,
|
||||
commandLineArgs,
|
||||
revertChanges,
|
||||
loadServerConfig
|
||||
};
|
||||
});
|
||||
export {
|
||||
useServerConfigStore as u
|
||||
};
|
||||
//# sourceMappingURL=serverConfigStore-D2Vr0L0h.js.map
|
Reference in New Issue
Block a user