feat(fix) nginx 删除操作新增还原配置

This commit is contained in:
bwcx_jzy 2022-02-12 13:46:01 +08:00
parent 83ac7fb143
commit ad9d0192dd
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
4 changed files with 332 additions and 274 deletions

View File

@ -1,5 +1,16 @@
# 🚀 版本日志
# 2.8.10
### 🐣 新增功能
1. nginx 删除操作新增还原配置
### 🐞 解决BUG、优化功能
------
# 2.8.9 (2022-02-12)
### 🐣 新增功能

View File

@ -78,13 +78,13 @@ public class NginxController extends BaseAgentController {
* @return json
*/
@RequestMapping(value = "list_data.json", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public String list(String whitePath, String name) {
public String list(String whitePath, String name, String showAll) {
boolean checkNgxDirectory = whitelistDirectoryService.checkNgxDirectory(whitePath);
Assert.state(checkNgxDirectory, "文件路径错误,非白名单路径");
if (StrUtil.isEmpty(name)) {
name = StrUtil.SLASH;
}
JSONArray array = nginxService.list(whitePath, name);
List<JSONObject> array = nginxService.list(whitePath, name, showAll);
return JsonMessage.getString(200, "", array);
}
@ -122,6 +122,11 @@ public class NginxController extends BaseAgentController {
// setAttribute("data", jsonObject);
}
private void checkName(String name) {
Assert.hasText(name, "请填写文件名");
Assert.state(name.endsWith(".conf"), "文件后缀必须为\".conf\"");
}
/**
* 新增或修改配置
*
@ -132,8 +137,7 @@ public class NginxController extends BaseAgentController {
*/
@RequestMapping(value = "updateNgx", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public String updateNgx(String name, String whitePath, String genre, String context) {
Assert.hasText(name, "请填写文件名");
Assert.state(name.endsWith(".conf"), "文件后缀必须为\".conf\"");
this.checkName(name);
//
boolean ngxDirectory = whitelistDirectoryService.checkNgxDirectory(whitePath);
Assert.state(ngxDirectory, "请选择正确的白名单");
@ -237,18 +241,35 @@ public class NginxController extends BaseAgentController {
* @return json
*/
@RequestMapping(value = "delete", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public String delete(String path, String name) {
public String delete(String path, String name, String type, String from) {
if (!whitelistDirectoryService.checkNgxDirectory(path)) {
return JsonMessage.getString(400, "非法操作");
}
Assert.hasText(name, "请选择文件");
Assert.hasText(name, "请填写文件名");
if (StrUtil.equals(from, "back")) {
Assert.state(name.endsWith(".conf_back"), "不能操作此文件");
} else {
Assert.state(name.endsWith(".conf"), "文件后缀必须为\".conf\"");
}
File file = FileUtil.file(path, name);
try {
FileUtil.rename(file, file.getName() + "_back", false, true);
} catch (Exception e) {
DefaultSystemLog.getLog().error("删除nginx", e);
return JsonMessage.getString(400, "删除失败:" + e.getMessage());
if (StrUtil.equals(type, "real")) {
// 真删除
FileUtil.del(file);
} else {
try {
if (StrUtil.equals(from, "back")) {
// 恢复 可能出现 所以 copy Read-only file system
File back = FileUtil.file(path, StrUtil.removeSuffix(name, "_back"));
FileUtil.copy(file, back, true);
FileUtil.del(file);
} else {
// 假删除
FileUtil.rename(file, file.getName() + "_back", false, true);
}
} catch (Exception e) {
DefaultSystemLog.getLog().error("删除nginx", e);
return JsonMessage.getString(400, "操作失败:" + e.getMessage());
}
}
String msg = this.reloadNginx();
return JsonMessage.getString(200, "删除成功" + msg);

View File

@ -23,6 +23,7 @@
package io.jpom.service.system;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
@ -33,8 +34,8 @@ import com.github.odiszapc.nginxparser.NgxBlock;
import com.github.odiszapc.nginxparser.NgxConfig;
import com.github.odiszapc.nginxparser.NgxEntry;
import com.github.odiszapc.nginxparser.NgxParam;
import io.jpom.service.BaseDataService;
import io.jpom.model.data.AgentWhitelist;
import io.jpom.service.BaseDataService;
import io.jpom.service.WhitelistDirectoryService;
import io.jpom.system.AgentConfigBean;
import io.jpom.util.JsonFileUtil;
@ -43,8 +44,11 @@ import org.springframework.stereotype.Service;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author Arno
@ -52,121 +56,122 @@ import java.util.List;
@Service
public class NginxService extends BaseDataService {
private final WhitelistDirectoryService whitelistDirectoryService;
private final WhitelistDirectoryService whitelistDirectoryService;
public NginxService(WhitelistDirectoryService whitelistDirectoryService) {
this.whitelistDirectoryService = whitelistDirectoryService;
}
public NginxService(WhitelistDirectoryService whitelistDirectoryService) {
this.whitelistDirectoryService = whitelistDirectoryService;
}
public JSONArray list(String whitePath, String fileName) {
AgentWhitelist agentWhitelist = whitelistDirectoryService.getWhitelist();
if (agentWhitelist == null) {
return null;
}
List<String> ngxDirectory = agentWhitelist.getNginx();
if (ngxDirectory == null) {
return null;
}
File normalize = FileUtil.file(whitePath, fileName);
File[] files = FileUtil.ls(normalize.getAbsolutePath());
if (files == null || files.length <= 0) {
return null;
}
JSONArray array = new JSONArray();
for (File file : files) {
String name = file.getName();
JSONObject jsonObject = new JSONObject();
jsonObject.put("path", whitePath);
long time = file.lastModified();
jsonObject.put("time", DateUtil.date(time).toString());
jsonObject.put("name", name);
jsonObject.put("relativePath", FileUtil.normalize(fileName + StrUtil.SLASH + name));
if (file.isDirectory()) {
continue;
public List<JSONObject> list(String whitePath, String fileName, String showAll) {
AgentWhitelist agentWhitelist = whitelistDirectoryService.getWhitelist();
if (agentWhitelist == null) {
return null;
}
List<String> ngxDirectory = agentWhitelist.getNginx();
if (ngxDirectory == null) {
return null;
}
File normalize = FileUtil.file(whitePath, fileName);
File[] files = FileUtil.ls(normalize.getAbsolutePath());
if (files == null || files.length <= 0) {
return null;
}
String[] suffixes = Convert.toBool(showAll, false) ? new String[]{".conf", ".conf_back"} : new String[]{".conf"};
return Arrays.stream(files).map(file -> {
String name = file.getName();
if (file.isDirectory()) {
return null;
}
if (!StrUtil.endWithAnyIgnoreCase(name, suffixes)) {
return null;
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("path", whitePath);
long time = file.lastModified();
jsonObject.put("time", DateUtil.date(time).toString());
jsonObject.put("name", name);
jsonObject.put("relativePath", FileUtil.normalize(fileName + StrUtil.SLASH + name));
// if (FileUtil.isEmpty(file)) {
// continue;
// }
// jsonObject.put("name", name + "【文件夹】");
// jsonObject.put("isDirectory", true);
} else {
if (!name.endsWith(".conf")) {
continue;
}
try {
NgxConfig config = NgxConfig.read(file.getPath());
List<NgxEntry> server = config.findAll(NgxBlock.class, "server");
JSONObject data = findSeverName(server);
if (data != null) {
jsonObject.putAll(data);
}
} catch (IOException e) {
DefaultSystemLog.getLog().error(e.getMessage(), e);
}
}
array.add(jsonObject);
}
return array;
}
/**
* 获取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;
}
/**
* 扫描目录下所有nginx配置文件
*
* @param whitePath 白名单路径
* @param fileName 文件路径
*/
private JSONObject addChild(String whitePath, String fileName) {
File parentFile = StrUtil.isNotEmpty(fileName) ? FileUtil.file(whitePath, fileName) : FileUtil.file(whitePath);
if (!FileUtil.isDirectory(parentFile)) {
return null;
}
String absolutePath = parentFile.getAbsolutePath();
File[] files = FileUtil.ls(absolutePath);
if (files == null || files.length <= 0) {
return null;
}
JSONObject object = new JSONObject();
String parentName = parentFile.getName();
object.put("title", parentName);
object.put("whitePath", whitePath);
object.put("path", fileName);
JSONArray array = new JSONArray();
for (File file : files) {
String name = StringUtil.delStartPath(file, whitePath, true);
if (file.isDirectory()) {
if (FileUtil.isEmpty(file)) {
continue;
}
JSONObject child = addChild(whitePath, name);
if (child != null) {
array.add(child);
}
} else {
try {
NgxConfig config = NgxConfig.read(file.getPath());
List<NgxEntry> server = config.findAll(NgxBlock.class, "server");
JSONObject data = findSeverName(server);
if (data != null) {
jsonObject.putAll(data);
}
} catch (IOException e) {
DefaultSystemLog.getLog().error(e.getMessage(), e);
}
return jsonObject;
}).filter(Objects::nonNull).collect(Collectors.toList());
}
/**
* 获取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;
}
/**
* 扫描目录下所有nginx配置文件
*
* @param whitePath 白名单路径
* @param fileName 文件路径
*/
private JSONObject addChild(String whitePath, String fileName) {
File parentFile = StrUtil.isNotEmpty(fileName) ? FileUtil.file(whitePath, fileName) : FileUtil.file(whitePath);
if (!FileUtil.isDirectory(parentFile)) {
return null;
}
String absolutePath = parentFile.getAbsolutePath();
File[] files = FileUtil.ls(absolutePath);
if (files == null || files.length <= 0) {
return null;
}
JSONObject object = new JSONObject();
String parentName = parentFile.getName();
object.put("title", parentName);
object.put("whitePath", whitePath);
object.put("path", fileName);
JSONArray array = new JSONArray();
for (File file : files) {
String name = StringUtil.delStartPath(file, whitePath, true);
if (file.isDirectory()) {
if (FileUtil.isEmpty(file)) {
continue;
}
JSONObject child = addChild(whitePath, name);
if (child != null) {
array.add(child);
}
} else {
// String fName = file.getName();
// if (fName.endsWith(".conf")) {
// JSONObject child = new JSONObject();
@ -175,151 +180,151 @@ public class NginxService extends BaseDataService {
// child.put("path", name);
// array.add(child);
// }
}
}
object.put("children", array);
return object;
}
}
}
object.put("children", array);
return object;
}
/**
* 获取域名
*
* @param server server块
* @return 域名
*/
private JSONObject findSeverName(List<NgxEntry> server) {
if (null == server) {
return null;
}
JSONObject jsonObject = new JSONObject();
HashSet<String> serverNames = new HashSet<>();
HashSet<String> location = new HashSet<>();
HashSet<String> listen = new HashSet<>();
for (NgxEntry ngxEntry : server) {
/**
* 获取域名
*
* @param server server块
* @return 域名
*/
private JSONObject findSeverName(List<NgxEntry> server) {
if (null == server) {
return null;
}
JSONObject jsonObject = new JSONObject();
HashSet<String> serverNames = new HashSet<>();
HashSet<String> location = new HashSet<>();
HashSet<String> listen = new HashSet<>();
for (NgxEntry ngxEntry : server) {
NgxBlock ngxBlock = (NgxBlock) ngxEntry;
NgxParam serverName = ngxBlock.findParam("server_name");
if (null != serverName) {
serverNames.add(serverName.getValue());
}
List<NgxEntry> locationAll = ngxBlock.findAll(NgxBlock.class, "location");
if (locationAll != null) {
locationAll.forEach(ngxEntry1 -> {
NgxBlock ngxBlock1 = (NgxBlock) ngxEntry1;
if (!StrUtil.SLASH.equals(ngxBlock1.getValue())) {
return;
}
NgxParam locationMain = ngxBlock1.findParam("proxy_pass");
if (locationMain == null) {
locationMain = ngxBlock1.findParam("root");
}
if (locationMain == null) {
locationMain = ngxBlock1.findParam("alias");
}
if (locationMain == null) {
return;
}
location.add(locationMain.getValue());
});
}
// 监听的端口
NgxParam listenParm = ngxBlock.findParam("listen");
if (listenParm != null) {
listen.add(listenParm.getValue());
}
}
jsonObject.put("serverCount", server.size());
jsonObject.put("server_name", CollUtil.join(serverNames, StrUtil.COMMA));
jsonObject.put("location", CollUtil.join(location, StrUtil.COMMA));
jsonObject.put("listen", CollUtil.join(listen, StrUtil.COMMA));
return jsonObject;
}
NgxBlock ngxBlock = (NgxBlock) ngxEntry;
NgxParam serverName = ngxBlock.findParam("server_name");
if (null != serverName) {
serverNames.add(serverName.getValue());
}
List<NgxEntry> locationAll = ngxBlock.findAll(NgxBlock.class, "location");
if (locationAll != null) {
locationAll.forEach(ngxEntry1 -> {
NgxBlock ngxBlock1 = (NgxBlock) ngxEntry1;
if (!StrUtil.SLASH.equals(ngxBlock1.getValue())) {
return;
}
NgxParam locationMain = ngxBlock1.findParam("proxy_pass");
if (locationMain == null) {
locationMain = ngxBlock1.findParam("root");
}
if (locationMain == null) {
locationMain = ngxBlock1.findParam("alias");
}
if (locationMain == null) {
return;
}
location.add(locationMain.getValue());
});
}
// 监听的端口
NgxParam listenParm = ngxBlock.findParam("listen");
if (listenParm != null) {
listen.add(listenParm.getValue());
}
}
jsonObject.put("serverCount", server.size());
jsonObject.put("server_name", CollUtil.join(serverNames, StrUtil.COMMA));
jsonObject.put("location", CollUtil.join(location, StrUtil.COMMA));
jsonObject.put("listen", CollUtil.join(listen, StrUtil.COMMA));
return jsonObject;
}
/**
* 解析nginx
*
* @param path nginx路径
*/
public JSONObject getItem(String path) {
JSONObject jsonObject = new JSONObject();
try {
NgxConfig conf = NgxConfig.read(path);
NgxParam cache = conf.findParam("http", "proxy_cache_path");
if (cache != null) {
String value = cache.getValue();
String[] split = value.split(" ");
jsonObject.put("cachePath", split[0].trim());
String maxSize = split[3];
String size = maxSize.substring("max_size=".length(), maxSize.length() - 1);
jsonObject.put("cacheSize", size);
String inactive = split[4];
String time = inactive.substring("inactive=".length(), inactive.length() - 1);
jsonObject.put("inactive", time);
}
List<NgxEntry> list = conf.findAll(NgxBlock.class, "server");
if (list == null) {
return jsonObject;
}
boolean main = true;
for (NgxEntry ngxEntry : list) {
NgxBlock block = (NgxBlock) ngxEntry;
NgxParam certificate = block.findParam("ssl_certificate");
NgxParam key = block.findParam("ssl_certificate_key");
NgxParam listen = block.findParam("listen");
NgxParam serverName = block.findParam("server_name");
NgxParam location = block.findParam("location", "proxy_pass");
if (certificate != null && main) {
main = false;
jsonObject.put("cert", certificate.getValue());
jsonObject.put("key", key.getValue());
jsonObject.put("port", listen.getValue());
jsonObject.put("domain", serverName.getValue());
jsonObject.put("location", location.getValue());
}
NgxParam rewrite = block.findParam("rewrite");
if (rewrite != null) {
jsonObject.put("convert", true);
}
if (main) {
jsonObject.put("port", listen.getValue());
jsonObject.put("domain", serverName.getValue());
if (null != location) {
jsonObject.put("location", location.getValue());
}
}
/**
* 解析nginx
*
* @param path nginx路径
*/
public JSONObject getItem(String path) {
JSONObject jsonObject = new JSONObject();
try {
NgxConfig conf = NgxConfig.read(path);
NgxParam cache = conf.findParam("http", "proxy_cache_path");
if (cache != null) {
String value = cache.getValue();
String[] split = value.split(" ");
jsonObject.put("cachePath", split[0].trim());
String maxSize = split[3];
String size = maxSize.substring("max_size=".length(), maxSize.length() - 1);
jsonObject.put("cacheSize", size);
String inactive = split[4];
String time = inactive.substring("inactive=".length(), inactive.length() - 1);
jsonObject.put("inactive", time);
}
List<NgxEntry> list = conf.findAll(NgxBlock.class, "server");
if (list == null) {
return jsonObject;
}
boolean main = true;
for (NgxEntry ngxEntry : list) {
NgxBlock block = (NgxBlock) ngxEntry;
NgxParam certificate = block.findParam("ssl_certificate");
NgxParam key = block.findParam("ssl_certificate_key");
NgxParam listen = block.findParam("listen");
NgxParam serverName = block.findParam("server_name");
NgxParam location = block.findParam("location", "proxy_pass");
if (certificate != null && main) {
main = false;
jsonObject.put("cert", certificate.getValue());
jsonObject.put("key", key.getValue());
jsonObject.put("port", listen.getValue());
jsonObject.put("domain", serverName.getValue());
jsonObject.put("location", location.getValue());
}
NgxParam rewrite = block.findParam("rewrite");
if (rewrite != null) {
jsonObject.put("convert", true);
}
if (main) {
jsonObject.put("port", listen.getValue());
jsonObject.put("domain", serverName.getValue());
if (null != location) {
jsonObject.put("location", location.getValue());
}
}
}
} catch (Exception e) {
DefaultSystemLog.getLog().error(e.getMessage(), e);
}
return jsonObject;
}
}
} catch (Exception e) {
DefaultSystemLog.getLog().error(e.getMessage(), e);
}
return jsonObject;
}
/**
* 获取nginx配置
* name 修改后的服务名
* status 状态开启 open/ 关闭close
*/
public JSONObject getNgxConf() {
JSONObject object = getJSONObject(AgentConfigBean.NGINX_CONF);
if (object == null) {
object = new JSONObject();
object.put("name", "nginx");
save(object);
}
return object;
}
/**
* 获取nginx配置
* name 修改后的服务名
* status 状态开启 open/ 关闭close
*/
public JSONObject getNgxConf() {
JSONObject object = getJSONObject(AgentConfigBean.NGINX_CONF);
if (object == null) {
object = new JSONObject();
object.put("name", "nginx");
save(object);
}
return object;
}
public String getServiceName() {
JSONObject ngxConf = getNgxConf();
return ngxConf.getString("name");
}
public String getServiceName() {
JSONObject ngxConf = getNgxConf();
return ngxConf.getString("name");
}
public void save(JSONObject object) {
String dataFilePath = getDataFilePath(AgentConfigBean.NGINX_CONF);
JsonFileUtil.saveJson(dataFilePath, object);
}
public void save(JSONObject object) {
String dataFilePath = getDataFilePath(AgentConfigBean.NGINX_CONF);
JsonFileUtil.saveJson(dataFilePath, object);
}
}

View File

@ -12,8 +12,13 @@
<a-table size="middle" :data-source="fileList" :loading="loading" :columns="columns" :pagination="false" bordered :rowKey="(record, index) => index">
<template slot="title">
<a-space>
<a-button size="small" type="primary" @click="handleAdd">新增配置</a-button>
<div>
查询
<a-switch v-model="listData.showAll" checked-children="显示所有" un-checked-children="显示正常" />
</div>
<a-button size="small" type="primary" @click="handleFilter">刷新</a-button>
<a-button size="small" type="primary" @click="handleAdd">新增配置</a-button>
<a-switch v-model="nginxData.status" checked-children="运行中" un-checked-children="未运行" disabled />
<a-dropdown>
<a class="ant-dropdown-link" @click="(e) => e.preventDefault()">
@ -52,9 +57,10 @@
</a-space>
</template>
<a-tooltip slot="name" slot-scope="text, record" placement="topLeft" :title="`名称:${text} server 节点数 ${record.serverCount}`">
<div @click="handleEdit(record)" style="color: blue">
<div @click="handleEdit(record)" :style="`${record.name.endsWith('.conf') ? 'color: blue' : ''}`">
<a-icon v-if="record.name.endsWith('.conf')" type="edit" />
<a-icon v-else type="eye" />
<span>{{ text }}</span>
<a-icon type="edit" />
</div>
</a-tooltip>
<!-- <a-tooltip slot="isDirectory" slot-scope="text" placement="topLeft" :title="text">
@ -71,7 +77,20 @@
</a-tooltip>
<template slot="operation" slot-scope="text, record">
<!-- <a-button type="primary" @click="handleEdit(record)">编辑</a-button> -->
<a-button size="small" type="danger" @click="handleDelete(record)">删除</a-button>
<a-popover title="删除确认" v-if="record.name.endsWith('.conf')">
<template slot="content">
<p><a-button size="small" type="danger" @click="handleDelete(record, 'temp', 'none')">临时删除</a-button></p>
<p><a-button size="small" type="danger" @click="handleDelete(record, 'real', 'none')">永久删除</a-button></p>
</template>
<a-button size="small" type="danger">删除</a-button>
</a-popover>
<a-popover title="还原" v-else>
<template slot="content">
<p><a-button size="small" type="danger" @click="handleDelete(record, 'temp', 'back')">还原配置</a-button></p>
<p><a-button size="small" type="danger" @click="handleDelete(record, 'real', 'back')">永久删除</a-button></p>
</template>
<a-button size="small" type="danger">还原</a-button>
</a-popover>
</template>
</a-table>
<!-- 编辑区 -->
@ -103,17 +122,7 @@
</a-layout>
</template>
<script>
import {
getNginxDirectoryList,
getNginxFileList,
editNginxConfig,
deleteNginxConfig,
loadNginxWhiteList,
loadNginxConfig,
loadNginxData,
doNginxCommand,
editNginxServerName,
} from "../../../../api/node-nginx";
import { getNginxDirectoryList, getNginxFileList, editNginxConfig, deleteNginxConfig, loadNginxWhiteList, loadNginxConfig, loadNginxData, doNginxCommand, editNginxServerName } from "@/api/node-nginx";
import codeEditor from "@/components/codeEditor";
@ -135,7 +144,10 @@ export default {
nginxData: {},
temp: {},
tempNode: {},
tableHeight: "80vh",
listData: {
showAll: false,
},
// tableHeight: "80vh",
editNginxVisible: false,
editNginxNameVisible: false,
defaultProps: {
@ -227,6 +239,7 @@ export default {
nodeId: this.node.id,
whitePath: this.tempNode.whitePath,
name: this.tempNode.path,
showAll: this.listData.showAll,
};
//
getNginxFileList(params).then((res) => {
@ -298,10 +311,16 @@ export default {
});
},
//
handleDelete(record) {
handleDelete(record, type, from) {
let msg;
if (from === "back") {
msg = "真的要" + (type === "real" ? "永久删除文件么?" : "还原配置文件么?");
} else {
msg = "真的要" + (type === "real" ? "永久" : "临时") + "删除文件么?";
}
this.$confirm({
title: "系统提示",
content: "真的要删除文件么?",
content: msg,
okText: "确认",
cancelText: "取消",
onOk: () => {
@ -310,6 +329,8 @@ export default {
nodeId: this.node.id,
path: record.path,
name: record.relativePath,
type: type,
from: from,
};
//
deleteNginxConfig(params).then((res) => {