@ant-design/icons APIs
- DeleteOutlined
- PlusOutlined
- SettingOutlined
- UserOutlined
- ExclamationCircleOutlined
- CloseOutlined
- DownOutlined
- SearchOutlined
- EditOutlined
- QuestionCircleOutlined
- LoadingOutlined
- CopyOutlined
- DownloadOutlined
- LogoutOutlined
- LeftOutlined
- PlusCircleOutlined
- MinusCircleOutlined
- CloseCircleOutlined
- CheckOutlined
- UploadOutlined
- ReloadOutlined
- InfoCircleOutlined
- SaveOutlined
- GithubOutlined
- LockOutlined
- RightOutlined
- CodeOutlined
- EyeOutlined
- EllipsisOutlined
- CaretRightOutlined
- CheckCircleOutlined
- SyncOutlined
- LinkOutlined
- HomeOutlined
- MenuUnfoldOutlined
- FullscreenExitOutlined
- FullscreenOutlined
- MenuOutlined
- BellOutlined
- MenuFoldOutlined
- AppstoreOutlined
- FormOutlined
- CaretDownOutlined
- UndoOutlined
- TeamOutlined
- ArrowDownOutlined
- ArrowLeftOutlined
- ClearOutlined
- RedoOutlined
- GlobalOutlined
- ExportOutlined
- ClockCircleOutlined
- PlayCircleOutlined
- MoreOutlined
- UpOutlined
- UnorderedListOutlined
- MessageOutlined
- ArrowUpOutlined
- FilterOutlined
- StarOutlined
- StopOutlined
- EyeInvisibleOutlined
- BgColorsOutlined
- WarningOutlined
- createFromIconfontCN
- MailOutlined
- ArrowRightOutlined
- AreaChartOutlined
- SendOutlined
- DatabaseOutlined
- CalendarOutlined
- VerticalAlignBottomOutlined
- PictureOutlined
- ProfileOutlined
- FileTextOutlined
- DeploymentUnitOutlined
- QuestionOutlined
- UserAddOutlined
- ApiOutlined
- AppstoreAddOutlined
- RollbackOutlined
- BoldOutlined
- ItalicOutlined
- UnderlineOutlined
- VerticalAlignTopOutlined
- SnippetsOutlined
- HighlightOutlined
- WeiboCircleOutlined
- ApartmentOutlined
- BugOutlined
- DashboardOutlined
- HistoryOutlined
- CloseCircleFilled
- SmileOutlined
- BarsOutlined
- InfoOutlined
- PhoneOutlined
- BarChartOutlined
- LineChartOutlined
- PieChartOutlined
- CommentOutlined
- UsergroupAddOutlined
- ExclamationCircleFilled
- ControlOutlined
- GoogleOutlined
- InboxOutlined
- ShareAltOutlined
- ReadOutlined
- CheckCircleFilled
- BlockOutlined
- NotificationOutlined
- DesktopOutlined
- FileOutlined
- MinusOutlined
- FieldTimeOutlined
- PlusSquareOutlined
- DiffOutlined
- AlignCenterOutlined
- ZoomInOutlined
- ZoomOutOutlined
- AlipayCircleOutlined
- FileAddOutlined
- FolderAddOutlined
- FolderOpenOutlined
- NumberOutlined
- PauseOutlined
- ContactsOutlined
- CloudSyncOutlined
- TableOutlined
- ContainerOutlined
- TagOutlined
- VideoCameraOutlined
- BookOutlined
- ToolOutlined
- SlackOutlined
- MobileOutlined
- SwapOutlined
- LockFilled
- CloudDownloadOutlined
- StarFilled
- FontSizeOutlined
- BranchesOutlined
- UpCircleOutlined
- DownCircleOutlined
- DoubleRightOutlined
- MinusSquareOutlined
- AlignLeftOutlined
- AlignRightOutlined
- SmallDashOutlined
- TaobaoCircleOutlined
- BuildOutlined
- CloudUploadOutlined
- FolderOutlined
- GroupOutlined
- Loading3QuartersOutlined
- QrcodeOutlined
- FolderFilled
- InfoCircleFilled
- PlusCircleFilled
- SmileTwoTone
- HeartTwoTone
- CheckCircleTwoTone
- EditFilled
- UserDeleteOutlined
- MacCommandOutlined
- PushpinOutlined
- CoffeeOutlined
- ProjectOutlined
- OrderedListOutlined
- FundOutlined
- RiseOutlined
- AimOutlined
- CalculatorOutlined
- GatewayOutlined
- KeyOutlined
- GitlabOutlined
- BulbOutlined
- CloseSquareOutlined
- PlaySquareOutlined
- RocketOutlined
- ClusterOutlined
- ArrowsAltOutlined
- DragOutlined
- CaretUpOutlined
- DoubleLeftOutlined
- EnterOutlined
- RetweetOutlined
- ScissorOutlined
- StrikethroughOutlined
- ColumnWidthOutlined
- DingdingOutlined
- TwitterOutlined
- QqOutlined
- ZhihuOutlined
- BorderOutlined
- CameraOutlined
- EnvironmentOutlined
- FieldNumberOutlined
- FileExcelOutlined
- FileImageOutlined
- FilePptOutlined
- FileSearchOutlined
- FormatPainterOutlined
- FunctionOutlined
- HourglassOutlined
- LayoutOutlined
- OneToOneOutlined
- PartitionOutlined
- PoweroffOutlined
- PrinterOutlined
- SafetyCertificateOutlined
- SolutionOutlined
- TagsOutlined
- UngroupOutlined
- CopyFilled
- DeleteTwoTone
- QuestionCircleFilled
- StepBackwardOutlined
- StepForwardOutlined
- CopyrightOutlined
- CrownOutlined
- ExclamationOutlined
- PaperClipOutlined
- DashOutlined
- CloseCircleTwoTone
- ExclamationCircleTwoTone
- FlagOutlined
- FunnelPlotOutlined
- InteractionOutlined
- CheckSquareOutlined
- LaptopOutlined
- CustomerServiceOutlined
- WarningFilled
- ApiTwoTone
- ApiFilled
- MergeCellsOutlined
- SlackSquareOutlined
- FallOutlined
- PercentageOutlined
- DollarOutlined
- CloudServerOutlined
- UnlockOutlined
- PicCenterOutlined
- FontColorsOutlined
- GithubFilled
- CaretLeftOutlined
- LeftCircleOutlined
- RightCircleOutlined
- VerticalAlignMiddleOutlined
- BackwardOutlined
- SwapRightOutlined
- LoginOutlined
- BorderBottomOutlined
- BorderLeftOutlined
- BorderRightOutlined
- BorderTopOutlined
- RadiusBottomleftOutlined
- RadiusBottomrightOutlined
- RadiusUpleftOutlined
- RadiusUprightOutlined
- PauseCircleOutlined
- IssuesCloseOutlined
- SortAscendingOutlined
- SortDescendingOutlined
- RadiusSettingOutlined
- ColumnHeightOutlined
- RadarChartOutlined
- BoxPlotOutlined
- WindowsOutlined
- WeiboOutlined
- WechatOutlined
- FacebookOutlined
- CodepenCircleOutlined
- AntDesignOutlined
- AliyunOutlined
- InstagramOutlined
- YuqueOutlined
- RedditOutlined
- AlertOutlined
- AudioOutlined
- AuditOutlined
- BankOutlined
- CompressOutlined
- ConsoleSqlOutlined
- CopyrightCircleOutlined
- CreditCardOutlined
- DeleteRowOutlined
- DisconnectOutlined
- ExceptionOutlined
- ExpandOutlined
- ExperimentOutlined
- FieldStringOutlined
- FileDoneOutlined
- FileProtectOutlined
- FileUnknownOutlined
- FireOutlined
- FolderViewOutlined
- FrownOutlined
- FundProjectionScreenOutlined
- FundViewOutlined
- GoldOutlined
- HddOutlined
- HeartOutlined
- InsertRowBelowOutlined
- InsertRowLeftOutlined
- LikeOutlined
- LineOutlined
- MonitorOutlined
- NodeIndexOutlined
- RotateRightOutlined
- SafetyOutlined
- SelectOutlined
- SisternodeOutlined
- SkinOutlined
- SubnodeOutlined
- SwitcherOutlined
- ThunderboltOutlined
- UserSwitchOutlined
- WalletOutlined
- FolderOpenFilled
- ProfileFilled
- HomeFilled
- DatabaseFilled
- PictureFilled
- LockTwoTone
- MailTwoTone
- MobileTwoTone
- ThunderboltFilled
- RobotFilled
- RestFilled
- DeleteFilled
- BankFilled
- SoundFilled
- CaretRightFilled
- QuestionCircleTwoTone
- SettingFilled
- EyeTwoTone
- ToolFilled
- CheckSquareFilled
- CloseSquareFilled
- RocketFilled
- PushpinFilled
- CrownFilled
- AppstoreFilled
- PlusCircleTwoTone
- AppleOutlined
- AndroidOutlined
- DropboxOutlined
- BehanceOutlined
- FastBackwardOutlined
- FastForwardOutlined
- ShrinkOutlined
- VerticalLeftOutlined
- VerticalRightOutlined
- ForwardOutlined
- SwapLeftOutlined
- UpSquareOutlined
- DownSquareOutlined
- LeftSquareOutlined
- RightSquareOutlined
- BorderHorizontalOutlined
- BorderInnerOutlined
- BorderOuterOutlined
- BorderVerticleOutlined
- PicLeftOutlined
- PicRightOutlined
- LineHeightOutlined
- DotChartOutlined
- HeatMapOutlined
- StockOutlined
- SlidersOutlined
- IeOutlined
- ChromeOutlined
- AliwangwangOutlined
- WeiboSquareOutlined
- Html5Outlined
- YoutubeOutlined
- TaobaoOutlined
- SkypeOutlined
- MediumWorkmarkOutlined
- MediumOutlined
- LinkedinOutlined
- GooglePlusOutlined
- CodepenOutlined
- CodeSandboxOutlined
- AmazonOutlined
- AlipayOutlined
- AntCloudOutlined
- BehanceSquareOutlined
- DribbbleOutlined
- DribbbleSquareOutlined
- AlibabaOutlined
- YahooOutlined
- SketchOutlined
- AccountBookOutlined
- AudioMutedOutlined
- BarcodeOutlined
- BorderlessTableOutlined
- CarOutlined
- CarryOutOutlined
- CiCircleOutlined
- CiOutlined
- CloudOutlined
- CompassOutlined
- DeleteColumnOutlined
- DeliveredProcedureOutlined
- DingtalkOutlined
- DislikeOutlined
- DollarCircleOutlined
- EuroCircleOutlined
- EuroOutlined
- ExpandAltOutlined
- FieldBinaryOutlined
- FileExclamationOutlined
- FileGifOutlined
- FileJpgOutlined
- FileMarkdownOutlined
- FilePdfOutlined
- FileSyncOutlined
- FileWordOutlined
- FileZipOutlined
- ForkOutlined
- GifOutlined
- GiftOutlined
- IdcardOutlined
- ImportOutlined
- InsertRowAboveOutlined
- InsertRowRightOutlined
- InsuranceOutlined
- ManOutlined
- MedicineBoxOutlined
- MehOutlined
- MoneyCollectOutlined
- NodeCollapseOutlined
- NodeExpandOutlined
- PayCircleOutlined
- PoundCircleOutlined
- PoundOutlined
- PropertySafetyOutlined
- PullRequestOutlined
- ReconciliationOutlined
- RedEnvelopeOutlined
- RestOutlined
- RobotOutlined
- RotateLeftOutlined
- ScanOutlined
- ScheduleOutlined
- SecurityScanOutlined
- ShakeOutlined
- ShopOutlined
- ShoppingCartOutlined
- ShoppingOutlined
- SoundOutlined
- SplitCellsOutlined
- TabletOutlined
- ToTopOutlined
- TrademarkCircleOutlined
- TrademarkOutlined
- TransactionOutlined
- TranslationOutlined
- TrophyOutlined
- UsbOutlined
- UsergroupDeleteOutlined
- VerifiedOutlined
- VideoCameraAddOutlined
- WhatsAppOutlined
- WifiOutlined
- WomanOutlined
- AlertFilled
- GoldenFilled
- MessageFilled
- BuildFilled
- PieChartFilled
- PlayCircleFilled
- StarTwoTone
- FacebookFilled
- CloudFilled
- NotificationFilled
- EyeFilled
- EyeInvisibleFilled
- SnippetsFilled
- HolderOutlined
- FilterFilled
- CreditCardFilled
- WechatFilled
- FilePdfFilled
- CaretDownFilled
- PlusSquareFilled
- TagsFilled
- BookFilled
- ContactsFilled
- TrophyTwoTone
- FundFilled
- WarningTwoTone
- SafetyCertificateFilled
- SaveFilled
- CodeFilled
- FolderAddFilled
- LinkedinFilled
- BellFilled
- FolderTwoTone
- CodeTwoTone
- DownCircleTwoTone
- UpCircleTwoTone
- ChromeFilled
- ThunderboltTwoTone
- PlaySquareTwoTone
- CompassTwoTone
Other Related APIs
- react#useState
- react#useEffect
- antd#Breadcrumb
- antd#Button
- antd#Modal
- antd#message
- antd#Tooltip
- antd#Switch
- antd#Drawer
- antd#Divider
- antd#Upload
- @ant-design/icons#HomeOutlined
- @ant-design/icons#DeleteOutlined
- @ant-design/icons#DownloadOutlined
- @ant-design/icons#UploadOutlined
- @ant-design/icons#LinkOutlined
- @ant-design/icons#InboxOutlined
- @ant-design/icons#FileOutlined
- @ant-design/icons#ApartmentOutlined
@ant-design/icons#FolderTwoTone TypeScript Examples
The following examples show how to use
@ant-design/icons#FolderTwoTone.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FileManager.tsx From anew-server with MIT License | 4 votes |
FileManager: React.FC<FileManagerProps> = (props) => {
const { modalVisible, handleChange, connectId } = props;
const [columnData, setColumnData] = useState<API.SSHFileList[]>([]);
const [showHidden, setShowHidden] = useState<boolean>(false);
const [childrenDrawer, setChildrenDrawer] = useState<boolean>(false);
const [currentPathArr, setCurrentPathArr] = useState<string[]>([]);
const [initPath, setInitPath] = useState<string>('');
const _dirSort = (item: API.SSHFileList) => {
return item.isDir;
};
const getFileData = (key: string, path: string) => {
querySSHFile(key, path).then((res) => {
const obj = lds.orderBy(res.data, [_dirSort, 'name'], ['desc', 'asc']);
showHidden ? setColumnData(obj) : setColumnData(obj.filter((x) => !x.name.startsWith('.')));
try {
// 获取服务器的当前路径
let pathb = obj[0].path;
const index = pathb.lastIndexOf('/');
pathb = pathb.substring(0, index + 1);
setCurrentPathArr(pathb.split('/').filter((x: any) => x !== ''));
setInitPath(pathb); // 保存当前路径,刷新用
} catch (exception) {
setCurrentPathArr(path.split('/').filter((x) => x !== ''));
setInitPath(path);
}
});
};
const getChdirDirData = (key: string, path: string) => {
const index = currentPathArr.indexOf(path);
const currentDir = '/' + currentPathArr.splice(0, index + 1).join('/');
getFileData(key, currentDir);
};
const handleDelete = (key: string, path: string) => {
if (!path) return;
const index = path.lastIndexOf('/');
const currentDir = path.substring(0, index + 1);
const currentFile = path.substring(index + 1, path.length);
const content = `您是否要删除 ${currentFile}?`;
Modal.confirm({
title: '注意',
content,
onOk: () => {
deleteSSHFile(key, path).then((res) => {
if (res.code === 200 && res.status === true) {
message.success(res.message);
getFileData(key, currentDir);
}
});
},
onCancel() { },
});
};
const handleDownload = (key: string, path: string) => {
if (!path) return;
const index = path.lastIndexOf('/');
const currentFile = path.substring(index + 1, path.length);
const content = `您是否要下载 ${currentFile}?`;
Modal.confirm({
title: '注意',
content,
onOk: () => {
const token = localStorage.getItem('token');
const link = document.createElement('a');
link.href = `/api/v1/host/ssh/download?key=${key}&path=${path}&token=${token}`;
document.body.appendChild(link);
const evt = document.createEvent('MouseEvents');
evt.initEvent('click', false, false);
link.dispatchEvent(evt);
document.body.removeChild(link);
},
onCancel() { },
});
};
const uploadProps = {
name: 'file',
action: `/api/v1/host/ssh/upload?key=${connectId}&path=${initPath}`,
multiple: true,
headers: {
Authorization: `Bearer ${localStorage.getItem('token')}`,
},
// showUploadList: {
// removeIcon: false,
// showRemoveIcon: false,
// },
onChange(info: any) {
// if (info.file.status !== 'uploading') {
// console.log(info.file, info.fileList);
// }
//console.log(info);
if (info.file.status === 'done') {
message.success(`${info.file.name} file uploaded successfully`);
getFileData(connectId, initPath as string); // 刷新数据
} else if (info.file.status === 'error') {
message.error(`${info.file.name} file upload failed.`);
}
},
progress: {
strokeColor: {
'0%': '#108ee9',
'100%': '#87d068',
},
strokeWidth: 3,
format: (percent: any) => `${parseFloat(percent.toFixed(2))}%`,
},
};
const columns: ProColumns<API.SSHFileList>[] = [
{
title: '名称',
dataIndex: 'name',
render: (_, record) =>
record.isDir ? (
<div onClick={() => getFileData(connectId, record.path)} style={{ cursor: 'pointer' }}>
<FolderTwoTone />
<span style={{ color: '#1890ff', paddingLeft: 5 }}>{record.name}</span>
</div>
) : (
<React.Fragment>
{record.isLink ? (
<div>
<LinkOutlined />
<Tooltip title="Is Link">
<span style={{ color: '#3cb371', paddingLeft: 5 }}>{record.name}</span>
</Tooltip>
</div>
) : (
<div>
<FileOutlined />
<span style={{ paddingLeft: 5 }}>{record.name}</span>
</div>
)}
</React.Fragment>
),
},
{
title: '大小',
dataIndex: 'size',
},
{
title: '修改时间',
dataIndex: 'mtime',
},
{
title: '属性',
dataIndex: 'mode',
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_, record) =>
!record.isDir && !record.isLink ? (
<>
<Tooltip title="下载文件">
<DownloadOutlined
style={{ fontSize: '17px', color: 'blue' }}
onClick={() => handleDownload(connectId, record.path)}
/>
</Tooltip>
<Divider type="vertical" />
<Tooltip title="删除文件">
<DeleteOutlined
style={{ fontSize: '17px', color: 'red' }}
onClick={() => handleDelete(connectId, record.path)}
/>
</Tooltip>
</>
) : null,
},
];
useEffect(() => {
// 是否显示隐藏文件
getFileData(connectId, initPath as string); // 刷新数据
}, [showHidden]);
const { Dragger } = Upload;
return (
<Drawer
title="文件管理器"
placement="right"
width={800}
visible={modalVisible}
onClose={()=>handleChange(false)}
getContainer={false}
>
{/* <input style={{ display: 'none' }} type="file" ref={(ref) => (this.input = ref)} /> */}
<div className={styles.drawerHeader}>
<Breadcrumb>
<Breadcrumb.Item href="#" onClick={() => getFileData(connectId, '/')}>
<ApartmentOutlined />
</Breadcrumb.Item>
<Breadcrumb.Item href="#" onClick={() => getFileData(connectId, '')}>
<HomeOutlined />
</Breadcrumb.Item>
{currentPathArr.map((item) => (
<Breadcrumb.Item key={item} href="#" onClick={() => getChdirDirData(connectId, item)}>
<span>{item}</span>
</Breadcrumb.Item>
))}
</Breadcrumb>
<div style={{ display: 'flex', alignItems: 'center' }}>
<span>显示隐藏文件:</span>
<Switch
checked={showHidden}
checkedChildren="开启"
unCheckedChildren="关闭"
onChange={(v) => {
setShowHidden(v);
}}
/>
<Button
style={{ marginLeft: 10 }}
size="small"
type="primary"
icon={<UploadOutlined />}
onClick={() => setChildrenDrawer(true)}
>
上传文件
</Button>
</div>
</div>
<Drawer
title="上传文件"
width={320}
closable={false}
onClose={() => setChildrenDrawer(false)}
visible={childrenDrawer}
>
<div style={{ height: 150 }}>
<Dragger {...uploadProps}>
<p className="ant-upload-drag-icon">
<InboxOutlined />
</p>
<p className="ant-upload-text">单击或拖入上传</p>
<p className="ant-upload-hint">支持多文件</p>
</Dragger>
</div>
</Drawer>
<ProTable
pagination={false}
search={false}
toolBarRender={false}
rowKey="name"
dataSource={columnData}
columns={columns}
/>
</Drawer>
);
}