Skip to content

Commit c94eef5

Browse files
committed
Update stubbed links as well as nodes
1 parent 315bb03 commit c94eef5

File tree

3 files changed

+875
-986
lines changed

3 files changed

+875
-986
lines changed

lib/Cro/Tools/Web.pm6

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,23 @@ sub web(Str $host, Int $port, $runner) is export {
8282
$found.generate($where, %json<id>, %json<name>, %options, @generated-links, @links);
8383
send-event('stub', { type => 'STUB_STUBBED' });
8484
# Update graph
85+
my $color = 10.rand.Int;
8586
my %graph-event = type => 'OVERVIEW_ADD_NODE',
8687
node => { id => %json<id>,
87-
type => 10.rand.Int };
88+
type => $color
89+
},
90+
links => @links.map(
91+
{ my %link;
92+
%link<source> = %json<name>;
93+
%link<target> = .service;
94+
%link<type> = $color;
95+
%link }
96+
);
8897
send-event('overview', %graph-event);
8998
CATCH {
9099
default {
100+
# Print error to terminal too to easify bug reporting
101+
.note;
91102
my $errors = .backtrace.full;
92103
send-event('stub', { type => 'STUB_STUB_ERROR_OCCURED',
93104
:$errors });

0 commit comments

Comments
 (0)