未验证 提交 e5a5e05f 编写于 作者: H honganan 提交者: GitHub

add suffix limit to avoid possible start problems (#7641)

上级 0b67d299
...@@ -52,6 +52,7 @@ Release Notes. ...@@ -52,6 +52,7 @@ Release Notes.
* Support nacos grouped dynamic configurations. * Support nacos grouped dynamic configurations.
* Support for filter function filtering of int type values. * Support for filter function filtering of int type values.
* Support mTLS for gRPC channel. * Support mTLS for gRPC channel.
* Add yaml file suffix limit when reading ui templates.
#### UI #### UI
......
...@@ -37,7 +37,7 @@ User could click the `lock` button left aside the `Service/Instance/Endpoint Rel ...@@ -37,7 +37,7 @@ User could click the `lock` button left aside the `Service/Instance/Endpoint Rel
Users could customize the dashboard. The default dashboards are provided through the default templates located in Users could customize the dashboard. The default dashboards are provided through the default templates located in
`/ui-initialized-templates` folders. `/ui-initialized-templates` folders.
The template file follows this format. The template file must end with `.yml` or `.yaml` and follows this format.
```yaml ```yaml
templates: templates:
- name: template name # The unique name - name: template name # The unique name
......
...@@ -376,6 +376,9 @@ public class CoreModuleProvider extends ModuleProvider { ...@@ -376,6 +376,9 @@ public class CoreModuleProvider extends ModuleProvider {
try { try {
final File[] templateFiles = ResourceUtils.getPathFiles("ui-initialized-templates"); final File[] templateFiles = ResourceUtils.getPathFiles("ui-initialized-templates");
for (final File templateFile : templateFiles) { for (final File templateFile : templateFiles) {
if (!templateFile.getName().endsWith(".yml") && !templateFile.getName().endsWith(".yaml")) {
continue;
}
new UITemplateInitializer(new FileInputStream(templateFile)) new UITemplateInitializer(new FileInputStream(templateFile))
.read() .read()
.forEach(uiTemplate -> { .forEach(uiTemplate -> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册