drop developer page
This commit is contained in:
parent
767630a985
commit
80f1cac4e5
5 changed files with 1 additions and 83 deletions
|
@ -8,7 +8,6 @@ import SendCreditsPage from "page/sendCredits";
|
||||||
import ShowPage from "page/show";
|
import ShowPage from "page/show";
|
||||||
import PublishPage from "page/publish";
|
import PublishPage from "page/publish";
|
||||||
import DiscoverPage from "page/discover";
|
import DiscoverPage from "page/discover";
|
||||||
import DeveloperPage from "page/developer.js";
|
|
||||||
import RewardsPage from "page/rewards";
|
import RewardsPage from "page/rewards";
|
||||||
import FileListDownloaded from "page/fileListDownloaded";
|
import FileListDownloaded from "page/fileListDownloaded";
|
||||||
import FileListPublished from "page/fileListPublished";
|
import FileListPublished from "page/fileListPublished";
|
||||||
|
@ -32,7 +31,6 @@ const Router = props => {
|
||||||
auth: <AuthPage params={params} />,
|
auth: <AuthPage params={params} />,
|
||||||
backup: <BackupPage params={params} />,
|
backup: <BackupPage params={params} />,
|
||||||
channel: <ChannelPage params={params} />,
|
channel: <ChannelPage params={params} />,
|
||||||
developer: <DeveloperPage params={params} />,
|
|
||||||
discover: <DiscoverPage params={params} />,
|
discover: <DiscoverPage params={params} />,
|
||||||
downloaded: <FileListDownloaded params={params} />,
|
downloaded: <FileListDownloaded params={params} />,
|
||||||
help: <HelpPage params={params} />,
|
help: <HelpPage params={params} />,
|
||||||
|
|
|
@ -1,75 +0,0 @@
|
||||||
import lbry from "../lbry.js";
|
|
||||||
import React from "react";
|
|
||||||
import FormField from "component/formField";
|
|
||||||
import Link from "../component/link";
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const { ipcRenderer } = require("electron");
|
|
||||||
|
|
||||||
class DeveloperPage extends React.PureComponent {
|
|
||||||
constructor(props) {
|
|
||||||
super(props);
|
|
||||||
|
|
||||||
this.state = {
|
|
||||||
upgradePath: "",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
handleUpgradeFileChange(event) {
|
|
||||||
this.setState({
|
|
||||||
upgradePath: event.target.value,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
handleForceUpgradeClick() {
|
|
||||||
let upgradeSent = false;
|
|
||||||
if (!this.state.upgradePath) {
|
|
||||||
alert(__("Please select a file to upgrade from"));
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
const stats = fs.lstatSync(this.state.upgradePath);
|
|
||||||
if (stats.isFile()) {
|
|
||||||
console.log("Starting upgrade using " + this.state.upgradePath);
|
|
||||||
ipcRenderer.send("upgrade", this.state.upgradePath);
|
|
||||||
upgradeSent = true;
|
|
||||||
}
|
|
||||||
} catch (e) {}
|
|
||||||
if (!upgradeSent) {
|
|
||||||
alert(
|
|
||||||
'Failed to start upgrade. Is "' +
|
|
||||||
this.state.upgradePath +
|
|
||||||
'" a valid path to the upgrade?'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<main>
|
|
||||||
<section className="card">
|
|
||||||
<div className="form-row">
|
|
||||||
<FormField
|
|
||||||
name="file"
|
|
||||||
ref="file"
|
|
||||||
type="file"
|
|
||||||
onChange={event => {
|
|
||||||
this.handleUpgradeFileChange();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Link
|
|
||||||
label={__("Force Upgrade")}
|
|
||||||
button="alt"
|
|
||||||
onClick={event => {
|
|
||||||
this.handleForceUpgradeClick();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default DeveloperPage;
|
|
|
@ -46,6 +46,7 @@ reducers[types.CLIENT_SETTING_CHANGED] = function(state, action) {
|
||||||
|
|
||||||
clientSettings[key] = value;
|
clientSettings[key] = value;
|
||||||
|
|
||||||
|
//this technically probably shouldn't happen here, and should be fixed when we're no longer using localStorage at all for persistent app state
|
||||||
localStorage.setItem("setting_" + key, JSON.stringify(value));
|
localStorage.setItem("setting_" + key, JSON.stringify(value));
|
||||||
|
|
||||||
return Object.assign({}, state, {
|
return Object.assign({}, state, {
|
||||||
|
|
|
@ -21,5 +21,4 @@
|
||||||
@import "component/_video.scss";
|
@import "component/_video.scss";
|
||||||
@import "component/_pagination.scss";
|
@import "component/_pagination.scss";
|
||||||
@import "component/_markdown-editor.scss";
|
@import "component/_markdown-editor.scss";
|
||||||
@import "page/_developer.scss";
|
|
||||||
@import "page/_show.scss";
|
@import "page/_show.scss";
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
.developer-page__custom-lighthouse-servers {
|
|
||||||
font: 0.8em monospace;
|
|
||||||
width: 30em;
|
|
||||||
height: 10em;
|
|
||||||
}
|
|
Loading…
Reference in a new issue