return format_number(n, 1024, ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB']);
};
+ rivets.formatters.short_version = function(version) {
+ // Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
+ var result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(version);
+ if (result) {
+ // Return the "1.2.3-g9asdasd" part
+ return result[1];
+ } else {
+ // Unexpected format, pass it through
+ return version;
+ }
+ return
+ };
+
/* This is useful if you need to display some alternative text
* when a collection is empty using rv-hide */
rivets.formatters.length = function(val) {
return strings.join(", ");
};
- rivets.formatters.short_version = function(version) {
- // Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
- var result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(version);
- if (result) {
- // Return the "1.2.3-g9asdasd" part
- return result[1];
- } else {
- // Unexpected format, pass it through
- return version;
- }
- return
- };
-
rivets.bind($("#content"), content_data);
});