blob: c7a151f76bec1a0574c251ab39d23a215151d222 [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"
10 minimumWidth: 600
11 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 {
47 id: discoverHub
48 text: "Discover nearest NDN hub"
49 onCheckedChanged: {
50 if (this.checked) {
51 trayModel.autoConfig()
52 }
53 }
54 }
55 CheckBox {
56 id: checkUpdate
57 enabled: false
58 text: "Check for software updates"
59 }
60 }
61 }
62 GroupBox {
63 title: "Status"
64 id: status
65 anchors.top: checkboxControl.bottom
66 anchors.left: parent.left
67 anchors.right: parent.right
68 anchors.topMargin: 20
69 anchors.leftMargin: 20
70 anchors.rightMargin: 20
71 anchors.bottomMargin: 20
72 Row {
73 spacing: 20
74 anchors.topMargin: 10
75 anchors.leftMargin: 10
76 anchors.rightMargin: 10
77 anchors.bottomMargin: 10
78 anchors.fill: parent
79 Button {
80 text: "Traffic map"
81 onClicked: Qt.openUrlExternally('http://ndnmap.arl.wustl.edu')
82 }
83 Button {
84 text: "Routing status"
85 onClicked: Qt.openUrlExternally('http://netlab.cs.memphis.edu/script/htm/status.htm')
86 }
87 }
88 }
89 }
90 }
91 Tab {
92 title: "FIB status"
93 TableView {
94 anchors.fill: parent
95 anchors.topMargin: 20
96 anchors.bottomMargin: 20
97 anchors.leftMargin: 20
98 anchors.rightMargin: 20
99 TableViewColumn{
100 role: "prefix"
101 title: "NDN prefix"
102 width: 300
103 }
104 TableViewColumn{
105 role: "faceId"
106 title: "Face ID"
107 width: 50
108 }
109 TableViewColumn{
110 role: "cost"
111 title: "Cost"
112 width: 50
113 }
114 model: fibModel
115 }
116 }
117 Tab {
118 title: "Forwarder status"
119 TableView {
120 anchors.fill: parent
121 anchors.topMargin: 20
122 anchors.bottomMargin: 20
123 anchors.leftMargin: 20
124 anchors.rightMargin: 20
125 model: forwarderModel
126 TableViewColumn{
127 role: "type"
128 title: "Type"
129 width: 200
130 }
131 TableViewColumn{
132 role: "value"
133 title: "Value"
134 width: 200
135 }
136 }
137 }
138 Tab {
139 title: "Security"
140 Column {
141 spacing: 2
142 anchors.fill: parent
143 anchors.topMargin: 20
144 anchors.bottomMargin: 20
145 anchors.leftMargin: 20
146 anchors.rightMargin: 20
147 Button {
148 text: "Obtain NDN Certificate"
149 onClicked: Qt.openUrlExternally('http://ndncert.named-data.net')
150 }
151 }
152 }
153 }
154 Connections {
155 target: trayModel;
156 onShowApp: {
157 window.show()
158 window.raise()
159 }
160 }
161 Timer {
162 interval: 1000; running: true; repeat: true
163 onTriggered: {
164 trayModel.checkNfdRunning()
165 fibModel.fetchFibInformation()
166 }
167 }
168
169 Timer {
170 interval: 5500; running: true; repeat: true
171 onTriggered: {
172 forwarderModel.fetchVersionInformation()
173 }
174 }
175}