Unverified Commit 3206819d authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

[Refactor][web] split codeshow of floatbutton && fix some bug (#1953)

* modify code && fix some bug * added todo * delete timer prpos
parent ff71906d
...@@ -246,9 +246,10 @@ public class UserServiceImpl extends SuperServiceImpl<UserMapper, User> implemen ...@@ -246,9 +246,10 @@ public class UserServiceImpl extends SuperServiceImpl<UserMapper, User> implemen
return Result.succeed(MessageResolverUtils.getMessage("user.assign.role.success")); return Result.succeed(MessageResolverUtils.getMessage("user.assign.role.success"));
} else { } else {
if (userRoleList.size() == 0) { if (userRoleList.size() == 0) {
return Result.succeed(MessageResolverUtils.getMessage("user.assign.role.failed")); return Result.succeed(
MessageResolverUtils.getMessage("user.binding.role.deleteAll"));
} }
return Result.failed(MessageResolverUtils.getMessage("user.binding.role.deleteAll")); return Result.failed(MessageResolverUtils.getMessage("user.assign.role.failed"));
} }
} }
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from "react";
import {FloatButton, Space} from "antd";
import {l} from "@/utils/intl";
import {DownCircleFilled, StopFilled, SyncOutlined, UpCircleFilled} from "@ant-design/icons";
import {PlayCircleFilled} from "@ant-design/icons/lib/icons";
/**
* props
*/
type EditFloatBtnProps = {
refreshLogCallback?: () => void; // refresh log callback
autoRefresh?: boolean; // auto refresh flag
stopping?: boolean; // stop auto refresh flag
loading?: boolean; // loading flag
handleSyncLog?: () => void; // sync log callback
handleStopAutoRefresh?: () => void; // stop auto refresh callback
handleStartAutoRefresh?: () => void; // start auto refresh callback
handleBackTop?: () => void; // back to top callback
handleBackBottom?: () => void; // back to bottom callback
handleUpScroll?: () => void; // up scroll callback
handleDownScroll?: () => void; // down scroll callback
}
const EditorFloatBtn: React.FC<EditFloatBtnProps> = (props) => {
/**
* init props
*/
const {
refreshLogCallback,
autoRefresh,
stopping,
loading,
handleSyncLog,
handleStopAutoRefresh,
handleStartAutoRefresh,
handleBackTop,
handleBackBottom,
handleUpScroll,
handleDownScroll
} = props;
/**
* render
*/
return <>
<FloatButton.Group
shape="circle"
className={"float-button"}
>
<Space direction={"vertical"}>
{/* if refreshLogCallback is not null, then show sync button , auto refresh button and stop auto refresh button */}
{refreshLogCallback &&
<>
<FloatButton tooltip={l("button.refresh")} icon={<SyncOutlined spin={loading}/>} onClick={handleSyncLog}/>
{autoRefresh ?
<FloatButton icon={<StopFilled spin={stopping}/>} tooltip={l("button.stopRefresh")} onClick={handleStopAutoRefresh}/> :
<FloatButton icon={<PlayCircleFilled/>} tooltip={l("button.startRefresh")} onClick={handleStartAutoRefresh}/>
}
</>
}
{/* back top */}
<FloatButton.BackTop tooltip={l("button.backTop")} onClick={handleBackTop} visibilityHeight={0}/>
{/* go bottom */}
<FloatButton.BackTop className={"back-bottom"} tooltip={l("button.backBottom")} onClick={handleBackBottom}
visibilityHeight={0}/>
{/* scroll up */}
<FloatButton icon={<UpCircleFilled/>} tooltip={l("button.upScroll")} onClick={handleUpScroll}/>
{/* scroll down */}
<FloatButton icon={<DownCircleFilled/>} tooltip={l("button.downScroll")} onClick={handleDownScroll}/>
</Space>
</FloatButton.Group>
</>;
};
export default EditorFloatBtn;
...@@ -205,3 +205,35 @@ export const MarkDownSvg = () => { ...@@ -205,3 +205,35 @@ export const MarkDownSvg = () => {
</>; </>;
}; };
export const LogSvg = () => {
return <>
<Icon style={{...IconStyle}} component={() => (
<svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M704 64c35.328 0 64 28.672 64 64v321.7408A288 288 0 0 0 496.5376 896H128c-35.328 0-64-28.672-64-64V128c0-35.328 28.672-64 64-64h576zM480 384h-256a32 32 0 0 0-31.488 26.2656l-0.512 5.7344v32c0 15.7184 11.3152 28.7744 26.2656 31.488l5.7344 0.512h256a32 32 0 0 0 31.488-26.2656L512 448v-32a32 32 0 0 0-26.2656-31.488l-5.7344-0.512z m128-192h-384a32 32 0 0 0-31.488 26.2656l-0.512 5.7344V256c0 15.7184 11.3152 28.7744 26.2656 31.488l5.7344 0.512h384a32 32 0 0 0 31.488-26.2656L640 256v-32a32 32 0 0 0-26.2656-31.488l-5.7344-0.512z"
fill="#007AF5"></path>
<path
d="M736 512a224 224 0 1 1 0 448 224 224 0 0 1 0-448z m0 80.0256a32 32 0 0 0-31.488 26.2144l-0.512 5.7856v128l0.512 5.7344a32.0512 32.0512 0 0 0 25.7536 25.7024l5.7344 0.512h128l5.7344-0.512a32.0512 32.0512 0 0 0 25.7536-25.7024l0.512-5.7856-0.512-5.7344a32.0512 32.0512 0 0 0-25.7536-25.7024l-5.7344-0.512H768v-96.0512l-0.512-5.7344a32 32 0 0 0-31.488-26.2144z"
fill="#66AFF9"></path>
</svg>
)}/>
</>;
};
export const ScalaSvg = () => {
return <>
<Icon style={{...IconStyle}} component={() => (
<svg className="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M213.844 203.564l596.4-87.928v197.952l-596.4 87.928zM213.788 457.312l596.4-87.928v197.952l-596.4 87.928zM213.768 710.4l596.392-87.932v197.952L213.768 908.348z"
fill="#F44336"></path>
<path
d="M225.12 366.636l382.416 123.684-11.328 35.028-382.416-123.684zM427.76 245.496l382.416 123.688-11.328 35.028-382.416-123.688zM225.112 620.148l382.416 123.684-11.328 35.032-382.416-123.688zM427.792 498.604l382.416 123.688-11.332 35.028-382.412-123.688z"
fill="#F44336"></path>
</svg>
)}/>
</>;
};
...@@ -121,8 +121,21 @@ ol { ...@@ -121,8 +121,21 @@ ol {
overflow-y: auto; overflow-y: auto;
max-height: 70vh; max-height: 70vh;
min-height: 70vh; min-height: 70vh;
.ant-tree {
min-width: max-content;
.ant-tree-node-content-wrapper {
display: flex;
:hover {
color: #1eef07;
}
}
}
} }
.code-content-empty{
.code-content-empty {
height: 100%; height: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -132,15 +145,17 @@ ol { ...@@ -132,15 +145,17 @@ ol {
max-height: 70vh; max-height: 70vh;
} }
.monaco-float{ .monaco-float {
position: relative; position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.float-button { .float-button {
position: absolute; position: absolute;
transform: translate(5%, 15%); transform: translate(5%, 15%);
.back-bottom{
.back-bottom {
transform: rotate(180deg); transform: rotate(180deg);
} }
} }
...@@ -153,4 +168,4 @@ ol { ...@@ -153,4 +168,4 @@ ol {
*/ */
.needWrap { .needWrap {
white-space: pre-wrap; white-space: pre-wrap;
} }
\ No newline at end of file
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
'button.downScroll': 'Down Scroll', 'button.downScroll': 'Down Scroll',
'button.upScroll': 'Up Scroll', 'button.upScroll': 'Up Scroll',
'button.stopRefresh': 'Stop Auto Refresh', 'button.stopRefresh': 'Stop Auto Refresh',
'button.startRefresh': 'Start Auto Refresh(5s/e)',
'right.menu.open': 'Open', 'right.menu.open': 'Open',
'right.menu.submit': 'Sync Submit', 'right.menu.submit': 'Sync Submit',
......
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
'button.downScroll': '向下滚动', 'button.downScroll': '向下滚动',
'button.upScroll': '向上滚动', 'button.upScroll': '向上滚动',
'button.stopRefresh': '停止自动刷新', 'button.stopRefresh': '停止自动刷新',
'button.startRefresh': '开始自动刷新(5s/次)',
'right.menu.open': '打开', 'right.menu.open': '打开',
......
...@@ -43,17 +43,22 @@ const RoleProTable: React.FC = () => { ...@@ -43,17 +43,22 @@ const RoleProTable: React.FC = () => {
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const executeAndCallbackRefresh = async (callback: () => void) => {
setLoading(true);
await callback();
setLoading(false);
actionRef.current?.reload?.();
}
/** /**
* delete role by id * delete role by id
* @param id role id * @param id role id
*/ */
const handleDeleteSubmit = async (id: number) => { const handleDeleteSubmit = async (id: number) => {
setLoading(true); await executeAndCallbackRefresh(async () => {
// TODO: DELETE role interface is use /api/role , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/role (ROLE) // TODO: DELETE role interface is use /api/role , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/role (ROLE)
await handleRemoveById(API_CONSTANTS.ROLE_DELETE, id); await handleRemoveById(API_CONSTANTS.ROLE_DELETE, id);
setLoading(false); });
actionRef.current?.reload?.();
} }
/** /**
...@@ -61,14 +66,13 @@ const RoleProTable: React.FC = () => { ...@@ -61,14 +66,13 @@ const RoleProTable: React.FC = () => {
* @param value * @param value
*/ */
const handleAddOrUpdateSubmit = async (value: any) => { const handleAddOrUpdateSubmit = async (value: any) => {
// TODO: added or update role interface is use /api/role/addedOrUpdateRole , because of the backend interface 'saveOrUpdate' is repeat , in the future, we need to change the interface to /api/role (ROLE) await executeAndCallbackRefresh(async () => {
await handleAddOrUpdate(API_CONSTANTS.ROLE_ADDED_OR_UPDATE, { // TODO: added or update role interface is use /api/role/addedOrUpdateRole , because of the backend interface 'saveOrUpdate' is repeat , in the future, we need to change the interface to /api/role (ROLE)
...value, await handleAddOrUpdate(API_CONSTANTS.ROLE_ADDED_OR_UPDATE, {...value, tenantId: getTenantByLocalStorage()});
tenantId: getTenantByLocalStorage() handleModalVisible(false);
}); });
handleModalVisible(false);
setFormValues({})
actionRef?.current?.reload?.();
} }
/** /**
...@@ -162,14 +166,12 @@ const RoleProTable: React.FC = () => { ...@@ -162,14 +166,12 @@ const RoleProTable: React.FC = () => {
values={{}} values={{}}
/> />
{/* modify */} {/* modify */}
{(formValues && Object.keys(formValues).length) && <RoleModalForm
<RoleModalForm onSubmit={(value: any) => handleAddOrUpdateSubmit(value)}
onSubmit={(value: any) => handleAddOrUpdateSubmit(value)} onCancel={() => handleCancel()}
onCancel={() => handleCancel()} modalVisible={updateModalVisible}
modalVisible={updateModalVisible} values={formValues}
values={formValues} />
/>
}
</> </>
} }
; ;
......
...@@ -38,17 +38,22 @@ const PermissionsProTable: React.FC = () => { ...@@ -38,17 +38,22 @@ const PermissionsProTable: React.FC = () => {
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const actionRef = useRef<ActionType>(); const actionRef = useRef<ActionType>();
const executeAndCallbackRefresh = async (callback: () => void) => {
setLoading(true);
await callback();
setLoading(false);
actionRef.current?.reload?.();
}
/** /**
* delete role by id * delete role by id
* @param id role id * @param id role id
*/ */
const handleDeleteSubmit = async (id: number) => { const handleDeleteSubmit = async (id: number) => {
setLoading(true); await executeAndCallbackRefresh(async () => {
// TODO: DELETE role interface is use /api/rowPermissions/delete , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/rowPermissions (rowPermissions) // TODO: DELETE role interface is use /api/rowPermissions/delete , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/rowPermissions (rowPermissions)
await handleRemoveById(API_CONSTANTS.ROW_PERMISSIONS_DELETE, id); await handleRemoveById(API_CONSTANTS.ROW_PERMISSIONS_DELETE, id);
setLoading(false); });
actionRef.current?.reload?.();
} }
/** /**
...@@ -56,13 +61,10 @@ const PermissionsProTable: React.FC = () => { ...@@ -56,13 +61,10 @@ const PermissionsProTable: React.FC = () => {
* @param value * @param value
*/ */
const handleAddOrUpdateSubmit = async (value: any) => { const handleAddOrUpdateSubmit = async (value: any) => {
await handleAddOrUpdate(API_CONSTANTS.ROW_PERMISSIONS, { await executeAndCallbackRefresh(async () => {
...value, await handleAddOrUpdate(API_CONSTANTS.ROW_PERMISSIONS, {...value, tenantId: getTenantByLocalStorage()});
tenantId: getTenantByLocalStorage() handleModalVisible(false);
}); });
handleModalVisible(false);
setFormValues({})
actionRef.current?.reload?.();
} }
/** /**
...@@ -163,16 +165,13 @@ const PermissionsProTable: React.FC = () => { ...@@ -163,16 +165,13 @@ const PermissionsProTable: React.FC = () => {
/> />
{/* modify row Permissions */} {/* modify row Permissions */}
{(formValues && Object.keys(formValues).length) && <PermissionsModal
<PermissionsModal onSubmit={(value) => handleAddOrUpdateSubmit(value)}
onSubmit={(value) => handleAddOrUpdateSubmit(value)} onCancel={() => handleCancel()}
onCancel={() => handleCancel()} modalVisible={updateModalVisible}
modalVisible={updateModalVisible} values={formValues}
values={formValues} />
/>
}
</> </>
} }
export default PermissionsProTable; export default PermissionsProTable;
\ No newline at end of file
...@@ -44,15 +44,22 @@ const TenantProTable: React.FC = () => { ...@@ -44,15 +44,22 @@ const TenantProTable: React.FC = () => {
const [formValues, setFormValues] = useState<Partial<UserBaseInfo.Tenant>>({}); const [formValues, setFormValues] = useState<Partial<UserBaseInfo.Tenant>>({});
const executeAndCallbackRefresh = async (callback: () => void) => {
setLoading(true);
await callback();
setLoading(false);
actionRef.current?.reload?.();
}
/** /**
* add tenant * add tenant
* @param value * @param value
*/ */
const handleAddOrUpdateSubmit = async (value: Partial<UserBaseInfo.Tenant>) => { const handleAddOrUpdateSubmit = async (value: Partial<UserBaseInfo.Tenant>) => {
await handleAddOrUpdate(API_CONSTANTS.TENANT, value); await executeAndCallbackRefresh(async () => {
handleModalVisible(false); await handleAddOrUpdate(API_CONSTANTS.TENANT, value);
setFormValues({}) handleModalVisible(false);
actionRef?.current?.reload?.(); })
}; };
/** /**
...@@ -60,24 +67,20 @@ const TenantProTable: React.FC = () => { ...@@ -60,24 +67,20 @@ const TenantProTable: React.FC = () => {
* @param id tenant id * @param id tenant id
*/ */
const handleDeleteSubmit = async (id: number) => { const handleDeleteSubmit = async (id: number) => {
setLoading(true) await executeAndCallbackRefresh(async () => {
// TODO: delete tenant interface is use /api/tenant/delete , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/tenant (TENANT) // TODO: delete tenant interface is use /api/tenant/delete , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/tenant (TENANT)
await handleRemoveById(API_CONSTANTS.TENANT_DELETE, id); await handleRemoveById(API_CONSTANTS.TENANT_DELETE, id);
setLoading(false) })
actionRef.current?.reload?.();
}; };
/** /**
* assign user to tenant * assign user to tenant
*/ */
const handleAssignUserSubmit = async () => { const handleAssignUserSubmit = async () => {
// to save await executeAndCallbackRefresh(async () => {
await handleAddOrUpdate(API_CONSTANTS.ASSIGN_USER_TO_TENANT, { await handleAddOrUpdate(API_CONSTANTS.ASSIGN_USER_TO_TENANT, {tenantId: formValues.id, userIds: tenantRelFormValues});
tenantId: formValues.id as number, setHandleGrantTenant(false);
userIds: tenantRelFormValues })
});
setHandleGrantTenant(false);
actionRef.current?.reload?.();
} }
const handleCancel = () => { const handleCancel = () => {
handleModalVisible(false); handleModalVisible(false);
...@@ -173,15 +176,13 @@ const TenantProTable: React.FC = () => { ...@@ -173,15 +176,13 @@ const TenantProTable: React.FC = () => {
/> />
{/*update tenant form*/} {/*update tenant form*/}
{(formValues && Object.keys(formValues).length) && <TenantForm
<TenantForm key={"tenantFormUpdate"}
key={"tenantFormUpdate"} onSubmit={(value) => handleAddOrUpdateSubmit(value)}
onSubmit={(value) => handleAddOrUpdateSubmit(value)} onCancel={() => handleCancel()}
onCancel={() => handleCancel()} modalVisible={updateModalVisible}
modalVisible={updateModalVisible} values={formValues}
values={formValues} />
/>
}
{/* assign user to tenant */} {/* assign user to tenant */}
<TenantModalTransfer <TenantModalTransfer
tenant={formValues} tenant={formValues}
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
import React, {useRef, useState} from "react"; import React, {useEffect, useRef, useState} from "react";
import {LockTwoTone} from "@ant-design/icons"; import {LockTwoTone} from "@ant-design/icons";
import ProTable, {ActionType, ProColumns} from "@ant-design/pro-table"; import ProTable, {ActionType, ProColumns} from "@ant-design/pro-table";
import {Button} from "antd"; import {Button} from "antd";
...@@ -61,24 +61,13 @@ const UserProTable = () => { ...@@ -61,24 +61,13 @@ const UserProTable = () => {
const actionRef = useRef<ActionType>(); // table action const actionRef = useRef<ActionType>(); // table action
const access = useAccess(); // access control const access = useAccess(); // access control
const executeAndCallbackRefresh = async (callback: () => void) => { const executeAndCallbackRefresh = async (callback: () => void) => {
setLoading(true); setLoading(true);
await callback(); await callback();
actionRef.current?.reload?.();
setLoading(false); setLoading(false);
actionRef.current?.reload?.();
} }
/**
* user add role to submit
*/
const handleGrantRoleSubmit = async () => {
await executeAndCallbackRefresh(() => {
handlePutData(API_CONSTANTS.USER_ASSIGN_ROLE, {userId: formValues.id, roleIds: roleList});
handleAssignRoleTransferOpen(false);
})
};
/** /**
* edit user * edit user
* @param value * @param value
...@@ -111,17 +100,31 @@ const UserProTable = () => { ...@@ -111,17 +100,31 @@ const UserProTable = () => {
* @param value * @param value
*/ */
const handleDeleteUser = async (value: UserBaseInfo.User) => { const handleDeleteUser = async (value: UserBaseInfo.User) => {
// TODO: delete user interface is use /api/users/delete , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/users (USER) await executeAndCallbackRefresh(async () => {
await executeAndCallbackRefresh(() => handleRemoveById(API_CONSTANTS.USER_DELETE, value.id)) // TODO: delete user interface is use /api/users/delete , because of the backend interface 'DeleteMapping' is repeat , in the future, we need to change the interface to /api/users (USER)
await handleRemoveById(API_CONSTANTS.USER_DELETE, value.id)
})
}; };
/**
* user add role to submit
*/
const handleGrantRoleSubmit = async () => {
await executeAndCallbackRefresh(async () => {
await handlePutData(API_CONSTANTS.USER_ASSIGN_ROLE, {userId: formValues.id, roleIds: roleList});
handleAssignRoleTransferOpen(false);
})
};
/** /**
* user enable or disable * user enable or disable
* @param value * @param value
*/ */
const handleChangeEnable = async (value: UserBaseInfo.User) => { const handleChangeEnable = async (value: UserBaseInfo.User) => {
await executeAndCallbackRefresh(() => updateEnabled(API_CONSTANTS.USER_ENABLE, {id: value.id})) await executeAndCallbackRefresh(async () => {
await updateEnabled(API_CONSTANTS.USER_ENABLE, {id: value.id})
})
}; };
/** /**
...@@ -129,8 +132,11 @@ const UserProTable = () => { ...@@ -129,8 +132,11 @@ const UserProTable = () => {
* @param value * @param value
*/ */
const handlePasswordChangeSubmit = async (value: any) => { const handlePasswordChangeSubmit = async (value: any) => {
await handleOption(API_CONSTANTS.USER_MODIFY_PASSWORD, l("button.changePassword"), value); await executeAndCallbackRefresh(async () => {
await handlePasswordModalOpen(false); await handleOption(API_CONSTANTS.USER_MODIFY_PASSWORD, l("button.changePassword"), value);
await handlePasswordModalOpen(false);
})
}; };
/** /**
...@@ -138,9 +144,9 @@ const UserProTable = () => { ...@@ -138,9 +144,9 @@ const UserProTable = () => {
* @param value * @param value
*/ */
const handleSubmitUser = async (value: Partial<UserBaseInfo.User>) => { const handleSubmitUser = async (value: Partial<UserBaseInfo.User>) => {
await executeAndCallbackRefresh(() => { await executeAndCallbackRefresh(async () => {
handleAddOrUpdate(API_CONSTANTS.USER, value); await handleAddOrUpdate(API_CONSTANTS.USER, value);
handleModalOpen(false); handleModalOpen(false);
}) })
}; };
...@@ -171,7 +177,8 @@ const UserProTable = () => { ...@@ -171,7 +177,8 @@ const UserProTable = () => {
dataIndex: "enabled", dataIndex: "enabled",
hideInSearch: true, hideInSearch: true,
render: (_, record) => { render: (_, record) => {
return <EnableSwitchBtn key={`${record.id}_enable`} record={record} onChange={() => handleChangeEnable(record)}/>; return <EnableSwitchBtn key={`${record.id}_enable`} record={record}
onChange={() => handleChangeEnable(record)}/>;
}, },
filters: STATUS_MAPPING(), filters: STATUS_MAPPING(),
filterMultiple: false, filterMultiple: false,
...@@ -198,7 +205,8 @@ const UserProTable = () => { ...@@ -198,7 +205,8 @@ const UserProTable = () => {
width: "10vh", width: "10vh",
render: (_: any, record: UserBaseInfo.User) => [ render: (_: any, record: UserBaseInfo.User) => [
<EditBtn key={`${record.id}_edit`} onClick={() => handleEditVisible(record)}/>, <EditBtn key={`${record.id}_edit`} onClick={() => handleEditVisible(record)}/>,
<AssignBtn key={`${record.id}_delete`} onClick={() => handleAssignRole(record)} title={l('user.assignRole')}/>, <AssignBtn key={`${record.id}_delete`} onClick={() => handleAssignRole(record)}
title={l('user.assignRole')}/>,
<Button <Button
className={"options-button"} className={"options-button"}
key={`${record.id}_change`} key={`${record.id}_change`}
...@@ -245,27 +253,23 @@ const UserProTable = () => { ...@@ -245,27 +253,23 @@ const UserProTable = () => {
modalVisible={modalOpen} modalVisible={modalOpen}
values={{}} values={{}}
/> />
{(formValues && Object.keys(formValues).length > 0) && ( <PasswordModal
<> key={"handlePasswordChangeSubmit"}
<PasswordModal onSubmit={handlePasswordChangeSubmit}
key={"handlePasswordChangeSubmit"} onCancel={() => handlePasswordModalOpen(false)}
onSubmit={handlePasswordChangeSubmit} modalVisible={passwordModalOpen}
onCancel={() => handlePasswordModalOpen(false)} values={formValues}
modalVisible={passwordModalOpen} />
values={formValues} <UserModalForm
/> key={"handleUpdateUser"}
<UserModalForm onSubmit={handleSubmitUser}
key={"handleUpdateUser"} onCancel={() => {
onSubmit={handleSubmitUser} handleUpdateModalOpen(false);
onCancel={() => { setFormValues({});
handleUpdateModalOpen(false); }}
setFormValues({}); modalVisible={updateModalOpen}
}} values={formValues}
modalVisible={updateModalOpen} />
values={formValues}
/>
</>
)}
{/* assign role to user */} {/* assign role to user */}
<RoleModalTransfer <RoleModalTransfer
user={formValues} user={formValues}
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
import React, {useEffect} from "react"; import React, {useEffect} from "react";
import {Form, Modal} from "antd"; import {Form, Modal} from "antd";
import {FormContextValue} from "@/components/Context/FormContext"; import {FormContextValue} from "@/components/Context/FormContext";
import {FORM_LAYOUT_PUBLIC, NORMAL_MODAL_OPTIONS} from "@/services/constants"; import {NORMAL_MODAL_OPTIONS} from "@/services/constants";
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {Document} from "@/types/RegCenter/data"; import {Document} from "@/types/RegCenter/data";
import DocumentForm from "@/pages/RegCenter/Document/components/DocumentModal/DocumentForm"; import DocumentForm from "@/pages/RegCenter/Document/components/DocumentModal/DocumentForm";
......
...@@ -18,12 +18,9 @@ ...@@ -18,12 +18,9 @@
*/ */
import {Button, Drawer, Popconfirm, Space, Switch} from 'antd';
import React, {useRef, useState} from 'react'; import React, {useRef, useState} from 'react';
import {PageContainer} from '@ant-design/pro-layout';
import type {ActionType, ProColumns} from '@ant-design/pro-table'; import type {ActionType, ProColumns} from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {Document} from "@/types/RegCenter/data"; import {Document} from "@/types/RegCenter/data";
import {queryList} from "@/services/api"; import {queryList} from "@/services/api";
...@@ -63,7 +60,14 @@ const DocumentTableList: React.FC = () => { ...@@ -63,7 +60,14 @@ const DocumentTableList: React.FC = () => {
handleModalVisible(false); handleModalVisible(false);
handleUpdateModalVisible(false); handleUpdateModalVisible(false);
setDrawerOpen(false); setDrawerOpen(false);
setFormValues({}); }
const executeAndCallbackRefresh = async (callback: () => void) => {
setLoading(true);
await callback();
setLoading(false);
handleCancel();
actionRef.current?.reload?.();
} }
/** /**
...@@ -71,8 +75,9 @@ const DocumentTableList: React.FC = () => { ...@@ -71,8 +75,9 @@ const DocumentTableList: React.FC = () => {
* @param id * @param id
*/ */
const handleDeleteSubmit = async (id: number) => { const handleDeleteSubmit = async (id: number) => {
await handleRemoveById(API_CONSTANTS.DOCUMENT_DELETE, id); await executeAndCallbackRefresh(async () => {
actionRef.current?.reload?.(); await handleRemoveById(API_CONSTANTS.DOCUMENT_DELETE, id);
})
} }
/** /**
...@@ -80,10 +85,9 @@ const DocumentTableList: React.FC = () => { ...@@ -80,10 +85,9 @@ const DocumentTableList: React.FC = () => {
* @param value * @param value
*/ */
const handleChangeEnable = async (value: Partial<Document>) => { const handleChangeEnable = async (value: Partial<Document>) => {
setLoading(true); await executeAndCallbackRefresh(async () => {
await updateEnabled(API_CONSTANTS.DOCUMENT_ENABLE, {id: value.id}); await updateEnabled(API_CONSTANTS.DOCUMENT_ENABLE, {id: value.id});
setLoading(false); })
actionRef.current?.reload?.();
}; };
...@@ -92,9 +96,9 @@ const DocumentTableList: React.FC = () => { ...@@ -92,9 +96,9 @@ const DocumentTableList: React.FC = () => {
* @param value * @param value
*/ */
const handleAddOrUpdateSubmit = async (value: Partial<Document>) => { const handleAddOrUpdateSubmit = async (value: Partial<Document>) => {
await handleAddOrUpdate(API_CONSTANTS.DOCUMENT, value); await executeAndCallbackRefresh(async () => {
handleCancel(); await handleAddOrUpdate(API_CONSTANTS.DOCUMENT, value);
actionRef.current?.reload?.(); })
} }
const handleClickEdit = (record: Partial<Document>) => { const handleClickEdit = (record: Partial<Document>) => {
...@@ -178,7 +182,8 @@ const DocumentTableList: React.FC = () => { ...@@ -178,7 +182,8 @@ const DocumentTableList: React.FC = () => {
filterMultiple: false, filterMultiple: false,
valueEnum: STATUS_ENUM(), valueEnum: STATUS_ENUM(),
render: (_, record) => { render: (_, record) => {
return <EnableSwitchBtn key={`${record.id}_enable`} disabled={drawerOpen} record={record} onChange={() => handleChangeEnable(record)}/> return <EnableSwitchBtn key={`${record.id}_enable`} disabled={drawerOpen} record={record}
onChange={() => handleChangeEnable(record)}/>
}, },
}, },
{ {
...@@ -229,14 +234,12 @@ const DocumentTableList: React.FC = () => { ...@@ -229,14 +234,12 @@ const DocumentTableList: React.FC = () => {
values={{}} values={{}}
/> />
{/*UPDATED*/} {/*UPDATED*/}
{formValues && Object.keys(formValues).length && <DocumentModalForm
<DocumentModalForm onSubmit={(value) => handleAddOrUpdateSubmit(value)}
onSubmit={(value) => handleAddOrUpdateSubmit(value)} onCancel={() => handleCancel()}
onCancel={() => handleCancel()} modalVisible={updateModalVisible}
modalVisible={updateModalVisible} values={formValues}
values={formValues} />
/>
}
{/*DRAWER*/} {/*DRAWER*/}
<DocumentDrawer onCancel={() => handleCancel()} modalVisible={drawerOpen} values={formValues} <DocumentDrawer onCancel={() => handleCancel()} modalVisible={drawerOpen} values={formValues}
columns={columns}/> columns={columns}/>
......
...@@ -86,7 +86,7 @@ export const CodeContent: React.FC<CodeContentProps> = (props) => { ...@@ -86,7 +86,7 @@ export const CodeContent: React.FC<CodeContentProps> = (props) => {
} else if (code === "" || code === null) { } else if (code === "" || code === null) {
return <Empty className={"code-content-empty"} description={l("rc.gp.codeTree.clickShow")}/> return <Empty className={"code-content-empty"} description={l("rc.gp.codeTree.clickShow")}/>
} else { } else {
return <CodeShow {...CodeEditProps} language={getLanguage()} code={code}/> return <CodeShow {...CodeEditProps} language={getLanguage()} showFloatButton code={code}/>
} }
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
import React from "react"; import React from "react";
import {PageLoading} from "@ant-design/pro-components"; import {PageLoading} from "@ant-design/pro-components";
import {buildTreeData} from "@/pages/RegCenter/GitProject/components/CodeTree/function"; import {buildTreeData} from "@/pages/RegCenter/GitProject/components/CodeTree/function";
import {Tree} from "antd"; import {Empty, Tree} from "antd";
import {GitProjectTreeNode} from "@/types/RegCenter/data"; import {GitProjectTreeNode} from "@/types/RegCenter/data";
/** /**
...@@ -45,11 +45,11 @@ export const SiderTree: React.FC<SiderTreeProps> = (props) => { ...@@ -45,11 +45,11 @@ export const SiderTree: React.FC<SiderTreeProps> = (props) => {
*/ */
return <> return <>
{loading ? <PageLoading/> : {loading ? <PageLoading/> :
<DirectoryTree (treeData.length > 0) ?
multiple <DirectoryTree
onSelect={(_, info) => onNodeClick(info)} onSelect={(_, info) => onNodeClick(info)}
treeData={buildTreeData(treeData)} treeData={buildTreeData(treeData)}
/> /> : <Empty className={"code-content-empty"}/>
} }
</>; </>;
}; };
...@@ -23,7 +23,7 @@ import {folderSeparator, renderIcon} from "@/utils/function"; ...@@ -23,7 +23,7 @@ import {folderSeparator, renderIcon} from "@/utils/function";
* @param data * @param data
* @returns {any} * @returns {any}
*/ */
export const buildTreeData = (data: any) => data?.map((item: any) => { export const buildTreeData = (data: any): any => data?.map((item: any) => {
// build key // build key
let buildKey = item.path + folderSeparator() + item.name; let buildKey = item.path + folderSeparator() + item.name;
...@@ -34,7 +34,7 @@ export const buildTreeData = (data: any) => data?.map((item: any) => { ...@@ -34,7 +34,7 @@ export const buildTreeData = (data: any) => data?.map((item: any) => {
isLeaf: !item.leaf, isLeaf: !item.leaf,
name: item.name, name: item.name,
parentId: item.path, parentId: item.path,
icon: renderIcon(item, ".", item.leaf), icon: renderIcon(item.name, ".", item.leaf),
content: item.content, content: item.content,
path: item.path, path: item.path,
title: item.name, title: item.name,
...@@ -46,7 +46,7 @@ export const buildTreeData = (data: any) => data?.map((item: any) => { ...@@ -46,7 +46,7 @@ export const buildTreeData = (data: any) => data?.map((item: any) => {
isLeaf: !item.leaf, isLeaf: !item.leaf,
name: item.name, name: item.name,
parentId: item.path, parentId: item.path,
icon: renderIcon(item, ".", item.leaf), icon: renderIcon(item.name, ".", item.leaf),
content: item.content, content: item.content,
path: item.path, path: item.path,
title: item.name, title: item.name,
......
...@@ -41,7 +41,7 @@ export const CodeTree: React.FC<CodeTreeProps> = (props) => { ...@@ -41,7 +41,7 @@ export const CodeTree: React.FC<CodeTreeProps> = (props) => {
cancelText={l("button.close")} cancelText={l("button.close")}
okButtonProps={{style: {display: "none"}}} okButtonProps={{style: {display: "none"}}}
> >
{modalVisible && <CodeTreeShow values={values}/>} <CodeTreeShow values={values}/>
</Modal> </Modal>
</>; </>;
}; };
...@@ -54,11 +54,6 @@ import {EditBtn} from "@/components/CallBackButton/EditBtn"; ...@@ -54,11 +54,6 @@ import {EditBtn} from "@/components/CallBackButton/EditBtn";
import {PopconfirmDeleteBtn} from "@/components/CallBackButton/PopconfirmDeleteBtn"; import {PopconfirmDeleteBtn} from "@/components/CallBackButton/PopconfirmDeleteBtn";
import {EnableSwitchBtn} from "@/components/CallBackButton/EnableSwitchBtn"; import {EnableSwitchBtn} from "@/components/CallBackButton/EnableSwitchBtn";
import {ShowLogBtn} from "@/components/CallBackButton/ShowLogBtn"; import {ShowLogBtn} from "@/components/CallBackButton/ShowLogBtn";
import {
BuildStepOfCodeType,
JavaSteps,
PythonSteps
} from "@/pages/RegCenter/GitProject/components/BuildSteps/constants";
const ProjectProTable: React.FC = () => { const ProjectProTable: React.FC = () => {
...@@ -90,7 +85,7 @@ const ProjectProTable: React.FC = () => { ...@@ -90,7 +85,7 @@ const ProjectProTable: React.FC = () => {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
const handleChangeEnable = async (value: Partial<GitProject>) => { const handleChangeEnable = async (value: Partial<GitProject>) => {
await executeAndCallback(() => updateEnabled(API_CONSTANTS.GIT_PROJECT_ENABLE, {id: value.id})); await executeAndCallback(async () => await updateEnabled(API_CONSTANTS.GIT_PROJECT_ENABLE, {id: value.id}));
}; };
...@@ -115,22 +110,19 @@ const ProjectProTable: React.FC = () => { ...@@ -115,22 +110,19 @@ const ProjectProTable: React.FC = () => {
}; };
/** /**
* build modal visible,when build success, set build modal visible to step modal visible * build modal visible,when build success, set build modal visible to step modal visible
* @param {Partial<GitProject>} value * @param {Partial<GitProject>} value
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
const handleBuild = async (value: Partial<GitProject>) => { const handleBuild = async (value: Partial<GitProject>) => {
setLoading(true); await executeAndCallback(async () => {
await setFormValues(value); const result = await handlePutDataByParams(API_CONSTANTS.GIT_PROJECT_BUILD, l("rc.gp.building"), {id: value.id});
const result = await handlePutDataByParams(API_CONSTANTS.GIT_PROJECT_BUILD, l("rc.gp.building"), {id: value.id}); if (result) {
if (result) { handleBuildVisible(true);
await handleBuildVisible(true); // todo : build success, set build modal visible and set build steps
// todo : build success, set build modal visible and set build steps }
} });
setLoading(false);
}; };
/** /**
...@@ -150,7 +142,7 @@ const ProjectProTable: React.FC = () => { ...@@ -150,7 +142,7 @@ const ProjectProTable: React.FC = () => {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
const handleDeleteSubmit = async (id: number) => { const handleDeleteSubmit = async (id: number) => {
await executeAndCallback(() => handleRemoveById(API_CONSTANTS.GIT_PROJECT_DELETE, id)); await executeAndCallback(async () => await handleRemoveById(API_CONSTANTS.GIT_PROJECT_DELETE, id));
}; };
/** /**
...@@ -174,6 +166,7 @@ const ProjectProTable: React.FC = () => { ...@@ -174,6 +166,7 @@ const ProjectProTable: React.FC = () => {
title: l("rc.gp.url"), title: l("rc.gp.url"),
dataIndex: "url", dataIndex: "url",
copyable: true, copyable: true,
ellipsis: true,
}, },
{ {
title: l("rc.gp.codeType"), title: l("rc.gp.codeType"),
...@@ -300,22 +293,19 @@ const ProjectProTable: React.FC = () => { ...@@ -300,22 +293,19 @@ const ProjectProTable: React.FC = () => {
columns={columns} columns={columns}
/> />
{/* added modal form */} {/* added modal form */}
{modalVisible && <ProjectModal onCancel={handleCancel} onSubmit={(value) => handleAddOrUpdateSubmit(value)}
<ProjectModal onCancel={handleCancel} onSubmit={(value) => handleAddOrUpdateSubmit(value)} modalVisible={modalVisible} values={{}}/>
modalVisible={modalVisible} values={{}}/>}
{/* modify modal form */} {/* modify modal form */}
{updateModalVisible && <ProjectModal onCancel={handleCancel} onSubmit={(value) => handleAddOrUpdateSubmit(value)}
<ProjectModal onCancel={handleCancel} onSubmit={(value) => handleAddOrUpdateSubmit(value)} modalVisible={updateModalVisible}
modalVisible={updateModalVisible} values={formValues}/>
values={formValues}/>}
{/* build steps modal */} {/* build steps modal */}
{formValues && <BuildSteps onCancel={handleCancel} modalVisible={buildModalVisible} {buildModalVisible && <BuildSteps onCancel={handleCancel} modalVisible={buildModalVisible}
values={formValues}/>} values={formValues}/>}
{/* show build log modal */} {/* show build log modal */}
{logModalVisible && <ShowLog modalVisible={logModalVisible} onCancel={handleCancel} values={formValues}/>} {logModalVisible && <ShowLog modalVisible={logModalVisible} onCancel={handleCancel} values={formValues}/>}
{/* show code tree modal */} {/* show code tree modal */}
{codeTreeModalVisible && <CodeTree modalVisible={codeTreeModalVisible} onCancel={handleCancel} values={formValues}/>
<CodeTree modalVisible={codeTreeModalVisible} onCancel={handleCancel} values={formValues}/>}
</>; </>;
}; };
export default ProjectProTable; export default ProjectProTable;
...@@ -22,8 +22,7 @@ import {Modal} from "antd"; ...@@ -22,8 +22,7 @@ import {Modal} from "antd";
import {l} from "@/utils/intl"; import {l} from "@/utils/intl";
import {GitProject} from "@/types/RegCenter/data"; import {GitProject} from "@/types/RegCenter/data";
import React, {useEffect} from "react"; import React, {useEffect} from "react";
import {getData} from "@/services/api"; import {handleData} from "@/services/BusinessCrud";
import {getDataByParams, handleData} from "@/services/BusinessCrud";
import {API_CONSTANTS} from "@/services/constants"; import {API_CONSTANTS} from "@/services/constants";
type ShowLogProps = { type ShowLogProps = {
...@@ -86,7 +85,6 @@ export const ShowLog: React.FC<ShowLogProps> = (props) => { ...@@ -86,7 +85,6 @@ export const ShowLog: React.FC<ShowLogProps> = (props) => {
code={log} code={log}
showFloatButton={true} showFloatButton={true}
refreshLogCallback={queryAllStepLogs} refreshLogCallback={queryAllStepLogs}
enableTimer={true}
/> />
</Modal> </Modal>
); );
......
...@@ -49,16 +49,32 @@ const GlobalVarProTable = () => { ...@@ -49,16 +49,32 @@ const GlobalVarProTable = () => {
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const [drawerOpen, setDrawerOpen] = useState<boolean>(false); const [drawerOpen, setDrawerOpen] = useState<boolean>(false);
/**
* handle cancel all
*/
const handleCancel = () => {
handleModalVisible(false);
handleUpdateModalVisible(false);
setDrawerOpen(false);
setFormValues({});
}
const executeAndCallbackRefresh = async (callback: () => void) => {
setLoading(true);
await callback();
setLoading(false);
handleCancel();
actionRef.current?.reload?.();
}
/** /**
* var enable or disable * var enable or disable
* @param value * @param value
*/ */
const handleChangeEnable = async (value: Partial<GlobalVar>) => { const handleChangeEnable = async (value: Partial<GlobalVar>) => {
setLoading(true); await executeAndCallbackRefresh(async () => {
await updateEnabled(API_CONSTANTS.GLOBAL_VARIABLE_ENABLE, {id: value.id}); await updateEnabled(API_CONSTANTS.GLOBAL_VARIABLE_ENABLE, {id: value.id});
setLoading(false); })
actionRef.current?.reload?.();
}; };
/** /**
...@@ -66,20 +82,12 @@ const GlobalVarProTable = () => { ...@@ -66,20 +82,12 @@ const GlobalVarProTable = () => {
* @param id role id * @param id role id
*/ */
const handleDeleteSubmit = async (id: number) => { const handleDeleteSubmit = async (id: number) => {
await handleRemoveById(API_CONSTANTS.GLOBAL_VARIABLE_DELETE, id); await executeAndCallbackRefresh(async () => {
actionRef.current?.reload?.(); await handleRemoveById(API_CONSTANTS.GLOBAL_VARIABLE_DELETE, id);
})
} }
/**
* handle cancel all
*/
const handleCancel = () => {
handleModalVisible(false);
handleUpdateModalVisible(false);
setDrawerOpen(false);
setFormValues({});
}
/** /**
* handle edit * handle edit
...@@ -106,11 +114,9 @@ const GlobalVarProTable = () => { ...@@ -106,11 +114,9 @@ const GlobalVarProTable = () => {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
const handleAddOrUpdateSubmit = async (value: Partial<GlobalVar>) => { const handleAddOrUpdateSubmit = async (value: Partial<GlobalVar>) => {
await handleAddOrUpdate(API_CONSTANTS.GLOBAL_VARIABLE, value); await executeAndCallbackRefresh(async () => {
handleCancel(); await handleAddOrUpdate(API_CONSTANTS.GLOBAL_VARIABLE, value);
if (actionRef.current) { })
actionRef.current.reload();
}
} }
...@@ -208,14 +214,12 @@ const GlobalVarProTable = () => { ...@@ -208,14 +214,12 @@ const GlobalVarProTable = () => {
values={{}} values={{}}
/> />
{/*update*/} {/*update*/}
{formValues && Object.keys(formValues).length && <GlobalVarModal
<GlobalVarModal onSubmit={(value) => handleAddOrUpdateSubmit(value)}
onSubmit={(value) => handleAddOrUpdateSubmit(value)} onCancel={() => handleCancel()}
onCancel={() => handleCancel()} modalVisible={updateModalVisible}
modalVisible={updateModalVisible} values={formValues}
values={formValues} />
/>
}
{/*drawer render*/} {/*drawer render*/}
<GlobalVarDrawer <GlobalVarDrawer
......
...@@ -262,6 +262,7 @@ export const SWITCH_OPTIONS =() => { ...@@ -262,6 +262,7 @@ export const SWITCH_OPTIONS =() => {
export const DIALECT = { export const DIALECT = {
JAVA: "java", JAVA: "java",
LOG: "log",
XML: "xml", XML: "xml",
MD: "md", MD: "md",
MDX: "mdx", MDX: "mdx",
......
...@@ -21,7 +21,17 @@ import {THEME, CODE_EDIT_THEME} from "@/types/Public/data"; ...@@ -21,7 +21,17 @@ import {THEME, CODE_EDIT_THEME} from "@/types/Public/data";
import {editor} from "monaco-editor"; import {editor} from "monaco-editor";
import React, {useEffect, useState} from "react"; import React, {useEffect, useState} from "react";
import {trim} from "lodash"; import {trim} from "lodash";
import {FileIcon, FolderSvgExpand, JavaSvg, MarkDownSvg, ShellSvg, XMLSvg, YAMLSvg} from "@/components/Icons/CodeLanguageIcon"; import {
FileIcon,
FolderSvgExpand,
JavaSvg,
LogSvg,
MarkDownSvg,
ScalaSvg,
ShellSvg,
XMLSvg,
YAMLSvg
} from "@/components/Icons/CodeLanguageIcon";
import path from "path"; import path from "path";
/** /**
...@@ -158,6 +168,7 @@ export const useSSEBuildArrayData = (url: string) => { ...@@ -158,6 +168,7 @@ export const useSSEBuildArrayData = (url: string) => {
export const getLanguage = (type: string): string => { export const getLanguage = (type: string): string => {
switch (type) { switch (type) {
case DIALECT.JAVA: case DIALECT.JAVA:
case DIALECT.LOG:
return DIALECT.JAVA; return DIALECT.JAVA;
case DIALECT.MD: case DIALECT.MD:
case DIALECT.MDX: case DIALECT.MDX:
...@@ -192,6 +203,8 @@ export const getIcon = (type: string) => { ...@@ -192,6 +203,8 @@ export const getIcon = (type: string) => {
switch (type) { switch (type) {
case DIALECT.JAVA: case DIALECT.JAVA:
return <JavaSvg/>; return <JavaSvg/>;
case DIALECT.SCALA:
return <ScalaSvg/>;
case DIALECT.MD: case DIALECT.MD:
case DIALECT.MDX: case DIALECT.MDX:
return <MarkDownSvg/>; return <MarkDownSvg/>;
...@@ -204,6 +217,8 @@ export const getIcon = (type: string) => { ...@@ -204,6 +217,8 @@ export const getIcon = (type: string) => {
case DIALECT.BASH: case DIALECT.BASH:
case DIALECT.CMD: case DIALECT.CMD:
return <ShellSvg/>; return <ShellSvg/>;
case DIALECT.LOG:
return <LogSvg/>;
default: default:
return <FileIcon/>; return <FileIcon/>;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment