Skip to content

Commit efb4ac9

Browse files
authored
Merge pull request #20 from goblint/layout-usability-changes
Some layout/UI improvements for better usability
2 parents dcc2b4d + 49c9d53 commit efb4ac9

34 files changed

+342
-404
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
# Web Frontend for Goblint
1+
# GobView
22

3-
Originally developed by Alex Micheli for his Bachelor's thesis at TUM i2.
3+
A Web Frontend for Goblint.
44

5-
Based on [jsoo-react](https://github.com/jchavarri/jsoo-react).
5+
It allows inspecting the analyzed files and results of an analysis run with Goblint.
6+
It is based on [jsoo-react](https://github.com/jchavarri/jsoo-react) and was originally developed by Alex Micheli for his Bachelor's thesis at TUM i2, significantly extended by Kerem Cakirer, and is now maintained by the Goblint team.
7+
8+
## Installing
9+
10+
Follow the instructions in the [Read the Docs](https://goblint.readthedocs.io/en/latest/user-guide/inspecting/).

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77

8-
<title>Gobview</title>
8+
<title>GobView</title>
99

1010
<link rel="icon" href="https://avatars.githubusercontent.com/u/917621?s=96&v=4"/>
1111
</head>

src/Content.re

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/DeadCodeView.re

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/Graphviz.mli

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,44 @@
1+
open Js_of_ocaml
2+
13
val makeProps :
2-
dot:Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t
4+
dot: Js.js_string Js.t
5+
-> options: <fit: bool Js.t Js.readonly_prop
6+
; height: Js.js_string Js.t
7+
; width: Js.js_string Js.t
8+
; zoom: bool Js.t Js.readonly_prop > Js.t
9+
-> className: Js.js_string Js.t
310
-> unit
4-
-> < dot:
5-
Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t Js_of_ocaml.Js.readonly_prop >
6-
Js_of_ocaml.Js.t
11+
-> < dot: Js.js_string Js.t Js.readonly_prop
12+
; options: <fit: bool Js.t Js.readonly_prop
13+
; height: Js.js_string Js.t
14+
; width: Js.js_string Js.t
15+
; zoom: bool Js.t Js.readonly_prop > Js.t Js.readonly_prop
16+
; className: Js.js_string Js.t Js.readonly_prop > Js.t
717
[@@js.custom
8-
let makeProps ~dot () =
18+
let makeProps ~dot ~options ~className () =
919
object%js
1020
val dot = dot
21+
val options = options
22+
val className = className
1123
end]
1224

1325
val make :
14-
< dot: Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t Js_of_ocaml.Js.readonly_prop >
15-
Js_of_ocaml.Js.t
26+
< dot: Js.js_string Js.t Js.readonly_prop
27+
; options: <fit: bool Js.t Js.readonly_prop
28+
; height: Js.js_string Js.t
29+
; width: Js.js_string Js.t
30+
; zoom: bool Js.t Js.readonly_prop > Js.t Js.readonly_prop
31+
; className: Js.js_string Js.t Js.readonly_prop > Js.t
1632
React.component
1733
[@@js.custom
1834
external to_component :
1935
Ojs.t
20-
-> < dot:
21-
Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t
22-
Js_of_ocaml.Js.readonly_prop >
23-
Js_of_ocaml.Js.t
36+
-> < dot: Js.js_string Js.t Js.readonly_prop
37+
; options: <fit: bool Js.t Js.readonly_prop
38+
; height: Js.js_string Js.t
39+
; width: Js.js_string Js.t
40+
; zoom: bool Js.t Js.readonly_prop > Js.t Js.readonly_prop
41+
; className: Js.js_string Js.t Js.readonly_prop > Js.t
2442
React.component = "%identity"
2543

2644
val make_internal : Ojs.t [@@js.global "Graphviz"]

src/Main.re

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,33 @@ let make = (~cil, ~goblint, ~warnings, ~meta, ~stats, ~file_loc) => {
4949
);
5050

5151
<div className="container-fluid">
52-
<div className="row">
53-
<div className="col-3 border-end overflow-auto vh-100">
54-
<Sidebar
55-
active={state.selected_sidebar}
52+
<header className="navbar navbar-dark fixed-top bg-dark flex-md-nowrap shadow p-1">
53+
<div className="navbar-brand mx-2" >{React.string("Gobview")}</div>
54+
</header>
55+
<div className="main row vh-100">
56+
<div className="col-3 border-end overflow-auto bg-light py-2 h-100">
57+
<SidebarLeft
58+
active={state.selected_sidebar_left}
59+
dispatch
60+
search={state.search}
61+
cil={state.cil}
62+
/>
63+
</div>
64+
<div className="col-6 d-flex flex-column h-100">
65+
{switch (state.display) {
66+
| None => <div className="d-flex flex-column h-75 overflow-auto p-4" />
67+
| Some(f) => <Content state display=f dispatch />
68+
}}
69+
<Panel state dispatch />
70+
</div>
71+
<div className="col-3 border-start overflow-auto py-2 h-100">
72+
<SidebarRight
73+
active={state.selected_sidebar_right}
5674
goblint
5775
inspect={state.inspect}
5876
dispatch
5977
/>
60-
</div>
61-
<div className="col-9 d-flex flex-column vh-100">
62-
<Content state dispatch />
63-
<Panel state dispatch />
64-
</div>
6578
</div>
79+
</div>
6680
</div>;
6781
};

src/Navigation.re

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/WarningView.re

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/state/gvMessages.ml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ module Message = struct
1010
| Single p -> loc p
1111
| Group { pieces; _ } -> pieces |> List.filter_map loc |> List.enum |> Enum.get
1212

13+
let severity_to_bs_alert m = match m.severity with
14+
| Error -> "alert-danger"
15+
| Warning -> "alert-warning"
16+
| Info -> "alert-info"
17+
| Debug -> "alert-light"
18+
| Success -> "alert-success"
19+
1320
let to_string msg =
1421
let out = IO.output_string () in
1522
let fmt = Format.formatter_of_output out in

src/state/reducer.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let reducer (s : State.t) = function
2-
| `SwitchSidebar selected_sidebar -> { s with selected_sidebar }
2+
| `SwitchSidebarLeft selected_sidebar_left -> { s with selected_sidebar_left }
3+
| `SwitchSidebarRight selected_sidebar_right -> { s with selected_sidebar_right }
34
| `SwitchPanel selected_panel -> { s with selected_panel }
45
| (`DisplayNothing | `DisplayFile _ | `DisplayFunc _ | `UpdateFileContents _ | `UpdateFuncDot _)
56
as a ->

0 commit comments

Comments
 (0)