Module: check_mk
Branch: master
Commit: 416a9b412e36808b3cff3ee37086daa413baf7a8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=416a9b412e3680…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jan 17 11:45:14 2012 +0100
Updated bug entries #0601
---
.bugs/601 | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/.bugs/601 b/.bugs/601
new file mode 100644
index 0000000..6f86b24
--- /dev/null
+++ b/.bugs/601
@@ -0,0 +1,20 @@
+Title: Checkboxes in views and brower back in disharmony
+Component: multisite
+State: open
+Date: 2012-01-17 11:43:07
+Targetversion: 1.2.0
+Class: bug
+
+Tested on IE8, but might be browser independent.
+The following steps produce the problem:
+
+1. Open a view and activate checkboxes
+2. Check one service
+3. Select "Downtime 2hours"
+4. When the question "Are you sure?" comes press the
+ browser "Back" button
+ -> The one service is still being displayed as
+ checks. Good. But internally it seems unchecked.
+5. Now again select a command.
+ -> Now the command will be applied to *all*
+ services instead of the one.
Module: check_mk
Branch: master
Commit: 9c484cd2cab8f66a721459b9dcf8af93efec51ee
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9c484cd2cab8f6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jan 16 15:34:02 2012 +0100
New valuespec for http urls
---
web/htdocs/valuespec.py | 40 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 39 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 02bd5b5..e498133 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -24,7 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import math, os, time, re
+import math, os, time, re, urlparse
from lib import *
# Abstract base class of all value declaration classes.
@@ -300,6 +300,44 @@ class EmailAddress(TextAscii):
def value_to_text(self, value):
return '<a href="mailto:%s">%s</a>' % (value, value)
+# Valuespec for a HTTP Url (not HTTPS), that
+# automatically adds http:// to the value
+class HTTPUrl(TextAscii):
+ def __init__(self, **kwargs):
+ TextAscii.__init__(self, **kwargs)
+ self._target= kwargs.get("target")
+
+ def validate_value(self, value, varprefix):
+ TextAscii.validate_value(self, value, varprefix)
+ if value:
+ if not value.startswith("http://"):
+ raise MKUserError(varprefix, _("The URL must begin with http://"))
+
+ def from_html_vars(self, varprefix):
+ value = TextAscii.from_html_vars(self, varprefix)
+ if value:
+ if not "://" in value:
+ value = "http://" + value
+ return value
+
+ def value_to_text(self, url):
+ if not url.startswith("http://"):
+ url = "http://" + url
+ try:
+ parts = urlparse.urlparse(url)
+ if parts.path in [ '', '/' ]:
+ text = parts.netloc
+ else:
+ text = url[7:]
+ except:
+ text = url[7:]
+
+ # Remove trailing / if the url does not contain
+ # any path component
+ return '<a %shref="%s">%s</a>' % (
+ (self._target and 'target="%s" ' % self._target or ""),
+ url, text)
+
class TextUnicode(TextAscii):
def __init__(self, **kwargs):