dbug fe: restore missing subscriptions component

This commit is contained in:
Fang 2020-05-14 17:24:03 +02:00
parent 98f3fa1171
commit 0d5f4214c0
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 70 additions and 0 deletions

View 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;

View File

@ -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';