| Server IP : 93.86.61.54 / Your IP : 216.73.216.60 Web Server : Apache/2.4.62 (Ubuntu) System : Linux rasin.ddns.net 6.8.0-124-generic #124~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 21:05:19 UTC x86_64 User : www-data ( 33) PHP Version : 8.4.22 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/projects/nextcloud/apps/logreader/js/Components/ |
Upload File : |
import {Component} from 'react';
import {TraceLine} from './TraceLine.js';
import style from './Exception.css';
export class Exception extends Component {
state = {
expanded: false
};
clickHandler = () => {
this.setState({
expanded: !this.state.expanded
});
};
render () {
const expanded = this.state.expanded || this.props.expanded;
return (
<span
className={[style.exceptionRow, (this.props.isPrevious ? style.previous : 'icon-caret-dark')].join(' ')}
onClick={this.clickHandler}>
<span className={style.exception}>
{this.props.isPrevious ? t('logreader', 'Caused by ') : ''}
{this.props.Exception}
</span>:
<span className={style.message}>{this.props.Message}</span>
<StackTrace trace={this.props.Trace}
expanded={expanded}/>
{expanded && this.props.Previous ? [
<Exception expanded={true} {...this.props.Previous}
isPrevious={true}/>
] : []}
</span>
);
}
}
function StackTrace ({trace, expanded}) {
if (expanded) {
return (
<ol className={style.trace} start="0">
{trace.map((trace, i) => {
return (
<TraceLine key={i} {...trace}/>
);
})}
</ol>
)
} else {
return [];
}
}