-
Notifications
You must be signed in to change notification settings - Fork 1
/
bpe_act.erl
40 lines (36 loc) · 1.06 KB
/
bpe_act.erl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
-module(bpe_act).
-copyright('Maxim Sokhatsky').
-include_lib("nitro/include/nitro.hrl").
-include_lib("form/include/meta.hrl").
-include_lib("bpe/include/bpe.hrl").
-include("act.hrl").
-export([event/1]).
event(init) ->
nitro:clear(tableHead),
nitro:clear(tableRow),
Bin = nitro:qc(p),
Id = try binary_to_list(Bin) catch _:_ -> 0 end,
case kvs:get("/bpe/proc",Id) of
{error,not_found} ->
nitro:update(n, "ERR"),
nitro:update(desc, "No process found."),
nitro:update(num, "ERR");
_ ->
nitro:insert_top(tableHead, header()),
nitro:update(n, Bin),
nitro:update(num, Bin),
History = bpe:hist(Id),
[ begin
{step,No,Step} = I#hist.id,
Name = nitro:to_list(No)++"-"++nitro:to_list(Step),
Trace = bpe_trace:new(form:atom([trace,Name]),I,[]),
nitro:insert_bottom(tableRow, Trace)
end
|| I <- History ]
end;
event(_) ->
ok.
header() ->
#panel{id=header,class=th,body=
[#panel{class=column6,body="State"},
#panel{class=column6,body="Documents"}]}.