From f4098fc1eb8001c5fd6062fd7deb117d8d7b904b Mon Sep 17 00:00:00 2001 From: Derferman Date: Tue, 20 Jul 2010 09:45:52 -0700 Subject: [PATCH 1/4] Bumped version to 1.1.3 --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 221c92db..1ce111ce 100755 --- a/config.py +++ b/config.py @@ -27,7 +27,7 @@ APP_ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) #Stashboard version -VERSION = "1.1.2" +VERSION = "1.1.3" # If we're debugging, turn the cache off, etc. # Set to true if we want to have our webapp print stack traces, etc From f2fe9c1f483882c19b8bdf9bb67d0f28520a0382 Mon Sep 17 00:00:00 2001 From: Derferman Date: Thu, 22 Jul 2010 11:34:27 -0700 Subject: [PATCH 2/4] Updated common.js to fix a few date issues --- static/js/common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/common.js b/static/js/common.js index 0d7ddaa4..ccae1bb8 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -34,6 +34,7 @@ stashboard.rfc1123 = function(date){ if (offset < 0) { off = "+"; + hours = -hours; } else { off = "-"; } @@ -252,7 +253,7 @@ stashboard.fillIndex = function() { for (var i=0; i < 5; i++) { $("", { "class": "date", - text: (d.getMonth() + 1) + "/" + d.getDate() + "/" + d.getFullYear() + text: d.toLocaleDateString() }).appendTo(thead); d = new Date(d.getTime() - 86400000); } From 28ce84f835dea8a73f804ca2604ab396f8aa536c Mon Sep 17 00:00:00 2001 From: Derferman Date: Thu, 22 Jul 2010 11:54:18 -0700 Subject: [PATCH 3/4] Fixed a small error with the date display in the rfc1123 function --- static/js/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/common.js b/static/js/common.js index ccae1bb8..bc56e424 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -253,7 +253,7 @@ stashboard.fillIndex = function() { for (var i=0; i < 5; i++) { $("", { "class": "date", - text: d.toLocaleDateString() + text: (d.getMonth() + 1) + "/" + d.getDate() + "/" + d.getFullYear() }).appendTo(thead); d = new Date(d.getTime() - 86400000); } From 1c4a72710b54696261da685343bb6c11db2a5c6f Mon Sep 17 00:00:00 2001 From: Derferman Date: Thu, 22 Jul 2010 13:05:32 -0700 Subject: [PATCH 4/4] * Updated the Events model to return the informational property as a boolean instead of a null value * Added a favicon * Fix a small ug in rfc1123 * Fixed a spelling error in common.js --- models.py | 10 +++++++++- static/favicon.ico | Bin 0 -> 1150 bytes static/js/common.js | 7 ++++--- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 static/favicon.ico diff --git a/models.py b/models.py index ae2020e0..e864aa77 100644 --- a/models.py +++ b/models.py @@ -248,7 +248,11 @@ def rest(self, base_url): class Event(db.Model): start = db.DateTimeProperty(required=True, auto_now_add=True) + + # We want this to be required, but it would break all current installs + # Instead, we handle it in the rest method informational = db.BooleanProperty(default=False) + status = db.ReferenceProperty(Status, required=True) message = db.TextProperty(required=True) service = db.ReferenceProperty(Service, required=True, @@ -273,10 +277,14 @@ def rest(self, base_url): stamp = mktime(self.start.timetuple()) m["timestamp"] = format_date_time(stamp) - m["informational"] = self.informational m["status"] = self.status.rest(base_url) m["message"] = str(self.message) m["url"] = base_url + self.resource_url() + + if self.informational: + m["informational"] = self.informational + else: + m["informational"] = False return m diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..f0fc42c8ee8aa955358bad30732e085152a1e418 GIT binary patch literal 1150 zcmeIvtqQ_W6u|K_CK@b*fnYQG2o_-oOID*jF0)p9MT@+tHlLkRBh@izFD5kx^ z^?#hA$h8>^JKJyf-gCdUI}wM=^Mq$fIvJ6Ih?GH!Op>RNfIdH;&~_Ssa{@KqWP$^Z z*kg<$dpQOv=59NTbN4>&d_*_YaX0s) BQYioc literal 0 HcmV?d00001 diff --git a/static/js/common.js b/static/js/common.js index bc56e424..484c44c2 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -326,10 +326,11 @@ stashboard.fillIndex = function() { var rightNow = new Date(); rightNow.setHours(0); rightNow.setMinutes(0); + rightNow.setSeconds(0); rightNow.setMilliseconds(0); - var endDate = new Date(rightNow.getTime() - 86400000); - var startDate = new Date(endDate.getTime() - 86400000 * 4); + var endDate = new Date(rightNow.getTime()); + var startDate = new Date(endDate.getTime() - 86400000 * 5); var url = "/api/v1/services/" + data.id + "/events"; url += "?start=" + stashboard.rfc1123(startDate); url += "&end=" + stashboard.rfc1123(endDate); @@ -353,7 +354,7 @@ stashboard.fillIndex = function() { for (i=0; i < events.length; i++) { var e = events[i]; var evtDate = new Date(e.timestamp); - calendar[evtDate.getDate()] = e.informatoinal || e.status.level !== "NORMAL"; + calendar[evtDate.getDate()] = e.informational || e.status.level !== "NORMAL"; } for (i= days.length-1; i >= 0; i--) {