summaryrefslogtreecommitdiff
path: root/widgets/gitlab_build_status
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/gitlab_build_status')
-rw-r--r--widgets/gitlab_build_status/gitlab_build_status.coffee11
-rw-r--r--widgets/gitlab_build_status/gitlab_build_status.html15
-rw-r--r--widgets/gitlab_build_status/gitlab_build_status.scss56
3 files changed, 82 insertions, 0 deletions
diff --git a/widgets/gitlab_build_status/gitlab_build_status.coffee b/widgets/gitlab_build_status/gitlab_build_status.coffee
new file mode 100644
index 0000000..e501aed
--- /dev/null
+++ b/widgets/gitlab_build_status/gitlab_build_status.coffee
@@ -0,0 +1,11 @@
+class Dashing.GitlabBuildStatus extends Dashing.Widget
+
+ onData: (data) ->
+ if data.failed
+ $(@node).find('div.gitlab-build-failed').show()
+ $(@node).find('div.gitlab-build-succeeded').hide()
+ $(@node).css("background-color", "red")
+ else
+ $(@node).find('div.gitlab-build-failed').hide()
+ $(@node).find('div.gitlab-build-succeeded').show()
+ $(@node).css("background-color", "#50BA5B")
diff --git a/widgets/gitlab_build_status/gitlab_build_status.html b/widgets/gitlab_build_status/gitlab_build_status.html
new file mode 100644
index 0000000..b71d8a6
--- /dev/null
+++ b/widgets/gitlab_build_status/gitlab_build_status.html
@@ -0,0 +1,15 @@
+<div class="build-failed">
+ <h1 class="gitlab-status"><span data-bind="title"></span> FAILED</h1>
+ <ul class="list-nostyle list-failed">
+ <li data-foreach-item="broken_builds">
+ <div class="label" data-bind="item.name"></div>
+ <div class="value" data-bind="item.status"></div>
+ </li>
+ </ul>
+</div>
+
+<div class="gitlab-build-succeeded">
+ <h1 class="gitlab-status">All Gitlab builds are successful</h1>
+</div>
+
+<p class="updated-at" data-bind="updatedAtMessage"></p>
diff --git a/widgets/gitlab_build_status/gitlab_build_status.scss b/widgets/gitlab_build_status/gitlab_build_status.scss
new file mode 100644
index 0000000..46e867d
--- /dev/null
+++ b/widgets/gitlab_build_status/gitlab_build_status.scss
@@ -0,0 +1,56 @@
+// ----------------------------------------------------------------------------
+// Sass declarations
+// ----------------------------------------------------------------------------
+$background-color: #ec663c;
+$title-color: rgba(255, 255, 255, 0.7);
+$label-color: rgba(255, 255, 255, 0.7);
+$value-color: #fff;
+
+// ----------------------------------------------------------------------------
+// Widget-text styles
+// ----------------------------------------------------------------------------
+.widget-gitlab-build-status {
+
+ background-color: $background-color;
+
+ .title {
+ color: $title-color;
+ }
+ .updated-at {
+ color: rgba(255, 255, 255, 0.7);
+ }
+
+ ol, ul {
+ margin: 0 15px;
+ text-align: left;
+ color: $label-color;
+ }
+
+ li {
+ margin-bottom: 5px;
+ font-size: 20px;
+ }
+
+ .label {
+ color: $label-color;
+ }
+
+ .value {
+ margin-left: 12px;
+ font-weight: 600;
+ color: $value-color;
+ }
+
+ .updated-at {
+ color: rgba(0, 0, 0, 0.3);
+ }
+
+ .build-failed {
+ display: none;
+ }
+
+ .fa {
+ font-size: 10em;
+ color: $label-color;
+ }
+}