mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-13 04:02:56 +08:00
脚本管理支持新增文件
This commit is contained in:
@@ -7,19 +7,17 @@ const SaveModal = ({
|
||||
file,
|
||||
handleCancel,
|
||||
visible,
|
||||
isNewFile,
|
||||
}: {
|
||||
file?: any;
|
||||
visible: boolean;
|
||||
handleCancel: (cks?: any[]) => void;
|
||||
isNewFile: boolean;
|
||||
}) => {
|
||||
const [form] = Form.useForm();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const handleOk = async (values: any) => {
|
||||
setLoading(true);
|
||||
const payload = { ...file, ...values };
|
||||
const payload = { ...file, ...values, originFilename: file.filename };
|
||||
request
|
||||
.post(`${config.apiPrefix}scripts`, {
|
||||
data: payload,
|
||||
@@ -71,12 +69,8 @@ const SaveModal = ({
|
||||
>
|
||||
<Input placeholder="请输入文件名" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="path"
|
||||
label="保存目录"
|
||||
rules={[{ required: true, message: '请输入保存目录' }]}
|
||||
>
|
||||
<Input placeholder="请输入保存目录" />
|
||||
<Form.Item name="path" label="保存目录">
|
||||
<Input placeholder="请输入保存目录,默认scripts目录" />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user