summaryrefslogtreecommitdiffstats
path: root/app/configuration/controllers/network-controller.js
Commit message (Collapse)AuthorAgeFilesLines
* DNS: Remove workaround for empty list arrayGunnar Mills2019-10-171-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This workaround is no longer needed with bmcweb. curl -k -H "Content-Type: application/json" -X PUT \ -d '{"data": [] }' \ https://${bmc}/xyz/openbmc_project/network/eth0/attr/Nameservers { "data": null, "message": "200 OK", "status": "ok" and actually casues an error now do to https://github.com/openbmc/phosphor-networkd/commit/5fb6c33a49ee2b9718cc9ce0f921d3b6cf38a463 curl -k -H "Content-Type: application/json" -X PUT \ -d '{"data": [""] }' \ https://${bmc}/xyz/openbmc_project/network/eth0/attr/Nameservers "data": { "description": "xyz.openbmc_project.Common.Error.InvalidArgument" }, "message": "Invalid argument was given.", See https://github.com/openbmc/openbmc/issues/3240 Tested: Built and loaded on a Witherspoon. Added, removed, and edited DNS servers. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Change-Id: I278489a8c4682641b61a0e5ab08fd714603b0234
* Fix invalid gateway toast messageDerick Montague2019-10-101-1/+2
| | | | | | | | | | | | Add check for gateway value before testing if the string is valid. The backend seems to handle an empty gateway the same as sending 0.0.0.0. When the GET call is made after sending 0.0.0.0 as the gateway value, the response returns an empty string. This field seems to be an override for the default gateway input for the interface. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Id6a5575e73a7c8adfff052c89bb4e8ca986d45f9
* Add role alert to toastsbeccabroek2019-02-061-7/+8
| | | | | | | | | | For accessibility reasons, 'role="alert" is required for toast messages. This notifies screen readers that an error or success message has appeared. Adds a service layer for toast messages that adds the role attribute to the message. Change-Id: Ic4dbf5556337eea589de5692c1b4c3323e771813 Signed-off-by: beccabroek <beccabroek@gmail.com>
* Add toast to Network Settings pagebeccabroek2019-01-231-43/+43
| | | | | | | | Displays error message if any settings fail to save and success if all succeed on the Network Settings page. Change-Id: Ifddf1822ba59753a217d1ec257b8d0ca870cceed Signed-off-by: beccabroek <beccabroek@gmail.com>
* Update code styling for network pagebeccabroek2018-10-091-42/+39
| | | | | | | | | | Now that the following style guide is being used: https://google.github.io/styleguide/jsguide.html#naming Some of the variable naming in this class needs to be updated. Change-Id: I6ca7a0ea7255ab2314bb4b5fc2d89cff9006039a Signed-off-by: beccabroek <beccabroek@gmail.com>
* Add and Update IPV4 addressbeccabroek2018-10-091-11/+41
| | | | | | | | | | | | | | | | | | This allows user to add IPV4 addresses and updates logic for editing IPV4 addresses. Resolves openbmc/phosphor-webui#12 Tested: Added, removed and modified IPV4 addresses, called API to verify that addresses had been correctly modified. Verified that if address had not been modified, no change was made for that address. Change-Id: I3dd25565f4f610dce2023e23348f6eb8d00add3d Signed-off-by: beccabroek <beccabroek@gmail.com>
* Remove IPV4 addressesbeccabroek2018-10-041-0/+29
| | | | | | | | Tested: Able to remove existing IPV4 addresses. Change-Id: I772bee6ad6b68bc0a69351f3e5386acc659241ef Signed-off-by: beccabroek <beccabroek@gmail.com>
* Button to remove DNS serverbeccabroek2018-09-181-0/+4
| | | | | | | | | | | | | Added button to remove DNS server from Nameservers list. Resolves openbmc/phosphor-webui#11 Tested: Added and was able to remove DNS servers from list. Page updated appropriately. Change-Id: I64e9d2499465f1aa5f9f34c831961578abf32b2b Signed-off-by: beccabroek <beccabroek@gmail.com>
* Set time fieldsGunnar Mills2018-09-131-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed 5 commits to set the date-time fields: time mode, time owner, BMC time, and host time. Also included is a commit to display the timezone. Set time mode Moved the selection of NTP vs Manual (time mode) to a radio button. Added code to allow the user set it. Tested: Set the time mode on a Witherspoon. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Set time owner The time owner is now a dropdown and is set when "Save settings" is pressed. Tested: Set the time owner on a Witherspoon Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Set the BMC and Host time The BMC and host have the same time except when time mode is split. Only need to set BMC or host time when time mode is not split. When time mode is split, set both. Use time owner to determine which to set. https://github.com/openbmc/phosphor-time-manager#time-settings Have date and time as two separate inputs, this is due to Firefox not supporting "datetime-local". The "date" and "time" input fields are more widely supported. https://caniuse.com/#feat=input-datetime The idea for 2 separate input fields came from: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local Must set the time mode and time owner before setting the time, this is due to permissions of who can set the time. Tested: Set the date and time on a Witherspoon. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Add NTP Servers The user can now view and set NTP Servers. Moved setFocusOnNewInput to a common directive since it is used on the NTP Servers and the DNS Servers on the network page. Even though NTPServers is a network interface specific path (e.g. /xyz/openbmc_project/network/eth0/attr/NTPServers) it acts like a global setting, openbmc/phosphor-time-manager#4. Using eth0 for setting and getting the NTP Servers until NTPServers is moved to a non-network interface specific path. In Redfish, NTPServers is a non-network interface specific. Tested: Set NTP Servers on a Witherspoon. Signed-off-by: Gunnar Mills <gmills@us.ibm.com> Add timezone Added the timezone for the host and bmc date time. The timezone looks like "GMT-0400 (EDT)" or "GMT-0500 (CDT)". I got this from https://stackoverflow.com/questions/1091372/getting-the-clients-timezone-in-javascript and choose this formatting over something like "America/Chicago". Tested: See the timezone on a Witherspoon Change-Id: I59a4449d63f73a6ed14cb934f3d8577e46620c4e Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Move to clang-format-6.0Gunnar Mills2018-09-041-2/+0
| | | | | | | The docker image moved from clang-format-5.0 to clang-format-6.0. Change-Id: I3c615d7df1f21569531b4dc2cb0bc4f425cb43f8 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Focus on newly created DNS server fieldGunnar Mills2018-08-071-0/+20
| | | | | | | | | | | | | | | | | | | Got feedback from IBM's design team that to help usability after adding a DNS Server field, focus on the newly created DNS server field. Decided to go with a directive instead of putting this in a controller after reading: https://stackoverflow.com/questions/22292832/angular-ng-init-pass-element-to-scope, https://github.com/angular/angular.js/issues/9031, https://groups.google.com/forum/#!topic/angular/6uxWl8Z0DPw Having dom manipulation code in the controller is frowned upon. Tested: Verified the field is in focus (i.e. the cursor is in the textbox). Change-Id: Ia548361e7ac47363e05ea2963807bca0c5bf51e2 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Fixed spelling errorsRebecca Shaw2018-07-191-1/+1
| | | | | Change-Id: I4b668b6246508d3bedda75ca179da1615516bad4 Signed-off-by: Rebecca Shaw <rebecca.shaw@ibm.com>
* Add TODO for openbmc/openbmc#3240Gunnar Mills2018-07-131-1/+1
| | | | | Change-Id: I2dcd3625cf72c774d84399e35d3c7be19f744d5c Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Keep the selected interfaceGunnar Mills2018-07-131-16/+25
| | | | | | | | | | | | If given 2 network interfaces: eth0 and eth0_60 (a VLAN interface), and eth0_60 is selected a "cancel" of the form would result in eth0 being selected. Fixed this by moving getNetworkInfo() to a function and calling it on a cancel. Also, call this new function after a successful network set (a temporary fix). Tested: The above case keeps eth0_60 selected. Change-Id: I136ca1030cbbb053ca3b96241197c56488204dfd Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add "Add new DNS server" buttonGunnar Mills2018-06-141-0/+10
| | | | | | | | | | | Added a button which allows the user to add new DNS Servers. After pressing the button a new empty field appears. Resolves openbmc/openbmc#3089 Tested: Added several new DNS Servers on a Witherspoon. Change-Id: Ic6a6d2b798ad177b0e9aeb64ba3e4993af442305 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Update DNS Servers on "Save settings"Gunnar Mills2018-06-141-0/+18
| | | | | | | | | | | | | | | "Nameservers" is called "DNS Servers" on the GUI. Update the property if it has changed when the user hits Save settings and confirms. Had difficulties getting the DNS input fields to update the interface.Nameservers array. The "ng-blur="interface.Nameservers[$index] = dns" solution is from: https://stackoverflow.com/questions/13714884/difficulty-with-ng-model-ng-repeat-and-inputs Tested: Changed some DNS Servers on a Witherspoon. Change-Id: Ib9c4be044d0725ac50e57e2733c3dc2ef8e29053 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add IPV4 properties parameter validationGunnar Mills2018-06-141-0/+24
| | | | | | | | | | | | | | | | | | | Added parameter validation for the IPV4 properties: IP Address, Gateway, and Netmask prefix length. This is important since we delete the IPV4 interface before adding the new one (i.e. if the add is unsuccessful we are down an IPV4 interface). This validation helps to prevent some of the unsuccessful adds. Took the logic from the network manager valid parameter checks: https://github.com/openbmc/phosphor-networkd/blob/master/util.cpp#L217 Moved "Netmask Prefix Length" to a "number" to do this. It should have been a number. Tested: A variety of good and bad values. Change-Id: Idf4486489097bc426164b9543ea8c05eb54a2bf8 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add reload 4 seconds after network set successGunnar Mills2018-06-141-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since an IPV4 interface (e.g. IP address, gateway, or netmask) edit is a delete then an add and the GUI can't calculate the interface id (e.g. 5c083707) beforehand and it is not returned by the REST call, reload the page after an edit, which makes another REST call. Do this for all network changes, instead of just IPV4 interface edits due to the possibility of a set network failing even though it returned success, openbmc/openbmc#1641. This REST call also updates dataService and old_interface which is used to know which data has changed if the user continues to edit network settings. The issue this is solving is the GUI deletes the old IPV4 interface (5c083707), creates a new one (4d9b1add), then let's say the user modifies the IPV4 interface again without a refresh, the GUI doesn't know what old IPV4 interface to delete (i.e. the GUI doesn't know to delete 4d9b1add). Choose 4 seconds to give the network manager time to set the network. Tested: Did the above scenario. Change-Id: I36cb438b12eb6540dc74f235f8f134df67e60389 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add loading spinnerGunnar Mills2018-06-061-7/+10
| | | | | | | | | Added a loading spinner that appears when set network settings are confirmed. This fits with the other pages such as firmware update. Tested: See the spinner when Save settings are confirmed. Change-Id: Iec321e036ad7a81d960109397b3a60ffdf256062 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set DHCP on "Save settings"Gunnar Mills2018-06-061-0/+15
| | | | | | | | | | | | | Set the DHCP enabled field when the user selects "Save settings" and accepts the popup. Added a TODO for issue #3154, Rest server should return a proper JSON bool. Resolves openbmc/openbmc#3165 Tested: Set "Obtain an IP address automatically using DHCP" on a Witherspoon. Change-Id: I45c817e3ddd8bf9c4f582460b1f9230e38548ff8 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set IPV4 interfacesGunnar Mills2018-06-061-0/+49
| | | | | | | | | | | | | | | | If a gateway, netmask, or IP address of an IPV4 interface changes on the page, when the user hits "Save changes" and confirms the popup, delete the old IPV4 interface and create a new one with the new values. After talking with Ratan, deleting then adding is the the correct way to change IPV4 interfaces. More information can be found in the network README up for review: https://gerrit.openbmc-project.xyz/#/c/6872/ Tested: Changed IPV4 interface properties on a Witherspoon. Also tested a Witherspoon in DHCP mode then moved over to a static IP. Change-Id: Idc0026aa01533ea327b53efc57e21147c4b68967 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Check if network settings changedGunnar Mills2018-06-061-10/+19
| | | | | | | | Before setting the Mac Address, Hostname, or DefaultGateway, check to see if those settings changed. Change-Id: Ifc735b61734ced13e2554651d74dc44d761f3432 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set Hostname on "Save settings"Gunnar Mills2018-06-061-0/+13
| | | | | | | | | Set the Hostname field when the user selects "Save settings" and accepts the popup. Before Hostname was readonly. Tested: Set the Hostname on a Witherspoon Change-Id: I9de840ee9d52ec4a9ae1fd69d4ea27f62b0baf17 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set DefaultGateway on "Save settings"Gunnar Mills2018-06-061-8/+29
| | | | | | | | | | | Set the DefaultGateway field when the user selects "Save settings" and accepts the popup. Moved to q.all() with a promise array. Later commits will add to this array and do a check to make sure the field changed before setting the value. Tested: Set the DefaultGateway on a Witherspoon Change-Id: Ica6abe14169f00bc3195f34a08db61ddbc09fa92 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Replace "Domain Name" with "Default Gateway"Gunnar Mills2018-05-251-0/+2
| | | | | | | | | | | "Domain Name" is not as important of a network settings as "Default Gateway". Remove it for now, later we will add fields for the other network settings but getting the basic network settings going for now. To setup the network, the user needs to configure the Default Gateway, MAC Address, IP, Gateway, and netmask. Change-Id: I27066dc188c3c30a01051b473a7ce10837d40fab Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add confirm "Change network settings" popupGunnar Mills2018-05-251-0/+3
| | | | | | | | | A modal appears when the user clicks "Save settings". This modal warns the user of the dangers of changing network settings. Change-Id: I20e45e8a814d9c5e3d048a0ed2523025f55d0c4d Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Reload the page on a CancelGunnar Mills2018-05-251-2/+5
| | | | | | | | | When the Cancel button is hit on the network settings page, reload the page, refreshing the network settings. Change-Id: Icc3d51e9b319bd70f7c7ab5b911b17728b5273b4 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set MAC address on "Save Settings"Gunnar Mills2018-05-251-0/+20
| | | | | | | | | Make a REST call to set the MAC address when the "Save Settings" button is pressed. Tested: Verified the MAC Address is set. Change-Id: I39f6d4688842b3453fd219795d07f819ba4ba481 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Format code using clang-format-5.0Andrew Geissler2018-05-241-28/+24
| | | | | | | | Once merged, this repository will have CI enforce the coding guidelines in the .clang-format file. Change-Id: I96a05972665f9c67625c6850c3da25edc540be06 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Run js-beautify and fixjsstyle on codeAndrew Geissler2018-05-241-31/+30
| | | | | | | | | | | Found this pointer on stackoverflow: https://stackoverflow.com/a/31660434/5508494 End goal is to get the code formatted well enough that clang format will run correctly against it. Change-Id: I80053e78d253d8eee49233e42d55e5807ae8fdc8 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
* Remove the version from each fileGunnar Mills2018-04-301-1/+0
| | | | | | | | Already have a Web UI version, no need to track the version of each file. These have not been getting updated. Change-Id: I1cd3a2c2d67b24ded5edcca9dbfd3f6806d93ed4 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Remove trailing spaces from filesGunnar Mills2018-03-051-3/+3
| | | | | | Tested: Manually tested GUI for any regressions Change-Id: I8c0922b7bd67b03b07e8880bc4dba3b862220b33 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Updating network settingsIftekharul Islam2017-11-021-0/+18
| | | | | | | Adding display network settings info in network settings page Change-Id: I5ab3b399445b8d2d6422f907dc4c5a477bfc794d Signed-off-by: Iftekharul Islam <iffy.ryan@ibm.com>
* Change navigation structureIftekharul Islam2017-09-201-0/+26
Change-Id: I12c819293ce1eda188dc9f257ae9370f1b73cb18 Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
OpenPOWER on IntegriCloud