#1556 Adding ability to open log file and log folder from help page
This commit is contained in:
parent
c6684054d5
commit
d46c60da86
2 changed files with 38 additions and 4 deletions
|
@ -1,12 +1,14 @@
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { doAuthNavigate } from 'redux/actions/navigation';
|
import { doAuthNavigate } from 'redux/actions/navigation';
|
||||||
import { doFetchAccessToken } from 'redux/actions/user';
|
import { doFetchAccessToken } from 'redux/actions/user';
|
||||||
|
import { selectDaemonSettings } from 'redux/selectors/settings';
|
||||||
import { selectAccessToken, selectUser } from 'redux/selectors/user';
|
import { selectAccessToken, selectUser } from 'redux/selectors/user';
|
||||||
import HelpPage from './view';
|
import HelpPage from './view';
|
||||||
|
|
||||||
const select = state => ({
|
const select = state => ({
|
||||||
user: selectUser(state),
|
user: selectUser(state),
|
||||||
accessToken: selectAccessToken(state),
|
accessToken: selectAccessToken(state),
|
||||||
|
deamonSettings: selectDaemonSettings(state),
|
||||||
});
|
});
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
|
@ -14,4 +16,7 @@ const perform = dispatch => ({
|
||||||
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(select, perform)(HelpPage);
|
export default connect(
|
||||||
|
select,
|
||||||
|
perform
|
||||||
|
)(HelpPage);
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
// @TODO: Customize advice based on OS
|
// @TODO: Customize advice based on OS
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { shell } from 'electron';
|
||||||
import { Lbry } from 'lbry-redux';
|
import { Lbry } from 'lbry-redux';
|
||||||
import Native from 'native';
|
import Native from 'native';
|
||||||
import Button from 'component/button';
|
import Button from 'component/button';
|
||||||
import BusyIndicator from 'component/common/busy-indicator';
|
import BusyIndicator from 'component/common/busy-indicator';
|
||||||
import Icon from 'component/common/icon';
|
|
||||||
import Page from 'component/page';
|
import Page from 'component/page';
|
||||||
import * as icons from 'constants/icons';
|
import * as icons from 'constants/icons';
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
deamonSettings: {
|
||||||
|
data_dir: ?string,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
class HelpPage extends React.PureComponent {
|
class HelpPage extends React.PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -56,7 +62,8 @@ class HelpPage extends React.PureComponent {
|
||||||
let platform;
|
let platform;
|
||||||
let newVerLink;
|
let newVerLink;
|
||||||
|
|
||||||
const { accessToken, doAuth, user } = this.props;
|
const { accessToken, doAuth, user, deamonSettings } = this.props;
|
||||||
|
const { data_dir: dataDirectory } = deamonSettings;
|
||||||
|
|
||||||
if (this.state.versionInfo) {
|
if (this.state.versionInfo) {
|
||||||
ver = this.state.versionInfo;
|
ver = this.state.versionInfo;
|
||||||
|
@ -108,12 +115,34 @@ class HelpPage extends React.PureComponent {
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<section className="card card--section">
|
||||||
|
<div className="card__title">{__('View your Log')}</div>
|
||||||
|
<p className="card__subtitle">
|
||||||
|
{__(
|
||||||
|
'Do you find something wrong? Have a look in your log, or send your log to support for some help.'
|
||||||
|
)}
|
||||||
|
</p>
|
||||||
|
<div className="card__actions">
|
||||||
|
<Button
|
||||||
|
button="primary"
|
||||||
|
label={__('Open Log')}
|
||||||
|
icon={icons.REPORT}
|
||||||
|
onClick={() => shell.openItem(`${dataDirectory}/lbrynet.log`)}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
button="primary"
|
||||||
|
label={__('Open Log Folder')}
|
||||||
|
icon={icons.REPORT}
|
||||||
|
onClick={() => shell.showItemInFolder(dataDirectory)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section className="card card--section">
|
<section className="card card--section">
|
||||||
<div className="card__title">{__('Report a Bug or Suggest a New Feature')}</div>
|
<div className="card__title">{__('Report a Bug or Suggest a New Feature')}</div>
|
||||||
<p className="card__subtitle">
|
<p className="card__subtitle">
|
||||||
{__('Did you find something wrong? Think LBRY could add something useful and cool?')}
|
{__('Did you find something wrong? Think LBRY could add something useful and cool?')}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="card__actions">
|
<div className="card__actions">
|
||||||
<Button
|
<Button
|
||||||
navigate="/report"
|
navigate="/report"
|
||||||
|
|
Loading…
Reference in a new issue