Hint which messages are compared in diff
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import CodeDiff from './components/CodeDiff'
|
|
||||||
import ConnectionSetup from './components/ConnectionSetup/ConnectionSetup'
|
import ConnectionSetup from './components/ConnectionSetup/ConnectionSetup'
|
||||||
import CssBaseline from '@material-ui/core/CssBaseline'
|
import CssBaseline from '@material-ui/core/CssBaseline'
|
||||||
import ErrorBoundary from './ErrorBoundary'
|
import ErrorBoundary from './ErrorBoundary'
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import * as diff from 'diff'
|
import * as diff from 'diff'
|
||||||
import * as Prism from 'prismjs'
|
import * as Prism from 'prismjs'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { Badge, Theme, withStyles } from '@material-ui/core'
|
import { Theme, withStyles } from '@material-ui/core'
|
||||||
import 'prismjs/components/prism-json'
|
import 'prismjs/components/prism-json'
|
||||||
import 'prismjs/themes/prism-tomorrow.css'
|
import 'prismjs/themes/prism-tomorrow.css'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
previous: string
|
previous: string
|
||||||
current: string
|
current: string
|
||||||
|
nameOfCompareMessage: string
|
||||||
language?: 'json'
|
language?: 'json'
|
||||||
classes: any
|
classes: any
|
||||||
}
|
}
|
||||||
@@ -60,10 +61,14 @@ class CodeDiff extends React.Component<Props, {}> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span style={{ display: 'block', textAlign: 'right' }}>
|
<span style={{ display: 'block', marginBottom: '8px', float: 'right' }}>
|
||||||
Diff: <span className={this.props.classes.additions}>+ {additions} line{additions === 1 ? '' : 's'}</span>
|
<span>
|
||||||
|
Comparing with <b>{this.props.nameOfCompareMessage}</b> message:
|
||||||
|
|
||||||
|
<span className={this.props.classes.additions}>+ {additions} line{additions === 1 ? '' : 's'}</span>
|
||||||
, <span className={this.props.classes.deletions}>- {deletions} line{deletions === 1 ? '' : 's'}</span>
|
, <span className={this.props.classes.deletions}>- {deletions} line{deletions === 1 ? '' : 's'}</span>
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ class ValueRenderer extends React.Component<Props, State> {
|
|||||||
previous={previous}
|
previous={previous}
|
||||||
current={current}
|
current={current}
|
||||||
language={language}
|
language={language}
|
||||||
|
nameOfCompareMessage={this.props.compareWith ? 'selected' : 'previous'}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "MQTT-Explorer",
|
"name": "MQTT-Explorer",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1-alpha4",
|
||||||
"description": "Explore your message queues",
|
"description": "Explore your message queues",
|
||||||
"main": "dist/src/electron.js",
|
"main": "dist/src/electron.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user