Search in sources :

Example 11 with AgentWhitelist

use of io.jpom.model.data.AgentWhitelist in project Jpom by dromara.

the class NginxService method tree.

/**
 * 获取nginx树型图列表
 *
 * @return JSONArray
 */
public JSONArray tree() {
    JSONArray treeArray = new JSONArray();
    AgentWhitelist agentWhitelist = whitelistDirectoryService.getWhitelist();
    if (agentWhitelist == null) {
        return treeArray;
    }
    List<String> ngxDirectory = agentWhitelist.getNginx();
    if (ngxDirectory == null) {
        return treeArray;
    }
    for (String str : ngxDirectory) {
        JSONObject object = addChild(str, "");
        if (object != null) {
            object.put("title", str);
            // object.put("spread", true);
            treeArray.add(object);
        }
    }
    return treeArray;
}
Also used : JSONObject(com.alibaba.fastjson.JSONObject) JSONArray(com.alibaba.fastjson.JSONArray) AgentWhitelist(io.jpom.model.data.AgentWhitelist)

Aggregations

AgentWhitelist (io.jpom.model.data.AgentWhitelist)11 JSONObject (com.alibaba.fastjson.JSONObject)4 NodeProjectInfoModel (io.jpom.model.data.NodeProjectInfoModel)4 File (java.io.File)4 JSONArray (com.alibaba.fastjson.JSONArray)3 Charset (java.nio.charset.Charset)3 JsonMessage (cn.jiangzeyin.common.JsonMessage)2 CollStreamUtil (cn.hutool.core.collection.CollStreamUtil)1 CollUtil (cn.hutool.core.collection.CollUtil)1 Convert (cn.hutool.core.convert.Convert)1 FileUtil (cn.hutool.core.io.FileUtil)1 ThreadUtil (cn.hutool.core.thread.ThreadUtil)1 ArrayUtil (cn.hutool.core.util.ArrayUtil)1 BooleanUtil (cn.hutool.core.util.BooleanUtil)1 StrUtil (cn.hutool.core.util.StrUtil)1 SecureUtil (cn.hutool.crypto.SecureUtil)1 ServletUtil (cn.hutool.extra.servlet.ServletUtil)1 HttpUtil (cn.hutool.http.HttpUtil)1 DefaultSystemLog (cn.jiangzeyin.common.DefaultSystemLog)1 MultipartFileBuilder (cn.jiangzeyin.controller.multipart.MultipartFileBuilder)1