import React, { FC } from 'react';
import styles from './index.less';
import { RedoOutlined } from '@ant-design/icons';
import { useParams } from 'umi';
import { message } from 'antd';
import ButtonComp from '@/components/ButtonComp';

interface PageProps { }

const RestartService: FC<PageProps> = ({ }) => {
  const urlParams = useParams();
  let sysData = localStorage.getItem(`${urlParams?.fileType}`);
  let info = sysData ? JSON.parse(sysData) : null;

  return <div className={styles.index_con}>
    {/* <div style={{
      width: 100, 
      height: 100, 
      background: 'rgba(0,0,0,.2)', 
      display: 'flex', 
      alignContent: 'center', 
      justifyContent: 'center',
      flexWrap: 'wrap',
      cursor: 'pointer'
    }}
    onClick={() => {
      message.success('重启服务成功！')
      localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({ ...info, restartService: true }))
    }}
    >
      <RedoOutlined  style={{fontSize: 30}}/>
      <div style={{width: '100%', textAlign: 'center', marginTop: 10}}>重启服务</div>
    </div> */}
    <div className={styles.contentWrap}>
      <div className={styles.title}>服务控制台 一体化对称密码管理系统核心区</div>
      <div className={styles.content}>
        <div className={styles.cleft}></div>
        <div className={styles.cright}>
          <ButtonComp text={'启动服务'} style={{marginRight:'10px'}} />
          <ButtonComp text={'停止服务'} style={{marginTop:'20px',marginRight:'10px'}}/>
          <ButtonComp text={'重启服务'} style={{marginTop:'20px',marginRight:'10px'}} onClick={() => {
            message.success('重启服务成功！')
            localStorage.setItem(`${urlParams?.fileType}`, JSON.stringify({ ...info, restartService: true }))
          }} />
          <ButtonComp text={'连接服务器'} style={{marginTop:'20px',marginRight:'10px'}} />
          <ButtonComp text={'选项设置'} style={{marginTop:'20px',marginRight:'10px'}} />
          <ButtonComp text={'打开日志文件'} style={{marginTop:'20px',marginRight:'10px'}} />
          <ButtonComp text={'关闭'} style={{marginTop:'20px',marginRight:'10px'}} />
        </div>
      </div>
    </div>
  </div>
}

export default RestartService;
