diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-07-30 15:33:29 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-07-30 15:33:29 +0200 |
commit | 4666e85de5c40e4cd7fa952a1d1c873a43dc60fb (patch) | |
tree | c53dad1ac7eea1641b79825d0d171bb027603b60 /src/stores/AppStore.js | |
parent | fix(Notifications): Fix issue that blocked notifications from e.g. Slack (diff) | |
download | ferdium-app-4666e85de5c40e4cd7fa952a1d1c873a43dc60fb.tar.gz ferdium-app-4666e85de5c40e4cd7fa952a1d1c873a43dc60fb.tar.zst ferdium-app-4666e85de5c40e4cd7fa952a1d1c873a43dc60fb.zip |
feat(App): Add option to copy debug information via the help menu
Diffstat (limited to 'src/stores/AppStore.js')
-rw-r--r-- | src/stores/AppStore.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index bca20a581..2ac306a2a 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -8,6 +8,9 @@ import AutoLaunch from 'auto-launch'; | |||
8 | import prettyBytes from 'pretty-bytes'; | 8 | import prettyBytes from 'pretty-bytes'; |
9 | import ms from 'ms'; | 9 | import ms from 'ms'; |
10 | import { URL } from 'url'; | 10 | import { URL } from 'url'; |
11 | import os from 'os'; | ||
12 | import path from 'path'; | ||
13 | import { readJsonSync } from 'fs-extra'; | ||
11 | 14 | ||
12 | import Store from './lib/Store'; | 15 | import Store from './lib/Store'; |
13 | import Request from './lib/Request'; | 16 | import Request from './lib/Request'; |
@@ -23,7 +26,7 @@ import { isValidExternalURL } from '../helpers/url-helpers'; | |||
23 | 26 | ||
24 | const debug = require('debug')('Franz:AppStore'); | 27 | const debug = require('debug')('Franz:AppStore'); |
25 | 28 | ||
26 | const { app, systemPreferences } = remote; | 29 | const { app, systemPreferences, screen } = remote; |
27 | 30 | ||
28 | const mainWindow = remote.getCurrentWindow(); | 31 | const mainWindow = remote.getCurrentWindow(); |
29 | 32 | ||
@@ -182,6 +185,26 @@ export default class AppStore extends Store { | |||
182 | return prettyBytes(this.getAppCacheSizeRequest.execute().result || 0); | 185 | return prettyBytes(this.getAppCacheSizeRequest.execute().result || 0); |
183 | } | 186 | } |
184 | 187 | ||
188 | @computed get debugInfo() { | ||
189 | return { | ||
190 | host: { | ||
191 | platform: process.platform, | ||
192 | release: os.release(), | ||
193 | screens: screen.getAllDisplays(), | ||
194 | }, | ||
195 | franz: { | ||
196 | version: app.getVersion(), | ||
197 | electron: process.versions.electron, | ||
198 | installedRecipes: this.stores.recipes.all.map(recipe => ({ id: recipe.id, version: recipe.version })), | ||
199 | devRecipes: this.stores.recipePreviews.dev.map(recipe => ({ id: recipe.id, version: recipe.version })), | ||
200 | services: this.stores.services.all.map(service => ({ id: service.id, recipe: service.recipe.id })), | ||
201 | workspaces: this.stores.workspaces.workspaces.map(workspace => ({ id: workspace.id, services: workspace.services })), | ||
202 | windowSettings: readJsonSync(path.join(app.getPath('userData'), 'window-state.json')), | ||
203 | user: this.stores.user.data.id, | ||
204 | }, | ||
205 | }; | ||
206 | } | ||
207 | |||
185 | // Actions | 208 | // Actions |
186 | @action _notify({ | 209 | @action _notify({ |
187 | title, options, notificationId, serviceId = null, | 210 | title, options, notificationId, serviceId = null, |