mirror of
https://github.com/yzernik/squeaknode.git
synced 2026-08-14 12:43:24 +02:00
Improve buttons in peer address page (#1823)
* Improve buttons in peer address page * Improve saved peer page * Update frontend build
This commit is contained in:
parent
66f5a70852
commit
fa45dc444c
9 changed files with 39 additions and 70 deletions
|
|
@ -15,7 +15,6 @@ import {
|
|||
import useStyles from './styles';
|
||||
|
||||
// components
|
||||
import PageTitle from '../../components/PageTitle';
|
||||
import DeletePeerDialog from '../../components/DeletePeerDialog';
|
||||
|
||||
import {
|
||||
|
|
@ -168,11 +167,9 @@ export default function PeerPage() {
|
|||
console.log(peer.getPeerAddress());
|
||||
console.log(peer.getPeerAddress().getNetwork());
|
||||
const peerAddressStr = peerAddressToStr(peer.getPeerAddress());
|
||||
const network = peer.getPeerAddress().getNetwork();
|
||||
return (
|
||||
<>
|
||||
<div className={classes.root}>
|
||||
Peer Address:
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
|
|
@ -187,11 +184,6 @@ export default function PeerPage() {
|
|||
{peerAddressStr}
|
||||
</Button>
|
||||
</div>
|
||||
<div className={classes.root}>
|
||||
Network:
|
||||
{' '}
|
||||
{network}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -207,7 +199,6 @@ export default function PeerPage() {
|
|||
{!waitingForPeer
|
||||
? (
|
||||
<>
|
||||
<PageTitle title={`Peer: ${peer ? peer.getPeerName() : null}`} />
|
||||
{PeerContent()}
|
||||
</>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import CardHeader from '@material-ui/core/CardHeader';
|
|||
|
||||
// components
|
||||
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import ComputerIcon from '@material-ui/icons/Computer';
|
||||
import CloudOff from '@material-ui/icons/CloudOff';
|
||||
|
||||
|
|
@ -111,39 +110,31 @@ export default function PeerAddressPage() {
|
|||
|
||||
function DisconnectPeerButton() {
|
||||
return (
|
||||
<>
|
||||
<Grid item xs={12}>
|
||||
<div className={classes.root}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
disconnectPeer();
|
||||
}}
|
||||
>
|
||||
Disconnect Peer
|
||||
</Button>
|
||||
</div>
|
||||
</Grid>
|
||||
</>
|
||||
<Box p={1}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
disconnectPeer();
|
||||
}}
|
||||
>
|
||||
Disconnect Peer
|
||||
</Button>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
function ConnectPeerButton() {
|
||||
return (
|
||||
<>
|
||||
<Grid item xs={12}>
|
||||
<div className={classes.root}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
connectPeer();
|
||||
}}
|
||||
>
|
||||
Connect Peer
|
||||
</Button>
|
||||
</div>
|
||||
</Grid>
|
||||
</>
|
||||
<Box p={1}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
connectPeer();
|
||||
}}
|
||||
>
|
||||
Connect Peer
|
||||
</Button>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -159,16 +150,6 @@ export default function PeerAddressPage() {
|
|||
);
|
||||
}
|
||||
|
||||
function AddressContent() {
|
||||
return (
|
||||
<>
|
||||
<Typography variant="h2" component="h2">
|
||||
{`Peer Address: ${host}:${port}`}
|
||||
</Typography>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
function ConnectedPeerDetails() {
|
||||
const connectTimeS = connectedPeer.getConnectTimeS();
|
||||
const momentTimeString = moment(connectTimeS * 1000).fromNow();
|
||||
|
|
@ -273,8 +254,7 @@ export default function PeerAddressPage() {
|
|||
|
||||
function NoPeerContent() {
|
||||
return (
|
||||
<div>
|
||||
No saved peer for this address.
|
||||
<Box p={1}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
|
|
@ -283,14 +263,13 @@ export default function PeerAddressPage() {
|
|||
>
|
||||
Save Peer
|
||||
</Button>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
function PeerContent() {
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
Saved Peer:
|
||||
<Box p={1}>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={() => {
|
||||
|
|
@ -299,7 +278,7 @@ export default function PeerAddressPage() {
|
|||
>
|
||||
{savedPeer.getPeerName()}
|
||||
</Button>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -322,7 +301,6 @@ export default function PeerAddressPage() {
|
|||
{!waitingForSavedPeer
|
||||
? (
|
||||
<>
|
||||
{AddressContent()}
|
||||
{SavedPeerContent()}
|
||||
{ConnectionContent()}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
{
|
||||
"files": {
|
||||
"main.js": "/static/js/main.a04603b3.chunk.js",
|
||||
"main.js.map": "/static/js/main.a04603b3.chunk.js.map",
|
||||
"main.js": "/static/js/main.a7d10c80.chunk.js",
|
||||
"main.js.map": "/static/js/main.a7d10c80.chunk.js.map",
|
||||
"runtime-main.js": "/static/js/runtime-main.48a1d1b9.js",
|
||||
"runtime-main.js.map": "/static/js/runtime-main.48a1d1b9.js.map",
|
||||
"static/css/2.f68b60d4.chunk.css": "/static/css/2.f68b60d4.chunk.css",
|
||||
"static/js/2.c9ba1d5d.chunk.js": "/static/js/2.c9ba1d5d.chunk.js",
|
||||
"static/js/2.c9ba1d5d.chunk.js.map": "/static/js/2.c9ba1d5d.chunk.js.map",
|
||||
"static/js/2.4b78e418.chunk.js": "/static/js/2.4b78e418.chunk.js",
|
||||
"static/js/2.4b78e418.chunk.js.map": "/static/js/2.4b78e418.chunk.js.map",
|
||||
"index.html": "/index.html",
|
||||
"static/css/2.f68b60d4.chunk.css.map": "/static/css/2.f68b60d4.chunk.css.map",
|
||||
"static/js/2.c9ba1d5d.chunk.js.LICENSE.txt": "/static/js/2.c9ba1d5d.chunk.js.LICENSE.txt",
|
||||
"static/js/2.4b78e418.chunk.js.LICENSE.txt": "/static/js/2.4b78e418.chunk.js.LICENSE.txt",
|
||||
"static/media/font-awesome.min.css": "/static/media/fontawesome-webfont.f691f37e.woff",
|
||||
"static/media/google.a4fa9b6f.svg": "/static/media/google.a4fa9b6f.svg",
|
||||
"static/media/logo.31df0ce8.svg": "/static/media/logo.31df0ce8.svg"
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
"entrypoints": [
|
||||
"static/js/runtime-main.48a1d1b9.js",
|
||||
"static/css/2.f68b60d4.chunk.css",
|
||||
"static/js/2.c9ba1d5d.chunk.js",
|
||||
"static/js/main.a04603b3.chunk.js"
|
||||
"static/js/2.4b78e418.chunk.js",
|
||||
"static/js/main.a7d10c80.chunk.js"
|
||||
]
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Squeaknode</title><meta name="description" content="Squeaknode is a frontend for accessing a squeak node"><meta name="keywords" content="squeak, bitcoin, lightning"><meta name="author" content="Flatlogic LLC."><link href="/static/css/2.f68b60d4.chunk.css" rel="stylesheet"></head><body style="font-family:Roboto,sans-serif"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,f,l=r[0],a=r[1],i=r[2],c=0,s=[];c<l.length;c++)f=l[c],Object.prototype.hasOwnProperty.call(o,f)&&o[f]&&s.push(o[f][0]),o[f]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var a=t[l];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},o={1:0},u=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var l=this["webpackJsonpsqueak-node-frontend"]=this["webpackJsonpsqueak-node-frontend"]||[],a=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var p=a;t()}([])</script><script src="/static/js/2.c9ba1d5d.chunk.js"></script><script src="/static/js/main.a04603b3.chunk.js"></script></body></html>
|
||||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><title>Squeaknode</title><meta name="description" content="Squeaknode is a frontend for accessing a squeak node"><meta name="keywords" content="squeak, bitcoin, lightning"><meta name="author" content="Flatlogic LLC."><link href="/static/css/2.f68b60d4.chunk.css" rel="stylesheet"></head><body style="font-family:Roboto,sans-serif"><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,f,l=r[0],a=r[1],i=r[2],c=0,s=[];c<l.length;c++)f=l[c],Object.prototype.hasOwnProperty.call(o,f)&&o[f]&&s.push(o[f][0]),o[f]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(p&&p(r);s.length;)s.shift()();return u.push.apply(u,i||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var a=t[l];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},o={1:0},u=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var l=this["webpackJsonpsqueak-node-frontend"]=this["webpackJsonpsqueak-node-frontend"]||[],a=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var p=a;t()}([])</script><script src="/static/js/2.4b78e418.chunk.js"></script><script src="/static/js/main.a7d10c80.chunk.js"></script></body></html>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue