提交 | 用户 | 时间
|
e7c126
|
1 |
/* |
H |
2 |
* Copyright 1999-2023 Alibaba Group Holding Ltd. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
|
|
17 |
package com.alibaba.nacos.console.config; |
|
18 |
|
|
19 |
import com.alibaba.nacos.sys.module.ModuleState; |
|
20 |
import com.alibaba.nacos.sys.module.ModuleStateBuilder; |
|
21 |
import com.alibaba.nacos.sys.utils.ApplicationUtils; |
|
22 |
|
|
23 |
/** |
|
24 |
* Console module state builder. |
|
25 |
* |
|
26 |
* @author xiweng.yy |
|
27 |
*/ |
|
28 |
public class ConsoleModuleStateBuilder implements ModuleStateBuilder { |
|
29 |
|
|
30 |
public static final String CONSOLE_MODULE = "console"; |
|
31 |
|
|
32 |
private static final String CONSOLE_UI_ENABLED = "console_ui_enabled"; |
|
33 |
|
|
34 |
@Override |
|
35 |
public ModuleState build() { |
|
36 |
ModuleState result = new ModuleState(CONSOLE_MODULE); |
|
37 |
try { |
|
38 |
ConsoleConfig consoleConfig = ApplicationUtils.getBean(ConsoleConfig.class); |
|
39 |
result.newState(CONSOLE_UI_ENABLED, consoleConfig.isConsoleUiEnabled()); |
|
40 |
} catch (Exception ignored) { |
|
41 |
} |
|
42 |
return result; |
|
43 |
} |
|
44 |
} |