All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastchar.extjs.systemtool.provider.FastBaseMenuProvider Maven / Gradle / Ivy

The newest version!
package com.fastchar.extjs.systemtool.provider;

import com.fastchar.core.FastChar;
import com.fastchar.extjs.systemtool.FastSystemToolConfig;
import com.fastchar.job.quartz.FastQuartzConfig;
import com.fastchar.utils.FastClassUtils;

/**
 * @author 沈建(Janesen)
 */
public class FastBaseMenuProvider  {

    public Boolean onShowMenu(String menuTitle) {
        FastSystemToolConfig config = FastChar.getConfig(FastSystemToolConfig.class);
        if (menuTitle.equals("任务计划日志")) {
            if (!config.isLogJob()) {
                return false;
            }
            if (FastClassUtils.getClass("com.fastchar.job.FastJob", false) == null) {
                return false;
            }
        }
        if (menuTitle.equals("系统HTTP日志")) {
            if (!config.isLogHttp()) {
                return false;
            }
            if (FastClassUtils.getClass("com.fastchar.http.core.FastHttpRequest", false) == null) {
                return false;
            }
        }
        if (menuTitle.equals("系统WebDriver日志")) {
            if (!config.isLogSelenium()) {
                return false;
            }
            if (FastClassUtils.getClass("com.fastchar.selenium.FastSeleniumConfig", false) == null) {
                return false;
            }
        }
        if (menuTitle.equals("系统Socket连接列表")
                || menuTitle.equals("系统Socket消息日志")) {
            if (!config.isLogSocket()) {
                return false;
            }
            if (FastClassUtils.getClass("com.fastchar.socket.FastSocketServerConfig", false) == null) {
                return false;
            }
        }

        if (menuTitle.equals("任务计划日志")) {
            if (!config.isLogJob()) {
                return false;
            }
            return FastChar.getConfig(FastQuartzConfig.class).isUseDatabase();
        }

        if (menuTitle.equals("系统请求日志")) {
            return config.isLogActionRequest();
        }
        if (menuTitle.equals("系统SQL日志")) {
            return config.isLogSql();
        }
        return true;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy