Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Lopez <fjsanpedro@gmail.com>2017-08-24 17:34:36 +0300
committerFrancisco Lopez <fjlopez@gitlab.com>2017-10-25 23:51:26 +0300
commit294f40e2c8f51239bfa0e3514e7fe4f3c8ae00cb (patch)
treedabae15824cce9c6e838751d872229a5fdfeed21 /app/helpers/instance_configuration_helper.rb
parent3ddffec0d62146e27298a982a7d2935dbe518fb9 (diff)
Added ssh fingerprint, gitlab ci and pages information in an instance configuration page
Closes #25142
Diffstat (limited to 'app/helpers/instance_configuration_helper.rb')
-rw-r--r--app/helpers/instance_configuration_helper.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/helpers/instance_configuration_helper.rb b/app/helpers/instance_configuration_helper.rb
new file mode 100644
index 00000000000..cee319f20bc
--- /dev/null
+++ b/app/helpers/instance_configuration_helper.rb
@@ -0,0 +1,18 @@
+module InstanceConfigurationHelper
+ def instance_configuration_cell_html(value, &block)
+ return '-' unless value.to_s.presence
+
+ block_given? ? yield(value) : value
+ end
+
+ def instance_configuration_host(host)
+ @instance_configuration_host ||= instance_configuration_cell_html(host).capitalize
+ end
+
+ # Value must be in bytes
+ def instance_configuration_human_size_cell(value)
+ instance_configuration_cell_html(value) do |v|
+ number_to_human_size(v, strip_insignificant_zeros: true, significant: false)
+ end
+ end
+end