blob: 0fcfcfb98a0ae80cbc3ae8dc4de526a73b0ffe1a [file] [log] [blame]
taylorchuc27dd482014-05-17 20:06:49 -07001import QtQuick 2.2
2import QtQuick.Window 2.1
3import QtQuick.Controls 1.1
4import QtQuick.Layouts 1.0
5
6ApplicationWindow {
7 visible: false
8 id: window
9 title: "NFD Control Center"
Qi Zhao86f2b212016-12-06 12:44:16 -080010 minimumWidth: 750
taylorchuc27dd482014-05-17 20:06:49 -070011 minimumHeight: 400
12
13 TabView {
14 anchors.fill: parent
15 anchors.topMargin: 20
16 anchors.bottomMargin: 20
17 anchors.leftMargin: 20
18 anchors.rightMargin: 20
19
20 Tab {
21 title: "General"
22 ColumnLayout {
23 anchors.fill: parent
24 GroupBox {
25 title: "Basic"
26 id: checkboxControl
27 anchors.top: parent.top
28 anchors.left: parent.left
29 anchors.right: parent.right
30 anchors.topMargin: 20
31 anchors.leftMargin: 20
32 anchors.rightMargin: 20
33 anchors.bottomMargin: 20
34 Column {
35 spacing: 5
36 anchors.fill: parent
37 anchors.topMargin: 10
38 anchors.bottomMargin: 10
39 anchors.leftMargin: 10
40 anchors.rightMargin: 10
41 CheckBox {
42 id: startOnLogin
Qi Zhaoae9c4312017-02-02 11:36:12 -080043 text: "Launch NFD Control Center on login"
44 checked: trayModel.isNccAutoStartEnabled()
45 onCheckedChanged: trayModel.enableDisableNccAutoStart(this.checked)
46 }
47 CheckBox {
48 id: autoStart
49 text: "Automatically start NFD"
50 checked: trayModel.isNfdAutoStartEnabled()
51 onCheckedChanged: trayModel.enableDisableNfdAutoStart(this.checked)
taylorchuc27dd482014-05-17 20:06:49 -070052 }
53 CheckBox {
Qi Zhao86f2b212016-12-06 12:44:16 -080054 id: autoConfig
55 text: "Automatically start NDN auto configuration"
Qi Zhaoae9c4312017-02-02 11:36:12 -080056 checked: trayModel.isNdnAutoConfigEnabled()
57 onCheckedChanged: trayModel.enableDisableNdnAutoConfig(this.checked)
58 }
59 CheckBox {
60 id: shutdownOnQuit
61 text: "Shutdown NFD daemon on quit"
62 checked: trayModel.isNfdStopOnExitEnabled()
63 onCheckedChanged: trayModel.enableDisableNfdStopOnExit(this.checked)
taylorchuc27dd482014-05-17 20:06:49 -070064 }
taylorchuc27dd482014-05-17 20:06:49 -070065 }
66 }
67 GroupBox {
68 title: "Status"
69 id: status
70 anchors.top: checkboxControl.bottom
71 anchors.left: parent.left
72 anchors.right: parent.right
73 anchors.topMargin: 20
74 anchors.leftMargin: 20
75 anchors.rightMargin: 20
76 anchors.bottomMargin: 20
77 Row {
78 spacing: 20
79 anchors.topMargin: 10
80 anchors.leftMargin: 10
81 anchors.rightMargin: 10
82 anchors.bottomMargin: 10
83 anchors.fill: parent
84 Button {
85 text: "Traffic map"
86 onClicked: Qt.openUrlExternally('http://ndnmap.arl.wustl.edu')
87 }
88 Button {
89 text: "Routing status"
90 onClicked: Qt.openUrlExternally('http://netlab.cs.memphis.edu/script/htm/status.htm')
91 }
92 }
93 }
Qi Zhao3615a102017-02-02 20:38:34 -080094 GridLayout {
95 anchors.left: parent.left
96 anchors.bottom: parent.bottom
97 Label {
98 text: "NFD Control Center version:"
99 font.pixelSize: 10
100 }
101 Label {
102 text: nccVersion
103 font.pixelSize: 10
104 font.bold: true
105 }
106 }
taylorchuc27dd482014-05-17 20:06:49 -0700107 }
108 }
taylorchuc27dd482014-05-17 20:06:49 -0700109 Tab {
110 title: "Forwarder status"
111 TableView {
112 anchors.fill: parent
113 anchors.topMargin: 20
114 anchors.bottomMargin: 20
115 anchors.leftMargin: 20
116 anchors.rightMargin: 20
117 model: forwarderModel
118 TableViewColumn{
119 role: "type"
120 title: "Type"
121 width: 200
122 }
123 TableViewColumn{
124 role: "value"
125 title: "Value"
susmit4fe3cb92016-03-20 17:08:41 -0700126 width: 300
taylorchuc27dd482014-05-17 20:06:49 -0700127 }
128 }
129 }
130 Tab {
Qi Zhaod3de12b2017-02-21 20:11:58 -0800131 title: "FIB"
132 TableView {
133 anchors.fill: parent
134 anchors.topMargin: 20
135 anchors.bottomMargin: 20
136 anchors.leftMargin: 20
137 anchors.rightMargin: 20
138 model: fibModel
139 TableViewColumn{
140 role: "prefix"
141 title: "NDN prefix"
142 width: 300
143 }
144 TableViewColumn{
145 role: "faceId"
146 title: "Face ID"
147 width: 100
148 }
149 TableViewColumn{
150 role: "cost"
151 title: "Cost"
152 width: 100
153 }
154 }
155 }
156 Tab {
Qi Zhaoec8ddd22017-02-24 05:16:15 -0800157 title: "RIB"
158 TableView {
159 anchors.fill: parent
160 anchors.topMargin: 20
161 anchors.bottomMargin: 20
162 anchors.leftMargin: 20
163 anchors.rightMargin: 20
164 model: ribModel
165 TableViewColumn{
166 role: "prefix"
167 title: "NDN prefix"
168 width: 200
169 }
170 TableViewColumn{
171 role: "faceId"
172 title: "Face ID"
173 width: 65
174 }
175 TableViewColumn{
176 role: "origin"
177 title: "Origin"
178 width: 50
179 }
180 TableViewColumn{
181 role: "cost"
182 title: "Cost"
183 width: 50
184 }
185 TableViewColumn{
186 role: "childinherit"
187 title: "ChildInherit"
188 width: 90
189 }
190 TableViewColumn{
191 role: "ribcapture"
192 title: "RibCapture"
193 width: 90
194 }
195 TableViewColumn{
196 role: "expiresin"
197 title: "Expires in"
198 width: 90
199 }
200 }
201 }
202 Tab {
Qi Zhao86f2b212016-12-06 12:44:16 -0800203 title: "Auto-config status"
204 TextArea {
Qi Zhaoae9c4312017-02-02 11:36:12 -0800205 id: ndnAutoConfigTextId
Qi Zhao86f2b212016-12-06 12:44:16 -0800206 anchors.fill: parent
207 anchors.topMargin: 20
208 anchors.bottomMargin: 20
209 anchors.leftMargin: 20
210 anchors.rightMargin: 20
211 readOnly: true
Qi Zhaoae9c4312017-02-02 11:36:12 -0800212 text: ndnAutoConfigText
Qi Zhao86f2b212016-12-06 12:44:16 -0800213 }
214 }
215 Tab {
taylorchuc27dd482014-05-17 20:06:49 -0700216 title: "Security"
217 Column {
218 spacing: 2
219 anchors.fill: parent
220 anchors.topMargin: 20
221 anchors.bottomMargin: 20
222 anchors.leftMargin: 20
223 anchors.rightMargin: 20
224 Button {
225 text: "Obtain NDN Certificate"
226 onClicked: Qt.openUrlExternally('http://ndncert.named-data.net')
227 }
228 }
229 }
susmit4fe3cb92016-03-20 17:08:41 -0700230 Tab {
231 title: "Add/Delete Route"
232 Column {
233 spacing: 2
234 anchors.fill: parent
235 anchors.topMargin: 20
236 anchors.bottomMargin: 20
237 anchors.leftMargin: 20
238 }
239
240 Row {
241 spacing: 20
242 anchors.topMargin: 30
243 anchors.leftMargin: 10
244 anchors.rightMargin: 10
245 anchors.bottomMargin: 10
246 anchors.fill: parent
247 TextField {
248 focus: true
249 }
250 Button {
251 text: "Add Route"
252 onClicked: trayModel.addRoute(TextField.text);
253 }
254 Button {
255 text: "Delete Route"
256 onClicked: trayModel.deleteRoute(TextField.text);
257 }
258 }
259 }
taylorchuc27dd482014-05-17 20:06:49 -0700260 }
261 Connections {
262 target: trayModel;
263 onShowApp: {
264 window.show()
265 window.raise()
266 }
267 }
Alexander Afanasyev4086d512014-07-11 15:56:33 -0700268 // Timer {
269 // interval: 1000; running: true; repeat: true
270 // onTriggered: {
271 // fibModel.fetchFibInformation()
272 // }
273 // }
taylorchuc27dd482014-05-17 20:06:49 -0700274}