add image and artifact stores
This commit is contained in:
@@ -30,11 +30,11 @@ componentDidMount() {
|
||||
render() {
|
||||
const {api, name} = this.state;
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<BrowserRouter basename={'/ui'}>
|
||||
<React.Fragment key={1}>
|
||||
<section className="container-responsive">
|
||||
<Switch>
|
||||
<Route path="/" component={Paste} />
|
||||
<Route path={`/`} component={Paste} />
|
||||
</Switch>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -204,15 +204,15 @@ class Paste extends Component {
|
||||
const { plain } = this.state;
|
||||
const { history } = this.props;
|
||||
|
||||
this.encrypt(plain).then(([hash, decryptKey]) => { history.push('/paste/#/' + hash + '!' + decryptKey) });
|
||||
this.encrypt(plain).then(([hash, decryptKey]) => { history.push('/#/' + hash + '!' + decryptKey) });
|
||||
}
|
||||
onNew(event) {
|
||||
const { history } = this.props;
|
||||
this.setState({cipher:"", plain:"", hash: "", decryptKey: "", syntax: "text", expire: 604800, burn: false}, () => history.push('/paste'));
|
||||
this.setState({cipher:"", plain:"", hash: "", decryptKey: "", syntax: "text", expire: 604800, burn: false}, () => history.push('/'));
|
||||
}
|
||||
onCopy(event) {
|
||||
const { history } = this.props;
|
||||
this.setState({hash: "", decryptKey: ""}, () => history.push('/paste'))
|
||||
this.setState({hash: "", decryptKey: ""}, () => history.push('/'))
|
||||
}
|
||||
|
||||
decrypt(tx) {
|
||||
@@ -346,7 +346,7 @@ function PasteCreate({error, onSubmit, onChange, syntax, syntaxItems, expire, ex
|
||||
|
||||
<div className="card">
|
||||
<div className="card-body">
|
||||
<p>Create pastes from the command line! <a href='/paste.sh' download>paste.sh</a></p>
|
||||
<p>Create pastes from the command line! <a href={`${window.location.origin}/ui/paste.sh`} download>paste.sh</a></p>
|
||||
<pre>{`$ echo /etc/passwd | ./paste.sh
|
||||
|
||||
env options:
|
||||
@@ -370,7 +370,7 @@ function PasteView({hash, decryptKey, expires, burn, gzip, cipher, plain, syntax
|
||||
<span className="input-group-prepend">
|
||||
<button className="btn btn-default" type="button" onClick={onNew}>New</button>
|
||||
</span>
|
||||
<input type='text' readOnly className='form-control' value={`${window.location.origin}/paste/#/${hash}!${decryptKey}`} onClick={(e) => e.target.select()}/>
|
||||
<input type='text' readOnly className='form-control' value={`${window.location.origin}/ui/#/${hash}!${decryptKey}`} onClick={(e) => e.target.select()}/>
|
||||
<span className="input-group-append">
|
||||
<button className="btn btn-default" type="button" onClick={onCopy}>Copy</button>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user