blob: 7ef19907d4cf8a7435d3f1c46561f286bc8abd16 [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
43 enabled: false
44 text: "Automatically start NFD Control Center on login"
45 }
46 CheckBox {
Qi Zhao86f2b212016-12-06 12:44:16 -080047 id: autoConfig
48 text: "Automatically start NDN auto configuration"
49 checked: trayModel.isAutoConfigEnabled()
50 onCheckedChanged: trayModel.startStopAutoConfig(this.checked)
taylorchuc27dd482014-05-17 20:06:49 -070051 }
taylorchuc27dd482014-05-17 20:06:49 -070052 }
53 }
54 GroupBox {
55 title: "Status"
56 id: status
57 anchors.top: checkboxControl.bottom
58 anchors.left: parent.left
59 anchors.right: parent.right
60 anchors.topMargin: 20
61 anchors.leftMargin: 20
62 anchors.rightMargin: 20
63 anchors.bottomMargin: 20
64 Row {
65 spacing: 20
66 anchors.topMargin: 10
67 anchors.leftMargin: 10
68 anchors.rightMargin: 10
69 anchors.bottomMargin: 10
70 anchors.fill: parent
71 Button {
72 text: "Traffic map"
73 onClicked: Qt.openUrlExternally('http://ndnmap.arl.wustl.edu')
74 }
75 Button {
76 text: "Routing status"
77 onClicked: Qt.openUrlExternally('http://netlab.cs.memphis.edu/script/htm/status.htm')
78 }
79 }
80 }
Alexander Afanasyev4086d512014-07-11 15:56:33 -070081 Button {
82 id: startStopButton
83 text: startStopButtonText
84
85 anchors.top: status.bottom
86 anchors.left: parent.left
87 anchors.right: parent.right
88 anchors.topMargin: 20
89 anchors.leftMargin: 20
90 anchors.rightMargin: 20
91 anchors.bottomMargin: 20
92
Qi Zhao86f2b212016-12-06 12:44:16 -080093 onClicked: trayModel.startStopNfd(autoConfig.checked)
Alexander Afanasyev4086d512014-07-11 15:56:33 -070094 }
taylorchuc27dd482014-05-17 20:06:49 -070095 }
96 }
Alexander Afanasyev4086d512014-07-11 15:56:33 -070097 // Tab {
98 // title: "FIB status"
99 // TableView {
100 // anchors.fill: parent
101 // anchors.topMargin: 20
102 // anchors.bottomMargin: 20
103 // anchors.leftMargin: 20
104 // anchors.rightMargin: 20
105 // TableViewColumn{
106 // role: "prefix"
107 // title: "NDN prefix"
108 // width: 300
109 // }
110 // TableViewColumn{
111 // role: "faceId"
112 // title: "Face ID"
113 // width: 50
114 // }
115 // TableViewColumn{
116 // role: "cost"
117 // title: "Cost"
118 // width: 50
119 // }
120 // model: fibModel
121 // }
122 // }
taylorchuc27dd482014-05-17 20:06:49 -0700123 Tab {
124 title: "Forwarder status"
125 TableView {
126 anchors.fill: parent
127 anchors.topMargin: 20
128 anchors.bottomMargin: 20
129 anchors.leftMargin: 20
130 anchors.rightMargin: 20
131 model: forwarderModel
132 TableViewColumn{
133 role: "type"
134 title: "Type"
135 width: 200
136 }
137 TableViewColumn{
138 role: "value"
139 title: "Value"
susmit4fe3cb92016-03-20 17:08:41 -0700140 width: 300
taylorchuc27dd482014-05-17 20:06:49 -0700141 }
142 }
143 }
144 Tab {
Qi Zhao86f2b212016-12-06 12:44:16 -0800145 title: "Auto-config status"
146 TextArea {
147 id: autoConfigText
148 anchors.fill: parent
149 anchors.topMargin: 20
150 anchors.bottomMargin: 20
151 anchors.leftMargin: 20
152 anchors.rightMargin: 20
153 readOnly: true
154 text: acText
155 }
156 }
157 Tab {
taylorchuc27dd482014-05-17 20:06:49 -0700158 title: "Security"
159 Column {
160 spacing: 2
161 anchors.fill: parent
162 anchors.topMargin: 20
163 anchors.bottomMargin: 20
164 anchors.leftMargin: 20
165 anchors.rightMargin: 20
166 Button {
167 text: "Obtain NDN Certificate"
168 onClicked: Qt.openUrlExternally('http://ndncert.named-data.net')
169 }
170 }
171 }
susmit4fe3cb92016-03-20 17:08:41 -0700172 Tab {
173 title: "Add/Delete Route"
174 Column {
175 spacing: 2
176 anchors.fill: parent
177 anchors.topMargin: 20
178 anchors.bottomMargin: 20
179 anchors.leftMargin: 20
180 }
181
182 Row {
183 spacing: 20
184 anchors.topMargin: 30
185 anchors.leftMargin: 10
186 anchors.rightMargin: 10
187 anchors.bottomMargin: 10
188 anchors.fill: parent
189 TextField {
190 focus: true
191 }
192 Button {
193 text: "Add Route"
194 onClicked: trayModel.addRoute(TextField.text);
195 }
196 Button {
197 text: "Delete Route"
198 onClicked: trayModel.deleteRoute(TextField.text);
199 }
200 }
201 }
taylorchuc27dd482014-05-17 20:06:49 -0700202 }
203 Connections {
204 target: trayModel;
205 onShowApp: {
206 window.show()
207 window.raise()
208 }
209 }
Alexander Afanasyev4086d512014-07-11 15:56:33 -0700210 // Timer {
211 // interval: 1000; running: true; repeat: true
212 // onTriggered: {
213 // fibModel.fetchFibInformation()
214 // }
215 // }
taylorchuc27dd482014-05-17 20:06:49 -0700216}