disable instead of hide if server scripts are disabled

This commit is contained in:
wh1te909
2024-06-14 23:42:56 +00:00
parent 1a6cb090fe
commit b539df007b

View File

@@ -917,12 +917,21 @@ const staticActionTypeOptions = [
];
const actionTypeOptions = computed(() => {
if (hosted.value || !server_scripts_enabled.value) {
// don't show for hosted at all
if (hosted.value) {
return staticActionTypeOptions.filter(
(option) => option.value !== "server",
);
}
return staticActionTypeOptions;
// disable the server script radio button if feature is disabled globally
const modifiedOptions = staticActionTypeOptions.map((option) => {
if (!server_scripts_enabled.value && option.value === "server") {
return { ...option, disable: true };
}
return option;
});
return modifiedOptions;
});
const stepper = ref<QStepper | null>(null);