mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 17:54:32 +08:00
修复脚本管理和日志管理树字段
This commit is contained in:
@@ -66,7 +66,7 @@ const EditModal = ({
|
||||
|
||||
const getDetail = (node: any) => {
|
||||
request
|
||||
.get(`${config.apiPrefix}scripts/${node.value}?path=${node.parent || ''}`)
|
||||
.get(`${config.apiPrefix}scripts/${node.title}?path=${node.parent || ''}`)
|
||||
.then((data) => {
|
||||
setValue(data.data);
|
||||
});
|
||||
@@ -77,7 +77,7 @@ const EditModal = ({
|
||||
request
|
||||
.put(`${config.apiPrefix}scripts/run`, {
|
||||
data: {
|
||||
filename: cNode.value,
|
||||
filename: cNode.title,
|
||||
path: cNode.parent || '',
|
||||
},
|
||||
})
|
||||
@@ -87,13 +87,13 @@ const EditModal = ({
|
||||
};
|
||||
|
||||
const stop = () => {
|
||||
if (!cNode || !cNode.value) {
|
||||
if (!cNode || !cNode.title) {
|
||||
return;
|
||||
}
|
||||
request
|
||||
.put(`${config.apiPrefix}scripts/stop`, {
|
||||
data: {
|
||||
filename: cNode.value,
|
||||
filename: cNode.title,
|
||||
path: cNode.parent || '',
|
||||
},
|
||||
})
|
||||
@@ -146,6 +146,7 @@ const EditModal = ({
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
treeData={treeData}
|
||||
placeholder="请选择脚本文件"
|
||||
fieldNames={{ value: 'key', label: 'title' }}
|
||||
showSearch
|
||||
onSelect={onSelect}
|
||||
/>
|
||||
@@ -243,7 +244,7 @@ const EditModal = ({
|
||||
content:
|
||||
editorRef.current &&
|
||||
editorRef.current.getValue().replace(/\r\n/g, '\n'),
|
||||
filename: cNode?.value,
|
||||
filename: cNode?.title,
|
||||
}}
|
||||
/>
|
||||
<SettingModal
|
||||
|
||||
@@ -451,6 +451,7 @@ const Script = ({ headerStyle, isPhone, theme, socketMessage }: any) => {
|
||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||
treeData={data}
|
||||
placeholder="请选择脚本"
|
||||
fieldNames={{ value: 'key', label: 'title' }}
|
||||
showSearch
|
||||
onSelect={onSelect}
|
||||
/>,
|
||||
|
||||
Reference in New Issue
Block a user