From 551f67bdaa58ece055011162b1dc90109d1e86b5 Mon Sep 17 00:00:00 2001 From: Jeremy Kauffman Date: Mon, 24 Jul 2017 18:15:51 -0400 Subject: [PATCH] remove bandwidth settings --- CHANGELOG.md | 4 +- ui/js/page/settings/view.jsx | 231 ++++++++++++++++++----------------- 2 files changed, 119 insertions(+), 116 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 477ed8013..702c75b47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,8 +40,8 @@ Web UI version numbers should always match the corresponding version of LBRY App * ### Removed - * - * + * Removed bandwidth caps from settings, because the daemon was not respecting them anyway. + * ## [0.13.0] - 2017-06-30 diff --git a/ui/js/page/settings/view.jsx b/ui/js/page/settings/view.jsx index 7704a37e1..107dfe836 100644 --- a/ui/js/page/settings/view.jsx +++ b/ui/js/page/settings/view.jsx @@ -13,8 +13,8 @@ class SettingsPage extends React.PureComponent { const { daemonSettings } = this.props; this.state = { - isMaxUpload: daemonSettings && daemonSettings.max_upload != 0, - isMaxDownload: daemonSettings && daemonSettings.max_download != 0, + // isMaxUpload: daemonSettings && daemonSettings.max_upload != 0, + // isMaxDownload: daemonSettings && daemonSettings.max_download != 0, showUnavailable: lbry.getClientSetting("showUnavailable"), language: lbry.getClientSetting("language"), clearingCache: false, @@ -55,31 +55,31 @@ class SettingsPage extends React.PureComponent { this.setDaemonSetting("download_directory", event.target.value); } - onMaxUploadPrefChange(isLimited) { - if (!isLimited) { - this.setDaemonSetting("max_upload", 0.0); - } - this.setState({ - isMaxUpload: isLimited, - }); - } - - onMaxUploadFieldChange(event) { - this.setDaemonSetting("max_upload", Number(event.target.value)); - } - - onMaxDownloadPrefChange(isLimited) { - if (!isLimited) { - this.setDaemonSetting("max_download", 0.0); - } - this.setState({ - isMaxDownload: isLimited, - }); - } - - onMaxDownloadFieldChange(event) { - this.setDaemonSetting("max_download", Number(event.target.value)); - } + // onMaxUploadPrefChange(isLimited) { + // if (!isLimited) { + // this.setDaemonSetting("max_upload", 0.0); + // } + // this.setState({ + // isMaxUpload: isLimited, + // }); + // } + // + // onMaxUploadFieldChange(event) { + // this.setDaemonSetting("max_upload", Number(event.target.value)); + // } + // + // onMaxDownloadPrefChange(isLimited) { + // if (!isLimited) { + // this.setDaemonSetting("max_download", 0.0); + // } + // this.setState({ + // isMaxDownload: isLimited, + // }); + // } + // + // onMaxDownloadFieldChange(event) { + // this.setDaemonSetting("max_download", Number(event.target.value)); + // } onShowNsfwChange(event) { this.props.setClientSetting("showNsfw", event.target.checked); @@ -148,6 +148,96 @@ class SettingsPage extends React.PureComponent { */ + + /* +
+
+

{__("Bandwidth Limits")}

+
+
+
+
{__("Max Upload")}
+
+ { + this.onMaxUploadPrefChange(false); + }} + defaultChecked={!this.state.isMaxUpload} + label={__("Unlimited")} + /> +
+ { + this.onMaxUploadPrefChange(true); + }} + defaultChecked={this.state.isMaxUpload} + label={ + this.state.isMaxUpload ? __("Up to") : __("Choose limit...") + } + /> + {this.state.isMaxUpload + ? + : ""} + {this.state.isMaxUpload + ? MB/s + : ""} +
+
+
+
+
{__("Max Download")}
+
+ { + this.onMaxDownloadPrefChange(false); + }} + defaultChecked={!this.state.isMaxDownload} + /> +
+ { + this.onMaxDownloadPrefChange(true); + }} + defaultChecked={this.state.isMaxDownload} + label={ + this.state.isMaxDownload ? __("Up to") : __("Choose limit...") + } + /> + {this.state.isMaxDownload + ? + : ""} + {this.state.isMaxDownload + ? MB/s + : ""} +
+
+
+ */ return (
@@ -165,93 +255,6 @@ class SettingsPage extends React.PureComponent { /> -
-
-

{__("Bandwidth Limits")}

-
-
-
-
{__("Max Upload")}
-
- { - this.onMaxUploadPrefChange(false); - }} - defaultChecked={!this.state.isMaxUpload} - label={__("Unlimited")} - /> -
- { - this.onMaxUploadPrefChange(true); - }} - defaultChecked={this.state.isMaxUpload} - label={ - this.state.isMaxUpload ? __("Up to") : __("Choose limit...") - } - /> - {this.state.isMaxUpload - ? - : ""} - {this.state.isMaxUpload - ? MB/s - : ""} -
-
-
-
-
{__("Max Download")}
-
- { - this.onMaxDownloadPrefChange(false); - }} - defaultChecked={!this.state.isMaxDownload} - /> -
- { - this.onMaxDownloadPrefChange(true); - }} - defaultChecked={this.state.isMaxDownload} - label={ - this.state.isMaxDownload ? __("Up to") : __("Choose limit...") - } - /> - {this.state.isMaxDownload - ? - : ""} - {this.state.isMaxDownload - ? MB/s - : ""} -
-
-

{__("Content")}