.eslintcache 19.4 KB
[{"C:\\ProgramasGO\\web-console\\web\\src\\index.tsx":"1","C:\\ProgramasGO\\web-console\\web\\src\\serviceWorkerRegistration.ts":"2","C:\\ProgramasGO\\web-console\\web\\src\\reportWebVitals.ts":"3","C:\\ProgramasGO\\web-console\\web\\src\\config\\config.ts":"4","C:\\ProgramasGO\\web-console\\web\\src\\locales\\i18n.ts":"5","C:\\ProgramasGO\\web-console\\web\\src\\App.tsx":"6","C:\\ProgramasGO\\web-console\\web\\src\\locales\\locales.ts":"7","C:\\ProgramasGO\\web-console\\web\\src\\components\\Console.tsx":"8","C:\\ProgramasGO\\web-console\\web\\src\\components\\Home.tsx":"9","C:\\ProgramasGO\\web-console\\web\\src\\config\\api_routers.ts":"10","C:\\ProgramasGO\\web-console\\web\\src\\components\\term\\term_theme.ts":"11","C:\\ProgramasGO\\web-console\\web\\src\\libs\\terminal-resize.ts":"12","C:\\ProgramasGO\\web-console\\web\\src\\libs\\utils.ts":"13","C:\\ProgramasGO\\web-console\\web\\src\\libs\\sshwebsocket.ts":"14","C:\\ProgramasGO\\web-console\\web\\src\\libs\\string_format.ts":"15","C:\\ProgramasGO\\web-console\\web\\src\\components\\FileTrans.tsx":"16","C:\\ProgramasGO\\web-console\\web\\src\\components\\term\\XTerm.tsx":"17","C:\\ProgramasGO\\web-console\\web\\src\\components\\layout\\Header.tsx":"18","C:\\ProgramasGO\\web-console\\web\\src\\components\\files\\files_types.ts":"19","C:\\ProgramasGO\\web-console\\web\\src\\components\\SftpUpload.tsx":"20","C:\\ProgramasGO\\web-console\\web\\src\\components\\PathNav.tsx":"21","C:\\ProgramasGO\\web-console\\web\\src\\components\\files\\GridFileItem.tsx":"22","C:\\ProgramasGO\\web-console\\web\\src\\components\\files\\DownloadingFile.tsx":"23","C:\\ProgramasGO\\web-console\\web\\src\\components\\Signin.tsx":"24"},{"size":1034,"mtime":1650139214522,"results":"25","hashOfConfig":"26"},{"size":5435,"mtime":1630760757965,"results":"27","hashOfConfig":"26"},{"size":440,"mtime":1630760788779,"results":"28","hashOfConfig":"26"},{"size":1657,"mtime":1630324302839,"results":"29","hashOfConfig":"26"},{"size":1628,"mtime":1630324329302,"results":"30","hashOfConfig":"26"},{"size":405,"mtime":1631155881829,"results":"31","hashOfConfig":"26"},{"size":6835,"mtime":1630324344127,"results":"32","hashOfConfig":"26"},{"size":8120,"mtime":1632867133431,"results":"33","hashOfConfig":"26"},{"size":1593,"mtime":1633120989408,"results":"34","hashOfConfig":"26"},{"size":670,"mtime":1630324289991,"results":"35","hashOfConfig":"26"},{"size":1154,"mtime":1630324391856,"results":"36","hashOfConfig":"26"},{"size":675,"mtime":1630324268633,"results":"37","hashOfConfig":"26"},{"size":1412,"mtime":1630324319263,"results":"38","hashOfConfig":"26"},{"size":1919,"mtime":1630324271105,"results":"39","hashOfConfig":"26"},{"size":357,"mtime":1630324270079,"results":"40","hashOfConfig":"26"},{"size":14281,"mtime":1630290983845,"results":"41","hashOfConfig":"26"},{"size":7409,"mtime":1630324390675,"results":"42","hashOfConfig":"26"},{"size":684,"mtime":1630290955236,"results":"43","hashOfConfig":"26"},{"size":586,"mtime":1630324355567,"results":"44","hashOfConfig":"26"},{"size":4049,"mtime":1630291005021,"results":"45","hashOfConfig":"26"},{"size":2017,"mtime":1630290993235,"results":"46","hashOfConfig":"26"},{"size":5416,"mtime":1630290947773,"results":"47","hashOfConfig":"26"},{"size":1508,"mtime":1630291088613,"results":"48","hashOfConfig":"26"},{"size":4459,"mtime":1653648858832,"results":"49","hashOfConfig":"26"},{"filePath":"50","messages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},"1b6yqyj",{"filePath":"53","messages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"55","messages":"56","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"57","messages":"58","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"59","messages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"61","messages":"62","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"63","messages":"64","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"65","messages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"67","usedDeprecatedRules":"52"},{"filePath":"68","messages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"70","usedDeprecatedRules":"52"},{"filePath":"71","messages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"73","messages":"74","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"75","messages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"77","messages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"79","messages":"80","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"81","messages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"83","messages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"85","messages":"86","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"87","messages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"89","messages":"90","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"91","messages":"92","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"93","messages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"95","messages":"96","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"97","messages":"98","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"99"},{"filePath":"100","messages":"101","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},"C:\\ProgramasGO\\web-console\\web\\src\\index.tsx",[],[],"C:\\ProgramasGO\\web-console\\web\\src\\serviceWorkerRegistration.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\reportWebVitals.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\config\\config.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\locales\\i18n.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\App.tsx",[],"C:\\ProgramasGO\\web-console\\web\\src\\locales\\locales.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\Console.tsx",["102"],"import React, { useEffect, useRef, useState } from 'react';\r\nimport {\r\n  Pane,\r\n  Text,\r\n  Heading,\r\n  Badge,\r\n  Menu,\r\n  Popover,\r\n  Position,\r\n  Avatar,\r\n  Button,\r\n  toaster,\r\n  CornerDialog,\r\n} from 'evergreen-ui';\r\nimport {\r\n  FullCircleIcon,\r\n  UngroupObjectsIcon,\r\n  ErrorIcon,\r\n  DisableIcon,\r\n} from 'evergreen-ui';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { FitAddon } from 'xterm-addon-fit';\r\nimport { WebLinksAddon } from 'xterm-addon-web-links';\r\n\r\nimport XTerm from './term/XTerm';\r\nimport theme from './term/term_theme';\r\nimport FileTrans, { NodeConfig, ConnStatus } from './FileTrans';\r\nimport sshWebSocket from '../libs/sshwebsocket';\r\nimport terminalResize from '../libs/terminal-resize';\r\nimport Util from '../libs/utils';\r\nimport apiRouters from '../config/api_routers';\r\nimport Config from '../config/config';\r\nimport stringFormat from '../libs/string_format';\r\n\r\nimport './console.less';\r\n\r\ntype ConnStatusProps = {\r\n  host: string;\r\n  status: ConnStatus;\r\n};\r\n\r\nconst ConnectionStatus = (props: ConnStatusProps) => {\r\n  if (props.status === ConnStatus.Connecting) {\r\n    return (\r\n      <>\r\n        <UngroupObjectsIcon\r\n          verticalAlign=\"baseline\"\r\n          size={10}\r\n          color=\"info\"\r\n          marginRight={8}\r\n        />\r\n        <Badge isInteractive textTransform=\"lowercase\" color=\"blue\">\r\n          waiting connection\r\n        </Badge>\r\n      </>\r\n    );\r\n  } else if (props.status === ConnStatus.ConnectionLost) {\r\n    return (\r\n      <>\r\n        <DisableIcon\r\n          verticalAlign=\"baseline\"\r\n          size={10}\r\n          color=\"#FAE2E2\"\r\n          marginRight={8}\r\n        />\r\n        <Badge isInteractive color=\"red\">\r\n          connection lost\r\n        </Badge>\r\n      </>\r\n    );\r\n  } else {\r\n    return (\r\n      <>\r\n        <FullCircleIcon\r\n          verticalAlign=\"baseline\"\r\n          size={10}\r\n          color=\"success\"\r\n          marginRight={8}\r\n        />\r\n        <Badge isInteractive textTransform=\"lowercase\" color=\"green\">\r\n          {props.host}\r\n        </Badge>\r\n      </>\r\n    );\r\n  }\r\n};\r\n\r\nconst Console = (props: RouteComponentProps) => {\r\n  const [isSideSheetShown, setSideSheetShwon] = useState<boolean>(false);\r\n  const terminalRef = useRef<XTerm>(null);\r\n  const { t } = useTranslation(['translation', 'console']);\r\n  const [fitAddon] = useState<FitAddon>(new FitAddon());\r\n  const [webLinksAddon] = useState<WebLinksAddon>(new WebLinksAddon());\r\n  const [fullscreen, setFullscreen] = useState<boolean>(false);\r\n  const [connecting, setConnecting] = useState<ConnStatus>(\r\n    ConnStatus.Connecting,\r\n  );\r\n  const [nodeConfig, setNodeConfig] = useState<NodeConfig>({\r\n    host: 'waiting connection',\r\n    username: 'Loading',\r\n  });\r\n  const [showCornerDialog, setShowCornerDialog] = useState<boolean>(false);\r\n\r\n  let ws: WebSocket | null = null;\r\n\r\n  useEffect(() => {\r\n    const lhost = window.localStorage.getItem('user.host');\r\n    const luname = window.localStorage.getItem('user.username');\r\n    if (lhost === null) {\r\n      return;\r\n    }\r\n    if (luname === null) {\r\n      return;\r\n    }\r\n    setNodeConfig({ host: lhost, username: luname });\r\n  }, []);\r\n\r\n  useEffect(() => {\r\n    // Once the terminal is loaded write a new line to it.\r\n    const term = terminalRef.current!.terminal;\r\n    fitAddon.fit();\r\n    term.writeln('Welcome to SSH web-console!');\r\n\r\n    const _t = sessionStorage.getItem(Config.jwt.tokenName);\r\n    if (_t === null) {\r\n      toaster.danger(t('console:web_socket_expire'));\r\n      props.history.push('/signin');\r\n      return;\r\n    }\r\n\r\n    ws = new WebSocket(\r\n      Util.loadWebSocketUrl(\r\n        apiRouters.router.ws_ssh,\r\n        stringFormat.format(\r\n          apiRouters.params.ws_ssh,\r\n          term.cols + '',\r\n          term.rows + '',\r\n          _t,\r\n        ),\r\n      ),\r\n    );\r\n    ws.binaryType = 'arraybuffer';\r\n    ws.onopen = () => {\r\n      setConnecting(ConnStatus.ConnectionAlive);\r\n    };\r\n\r\n    ws.onclose = (ev) => {\r\n      term.setOption('cursorBlink', false);\r\n      sessionStorage.removeItem(Config.jwt.tokenName);\r\n      setConnecting(ConnStatus.ConnectionLost);\r\n      setShowCornerDialog(true);\r\n\r\n      send(ev);\r\n    };\r\n\r\n    const send = (e: CloseEvent) => {\r\n      e.preventDefault();\r\n\r\n      if (window && window.parent) {\r\n        window.parent.postMessage(\r\n          {\r\n            message: 'close',\r\n          },\r\n          '*',\r\n        );\r\n      }\r\n    };\r\n\r\n    sshWebSocket.bindTerminal(term, ws!, true, -1);\r\n    terminalResize.bindTerminalResize(term, ws!);\r\n    return () => {\r\n      if (ws !== null) {\r\n        ws.close();\r\n      }\r\n    };\r\n  }, []);\r\n\r\n  useEffect(() => {\r\n    fitAddon.fit();\r\n  }, [fullscreen]);\r\n\r\n  const onWindowResize = () => {\r\n    fitAddon.fit();\r\n  };\r\n  const closeWindowListener = (ev: BeforeUnloadEvent) => {\r\n    ev.preventDefault();\r\n    ev.returnValue = t('console:make_sure_to_leave');\r\n  };\r\n\r\n  useEffect(() => {\r\n    window.addEventListener('resize', onWindowResize);\r\n    window.addEventListener('beforeunload', closeWindowListener);\r\n    return () => {\r\n      window.removeEventListener('resize', onWindowResize);\r\n      window.removeEventListener('beforeunload', closeWindowListener);\r\n    };\r\n  }, []);\r\n\r\n  return (\r\n    <Pane height=\"100vh\" display=\"flex\" flexDirection=\"column\" borderRadius={3}>\r\n      <Pane\r\n        display=\"flex\"\r\n        flexDirection=\"row\"\r\n        alignItems=\"center\"\r\n        background=\"rgba(27,33,47,0.86)\">\r\n        <Heading padding={18} color=\"white\">\r\n          {' '}\r\n          {t('title')}\r\n        </Heading>\r\n        <Pane\r\n          padding={18}\r\n          flex={1}\r\n          alignItems=\"center\"\r\n          alignContent=\"center\"\r\n          textAlign=\"center\">\r\n          <ConnectionStatus status={connecting} host={nodeConfig.host} />\r\n        </Pane>\r\n        <Popover\r\n          position={Position.BOTTOM_LEFT}\r\n          content={\r\n            <Menu>\r\n              <Menu.Group>\r\n                <Menu.Item>\r\n                  {'@'} {nodeConfig.username}{' '}\r\n                </Menu.Item>\r\n              </Menu.Group>\r\n              <Menu.Divider />\r\n            </Menu>\r\n          }>\r\n          <Avatar\r\n            isSolid\r\n            name={nodeConfig.username}\r\n            size={36}\r\n            marginRight={36}\r\n            cursor=\"pointer\"\r\n          />\r\n        </Popover>\r\n      </Pane>\r\n      <Pane flex={1} overflowY=\"hidden\">\r\n        <XTerm\r\n          className={\r\n            fullscreen ? 'term-container fullscreen' : 'term-container'\r\n          }\r\n          options={{\r\n            cursorBlink: true,\r\n            bellStyle: 'sound',\r\n            theme: theme.default_theme,\r\n          }}\r\n          addons={[fitAddon, webLinksAddon]}\r\n          ref={terminalRef}\r\n        />\r\n      </Pane>\r\n      <Pane display=\"flex\" alignItems=\"center\">\r\n        <FileTrans\r\n          isShown={isSideSheetShown}\r\n          node={{ host: nodeConfig.host, username: nodeConfig.username }}\r\n          sshStatus={connecting}\r\n          hideSideSheeeet={() => {\r\n            setSideSheetShwon(false);\r\n          }}\r\n        />\r\n        <Button intent=\"success\" onClick={() => setSideSheetShwon(true)}>\r\n          SFTP\r\n        </Button>\r\n        <Pane flex=\"1\"></Pane>\r\n        <Text marginRight=\"0.4rem\">active time: 0:00:00</Text>\r\n      </Pane>\r\n      <CornerDialog\r\n        title={\r\n          <Text size={500} color=\"danger\" alignItems=\"center\" display=\"flex\">\r\n            <ErrorIcon marginRight=\"0.2rem\" />{' '}\r\n            {t('console:ssh_disconn_dialog_title')}\r\n          </Text>\r\n        }\r\n        isShown={showCornerDialog}\r\n        hasClose={false}\r\n        cancelLabel={t('console:ssh_disconn_dialog_cancel_btn')}\r\n        confirmLabel={t('console:ssh_disconn_dialog_confirm_btn')}\r\n        onConfirm={() => {\r\n          props.history.push('/signin');\r\n        }}\r\n        containerProps={{ zIndex: 20 }}\r\n        onCloseComplete={() => setShowCornerDialog(false)}>\r\n        {t('console:ssh_disconn_dialog_text')}\r\n      </CornerDialog>\r\n    </Pane>\r\n  );\r\n};\r\n\r\nexport default Console;\r\n","C:\\ProgramasGO\\web-console\\web\\src\\components\\Home.tsx",["103"],"import React from 'react';\r\nimport { NavLink, Route, Switch } from 'react-router-dom';\r\nimport { Button, Pane, Heading } from 'evergreen-ui';\r\nimport { useTranslation } from 'react-i18next';\r\n\r\nimport Header from './layout/Header';\r\nimport Signin from './Signin';\r\n\r\nimport './home.less';\r\nimport headerLogo from '../assets/ssh.png';\r\n\r\nconst MainPage = () => {\r\n  const { t } = useTranslation(['home']);\r\n  return (\r\n    <>\r\n      <Pane\r\n        alignItems=\"center\"\r\n        justifyContent=\"center\"\r\n        display=\"flex\"\r\n        flexDirection=\"column\">\r\n        <div\r\n          style={{\r\n            minHeight: '360px',\r\n            marginTop: '10rem',\r\n            textAlign: 'center',\r\n          }}>\r\n          <img src={headerLogo} className=\"App-logo\" alt=\"logo\" />\r\n          <Heading marginBottom=\"0.6rem\" marginTop=\"0.6rem\" size={700}>\r\n            {t('home:welcome')}\r\n          </Heading>\r\n          <div>\r\n            <NavLink to=\"/signin\" className=\"focus-ring-link\">\r\n              <Button appearance=\"primary\"> {t('home:goto_signin')} </Button>\r\n            </NavLink>\r\n          </div>\r\n        </div>\r\n      </Pane>\r\n    </>\r\n  );\r\n};\r\n\r\nconst Home = () => {\r\n  return (\r\n    <div className=\"home-container\">\r\n      <header className=\"home-content-header\">\r\n        <Header />\r\n      </header>\r\n      <main className=\"home-content-main main-content-container\">\r\n        <Switch>\r\n          <Route exact path={`/`} component={Signin} />\r\n          <Route path={`/signin`} component={Signin} />\r\n        </Switch>\r\n      </main>\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default Home;\r\n","C:\\ProgramasGO\\web-console\\web\\src\\config\\api_routers.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\term\\term_theme.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\libs\\terminal-resize.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\libs\\utils.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\libs\\sshwebsocket.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\libs\\string_format.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\FileTrans.tsx",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\term\\XTerm.tsx",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\layout\\Header.tsx",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\files\\files_types.ts",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\SftpUpload.tsx",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\PathNav.tsx",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\files\\GridFileItem.tsx",[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\files\\DownloadingFile.tsx",[],[],"C:\\ProgramasGO\\web-console\\web\\src\\components\\Signin.tsx",[],{"ruleId":"104","severity":1,"message":"105","line":95,"column":22,"nodeType":"106","messageId":"107","endLine":95,"endColumn":35},{"ruleId":"104","severity":1,"message":"108","line":12,"column":7,"nodeType":"106","messageId":"107","endLine":12,"endColumn":15},"@typescript-eslint/no-unused-vars","'setFullscreen' is assigned a value but never used.","Identifier","unusedVar","'MainPage' is assigned a value but never used."]