From 4a141c3f5772bc4ee1e2277efdc78d8b31ae3d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 3 Aug 2025 09:10:17 +0800 Subject: [PATCH] Disk: add missing JSON config options --- doc/json_schema.json | 5 +++++ src/modules/disk/disk.c | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/doc/json_schema.json b/doc/json_schema.json index 3c6e5d5a7..b742f0afb 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -2100,6 +2100,11 @@ "type": "string", "description": "A colon separated file systems to hide from the disk output" }, + "showRegular": { + "type": "boolean", + "description": "Set if regular volume should be printed", + "default": true + }, "showExternal": { "type": "boolean", "description": "Set if external volume should be printed", diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index 14b4754ec..9f71ec786 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -324,6 +324,15 @@ void ffParseDiskJsonObject(FFDiskOptions* options, yyjson_val* module) continue; } + if (unsafe_yyjson_equals_str(key, "showRegular")) + { + if (yyjson_get_bool(val)) + options->showTypes |= FF_DISK_VOLUME_TYPE_REGULAR_BIT; + else + options->showTypes &= ~FF_DISK_VOLUME_TYPE_REGULAR_BIT; + continue; + } + if (unsafe_yyjson_equals_str(key, "showExternal")) { if (yyjson_get_bool(val)) @@ -394,6 +403,9 @@ void ffGenerateDiskJsonConfig(FFDiskOptions* options, yyjson_mut_doc* doc, yyjso if (defaultOptions.showTypes != options->showTypes) { + if (options->showTypes & FF_DISK_VOLUME_TYPE_REGULAR_BIT) + yyjson_mut_obj_add_bool(doc, module, "showRegular", true); + if (options->showTypes & FF_DISK_VOLUME_TYPE_EXTERNAL_BIT) yyjson_mut_obj_add_bool(doc, module, "showExternal", true);