mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
修复调试脚本选择脚本
This commit is contained in:
parent
75fca715e3
commit
d4b6cc5e4d
|
@ -80,6 +80,7 @@ const Config = () => {
|
||||||
loading={loading}
|
loading={loading}
|
||||||
extra={[
|
extra={[
|
||||||
<TreeSelect
|
<TreeSelect
|
||||||
|
treeExpandAction="click"
|
||||||
className="config-select"
|
className="config-select"
|
||||||
value={select}
|
value={select}
|
||||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||||
|
|
|
@ -185,6 +185,7 @@ const Log = () => {
|
||||||
isPhone
|
isPhone
|
||||||
? [
|
? [
|
||||||
<TreeSelect
|
<TreeSelect
|
||||||
|
treeExpandAction="click"
|
||||||
className="log-select"
|
className="log-select"
|
||||||
value={select}
|
value={select}
|
||||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||||
|
|
|
@ -57,6 +57,11 @@ const EditModal = ({
|
||||||
if (node.key === selectedKey || !value) {
|
if (node.key === selectedKey || !value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.type === 'directory') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const newMode = LangMap[value.slice(-3)] || '';
|
const newMode = LangMap[value.slice(-3)] || '';
|
||||||
setCNode(node);
|
setCNode(node);
|
||||||
setLanguage(newMode);
|
setLanguage(newMode);
|
||||||
|
@ -136,10 +141,13 @@ const EditModal = ({
|
||||||
}, [socketMessage]);
|
}, [socketMessage]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
setLog('');
|
||||||
if (currentNode) {
|
if (currentNode) {
|
||||||
setCNode(currentNode);
|
setCNode(currentNode);
|
||||||
setValue(content as string);
|
setValue(content as string);
|
||||||
setSelectedKey(currentNode.key);
|
setSelectedKey(currentNode.key);
|
||||||
|
const newMode = LangMap[value.slice(-3)] || '';
|
||||||
|
setLanguage(newMode);
|
||||||
}
|
}
|
||||||
}, [content, currentNode]);
|
}, [content, currentNode]);
|
||||||
|
|
||||||
|
@ -150,6 +158,7 @@ const EditModal = ({
|
||||||
title={
|
title={
|
||||||
<>
|
<>
|
||||||
<TreeSelect
|
<TreeSelect
|
||||||
|
treeExpandAction="click"
|
||||||
style={{ marginRight: 8, width: 150 }}
|
style={{ marginRight: 8, width: 150 }}
|
||||||
value={selectedKey}
|
value={selectedKey}
|
||||||
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
||||||
|
|
|
@ -82,7 +82,11 @@ const Script = () => {
|
||||||
|
|
||||||
const getDetail = (node: any) => {
|
const getDetail = (node: any) => {
|
||||||
request
|
request
|
||||||
.get(`${config.apiPrefix}scripts/${node.title}?path=${node.parent || ''}`)
|
.get(
|
||||||
|
`${config.apiPrefix}scripts/${encodeURIComponent(node.title)}?path=${
|
||||||
|
node.parent || ''
|
||||||
|
}`,
|
||||||
|
)
|
||||||
.then(({ code, data }) => {
|
.then(({ code, data }) => {
|
||||||
if (code === 200) {
|
if (code === 200) {
|
||||||
setValue(data);
|
setValue(data);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user