mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 13:54:20 +03:00
dbug fe: restore missing subscriptions component
This commit is contained in:
parent
98f3fa1171
commit
0d5f4214c0
69
pkg/interface/dbug/src/js/components/subscriptions.js
Normal file
69
pkg/interface/dbug/src/js/components/subscriptions.js
Normal file
@ -0,0 +1,69 @@
|
||||
import React, { Component } from 'react';
|
||||
import { SearchableList } from '../components/searchable-list';
|
||||
import { renderDuct } from '../lib/util';
|
||||
|
||||
export class Subscriptions extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.componentDidUpdate();
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
//
|
||||
}
|
||||
|
||||
render() {
|
||||
const props = this.props;
|
||||
|
||||
const incoming = props.in.map(inc => {
|
||||
return {key: '~'+inc.ship + ' ' + inc.path, jsx: (
|
||||
<div class="flex">
|
||||
<div class="flex-auto" style={{maxWidth: '10%'}}>
|
||||
~{inc.ship}
|
||||
</div>
|
||||
<div class="flex-auto" style={{maxWidth: '30%'}}>
|
||||
{inc.path}
|
||||
</div>
|
||||
<div class="flex-auto" style={{maxWidth: '60%'}}>
|
||||
{renderDuct(inc.duct)}
|
||||
</div>
|
||||
</div>
|
||||
)};
|
||||
});
|
||||
|
||||
const outgoing = props.out.map(out => {
|
||||
return {key: `~${out.ship} ${out.app} ${out.wire} ${out.path}`, jsx: (
|
||||
<div class="flex">
|
||||
<div class="flex-auto" style={{maxWidth: '35%'}}>
|
||||
{out.wire}
|
||||
</div>
|
||||
<div class="flex-auto" style={{maxWidth: '10%'}}>
|
||||
~{out.ship}
|
||||
</div>
|
||||
<div class="flex-auto" style={{maxWidth: '10%'}}>
|
||||
{out.app}
|
||||
</div>
|
||||
<div class="flex-auto" style={{maxWidth: '35%'}}>
|
||||
{out.path}
|
||||
</div>
|
||||
<div class="flex-auto" style={{maxWidth: '10%'}}>
|
||||
{out.acked ? 'acked' : 'not acked'}
|
||||
</div>
|
||||
</div>
|
||||
)};
|
||||
});
|
||||
|
||||
console.log('render subs', props.in, props.out);
|
||||
return (<div>
|
||||
<h4>Incoming</h4>
|
||||
<SearchableList placeholder="ship / path" items={incoming} />
|
||||
<h4>Outgoing</h4>
|
||||
<SearchableList placeholder="ship / app / wire / path" items={outgoing} />
|
||||
</div>);
|
||||
}
|
||||
}
|
||||
|
||||
export default Links;
|
@ -2,6 +2,7 @@ import React, { Component } from 'react';
|
||||
import { Route, Link } from 'react-router-dom';
|
||||
import { makeRoutePath } from '../lib/util';
|
||||
import urbitOb from 'urbit-ob';
|
||||
import { Subscriptions } from '../components/subscriptions';
|
||||
import { SearchableList } from '../components/searchable-list';
|
||||
import { Summary } from '../components/summary';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user