fix: removed 'Share with Lamassu' button from machine logs and server

maintanence pages
This commit is contained in:
Liordino Neto 2020-10-27 17:34:51 -03:00 committed by Josh Harvey
parent cce8289e22
commit cb44468e47
2 changed files with 4 additions and 52 deletions

View file

@ -1,4 +1,4 @@
import { useQuery, useMutation } from '@apollo/react-hooks'
import { useQuery } from '@apollo/react-hooks'
import { makeStyles } from '@material-ui/core/styles'
import gql from 'graphql-tag'
import moment from 'moment'
@ -7,7 +7,6 @@ import React, { useState } from 'react'
import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper'
import Title from 'src/components/Title'
import { SimpleButton } from 'src/components/buttons'
import Sidebar from 'src/components/layout/Sidebar'
import {
Table,
@ -17,9 +16,7 @@ import {
TableBody,
TableCell
} from 'src/components/table'
import { Label1, Info3 } from 'src/components/typography'
import { ReactComponent as WhiteShareIcon } from 'src/styling/icons/circle buttons/share/white.svg'
import { ReactComponent as ShareIcon } from 'src/styling/icons/circle buttons/share/zodiac.svg'
import { Info3 } from 'src/components/typography'
import styles from './Logs.styles'
@ -52,14 +49,6 @@ const GET_MACHINE_LOGS = gql`
}
`
const SUPPORT_LOGS = gql`
mutation SupportLogs($deviceId: ID!) {
machineSupportLogs(deviceId: $deviceId) {
id
}
}
`
const formatDate = date => {
return moment(date).format('YYYY-MM-DD HH:mm')
}
@ -74,12 +63,6 @@ const Logs = () => {
const { data: machineResponse } = useQuery(GET_MACHINES)
const [sendSnapshot, { loading }] = useMutation(SUPPORT_LOGS, {
variables: { deviceId },
onError: () => setSaveMessage('Failure saving snapshot'),
onCompleted: () => setSaveMessage('✓ Saved latest snapshot')
})
const { data: logsResponse } = useQuery(GET_MACHINE_LOGS, {
variables: { deviceId, limit: NUM_LOG_RESULTS },
skip: !selected,
@ -108,14 +91,6 @@ const Logs = () => {
args={{ deviceId }}
getLogs={logs => R.path(['machineLogs'])(logs)}
/>
<SimpleButton
className={classes.shareButton}
disabled={loading}
Icon={ShareIcon}
InverseIcon={WhiteShareIcon}
onClick={sendSnapshot}>
<Label1>Share with Lamassu</Label1>
</SimpleButton>
<Info3>{saveMessage}</Info3>
</div>
)}

View file

@ -1,4 +1,4 @@
import { useQuery, useMutation } from '@apollo/react-hooks'
import { useQuery } from '@apollo/react-hooks'
import { makeStyles } from '@material-ui/core'
import gql from 'graphql-tag'
import moment from 'moment'
@ -8,7 +8,6 @@ import React, { useState, useRef } from 'react'
import LogsDowloaderPopover from 'src/components/LogsDownloaderPopper'
import Title from 'src/components/Title'
import Uptime from 'src/components/Uptime'
import { SimpleButton } from 'src/components/buttons'
import { Select } from 'src/components/inputs'
import {
Table,
@ -18,10 +17,8 @@ import {
TableBody,
TableCell
} from 'src/components/table'
import { Label1, Info3 } from 'src/components/typography'
import { Info3 } from 'src/components/typography'
import typographyStyles from 'src/components/typography/styles'
import { ReactComponent as WhiteShareIcon } from 'src/styling/icons/circle buttons/share/white.svg'
import { ReactComponent as ShareIcon } from 'src/styling/icons/circle buttons/share/zodiac.svg'
import { offColor } from 'src/styling/variables'
import logsStyles from './Logs.styles'
@ -78,13 +75,6 @@ const GET_DATA = gql`
}
}
`
const SUPPORT_LOGS = gql`
mutation ServerSupportLogs {
serverSupportLogs {
id
}
}
`
const Logs = () => {
const classes = useStyles()
@ -104,11 +94,6 @@ const Logs = () => {
const serverVersion = data?.serverVersion
const processStates = data?.uptime ?? []
const [sendSnapshot, { loading }] = useMutation(SUPPORT_LOGS, {
onError: () => setSaveMessage('Failure saving snapshot'),
onCompleted: () => setSaveMessage('✓ Saved latest snapshot')
})
const getLogLevels = R.compose(
R.prepend(SHOW_ALL),
R.uniq,
@ -136,14 +121,6 @@ const Logs = () => {
logs={data.serverLogs}
getTimestamp={log => log.timestamp}
/>
<SimpleButton
className={classes.shareButton}
disabled={loading}
Icon={ShareIcon}
InverseIcon={WhiteShareIcon}
onClick={sendSnapshot}>
<Label1>Share with Lamassu</Label1>
</SimpleButton>
<Info3>{saveMessage}</Info3>
</div>
)}