diff options
| author | snaury <[email protected]> | 2023-02-01 18:18:51 +0300 |
|---|---|---|
| committer | snaury <[email protected]> | 2023-02-01 18:18:51 +0300 |
| commit | b3f36b1a35914a9e05875380b01a6b18f2bf2096 (patch) | |
| tree | a42f7aed51163e28121461faa4aed191943488f5 | |
| parent | 6d76eca0ba0a0b0820540babc17b259210e63830 (diff) | |
Handle repeated fields when displaying app config in configs dispatcher
| -rw-r--r-- | ydb/core/cms/console/http.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ydb/core/cms/console/http.cpp b/ydb/core/cms/console/http.cpp index 97b3dcb071a..ec7cd262091 100644 --- a/ydb/core/cms/console/http.cpp +++ b/ydb/core/cms/console/http.cpp @@ -68,10 +68,26 @@ void OutputConfigHTML(IOutputStream &os, const NKikimrConfig::TAppConfig &config os << reflection->GetEnum(config, field)->name(); break; case ::google::protobuf::FieldDescriptor::CPPTYPE_STRING: - os << reflection->GetString(config, field); + if (field->is_repeated()) { + int count = reflection->FieldSize(config, field); + for (int index = 0; index < count; ++index) { + os << "[" << index << "]: " + << reflection->GetRepeatedString(config, field, index) << '\n'; + } + } else { + os << reflection->GetString(config, field); + } break; case ::google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE: - os << reflection->GetMessage(config, field).DebugString(); + if (field->is_repeated()) { + int count = reflection->FieldSize(config, field); + for (int index = 0; index < count; ++index) { + os << "[" << index << "]:" << '\n' + << reflection->GetRepeatedMessage(config, field, index).DebugString(); + } + } else { + os << reflection->GetMessage(config, field).DebugString(); + } break; default: os << "<unsupported value type>"; |
