diff --git a/app/brave_generated_resources.grd b/app/brave_generated_resources.grd index 1488926b9604..85bc61442dd2 100644 --- a/app/brave_generated_resources.grd +++ b/app/brave_generated_resources.grd @@ -790,6 +790,15 @@ By installing this extension, you are agreeing to the Google Widevine Terms of U IPFS service launch error, more information is available on the <a target="_blank" rel="noopener noreferrer" style="text-decoration: underline;" href="chrome://ipfs-internals/">diagnostic page</a> + + '$1MyCustomKey' key import failed + + + Import + + + Generate + Start node diff --git a/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.html b/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.html index e1e1ba8aaa55..e8498e2c79e9 100644 --- a/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.html +++ b/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.html @@ -2,6 +2,9 @@
$i18n{ipfsAddKeyDialogTitle}
@@ -14,9 +17,12 @@
+ + $i18n{ipfsKeyImport} + - Submit + $i18n{ipfsKeyGenerate}
diff --git a/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.js b/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.js index 7b2bfd2b889e..fe38e8b27a9d 100644 --- a/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.js +++ b/browser/resources/settings/brave_ipfs_page/add_p2p_key_dialog.js @@ -65,7 +65,10 @@ Polymer({ this.isNameValid_ = value; this.isSubmitButtonEnabled_ = value; }, - + onImportKeyTap_: function(item) { + this.browserProxy_.importIpnsKey(this.$.key.value) + this.fire('close'); + }, handleSubmit_: function() { var name = this.$.key.value this.browserProxy_.addIpnsKey(name).then(json => { diff --git a/browser/resources/settings/brave_ipfs_page/brave_ipfs_browser_proxy.js b/browser/resources/settings/brave_ipfs_page/brave_ipfs_browser_proxy.js index b3b3031f9e6b..b8fc44c6b093 100644 --- a/browser/resources/settings/brave_ipfs_page/brave_ipfs_browser_proxy.js +++ b/browser/resources/settings/brave_ipfs_page/brave_ipfs_browser_proxy.js @@ -13,6 +13,7 @@ export class BraveIPFSBrowserProxy { getIPFSResolveMethodList () {} getIPFSEnabled () {} setIPFSStorageMax (value) {} + importIpnsKey () {} } /** @@ -27,6 +28,10 @@ export class BraveIPFSBrowserProxyImpl { chrome.send('setIPFSStorageMax', [value]) } + importIpnsKey (value) { + chrome.send('importIpnsKey', [value]) + } + launchIPFSService () { return new Promise(resolve => { if (!chrome.ipfs) { diff --git a/browser/resources/settings/brave_ipfs_page/p2p_keys_subpage.html b/browser/resources/settings/brave_ipfs_page/p2p_keys_subpage.html index c72ce82aab48..585ab2b7c3d5 100644 --- a/browser/resources/settings/brave_ipfs_page/p2p_keys_subpage.html +++ b/browser/resources/settings/brave_ipfs_page/p2p_keys_subpage.html @@ -55,13 +55,15 @@
$i18n{ipfsKeysListTitle} +
$i18n{add}
-