mirror of
https://github.com/thomasnordquist/MQTT-Explorer.git
synced 2026-09-12 01:23:31 +00:00
Compare commits
20
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ead83463c | ||
|
|
2d8253ef31 | ||
|
|
d4a709f0d5 | ||
|
|
d090197fe5 | ||
|
|
63cdc53075 | ||
|
|
dca35c1ed7 | ||
|
|
4c58d4af69 | ||
|
|
766a283b01 | ||
|
|
870043bde6 | ||
|
|
d2fea71bd5 | ||
|
|
208c379898 | ||
|
|
55e3c827c4 | ||
|
|
8ac285846a | ||
|
|
2cb4084ed6 | ||
|
|
0bcae7912c | ||
|
|
1868a08237 | ||
|
|
ba919c19fa | ||
|
|
701477f32e | ||
|
|
fc59c46121 | ||
|
|
eb67c69fad |
@@ -2,7 +2,6 @@
|
||||
[](https://travis-ci.org/thomasnordquist/MQTT-Explorer/releases)
|
||||
[](https://travis-ci.org/thomasnordquist/MQTT-Explorer/releases)
|
||||
[](https://travis-ci.org/thomasnordquist/MQTT-Explorer)
|
||||
[](https://ci.appveyor.com/project/thomasnordquist/mqtt-explorer/branch/master)
|
||||
|
||||
### Version
|
||||
|
||||
|
||||
+2
-2
@@ -24,9 +24,9 @@ The hierarchical view allows for a quick understanding what is going on on your
|
||||
|
||||
| Platform | | Downloads |
|
||||
|:----------:|:-------------:|:------:|
|
||||
|  | Windows | <a href="https://www.microsoft.com/store/apps/9PP8SFM082WD?ocid=badge"><img src="https://assets.windowsphone.com/85864462-9c82-451e-9355-a3d5f874397a/English_get-it-from-MS_InvariantCulture_Default.png" width="150" /></a><br/>{{windowsTargets}} |
|
||||
|  | Windows | {{windowsTargets}} |
|
||||
|  | Linux | {{linuxTargets}}<br>*Run AppImage:<br>Make it executable and double-click it.* |
|
||||
|  | Ubuntu | <a href="https://snapcraft.io/mqtt-explorer" title="Get it from the Snap Store"><img src="https://snapcraft.io/static/images/badges/en/snap-store-black.svg" width="150" /><br/>[Ubuntu Store](snap://mqtt-explorer) |
|
||||
|  | Ubuntu | [](https://snapcraft.io/mqtt-explorer)<br>[Ubuntu Store](snap://mqtt-explorer) |
|
||||
|  | Mac | {{macTargets}} |
|
||||
|
||||
[More Downloads](https://github.com/thomasnordquist/MQTT-Explorer/releases)
|
||||
|
||||
+3
-5
@@ -9,10 +9,9 @@
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@material-ui/core": "^4.0.0-alpha.1",
|
||||
"@material-ui/icons": "^3.0.2",
|
||||
"@material-ui/lab": "^3.0.0-alpha.30",
|
||||
"@material-ui/styles": "^3.0.0-alpha.10",
|
||||
"@material-ui/core": "^4.0.0-alpha.0",
|
||||
"@material-ui/icons": "^3.0.1",
|
||||
"@material-ui/styles": "^3.0.0-alpha.8",
|
||||
"@types/diff": "^4.0.1",
|
||||
"@types/node": "^10.12.18",
|
||||
"@types/prismjs": "^1.9.1",
|
||||
@@ -48,7 +47,6 @@
|
||||
"react-vis": "^1.11.6",
|
||||
"redux": "^4.0.1",
|
||||
"redux-batched-actions": "^0.4.1",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"sha1": "^1.1.1",
|
||||
"socket.io-client": "^2.2.0",
|
||||
"source-map-loader": "^0.2.4",
|
||||
|
||||
@@ -18,6 +18,7 @@ import { Theme, withStyles } from '@material-ui/core/styles'
|
||||
const Settings = React.lazy(() => import('./components/Settings'))
|
||||
|
||||
interface Props {
|
||||
name: string
|
||||
connectionId: string
|
||||
classes: any
|
||||
settingsVisible: boolean
|
||||
|
||||
@@ -51,22 +51,6 @@ export const setAutoExpandLimit = (autoExpandLimit: number = 0) => (dispatch: Di
|
||||
dispatch(storeSettings())
|
||||
}
|
||||
|
||||
export const selectTopicWithMouseOver = (selectTopicWithMouseOver: boolean) => (dispatch: Dispatch<any>, getState: () => AppState) => {
|
||||
dispatch({
|
||||
selectTopicWithMouseOver,
|
||||
type: ActionTypes.SETTINGS_SET_SELECT_TOPIC_WITH_MOUSE_OVER,
|
||||
})
|
||||
dispatch(storeSettings())
|
||||
}
|
||||
|
||||
export const setValueDisplayMode = (valueRendererDisplayMode: 'diff' | 'raw') => (dispatch: Dispatch<any>, getState: () => AppState) => {
|
||||
dispatch({
|
||||
valueRendererDisplayMode,
|
||||
type: ActionTypes.SETTINGS_SET_VALUE_RENDERER_DISPLAY_MODE,
|
||||
})
|
||||
dispatch(storeSettings())
|
||||
}
|
||||
|
||||
export const toggleSettingsVisibility = () => (dispatch: Dispatch<any>, _getState: () => AppState) => {
|
||||
dispatch({
|
||||
type: ActionTypes.SETTINGS_TOGGLE_VISIBILITY,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import * as q from '../../../../backend/src/Model'
|
||||
import * as React from 'react'
|
||||
import Clear from '@material-ui/icons/Clear'
|
||||
import Code from '@material-ui/icons/Code'
|
||||
import Copy from '../Copy'
|
||||
import CustomIconButton from '../CustomIconButton'
|
||||
import DateFormatter from '../helper/DateFormatter'
|
||||
@@ -10,23 +9,23 @@ import DeleteForever from '@material-ui/icons/DeleteForever'
|
||||
import ExpandMore from '@material-ui/icons/ExpandMore'
|
||||
import MessageHistory from './MessageHistory'
|
||||
import NodeStats from './NodeStats'
|
||||
import Reorder from '@material-ui/icons/Reorder'
|
||||
import ToggleButton from '@material-ui/lab/ToggleButton'
|
||||
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup'
|
||||
import Topic from './Topic'
|
||||
import { AppState } from '../../reducers'
|
||||
import { bindActionCreators } from 'redux'
|
||||
import { connect } from 'react-redux'
|
||||
import { settingsActions, sidebarActons } from '../../actions'
|
||||
import { default as ReactResizeDetector } from 'react-resize-detector'
|
||||
import { sidebarActons } from '../../actions'
|
||||
import { StyleRulesCallback, Theme, withStyles } from '@material-ui/core/styles'
|
||||
import { TopicViewModel } from '../../TopicViewModel'
|
||||
import { ValueRendererDisplayMode } from '../../reducers/Settings'
|
||||
|
||||
import {
|
||||
Button,
|
||||
ExpansionPanel,
|
||||
ExpansionPanelDetails,
|
||||
ExpansionPanelSummary,
|
||||
Fade,
|
||||
Paper,
|
||||
Popper,
|
||||
Typography,
|
||||
Tooltip,
|
||||
Badge,
|
||||
@@ -38,12 +37,10 @@ const Publish = React.lazy(() => import('./Publish/Publish'))
|
||||
const ValueRenderer = React.lazy(() => import('./ValueRenderer'))
|
||||
|
||||
interface Props {
|
||||
node?: q.TreeNode<TopicViewModel>
|
||||
actions: typeof sidebarActons
|
||||
settingsActions: typeof settingsActions
|
||||
valueRendererDisplayMode: ValueRendererDisplayMode
|
||||
classes: any
|
||||
connectionId?: string
|
||||
node?: q.TreeNode<TopicViewModel>,
|
||||
actions: typeof sidebarActons,
|
||||
classes: any,
|
||||
connectionId?: string,
|
||||
}
|
||||
|
||||
interface State {
|
||||
@@ -142,27 +139,6 @@ class Sidebar extends React.Component<Props, State> {
|
||||
this.props.actions.clearTopic(topic, recursive, maxCount)
|
||||
}
|
||||
|
||||
private renderActionButtons() {
|
||||
const handleValue = (_e: React.MouseEvent, value: any) => {
|
||||
this.props.settingsActions.setValueDisplayMode(value)
|
||||
}
|
||||
|
||||
return (
|
||||
<ToggleButtonGroup value={this.props.valueRendererDisplayMode} exclusive={true} onChange={handleValue}>
|
||||
<ToggleButton value="diff">
|
||||
<Tooltip title="Show difference between the current and the last message">
|
||||
<Code />
|
||||
</Tooltip>
|
||||
</ToggleButton>
|
||||
<ToggleButton value="raw">
|
||||
<Tooltip title="Raw value">
|
||||
<Reorder />
|
||||
</Tooltip>
|
||||
</ToggleButton>
|
||||
</ToggleButtonGroup>
|
||||
)
|
||||
}
|
||||
|
||||
private renderNode() {
|
||||
const { classes, node } = this.props
|
||||
|
||||
@@ -188,9 +164,9 @@ class Sidebar extends React.Component<Props, State> {
|
||||
<ExpansionPanelDetails style={this.detailsStyle}>
|
||||
{this.messageMetaInfo()}
|
||||
<div ref={this.valueRef}>
|
||||
<React.Suspense fallback={<div>Loading...</div>}>
|
||||
{this.renderValue()}
|
||||
</React.Suspense>
|
||||
<React.Suspense fallback={<div>Loading...</div>}>
|
||||
<ValueRenderer node={this.props.node} compareWith={this.state.compareMessage} />
|
||||
</React.Suspense>
|
||||
</div>
|
||||
<div><MessageHistory onSelect={this.handleMessageHistorySelect} selected={this.state.compareMessage} node={this.props.node} /></div>
|
||||
</ExpansionPanelDetails>
|
||||
@@ -215,20 +191,6 @@ class Sidebar extends React.Component<Props, State> {
|
||||
)
|
||||
}
|
||||
|
||||
private renderValue() {
|
||||
const node = this.props.node
|
||||
if (!node || !node.message) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<ValueRenderer
|
||||
message={node.message}
|
||||
messageHistory={node.messageHistory}
|
||||
compareWith={this.state.compareMessage} />
|
||||
)
|
||||
}
|
||||
|
||||
private messageMetaInfo() {
|
||||
if (!this.props.node || !this.props.node.message || !this.props.node.mqttMessage) {
|
||||
return null
|
||||
@@ -249,9 +211,8 @@ class Sidebar extends React.Component<Props, State> {
|
||||
)
|
||||
|
||||
return (
|
||||
<div style={{ width: '100%', display: 'flex', paddingLeft: '8px' }}>
|
||||
<div style={{ width: '100%', display: 'flex' }}>
|
||||
<div style={{ flex: 6 }}><Typography>QoS: {this.props.node.mqttMessage.qos}</Typography></div>
|
||||
<span style={{ marginTop: '-8px' }}>{this.renderActionButtons()}</span>
|
||||
<div style={{ flex: 8, textAlign: 'center' }}>
|
||||
{this.props.node.mqttMessage.retain ? retainedButton : null}
|
||||
</div>
|
||||
@@ -284,14 +245,12 @@ class Sidebar extends React.Component<Props, State> {
|
||||
const mapStateToProps = (state: AppState) => {
|
||||
return {
|
||||
node: state.tree.selectedTopic,
|
||||
valueRendererDisplayMode: state.settings.valueRendererDisplayMode,
|
||||
}
|
||||
}
|
||||
|
||||
const mapDispatchToProps = (dispatch: any) => {
|
||||
return {
|
||||
actions: bindActionCreators(sidebarActons, dispatch),
|
||||
settingsActions: bindActionCreators(settingsActions, dispatch),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import * as q from '../../../../backend/src/Model'
|
||||
import * as React from 'react'
|
||||
import CodeDiff from '../CodeDiff'
|
||||
import { AppState } from '../../reducers'
|
||||
import { connect } from 'react-redux'
|
||||
import { default as ReactResizeDetector } from 'react-resize-detector'
|
||||
import { ValueRendererDisplayMode } from '../../reducers/Settings'
|
||||
import { Theme, withTheme } from '@material-ui/core/styles'
|
||||
|
||||
interface Props {
|
||||
message: q.Message
|
||||
messageHistory: q.RingBuffer<q.Message>
|
||||
node?: q.TreeNode<any>,
|
||||
compareWith?: q.Message
|
||||
renderMode: ValueRendererDisplayMode
|
||||
theme: Theme
|
||||
}
|
||||
|
||||
interface State {
|
||||
@@ -24,6 +21,10 @@ class ValueRenderer extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
public render() {
|
||||
if (!this.props.node) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ padding: '8px 0px 8px 8px' }}>
|
||||
<ReactResizeDetector handleWidth={true} onResize={this.updateWidth} />
|
||||
@@ -33,15 +34,16 @@ class ValueRenderer extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
public renderValue() {
|
||||
const { message, messageHistory, compareWith, renderMode } = this.props
|
||||
|
||||
const previousMessages = messageHistory.toArray()
|
||||
const previousMessage = previousMessages[previousMessages.length - 2]
|
||||
let compareMessage = compareWith || previousMessage || message
|
||||
if (renderMode === 'raw') {
|
||||
compareMessage = message
|
||||
const { node } = this.props
|
||||
if (!node || !node.message) {
|
||||
return <span key="empty" />
|
||||
}
|
||||
|
||||
const message = node.message
|
||||
const previousMessages = node.messageHistory.toArray()
|
||||
const previousMessage = previousMessages[previousMessages.length - 2]
|
||||
const compareMessage = this.props.compareWith || previousMessage || message
|
||||
|
||||
let json
|
||||
try {
|
||||
json = JSON.parse(message.value)
|
||||
@@ -98,10 +100,4 @@ class ValueRenderer extends React.Component<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: AppState) => {
|
||||
return {
|
||||
renderMode: state.settings.valueRendererDisplayMode,
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(mapStateToProps)(ValueRenderer)
|
||||
export default withTheme()(ValueRenderer)
|
||||
|
||||
@@ -51,13 +51,13 @@ class TreeNodeSubnodes extends React.Component<Props, State> {
|
||||
}
|
||||
|
||||
private renderMore() {
|
||||
this.renderMoreAnimationFrame = (window as any).requestIdleCallback(() => {
|
||||
this.renderMoreAnimationFrame = window.requestIdleCallback(() => {
|
||||
this.setState({ ...this.state, alreadyAdded: this.state.alreadyAdded * 1.5 })
|
||||
}, { timeout: 500 })
|
||||
}
|
||||
|
||||
public componentWillUnmount() {
|
||||
(window as any).cancelIdleCallback(this.renderMoreAnimationFrame)
|
||||
window.cancelIdleCallback(this.renderMoreAnimationFrame)
|
||||
}
|
||||
|
||||
public render() {
|
||||
|
||||
+2
-1
@@ -27,6 +27,7 @@ const theme = createMuiTheme({
|
||||
palette: {
|
||||
type: 'dark',
|
||||
},
|
||||
typography: { useNextVariants: true },
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -40,7 +41,7 @@ setTimeout(() => {
|
||||
ReactDOM.render(
|
||||
<MuiThemeProvider theme={theme}>
|
||||
<Provider store={store}>
|
||||
<App />
|
||||
<App name="" />
|
||||
</Provider>
|
||||
</MuiThemeProvider>,
|
||||
document.getElementById('app'),
|
||||
|
||||
@@ -8,19 +8,14 @@ export enum TopicOrder {
|
||||
topics = '#topics',
|
||||
}
|
||||
|
||||
export type ValueRendererDisplayMode = 'diff' | 'raw'
|
||||
|
||||
export interface SettingsState {
|
||||
autoExpandLimit: number
|
||||
visible: boolean
|
||||
topicOrder: TopicOrder
|
||||
topicFilter?: string
|
||||
highlightTopicUpdates: boolean
|
||||
valueRendererDisplayMode: ValueRendererDisplayMode
|
||||
selectTopicWithMouseOver: boolean
|
||||
}
|
||||
|
||||
export type Action = SetAutoExpandLimit | ToggleVisibility | SetTopicOrder | FilterTopics | TogglehighlightTopicUpdates | SetValueRendererDisplayMode
|
||||
export type Action = SetAutoExpandLimit | ToggleVisibility | SetTopicOrder | FilterTopics | TogglehighlightTopicUpdates
|
||||
|
||||
export enum ActionTypes {
|
||||
SETTINGS_SET_AUTO_EXPAND_LIMIT = 'SETTINGS_SET_AUTO_EXPAND_LIMIT',
|
||||
@@ -29,9 +24,6 @@ export enum ActionTypes {
|
||||
SETTINGS_FILTER_TOPICS = 'SETTINGS_FILTER_TOPICS',
|
||||
SETTINGS_TOGGLE_HIGHLIGHT_ACTIVITY = 'SETTINGS_TOGGLE_HIGHLIGHT_ACTIVITY',
|
||||
SETTINGS_DID_LOAD_SETTINGS = 'SETTINGS_DID_LOAD_SETTINGS',
|
||||
SETTINGS_SET_VALUE_RENDERER_DISPLAY_MODE = 'SETTINGS_SET_VALUE_RENDERER_DISPLAY_MODE',
|
||||
SETTINGS_SET_SELECT_TOPIC_WITH_MOUSE_OVER = 'SETTINGS_SET_SELECT_TOPIC_WITH_MOUSE_OVER',
|
||||
|
||||
}
|
||||
|
||||
const initialState: SettingsState = {
|
||||
@@ -39,8 +31,6 @@ const initialState: SettingsState = {
|
||||
topicOrder: TopicOrder.none,
|
||||
visible: false,
|
||||
highlightTopicUpdates: true,
|
||||
valueRendererDisplayMode: 'diff',
|
||||
selectTopicWithMouseOver: false,
|
||||
}
|
||||
|
||||
export const settingsReducer = createReducer(initialState, {
|
||||
@@ -50,8 +40,6 @@ export const settingsReducer = createReducer(initialState, {
|
||||
SETTINGS_FILTER_TOPICS: filterTopics,
|
||||
SETTINGS_TOGGLE_HIGHLIGHT_ACTIVITY: togglehighlightTopicUpdates,
|
||||
SETTINGS_DID_LOAD_SETTINGS: didLoadSettings,
|
||||
SETTINGS_SET_VALUE_RENDERER_DISPLAY_MODE: setValueRendererDisplayMode,
|
||||
SETTINGS_SET_SELECT_TOPIC_WITH_MOUSE_OVER: setSelectTopicWithMouseOver,
|
||||
})
|
||||
|
||||
export interface DidLoadSettings {
|
||||
@@ -66,30 +54,6 @@ function didLoadSettings(state: SettingsState, action: DidLoadSettings) {
|
||||
}
|
||||
}
|
||||
|
||||
export interface SetSelectTopicWithMouseOver {
|
||||
type: ActionTypes.SETTINGS_SET_SELECT_TOPIC_WITH_MOUSE_OVER
|
||||
selectTopicWithMouseOver: boolean
|
||||
}
|
||||
|
||||
export function setSelectTopicWithMouseOver(state: SettingsState, action: SetSelectTopicWithMouseOver) {
|
||||
return {
|
||||
...state,
|
||||
selectTopicWithMouseOver: action.selectTopicWithMouseOver,
|
||||
}
|
||||
}
|
||||
|
||||
export interface SetValueRendererDisplayMode {
|
||||
type: ActionTypes.SETTINGS_SET_VALUE_RENDERER_DISPLAY_MODE
|
||||
valueRendererDisplayMode: ValueRendererDisplayMode
|
||||
}
|
||||
|
||||
export function setValueRendererDisplayMode(state: SettingsState, action: SetValueRendererDisplayMode) {
|
||||
return {
|
||||
...state,
|
||||
valueRendererDisplayMode: action.valueRendererDisplayMode,
|
||||
}
|
||||
}
|
||||
|
||||
export interface SetAutoExpandLimit {
|
||||
type: ActionTypes.SETTINGS_SET_AUTO_EXPAND_LIMIT
|
||||
autoExpandLimit: number
|
||||
|
||||
+547
-502
File diff suppressed because it is too large
Load Diff
+11
-2
@@ -12,12 +12,21 @@ install:
|
||||
build_script:
|
||||
- yarn
|
||||
- yarn build
|
||||
- yarn prepare-release
|
||||
- yarn package appx
|
||||
|
||||
test_script:
|
||||
- yarn test
|
||||
|
||||
before_deploy:
|
||||
- yarn prepare-release
|
||||
- yarn package appx
|
||||
|
||||
deploy:
|
||||
- provider: Environment
|
||||
name: production
|
||||
on:
|
||||
branch: master # only this will work
|
||||
APPVEYOR_REPO_TAG: true # condition will never be evaluated
|
||||
|
||||
artifacts:
|
||||
- path: 'build\clean\build\MQTT-Explorer*.appx'
|
||||
|
||||
|
||||
+3
-3
@@ -36,8 +36,7 @@
|
||||
"applicationId": "mqttexplorer",
|
||||
"identityName": "51031thomas.nordquist.MQTT-Explorer",
|
||||
"publisherDisplayName": "Thomas Nordquist",
|
||||
"publisher": "CN=0A6DE643-4AA2-4FF2-9729-6935C9ED8C13",
|
||||
"backgroundColor": "#FFFFFF"
|
||||
"publisher": "CN=0A6DE643-4AA2-4FF2-9729-6935C9ED8C13"
|
||||
},
|
||||
"directories": {
|
||||
"app": "./",
|
||||
@@ -61,7 +60,7 @@
|
||||
"@types/sha1": "^1.1.1",
|
||||
"axios": "^0.18.0",
|
||||
"chai": "^4.2.0",
|
||||
"electron": "^5.0.0-beta.4",
|
||||
"electron": "^4.0.2",
|
||||
"electron-builder": "^20.38.5",
|
||||
"fs-extra": "^7.0.1",
|
||||
"mime": "^2.4.0",
|
||||
@@ -81,6 +80,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"about-window": "^1.12.1",
|
||||
"electron-debug": "^2.0.0",
|
||||
"electron-is-dev": "^1.0.1",
|
||||
"electron-log": "^2.2.17",
|
||||
"electron-telemetry": "git+https://github.com/thomasnordquist/electron-telemetry.git#dist",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB |
+18
-16
@@ -1,8 +1,8 @@
|
||||
import { Menu, app, BrowserWindow, webContents, MenuItemConstructorOptions, MenuItem } from 'electron'
|
||||
import { Menu, app, BrowserWindow, webContents } from 'electron'
|
||||
import openAboutWindow from 'about-window'
|
||||
import * as path from 'path'
|
||||
|
||||
const applicationMenu: MenuItemConstructorOptions = {
|
||||
const applicationMenu = {
|
||||
label: 'Application',
|
||||
submenu: [
|
||||
{
|
||||
@@ -23,7 +23,7 @@ const applicationMenu: MenuItemConstructorOptions = {
|
||||
{
|
||||
label: 'Dev Tools',
|
||||
accelerator: 'CmdOrCtrl+Alt+I',
|
||||
role: 'toggledevtools' as 'toggledevtools',
|
||||
role: 'toggleDevTools',
|
||||
},
|
||||
{
|
||||
label: 'Quit',
|
||||
@@ -35,41 +35,41 @@ const applicationMenu: MenuItemConstructorOptions = {
|
||||
],
|
||||
}
|
||||
|
||||
const editMenu: MenuItemConstructorOptions = {
|
||||
const editMenu = {
|
||||
label: 'Edit',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Undo',
|
||||
accelerator: 'CmdOrCtrl+Z',
|
||||
role: 'undo',
|
||||
selector: 'undo:',
|
||||
},
|
||||
{
|
||||
label: 'Redo',
|
||||
accelerator: 'Shift+CmdOrCtrl+Z',
|
||||
role: 'redo',
|
||||
selector: 'redo:',
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
type: 'separator' as 'separator',
|
||||
},
|
||||
{
|
||||
label: 'Cut',
|
||||
accelerator: 'CmdOrCtrl+X',
|
||||
role: 'cut',
|
||||
selector: 'cut:',
|
||||
},
|
||||
{
|
||||
label: 'Copy',
|
||||
accelerator: 'CmdOrCtrl+C',
|
||||
role: 'copy',
|
||||
selector: 'copy:',
|
||||
},
|
||||
{
|
||||
label: 'Paste',
|
||||
accelerator: 'CmdOrCtrl+V',
|
||||
role: 'paste',
|
||||
selector: 'paste:',
|
||||
},
|
||||
{
|
||||
label: 'Select All',
|
||||
accelerator: 'CmdOrCtrl+A',
|
||||
role: 'selectall',
|
||||
selector: 'selectAll:',
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -93,8 +93,9 @@ const viewMenu = {
|
||||
click: () => {
|
||||
const window = BrowserWindow.getFocusedWindow()
|
||||
if (window) {
|
||||
const zoom = window.webContents.getZoomFactor()
|
||||
window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0))
|
||||
window.webContents.getZoomFactor((zoom) => {
|
||||
window.webContents.setZoomFactor(Math.min(zoom + 0.1, 2.0))
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -104,15 +105,16 @@ const viewMenu = {
|
||||
click: () => {
|
||||
const window = BrowserWindow.getFocusedWindow()
|
||||
if (window) {
|
||||
const zoom = window.webContents.getZoomFactor()
|
||||
window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5))
|
||||
window.webContents.getZoomFactor((zoom) => {
|
||||
window.webContents.setZoomFactor(Math.max(zoom - 0.1, 0.5))
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
const template: Array<(MenuItemConstructorOptions) | (MenuItem)> = [
|
||||
const template = [
|
||||
applicationMenu,
|
||||
editMenu,
|
||||
viewMenu,
|
||||
|
||||
+5
-2
@@ -9,13 +9,16 @@ import { menuTemplate } from './MenuTemplate'
|
||||
import { UpdateInfo } from '../events'
|
||||
const isDev = require('electron-is-dev')
|
||||
|
||||
let electronTelemetry: any
|
||||
if (!isDev) {
|
||||
const electronTelemetry = electronTelemetryFactory('9b0c8ca04a361eb8160d98c5')
|
||||
electronTelemetry = electronTelemetryFactory('9b0c8ca04a361eb8160d98c5')
|
||||
}
|
||||
|
||||
// const isDebugEnabled = Boolean(process.argv.find(arg => arg === 'debug'))
|
||||
const isDebugEnabled = Boolean(process.argv.find(arg => arg === 'debug'))
|
||||
const runningUiTestOnCi = Boolean(process.argv.find(arg => arg === '--runningUiTestOnCi'))
|
||||
|
||||
require('electron-debug')({ enabled: isDebugEnabled })
|
||||
|
||||
autoUpdater.logger = log
|
||||
log.info('App starting...')
|
||||
|
||||
|
||||
@@ -1095,6 +1095,14 @@ electron-chromedriver@~3.0.0:
|
||||
electron-download "^4.1.0"
|
||||
extract-zip "^1.6.5"
|
||||
|
||||
electron-debug@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-debug/-/electron-debug-2.0.0.tgz#3059a6557acbfb091f138d83875f57bac80cea6d"
|
||||
integrity sha512-orGlw9uErUztdD7cgdKz78txq3czpOnKG/zvvsINkUsugqL+dn77UFrbwRGVgPwuLJ7Ejbjjk9EcxIcgTivMbA==
|
||||
dependencies:
|
||||
electron-is-dev "^0.3.0"
|
||||
electron-localshortcut "^3.0.0"
|
||||
|
||||
electron-download@^4.1.0:
|
||||
version "4.1.1"
|
||||
resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8"
|
||||
@@ -1110,11 +1118,31 @@ electron-download@^4.1.0:
|
||||
semver "^5.4.1"
|
||||
sumchecker "^2.0.2"
|
||||
|
||||
electron-is-accelerator@^0.1.0:
|
||||
version "0.1.2"
|
||||
resolved "https://registry.yarnpkg.com/electron-is-accelerator/-/electron-is-accelerator-0.1.2.tgz#509e510c26a56b55e17f863a4b04e111846ab27b"
|
||||
integrity sha1-UJ5RDCala1Xhf4Y6SwThEYRqsns=
|
||||
|
||||
electron-is-dev@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-0.3.0.tgz#14e6fda5c68e9e4ecbeff9ccf037cbd7c05c5afe"
|
||||
integrity sha1-FOb9pcaOnk7L7/nM8DfL18BcWv4=
|
||||
|
||||
electron-is-dev@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-1.0.1.tgz#6e0a184736fe7aea77d18210b0b0f6a02402c4bc"
|
||||
integrity sha512-iwM3EotA9HTXqMGpQRkR/kT8OZqBbdfHTnlwcxsjSLYqY8svvsq0MuujsWCn3/vtgRmDv/PC/gKUUpoZvi5C1w==
|
||||
|
||||
electron-localshortcut@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/electron-localshortcut/-/electron-localshortcut-3.1.0.tgz#10c1ffd537b8d39170aaf6e1551341f7780dd2ce"
|
||||
integrity sha512-MgL/j5jdjW7iA0R6cI7S045B0GlKXWM1FjjujVPjlrmyXRa6yH0bGSaIAfxXAF9tpJm3pLEiQzerYHkRh9JG/A==
|
||||
dependencies:
|
||||
debug "^2.6.8"
|
||||
electron-is-accelerator "^0.1.0"
|
||||
keyboardevent-from-electron-accelerator "^1.1.0"
|
||||
keyboardevents-areequal "^0.2.1"
|
||||
|
||||
electron-log@^2.2.17:
|
||||
version "2.2.17"
|
||||
resolved "https://registry.yarnpkg.com/electron-log/-/electron-log-2.2.17.tgz#e71e2ebb949fc96ded7cdb99eeee7202e48981d2"
|
||||
@@ -1168,10 +1196,10 @@ electron-updater@^4.0.6:
|
||||
semver "^5.6.0"
|
||||
source-map-support "^0.5.9"
|
||||
|
||||
electron@^5.0.0-beta.4:
|
||||
version "5.0.0-beta.4"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-5.0.0-beta.4.tgz#436af638c20c7563e749d9d7599c4267b665759b"
|
||||
integrity sha512-8rBHuR04zcyJP1MfnhbbqExeIywxrbzR9FyKyrLc8O/ho4tEpKbxgGWoRStFDrv9YYL9BEjsaaExPseI7Rwu5A==
|
||||
electron@^4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/electron/-/electron-4.0.2.tgz#b5e074c149841490825d0785aa2bc4f5e29bbea4"
|
||||
integrity sha512-H0pmSvOVuC+Mq/+cYNXbCDBmqq5d1xYUVdBOjqGJuwuwJeP7qDHF35JA3cq+ARzq/CbwlXq98zdW6i6+x3U24g==
|
||||
dependencies:
|
||||
"@types/node" "^10.12.18"
|
||||
electron-download "^4.1.0"
|
||||
@@ -2062,6 +2090,16 @@ jsprim@^1.2.2:
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
keyboardevent-from-electron-accelerator@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/keyboardevent-from-electron-accelerator/-/keyboardevent-from-electron-accelerator-1.1.0.tgz#324614f6e33490c37ffc5be5876b3e85fe223c84"
|
||||
integrity sha512-VDC4vKWGrR3VgIKCE4CsXnvObGgP8C2idnTKEMUkuEuvDGE1GEBX9FtNdJzrD00iQlhI3xFxRaeItsUmlERVng==
|
||||
|
||||
keyboardevents-areequal@^0.2.1:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/keyboardevents-areequal/-/keyboardevents-areequal-0.2.2.tgz#88191ec738ce9f7591c25e9056de928b40277194"
|
||||
integrity sha512-Nv+Kr33T0mEjxR500q+I6IWisOQ0lK1GGOncV0kWE6n4KFmpcu7RUX5/2B0EUtX51Cb0HjZ9VJsSY3u4cBa0kw==
|
||||
|
||||
latest-version@^3.0.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15"
|
||||
|
||||
Reference in New Issue
Block a user