|
|
@ -6,32 +6,38 @@ import { RemixUiCompileDetails } from '@remix-ui/solidity-compile-details' |
|
|
|
|
|
|
|
|
|
|
|
const _paq = (window._paq = window._paq || []) |
|
|
|
const _paq = (window._paq = window._paq || []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type CompileDetailsPayload = { |
|
|
|
|
|
|
|
contractProperties: any, |
|
|
|
|
|
|
|
selectedContract: string, |
|
|
|
|
|
|
|
help: any, |
|
|
|
|
|
|
|
insertValue: any, |
|
|
|
|
|
|
|
saveAs: any, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
interface ICompilationDetailsPlugin extends ViewPlugin { |
|
|
|
|
|
|
|
showDetails: (payload: any) => void |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const profile = { |
|
|
|
const profile = { |
|
|
|
name: 'compilationDetails', |
|
|
|
name: 'compilationDetails', |
|
|
|
displayName: 'Solidity Compile Details', |
|
|
|
displayName: 'Solidity Compile Details', |
|
|
|
description: 'Displays details from solidity compiler', |
|
|
|
description: 'Displays details from solidity compiler', |
|
|
|
location: 'mainPanel', |
|
|
|
location: 'mainPanel', |
|
|
|
methods: ['showDetails'], |
|
|
|
methods: ['showDetails', 'getTabHeadDetails'], |
|
|
|
events: [] |
|
|
|
events: [] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export class CompilationDetailsPlugin extends ViewPlugin { |
|
|
|
export class CompilationDetailsPlugin extends ViewPlugin implements ICompilationDetailsPlugin { |
|
|
|
dispatch: React.Dispatch<any> = () => {} |
|
|
|
dispatch: React.Dispatch<any> = () => {} |
|
|
|
appManager: RemixAppManager |
|
|
|
appManager: RemixAppManager |
|
|
|
element: HTMLDivElement |
|
|
|
element: HTMLDivElement |
|
|
|
payload: any |
|
|
|
payload: CompileDetailsPayload |
|
|
|
constructor(appManager: RemixAppManager) { |
|
|
|
constructor(appManager: RemixAppManager) { |
|
|
|
super(profile) |
|
|
|
super(profile) |
|
|
|
this.appManager = appManager |
|
|
|
this.appManager = appManager |
|
|
|
this.element = document.createElement('div') |
|
|
|
this.element = document.createElement('div') |
|
|
|
this.element.setAttribute('id', 'compileDetails') |
|
|
|
this.element.setAttribute('id', 'compileDetails') |
|
|
|
this.payload = { |
|
|
|
this.payload |
|
|
|
contractProperties: {} as any, |
|
|
|
|
|
|
|
selectedContract: '', |
|
|
|
|
|
|
|
help: {} as any, |
|
|
|
|
|
|
|
insertValue: {} as any, |
|
|
|
|
|
|
|
saveAs: {} as any, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async onActivation() { |
|
|
|
async onActivation() { |
|
|
@ -44,8 +50,7 @@ export class CompilationDetailsPlugin extends ViewPlugin { |
|
|
|
|
|
|
|
|
|
|
|
async showDetails(sentPayload: any) { |
|
|
|
async showDetails(sentPayload: any) { |
|
|
|
await this.call('tabs', 'focus', 'compilationDetails') |
|
|
|
await this.call('tabs', 'focus', 'compilationDetails') |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(async () => { |
|
|
|
// TODO: use the react API to render when the tab is focused and the plugin in the view.
|
|
|
|
|
|
|
|
this.payload = sentPayload |
|
|
|
this.payload = sentPayload |
|
|
|
this.renderComponent() |
|
|
|
this.renderComponent() |
|
|
|
}, 2000) |
|
|
|
}, 2000) |
|
|
|