Skip to content

Commit

Permalink
add all share/access overview data (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Oct 4, 2024
1 parent 99a0eea commit 5d57087
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion agent/agentUi/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,50 @@ import DataTable from 'react-data-table-component';
function App() {
const [version, setVersion] = useState("");
const [shares, setShares] = useState([]);
const [accesses, setAccesses] = useState([]);

const shareColumns = [
{
name: 'Token',
selector: row => row.token
selector: row => row.reserved ? row.token+' (reserved)' : row.token
},
{
name: 'Share Mode',
selector: row => row.shareMode
},
{
name: 'Backend Mode',
selector: row => row.backendMode
},
{
name: 'Frontend Endpoints',
selector: row => row.frontendEndpoint
},
{
name: 'Target',
selector: row => row.backendEndpoint,
},
{
name: 'Closed Permissions',
selector: row => ''+row.closed
}
];

const accessColumns = [
{
name: 'Frontend Token',
selector: row => row.frontendToken
},
{
name: 'Token',
selector: row => row.token
},
{
name: 'Bind Address',
selector: row => row.bindAddress
},
];

let api = new AgentApi(new ApiClient(window.location.protocol+'//'+window.location.host));

useEffect(() => {
Expand All @@ -35,6 +67,7 @@ function App() {
api.agentStatus((err, data) => {
if(mounted) {
setShares(data.shares);
setAccesses(data.accesses);
}
});
}, 1000);
Expand All @@ -56,6 +89,14 @@ function App() {
data={shares}
/>
</div>

<div>
<h2>Accesses</h2>
<DataTable
columns={accessColumns}
data={accesses}
/>
</div>
</>
)
}
Expand Down

0 comments on commit 5d57087

Please sign in to comment.