summaryrefslogtreecommitdiffstats
path: root/app/configuration/controllers/date-time-controller.js
Commit message (Collapse)AuthorAgeFilesLines
* NTP: Remove workaround for empty list arrayGunnar Mills2019-10-171-7/+2
| | | | | | | | | | | | | | | 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/NTPServers See https://github.com/openbmc/openbmc/issues/3240 Tested: Built and loaded on a Witherspoon. Added, removed, and edited NTP servers. Change-Id: Ia106067a479c63a5761b1f62c624d3ccc6df55c7 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Fix date and time settings bugDixsie Wolmers2019-10-071-56/+71
| | | | | | | | | | | | | | | | When time mode is initially set to Manual from NTP, NTP service is disabled and the NTP service is stopping but not stopped, setting time will return an error. There are no response messages to notify when NTP is completely stopped. To work around, a timeout is set to allow NTP to fully stop before saving date/time changes. https://github.com/openbmc/phosphor-time-manager/blob/master/README.md Signed-off-by: Dixsie Wolmers <dixsiew@gmail.com> Change-Id: Icb86dfe339a10567aecf9aedd9b0dd696937a398
* Add role alert to toastsbeccabroek2019-02-061-5/+5
| | | | | | | | | | 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 Date Time pagebeccabroek2019-01-211-9/+6
| | | | | Change-Id: I0c0912f9d18fbb170ccf4863366b5973eb25050a Signed-off-by: beccabroek <beccabroek@gmail.com>
* fix date/time representation in national localesAlexander Filippov2018-12-071-7/+24
| | | | | | | | | | | | | | | | | Added "localeDate" filter to present date and time in preferred format: - the date will be displayed as: 'Dec 3, 2018' - the time will be displayed in locale preferred format. - the timezone will be displayed as abbrev or GMT+/-offset. At the 'Date and Time setting' the time zone name will displayed in long format if it is possible. All text parts of date/time representation will be in English. Resolves: openbmc/phosphor-webui#42 Change-Id: I2fdbb47c62dfc5000039b0c00a20f64a9a389fc6 Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
* Display log events in user timebeccabroek2018-11-061-2/+14
| | | | | | | | | | | | | | | | | Allows user to display events in their timezone or in UTC. Previously allowed either ETC or UTC, but listed ETC as 'user timezone'. Updates date time page from GMT offset to UTC offset for overall consistency. Also updates overview page to list critical events in user timezone Resolves openbmc/phosphor-webui#36 Tested: changed timezone settings locally and validated that correct timezone and UTC offset was presented in the UI. Change-Id: I89ca5045eeb789527aa07f5b1baebaa3fbd6b1fa Signed-off-by: beccabroek <beccabroek@gmail.com>
* Date-time: Use lowerCamelCase for varsGunnar Mills2018-10-191-30/+31
| | | | | | | | Following https://google.github.io/styleguide/jsguide.html. Also, added a comment to clarify a variable. Change-Id: I27dd8c0af6187ccd3f8093b88ebe2674fd42747b Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set Host Time from correct fieldsGunnar Mills2018-10-091-9/+16
| | | | | | | | | | | | | In all cases except when the time owner is "Split", Host and BMC time share fields. Make sure to set the Host time from the correct fields, which is these shared fields in all cases except when time owner is "Split". Resolves openbmc/phosphor-webui#20 Tested: Able to set the Host and BMC time Change-Id: I69985fd2de08fe71c62fd57dd1fa872f7f33ba09 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set the Host Time if "Split" and "NTP"Gunnar Mills2018-10-091-2/+6
| | | | | | | | | | | From: https://github.com/openbmc/phosphor-time-manager Mode Owner Set BMC Time Set Host Time NTP SPLIT Fail to set OK Resolves openbmc/phosphor-webui#19 Change-Id: I72f5617581533a2bb17d415b45bdf7ec6372ecab Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Button to remove NTP serverGunnar Mills2018-09-191-0/+4
| | | | | Change-Id: I58a3a894c192fafb551e07302b107bcd776e4901 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Set time fieldsGunnar Mills2018-09-131-16/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Add Host TimeGunnar Mills2018-09-051-0/+3
| | | | | | | | | | | If the Time Owner is 'BMC', 'Host', or 'Both' a single time field is present with a title of "BMC and Host Time". If the Time Owner is 'Split', meaning the BMC and Host have separate times, 2 time fields are present "BMC Time" and "Host Time". Tested: Set Time Owner to "BMC" and Time Owner to "Split". Change-Id: I6399fa30e4489d4bd62250b639e66e60cf9c2426 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Add Time Owner and Time ModeGunnar Mills2018-09-051-3/+13
| | | | | | | | | Added the Time Owner and the Time Mode Created a new function that enumerates /xyz/openbmc_project/time. Tested: See Time Mode and Time Owner Change-Id: I3d1788bdb87b99028000d13c868b4a0cbfbc3006 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Create "Date and time settings" pageGunnar Mills2018-09-051-3/+16
| | | | | | | | | | | | | | | | | There was a Date and time page in the GUI. Enhanced it to display the BMC time and added it to the menu so users could navigate to it. Future things planned for this page: Setting the time, time mode, and time owner. Adding a NTP server. More information can be found in the time manager README: https://github.com/openbmc/phosphor-time-manager/blob/master/README.md Tested: See the BMC time. Change-Id: Ia3ac2385cb45ec8009ed6df0899c3410fe18ef64 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
* Move to clang-format-6.0Gunnar Mills2018-09-041-1/+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>
* Format code using clang-format-5.0Andrew Geissler2018-05-241-11/+6
| | | | | | | | 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-14/+13
| | | | | | | | | | | 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>
* Change navigation structureIftekharul Islam2017-09-201-0/+26
Change-Id: I12c819293ce1eda188dc9f257ae9370f1b73cb18 Signed-off-by: Iftekharul Islam <iislam@us.ibm.com>
OpenPOWER on IntegriCloud