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 | } |
| 94 | } |
| 95 | } |
Alexander Afanasyev | 4086d51 | 2014-07-11 15:56:33 -0700 | [diff] [blame] | 96 | // Tab { |
| 97 | // title: "FIB status" |
| 98 | // TableView { |
| 99 | // anchors.fill: parent |
| 100 | // anchors.topMargin: 20 |
| 101 | // anchors.bottomMargin: 20 |
| 102 | // anchors.leftMargin: 20 |
| 103 | // anchors.rightMargin: 20 |
| 104 | // TableViewColumn{ |
| 105 | // role: "prefix" |
| 106 | // title: "NDN prefix" |
| 107 | // width: 300 |
| 108 | // } |
| 109 | // TableViewColumn{ |
| 110 | // role: "faceId" |
| 111 | // title: "Face ID" |
| 112 | // width: 50 |
| 113 | // } |
| 114 | // TableViewColumn{ |
| 115 | // role: "cost" |
| 116 | // title: "Cost" |
| 117 | // width: 50 |
| 118 | // } |
| 119 | // model: fibModel |
| 120 | // } |
| 121 | // } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 122 | Tab { |
| 123 | title: "Forwarder status" |
| 124 | TableView { |
| 125 | anchors.fill: parent |
| 126 | anchors.topMargin: 20 |
| 127 | anchors.bottomMargin: 20 |
| 128 | anchors.leftMargin: 20 |
| 129 | anchors.rightMargin: 20 |
| 130 | model: forwarderModel |
| 131 | TableViewColumn{ |
| 132 | role: "type" |
| 133 | title: "Type" |
| 134 | width: 200 |
| 135 | } |
| 136 | TableViewColumn{ |
| 137 | role: "value" |
| 138 | title: "Value" |
susmit | 4fe3cb9 | 2016-03-20 17:08:41 -0700 | [diff] [blame] | 139 | width: 300 |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 140 | } |
| 141 | } |
| 142 | } |
| 143 | Tab { |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 144 | title: "Auto-config status" |
| 145 | TextArea { |
Qi Zhao | ae9c431 | 2017-02-02 11:36:12 -0800 | [diff] [blame^] | 146 | id: ndnAutoConfigTextId |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 147 | anchors.fill: parent |
| 148 | anchors.topMargin: 20 |
| 149 | anchors.bottomMargin: 20 |
| 150 | anchors.leftMargin: 20 |
| 151 | anchors.rightMargin: 20 |
| 152 | readOnly: true |
Qi Zhao | ae9c431 | 2017-02-02 11:36:12 -0800 | [diff] [blame^] | 153 | text: ndnAutoConfigText |
Qi Zhao | 86f2b21 | 2016-12-06 12:44:16 -0800 | [diff] [blame] | 154 | } |
| 155 | } |
| 156 | Tab { |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 157 | title: "Security" |
| 158 | Column { |
| 159 | spacing: 2 |
| 160 | anchors.fill: parent |
| 161 | anchors.topMargin: 20 |
| 162 | anchors.bottomMargin: 20 |
| 163 | anchors.leftMargin: 20 |
| 164 | anchors.rightMargin: 20 |
| 165 | Button { |
| 166 | text: "Obtain NDN Certificate" |
| 167 | onClicked: Qt.openUrlExternally('http://ndncert.named-data.net') |
| 168 | } |
| 169 | } |
| 170 | } |
susmit | 4fe3cb9 | 2016-03-20 17:08:41 -0700 | [diff] [blame] | 171 | Tab { |
| 172 | title: "Add/Delete Route" |
| 173 | Column { |
| 174 | spacing: 2 |
| 175 | anchors.fill: parent |
| 176 | anchors.topMargin: 20 |
| 177 | anchors.bottomMargin: 20 |
| 178 | anchors.leftMargin: 20 |
| 179 | } |
| 180 | |
| 181 | Row { |
| 182 | spacing: 20 |
| 183 | anchors.topMargin: 30 |
| 184 | anchors.leftMargin: 10 |
| 185 | anchors.rightMargin: 10 |
| 186 | anchors.bottomMargin: 10 |
| 187 | anchors.fill: parent |
| 188 | TextField { |
| 189 | focus: true |
| 190 | } |
| 191 | Button { |
| 192 | text: "Add Route" |
| 193 | onClicked: trayModel.addRoute(TextField.text); |
| 194 | } |
| 195 | Button { |
| 196 | text: "Delete Route" |
| 197 | onClicked: trayModel.deleteRoute(TextField.text); |
| 198 | } |
| 199 | } |
| 200 | } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 201 | } |
| 202 | Connections { |
| 203 | target: trayModel; |
| 204 | onShowApp: { |
| 205 | window.show() |
| 206 | window.raise() |
| 207 | } |
| 208 | } |
Alexander Afanasyev | 4086d51 | 2014-07-11 15:56:33 -0700 | [diff] [blame] | 209 | // Timer { |
| 210 | // interval: 1000; running: true; repeat: true |
| 211 | // onTriggered: { |
| 212 | // fibModel.fetchFibInformation() |
| 213 | // } |
| 214 | // } |
taylorchu | c27dd48 | 2014-05-17 20:06:49 -0700 | [diff] [blame] | 215 | } |