Share Flipper file
Reviewed By: jknoxville Differential Revision: D14340965 fbshipit-source-id: 9145ae8d409e9d4f8becfd1a19a8a9b3739af3fb
This commit is contained in:
committed by
Facebook Github Bot
parent
c0a30380dc
commit
b304126af3
@@ -8,6 +8,7 @@
|
|||||||
import type {FlipperPlugin, FlipperDevicePlugin} from './plugin.js';
|
import type {FlipperPlugin, FlipperDevicePlugin} from './plugin.js';
|
||||||
import {
|
import {
|
||||||
exportStoreToFile,
|
exportStoreToFile,
|
||||||
|
exportStore,
|
||||||
importFileToStore,
|
importFileToStore,
|
||||||
IMPORT_FLIPPER_TRACE_EVENT,
|
IMPORT_FLIPPER_TRACE_EVENT,
|
||||||
EXPORT_FLIPPER_TRACE_EVENT,
|
EXPORT_FLIPPER_TRACE_EVENT,
|
||||||
@@ -19,6 +20,7 @@ import {remote} from 'electron';
|
|||||||
const {dialog} = remote;
|
const {dialog} = remote;
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import {shareFlipperData} from './fb-stubs/user';
|
||||||
import {
|
import {
|
||||||
reportPlatformFailures,
|
reportPlatformFailures,
|
||||||
tryCatchReportPlatformFailures,
|
tryCatchReportPlatformFailures,
|
||||||
@@ -326,27 +328,8 @@ function getTemplate(
|
|||||||
label: 'File',
|
label: 'File',
|
||||||
submenu: [
|
submenu: [
|
||||||
{
|
{
|
||||||
label: 'Export Data...',
|
label: 'Open File...',
|
||||||
role: 'export',
|
accelerator: 'CommandOrControl+O',
|
||||||
click: function(item: Object, focusedWindow: Object) {
|
|
||||||
dialog.showSaveDialog(
|
|
||||||
null,
|
|
||||||
{
|
|
||||||
title: 'FlipperExport',
|
|
||||||
defaultPath: path.join(os.homedir(), 'FlipperExport.flipper'),
|
|
||||||
},
|
|
||||||
file => {
|
|
||||||
reportPlatformFailures(
|
|
||||||
exportStoreToFile(file, store),
|
|
||||||
`${EXPORT_FLIPPER_TRACE_EVENT}:UI`,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Import Data...',
|
|
||||||
role: 'import',
|
|
||||||
click: function(item: Object, focusedWindow: Object) {
|
click: function(item: Object, focusedWindow: Object) {
|
||||||
dialog.showOpenDialog(
|
dialog.showOpenDialog(
|
||||||
{
|
{
|
||||||
@@ -362,6 +345,40 @@ function getTemplate(
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Export',
|
||||||
|
submenu: [
|
||||||
|
{
|
||||||
|
label: 'File...',
|
||||||
|
accelerator: 'CommandOrControl+E',
|
||||||
|
click: function(item: Object, focusedWindow: Object) {
|
||||||
|
dialog.showSaveDialog(
|
||||||
|
null,
|
||||||
|
{
|
||||||
|
title: 'FlipperExport',
|
||||||
|
defaultPath: path.join(
|
||||||
|
os.homedir(),
|
||||||
|
'FlipperExport.flipper',
|
||||||
|
),
|
||||||
|
},
|
||||||
|
file => {
|
||||||
|
reportPlatformFailures(
|
||||||
|
exportStoreToFile(file, store),
|
||||||
|
`${EXPORT_FLIPPER_TRACE_EVENT}:UI`,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Sharable Link',
|
||||||
|
accelerator: 'CommandOrControl+Shift+E',
|
||||||
|
click: async function(item: Object, focusedWindow: Object) {
|
||||||
|
shareFlipperData(await exportStore(store));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,3 +16,8 @@ export async function graphQLQuery(query: string) {
|
|||||||
export function logoutUser(): Promise<void> {
|
export function logoutUser(): Promise<void> {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function shareFlipperData(trace: string) {
|
||||||
|
new window.Notification('Feature not implemented');
|
||||||
|
return Promise.reject();
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user