taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 1 | import QtQuick 2.2 |
| 2 | import QtQuick.Window 2.1 |
| 3 | import QtQuick.Controls 1.1 |
| 4 | import QtQuick.Layouts 1.0 |
| 5 | |
| 6 | ApplicationWindow { |
| 7 | visible: false |
| 8 | id: window |
| 9 | title: "NFD Control Center" |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 10 | minimumWidth: 750 |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 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 |
Qi Zhao | ae9c431 | 2017-02-02 11:36:12 -0800 | [diff] [blame] | 43 | 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) |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 52 | } |
| 53 | CheckBox { |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 54 | id: autoConfig |
| 55 | text: "Automatically start NDN auto configuration" |
Qi Zhao | ae9c431 | 2017-02-02 11:36:12 -0800 | [diff] [blame] | 56 | 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) |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 64 | } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 65 | } |
| 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 Zhao | 3615a10 | 2017-02-02 20:38:34 -0800 | [diff] [blame^] | 94 | 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 | } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 107 | } |
| 108 | } |
Alexander Afanasyev | 4086d51 | 2014-07-11 15:56:33 -0700 | [diff] [blame] | 109 | // Tab { |
| 110 | // title: "FIB status" |
| 111 | // TableView { |
| 112 | // anchors.fill: parent |
| 113 | // anchors.topMargin: 20 |
| 114 | // anchors.bottomMargin: 20 |
| 115 | // anchors.leftMargin: 20 |
| 116 | // anchors.rightMargin: 20 |
| 117 | // TableViewColumn{ |
| 118 | // role: "prefix" |
| 119 | // title: "NDN prefix" |
| 120 | // width: 300 |
| 121 | // } |
| 122 | // TableViewColumn{ |
| 123 | // role: "faceId" |
| 124 | // title: "Face ID" |
| 125 | // width: 50 |
| 126 | // } |
| 127 | // TableViewColumn{ |
| 128 | // role: "cost" |
| 129 | // title: "Cost" |
| 130 | // width: 50 |
| 131 | // } |
| 132 | // model: fibModel |
| 133 | // } |
| 134 | // } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 135 | Tab { |
| 136 | title: "Forwarder status" |
| 137 | TableView { |
| 138 | anchors.fill: parent |
| 139 | anchors.topMargin: 20 |
| 140 | anchors.bottomMargin: 20 |
| 141 | anchors.leftMargin: 20 |
| 142 | anchors.rightMargin: 20 |
| 143 | model: forwarderModel |
| 144 | TableViewColumn{ |
| 145 | role: "type" |
| 146 | title: "Type" |
| 147 | width: 200 |
| 148 | } |
| 149 | TableViewColumn{ |
| 150 | role: "value" |
| 151 | title: "Value" |
susmit | 4fe3cb9 | 2016-03-20 17:08:41 -0700 | [diff] [blame] | 152 | width: 300 |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 153 | } |
| 154 | } |
| 155 | } |
| 156 | Tab { |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 157 | title: "Auto-config status" |
| 158 | TextArea { |
Qi Zhao | ae9c431 | 2017-02-02 11:36:12 -0800 | [diff] [blame] | 159 | id: ndnAutoConfigTextId |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 160 | anchors.fill: parent |
| 161 | anchors.topMargin: 20 |
| 162 | anchors.bottomMargin: 20 |
| 163 | anchors.leftMargin: 20 |
| 164 | anchors.rightMargin: 20 |
| 165 | readOnly: true |
Qi Zhao | ae9c431 | 2017-02-02 11:36:12 -0800 | [diff] [blame] | 166 | text: ndnAutoConfigText |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 167 | } |
| 168 | } |
| 169 | Tab { |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 170 | title: "Security" |
| 171 | Column { |
| 172 | spacing: 2 |
| 173 | anchors.fill: parent |
| 174 | anchors.topMargin: 20 |
| 175 | anchors.bottomMargin: 20 |
| 176 | anchors.leftMargin: 20 |
| 177 | anchors.rightMargin: 20 |
| 178 | Button { |
| 179 | text: "Obtain NDN Certificate" |
| 180 | onClicked: Qt.openUrlExternally('http://ndncert.named-data.net') |
| 181 | } |
| 182 | } |
| 183 | } |
susmit | 4fe3cb9 | 2016-03-20 17:08:41 -0700 | [diff] [blame] | 184 | Tab { |
| 185 | title: "Add/Delete Route" |
| 186 | Column { |
| 187 | spacing: 2 |
| 188 | anchors.fill: parent |
| 189 | anchors.topMargin: 20 |
| 190 | anchors.bottomMargin: 20 |
| 191 | anchors.leftMargin: 20 |
| 192 | } |
| 193 | |
| 194 | Row { |
| 195 | spacing: 20 |
| 196 | anchors.topMargin: 30 |
| 197 | anchors.leftMargin: 10 |
| 198 | anchors.rightMargin: 10 |
| 199 | anchors.bottomMargin: 10 |
| 200 | anchors.fill: parent |
| 201 | TextField { |
| 202 | focus: true |
| 203 | } |
| 204 | Button { |
| 205 | text: "Add Route" |
| 206 | onClicked: trayModel.addRoute(TextField.text); |
| 207 | } |
| 208 | Button { |
| 209 | text: "Delete Route" |
| 210 | onClicked: trayModel.deleteRoute(TextField.text); |
| 211 | } |
| 212 | } |
| 213 | } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 214 | } |
| 215 | Connections { |
| 216 | target: trayModel; |
| 217 | onShowApp: { |
| 218 | window.show() |
| 219 | window.raise() |
| 220 | } |
| 221 | } |
Alexander Afanasyev | 4086d51 | 2014-07-11 15:56:33 -0700 | [diff] [blame] | 222 | // Timer { |
| 223 | // interval: 1000; running: true; repeat: true |
| 224 | // onTriggered: { |
| 225 | // fibModel.fetchFibInformation() |
| 226 | // } |
| 227 | // } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 228 | } |