@ -1,5 +1,6 @@
/* eslint-disable no-unused-vars */
/* eslint-disable no-unused-vars */
import React , { useRef , useState , useEffect } from 'react' // eslint-disable-line
import React , { useRef , useState , useEffect } from 'react' // eslint-disable-line
import { FormattedMessage } from 'react-intl'
import { WebsocketPlugin } from '@remixproject/engine-web'
import { WebsocketPlugin } from '@remixproject/engine-web'
import * as packageJson from '../../../../../package.json'
import * as packageJson from '../../../../../package.json'
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
@ -84,7 +85,7 @@ export class RemixdHandle extends WebsocketPlugin {
console . log ( error )
console . log ( error )
const alert : AlertModal = {
const alert : AlertModal = {
id : 'connectionAlert' ,
id : 'connectionAlert' ,
message : 'Cannot connect to the remixd daemon. Please make sure you have the remixd running in the background.'
message : window._intl.formatMessage ( { id : 'remixd.connectionAlert1' } ) ,
}
}
this . call ( 'notification' , 'alert' , alert )
this . call ( 'notification' , 'alert' , alert )
this . canceled ( )
this . canceled ( )
@ -95,7 +96,7 @@ export class RemixdHandle extends WebsocketPlugin {
clearInterval ( intervalId )
clearInterval ( intervalId )
const alert : AlertModal = {
const alert : AlertModal = {
id : 'connectionAlert' ,
id : 'connectionAlert' ,
message : 'Connection to remixd terminated. Please make sure remixd is still running in the background.'
message : window._intl.formatMessage ( { id : 'remixd.connectionAlert2' } ) ,
}
}
this . call ( 'notification' , 'alert' , alert )
this . call ( 'notification' , 'alert' , alert )
this . canceled ( )
this . canceled ( )
@ -115,10 +116,10 @@ export class RemixdHandle extends WebsocketPlugin {
// warn the user only if he/she is in the browser context
// warn the user only if he/she is in the browser context
const mod : AppModal = {
const mod : AppModal = {
id : 'remixdConnect' ,
id : 'remixdConnect' ,
title : 'Access file system using remixd' ,
title : window._intl.formatMessage ( { id : 'remixd.remixdConnect' } ) ,
message : remixdDialog ( ) ,
message : remixdDialog ( ) ,
okLabel : 'Connect' ,
okLabel : window._intl.formatMessage ( { id : 'remixd.connect' } ) ,
cancelLabel : 'Cancel'
cancelLabel : window._intl.formatMessage ( { id : 'remixd.cancel' } ) ,
}
}
const result = await this . call ( 'notification' , 'modal' , mod )
const result = await this . call ( 'notification' , 'modal' , mod )
if ( result ) {
if ( result ) {
@ -159,45 +160,62 @@ function remixdDialog() {
< >
< >
< div className = "" >
< div className = "" >
< div className = "mb-2 text-break" >
< div className = "mb-2 text-break" >
Access your local file system from Remix IDE using { ' ' }
< FormattedMessage
< a target = "_blank" href = "https://www.npmjs.com/package/@remix-project/remixd" >
id = "remixd.text1"
Remixd NPM package
values = { {
< / a >
a : ( chunks ) = > (
.
< a target = "_blank" href = "https://www.npmjs.com/package/@remix-project/remixd" >
{ chunks }
< / a >
) ,
} }
/ >
< / div >
< / div >
< div className = "mb-2 text-break" >
< div className = "mb-2 text-break" >
Remixd { ' ' }
< FormattedMessage
< a target = "_blank" href = "https://remix-ide.readthedocs.io/en/latest/remixd.html" >
id = "remixd.text2"
documentation
values = { {
< / a >
a : ( chunks ) = > (
.
< a target = "_blank" href = "https://remix-ide.readthedocs.io/en/latest/remixd.html" >
{ chunks }
< / a >
) ,
} }
/ >
< / div >
< / div >
< div className = "mb-2 text-break" >
< div className = "mb-2 text-break" >
The remixd command is :
< FormattedMessage id = "remixd.text3" / >
< br / >
< br / >
< b > { commandText } < / b >
< b > { commandText } < / b >
< / div >
< / div >
< div className = "mb-2 text-break" >
< div className = "mb-2 text-break" >
The remixd command without options uses the terminal ' s current directory as the shared directory and the shared Remix domain can only be https : //remix.ethereum.org,
< FormattedMessage id = "remixd.text4" / >
https : //remix-alpha.ethereum.org, or https://remix-beta.ethereum.org
< / div >
< / div >
< div className = "mb-2 text-break" >
< div className = "mb-2 text-break" >
Example command with flags : < br / >
< FormattedMessage id = "remixd.text5" / > < br / >
< b > { fullCommandText } < / b >
< b > { fullCommandText } < / b >
< / div >
< / div >
< div className = "mb-2 text-break" >
< div className = "mb-2 text-break" >
For info about ports , see { ' ' }
< FormattedMessage
< a target = "_blank" href = "https://remix-ide.readthedocs.io/en/latest/remixd.html#ports-usage" >
id = "remixd.text6"
Remixd ports usage
values = { {
< / a >
a : ( chunks ) = > (
< a target = "_blank" href = "https://remix-ide.readthedocs.io/en/latest/remixd.html#ports-usage" >
{ chunks }
< / a >
) ,
} }
/ >
< / div >
< div className = "mb-2 text-break" >
< FormattedMessage id = "remixd.text7" / >
< / div >
< / div >
< div className = "mb-2 text-break" > This feature is still in Alpha . We recommend to keep a backup of the shared folder . < / div >
< div className = "mb-2 text-break" >
< div className = "mb-2 text-break" >
< h6 className = "text-danger" >
< h6 className = "text-danger" >
Before using , make sure remixd version is latest i . e . < b > v { remixdVersion } < / b >
< FormattedMessage id = "remixd.text8" / > < b > v { remixdVersion } < / b >
< br > < / br >
< br > < / br >
< a target = "_blank" href = "https://remix-ide.readthedocs.io/en/latest/remixd.html#update-to-the-latest-remixd" >
< a target = "_blank" href = "https://remix-ide.readthedocs.io/en/latest/remixd.html#update-to-the-latest-remixd" >
Read here how to update it
< FormattedMessage id = "remixd.text9" / >
< / a >
< / a >
< / h6 >
< / h6 >
< / div >
< / div >