sw2at-ui 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/app/assets/javascripts/swat/app/app.coffee +9 -0
  4. data/app/assets/javascripts/swat/app/controllers/global_nav.coffee +2 -0
  5. data/app/assets/javascripts/swat/app/controllers/management/configuration.coffee +13 -0
  6. data/app/assets/javascripts/swat/app/controllers/revision.coffee +3 -2
  7. data/app/assets/javascripts/swat/app/controllers/revisions.coffee +5 -1
  8. data/app/assets/javascripts/swat/app/controllers/root.coffee +3 -1
  9. data/app/assets/javascripts/swat/app/controllers/summary.coffee +5 -36
  10. data/app/assets/javascripts/swat/app/factories/global_control.coffee +23 -0
  11. data/app/assets/javascripts/swat/app/factories/summary/exception_groups.coffee +17 -0
  12. data/app/assets/javascripts/swat/app/factories/{fails_graph.coffee → summary/fails_graph.coffee} +0 -0
  13. data/app/assets/javascripts/swat/app/factories/summary/revision_metrics.coffee +26 -0
  14. data/app/assets/javascripts/swat/app/services/configuration.coffee +4 -0
  15. data/app/assets/javascripts/swat/bower_components.coffee +1 -0
  16. data/app/assets/javascripts/swat/lib/angular-cookies.js +321 -0
  17. data/app/assets/stylesheets/swat/application.scss +22 -6
  18. data/app/assets/stylesheets/swat/configuration.scss +35 -0
  19. data/app/assets/stylesheets/swat/header.scss +35 -1
  20. data/app/assets/stylesheets/swat/nav.scss +85 -0
  21. data/app/assets/stylesheets/swat/swat_theme.scss +60 -67
  22. data/app/assets/stylesheets/swat/vars.scss +54 -0
  23. data/app/controllers/swat/api/configuration_controller.rb +12 -0
  24. data/app/controllers/swat/api/revisions_controller.rb +1 -0
  25. data/app/controllers/swat/pages/management_controller.rb +6 -0
  26. data/app/views/layouts/swat/application.slim +6 -3
  27. data/app/views/swat/pages/management/configuration.slim +28 -0
  28. data/app/views/swat/pages/revisions/index.slim +4 -3
  29. data/app/views/swat/pages/revisions/partials/_revision_header.slim +13 -0
  30. data/app/views/swat/pages/revisions/show.slim +1 -13
  31. data/app/views/swat/pages/revisions/summary.slim +4 -17
  32. data/app/views/swat/shared/_header.slim +2 -0
  33. data/app/views/swat/shared/_nav.slim +22 -0
  34. data/config/routes.rb +10 -0
  35. data/sw2at-ui.gemspec +19 -5
  36. metadata +18 -4
  37. data/app/controllers/swat/revisions_controller.rb +0 -4
@@ -1,5 +1,6 @@
1
+ @import "vars";
2
+
1
3
  #swat {
2
- $greenMain: greenyellow;
3
4
 
4
5
  header {
5
6
  background-color: black;
@@ -15,6 +16,39 @@
15
16
  margin-top: 0;
16
17
  padding: 12px;
17
18
 
19
+ .control {
20
+ float: left;
21
+ color: $greenMain;
22
+ padding: 14px;
23
+ border-radius: 24px;
24
+ width: 43px;
25
+ height: 40px;
26
+ font-size: 27px;
27
+ line-height: 15px;
28
+ cursor: pointer;
29
+ margin-left: 0;
30
+
31
+ &:hover {
32
+ background: rgba(255, 255, 255, 0.31);
33
+ }
34
+
35
+ &.closed {
36
+ &:after { content: '>' }
37
+ }
38
+ &.opened {
39
+ &:after { content: '<' }
40
+ }
41
+ &.refresh {
42
+ float: right;
43
+ width: 40px;
44
+ font-size: 21px;
45
+ margin-top: -3px;
46
+ padding: 7px;
47
+ line-height: 25px;
48
+ &:after { content: 'F5' }
49
+ }
50
+ }
51
+
18
52
  a {
19
53
  color: $greenMain;
20
54
  &:hover {
@@ -0,0 +1,85 @@
1
+ @import "vars";
2
+
3
+ $sidebar-width: 200px;
4
+ $sidebar-width-negative: -$sidebar-width;
5
+
6
+
7
+ #swat {
8
+
9
+ #global-nav {
10
+ //background: grey;
11
+
12
+ width: $sidebar-width;
13
+ overflow: hidden;
14
+ padding: 0px 0px 10px 14px;
15
+ //border-right: 1px solid rgb(204, 200, 200);
16
+
17
+ h2.menu {
18
+ margin-top: 33px;
19
+ text-align: left;
20
+ }
21
+
22
+ ul {
23
+ margin: 0;
24
+ padding: 0;
25
+
26
+ li {
27
+ list-style: none;
28
+ font-size: 20px;
29
+ //border-top: 1px solid #d5d5d5;
30
+ margin-right: 20px;
31
+
32
+
33
+ a {
34
+ background: none;
35
+ width: 100%;
36
+ height: 100%;
37
+ display: inline-block;
38
+ padding: 9px 0px;
39
+ color: darken($successTitleColor,5);
40
+ text-decoration: none;
41
+
42
+ &:hover {
43
+ color: lighten($successTitleColor, 10);
44
+ }
45
+ &[disabled] {
46
+ color: $disabledLinkColor;
47
+ &:hover {
48
+ color: $disabledLinkColor;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+
57
+ .left-menu {
58
+ float: left;
59
+ width: 0;
60
+ margin-left: 0;
61
+ transition: all 0.3s;
62
+ overflow: hidden;
63
+ }
64
+
65
+ .wrapper {
66
+ min-width: 100px;
67
+ margin-left: 0;
68
+ transition: all 0.3s;
69
+ }
70
+
71
+ .main-view {
72
+ display: inline-block;
73
+ width: 100%;
74
+ background: rgb(240, 240, 240);
75
+ padding: 0 5px;
76
+ }
77
+
78
+ .opened {
79
+ margin-left: $sidebar-width;
80
+ .left-menu {
81
+ width: $sidebar-width;
82
+ margin-left: $sidebar-width-negative;
83
+ }
84
+ }
85
+
@@ -1,60 +1,77 @@
1
- $footerSize: 45px;
2
- $negativeFooterSize: -$footerSize;
3
-
4
- $commandWidth: 400px;
5
- $copyIconWidth: 30px;
6
- $commandTextWidth: $commandWidth - $copyIconWidth;
1
+ @import "vars";
7
2
 
8
3
  html, body {
9
4
  height: 100% !important;
10
5
  min-height: 100%;
11
6
  }
12
7
 
8
+ body {
9
+ overflow-y: scroll;
10
+ }
11
+
13
12
  #swat {
14
13
  height: 100%;
15
14
  min-height: 100%;
16
15
 
16
+ .controls {
17
+ float: right;
18
+ .btn {
19
+
20
+
21
+ background-color: $greenBtnBg;
22
+ color: $greenBtnColor;
23
+ font-weight: bold;
24
+ margin-right: 10px;
25
+ &:hover {
26
+ background-color: $greenBtnBgHover;
27
+ }
28
+ }
29
+ }
30
+
31
+
17
32
  #container {
33
+ background: $containerBg;
34
+ margin: 0px 15px 0 15px;
35
+ border: 1px solid $containerBorder;
18
36
 
19
37
  .has-status {
20
-
21
38
  &.in_progress_failed {
22
- color: rgb(242, 40, 77);
23
- background: #F2FFBA;
39
+ color: $failedColor;
40
+ background: $inProgressBg;
24
41
  }
25
42
 
26
43
  &.in_progress_success {
27
- color: rgb(59, 153, 78);
28
- background: #F2FFBA;
44
+ color: $successColor;
45
+ background: $inProgressBg;
29
46
  }
30
47
 
31
48
  &.completed_failed {
32
- color: rgb(242, 40, 77);
33
- background: rgba(252, 226, 222, 0.49);
49
+ color: $failedColor;
50
+ background: $failedBg;
34
51
  }
35
52
 
36
53
  &.completed_passed {
37
- color: rgb(59, 153, 78);
38
- background: rgba(134, 252, 148, 0.49);
54
+ color: $successColor;
55
+ background: $successBg;
39
56
  }
40
57
 
41
58
  &.terminated {
42
- color: rgba(78, 73, 71, 0.68);
43
- background: rgba(205, 202, 201, 0.36);
59
+ color: $terminatedColor;
60
+ background: $terminatedBg;
44
61
  }
45
62
 
46
63
  }
47
64
 
48
65
  .backtrace {
49
- background-color: #400e30;
66
+ background-color: $backtraceBg;
50
67
  padding: 10px;
51
68
  margin-bottom: 5px;
52
- color: #f8f8f8;
69
+ color: $backtraceColor;
53
70
  border-radius: 3px;
54
71
  p {
55
72
  margin-bottom: 0;
56
73
  &.spec {
57
- color: #ff5860;
74
+ color: $backtraceSpecColor;
58
75
  }
59
76
  }
60
77
  }
@@ -85,28 +102,10 @@ html, body {
85
102
  float: left;
86
103
  margin-left: 20px;
87
104
  &.in_progress_success, &.completed_passed {
88
- color: #50ce5f;
105
+ color: $successTitleColor;
89
106
  }
90
107
  &.in_progress_failed,&.completed_failed {
91
- color: #ff5246;
92
- }
93
- }
94
- .controls {
95
- float: right;
96
- .btn {
97
- background-color: rgb(124, 222, 124);
98
- color: green;
99
- font-weight: bold;
100
- margin-right: 10px;
101
- &:hover {
102
- background-color: rgb(169, 222, 157);
103
- }
104
- }
105
- .revisions {
106
- opacity: 1;
107
- }
108
- .reload {
109
- opacity: 1;
108
+ color: $failedTitleColor;
110
109
  }
111
110
  }
112
111
  }
@@ -123,7 +122,7 @@ html, body {
123
122
 
124
123
  #metrics-container {
125
124
  background: white;
126
- border: 1px solid rgb(228, 225, 225);
125
+ border: 1px solid $containerBorder;
127
126
  border-top: none;
128
127
  min-height: 500px;
129
128
  overflow: hidden;
@@ -145,7 +144,7 @@ html, body {
145
144
  #exceptions-groups {
146
145
  .failed-tests {
147
146
  .test-case {
148
- color: #3F3F3F;
147
+ color: $failedCaseColor;
149
148
  margin-top: 3px;
150
149
  }
151
150
 
@@ -154,6 +153,7 @@ html, body {
154
153
 
155
154
  #revisions-container {
156
155
  min-height: 50px;
156
+ padding-top: 24px;
157
157
 
158
158
  .revisions-header {
159
159
  margin: 0;
@@ -205,6 +205,7 @@ html, body {
205
205
  .cell {
206
206
  padding: 8px;
207
207
  display: block;
208
+ //background: $greyBg;
208
209
  }
209
210
  .detailed-info {
210
211
  padding: 0 8px;
@@ -228,31 +229,30 @@ html, body {
228
229
  margin: 0;
229
230
  border: none;
230
231
  font-weight: bold;
231
- background: black;
232
- color: red;
232
+ background: $commandBg;
233
233
  }
234
234
  }
235
235
  &.failed {
236
- background: mistyrose;
237
- color: red;
236
+ background: $failedTestCaseBg;
237
+ color: $failedTestCaseColor;
238
238
  .main-info {
239
239
  cursor: pointer;
240
240
  &:hover {
241
- background: #ffd7e5;
241
+ background: $failedTestCaseBgHover;
242
242
  }
243
243
  }
244
244
  td.command {
245
245
  input {
246
- color: rgb(223, 96, 96);
246
+ color: $failedTestCaseCommandColor;
247
247
  }
248
248
  }
249
249
  }
250
250
  &.passed {
251
- background: lightgreen;
252
- color: green;
251
+ background: $passedTestCaseBg;
252
+ color: $passedTestCaseColor;
253
253
  td.command {
254
254
  input {
255
- color: rgb(129, 192, 129);
255
+ color: $passedTestCaseCommandColor;
256
256
  }
257
257
  }
258
258
  }
@@ -272,28 +272,21 @@ html, body {
272
272
  height: $footerSize;
273
273
  margin-top: $negativeFooterSize;
274
274
  text-align: center;
275
+
276
+
277
+ background-color: $blackColor;
278
+ color: $greenMain;
279
+ padding-top: 15px;
280
+ margin-left: 15px;
281
+ margin-right: 15px;
275
282
  }
276
283
  .nav-tabs {
277
284
  margin-left: 12px;
278
285
  margin-right: 12px;
279
286
  span.label {
280
- color: black;
287
+ color: $blackColor;
281
288
  font-size: 15px;
282
289
  }
283
- span.status {
284
- &.in_progress_success {
285
- color: rgb(192, 175, 84);
286
- }
287
- &.in_progress_failed {
288
- color: rgb(217, 140, 160);
289
- }
290
- &.completed_failed {
291
- color: rgb(242, 40, 77);
292
- }
293
- &.completed_passed {
294
- color: rgb(61, 168, 83);
295
- }
296
- }
297
290
  }
298
291
  .tab-content {
299
292
  .tab-pane {
@@ -305,7 +298,7 @@ html, body {
305
298
  font-size: 20px;
306
299
  display: inline-block;
307
300
  text-decoration: none;
308
- color: black;
301
+ color: $blackColor;
309
302
  margin-left: 5px;
310
303
  }
311
304
  }
@@ -0,0 +1,54 @@
1
+ $greyBg: #9f9f9f;
2
+ $greenMain: greenyellow;
3
+
4
+ $blackColor: black;
5
+ $whiteColor: white;
6
+ $lightBlueColor: #C2CAF2;
7
+
8
+ $disabledLinkColor: rgba(198, 198, 197, 0.68);
9
+
10
+ $footerSize: 45px;
11
+ $negativeFooterSize: -$footerSize;
12
+
13
+ $commandWidth: 400px;
14
+ $copyIconWidth: 30px;
15
+ $commandTextWidth: $commandWidth - $copyIconWidth;
16
+
17
+ $greenBtnBg: rgb(124, 222, 124);
18
+ $greenBtnBgHover: rgb(169, 222, 157);
19
+ $greenBtnColor: green;
20
+
21
+ $containerBg: rgb(240, 240, 240);
22
+ $containerBorder: rgb(215, 215, 215);
23
+
24
+ $failedColor: rgb(242, 40, 77);
25
+ $inProgressBg: #F2FFBA;
26
+ $successColor: rgb(59, 153, 78);
27
+ $successBg: rgba(134, 252, 148, 0.49);
28
+ $failedBg: rgba(252, 226, 222, 0.49);
29
+ $terminatedColor: rgba(78, 73, 71, 0.68);
30
+ $terminatedBg: rgba(205, 202, 201, 0.36);
31
+
32
+ $backtraceBg: #400e30;
33
+ $backtraceColor: #f8f8f8;
34
+ $backtraceSpecColor: #ff5860;
35
+
36
+ $successTitleColor: #50ce5f;
37
+ $failedTitleColor: #ff5246;
38
+
39
+ $failedCaseColor: #3F3F3F;
40
+
41
+ $commandBg: $blackColor;
42
+
43
+ $failedTestCaseCommandColor: rgb(223, 96, 96);
44
+ $failedTestCaseBg: mistyrose;
45
+ $failedTestCaseColor: red;
46
+ $failedTestCaseBgHover: #ffd7e5;
47
+
48
+ $passedTestCaseCommandColor: rgb(129, 192, 129);
49
+ $passedTestCaseBg: lightgreen;
50
+ $passedTestCaseColor: green;
51
+ $passedTestCaseBgHover: #ffd7e5;
52
+
53
+ $greyBg: rgb(236, 236, 236);
54
+ $lightBlueColor: #5967AB;
@@ -0,0 +1,12 @@
1
+ module Swat
2
+ module Api
3
+ class ConfigurationController < Swat::ApplicationController
4
+
5
+
6
+ def show
7
+ render json: Swat::UI.config.options
8
+ end
9
+
10
+ end
11
+ end
12
+ end
@@ -27,6 +27,7 @@ module Swat
27
27
  def parse_revision_options
28
28
  @options = params[:json_params] ? HashWithIndifferentAccess[JSON.parse(params[:json_params])] : params
29
29
  @options[:time] = @options[:time].to_i if @options[:time]
30
+ @options[:branch] = URI.unescape(@options[:branch].to_s) if @options[:branch]
30
31
  end
31
32
 
32
33
  end
@@ -0,0 +1,6 @@
1
+ module Swat
2
+ module Pages
3
+ class ManagementController < BasePagesController
4
+ end
5
+ end
6
+ end
@@ -25,9 +25,12 @@ html lang="en" ng-app="SWAT"
25
25
  = yield(:subheader)
26
26
  nav
27
27
  = yield(:nav)
28
- #content
29
- = yield
30
- #ui-view ui-view="content"
28
+ #content.wrapper ng-class="globalControl.status"
29
+ .left-menu ng-contoller="GlobalNavController"
30
+ = render partial: 'swat/shared/nav'
31
+ .main-view
32
+ = yield
33
+ #ui-view ui-view="content"
31
34
 
32
35
  div.push
33
36
  footer#footer
@@ -0,0 +1,28 @@
1
+ #configuration
2
+ span.loader ng-class="{ true: 'invisible' }[(configPromise && configPromise.$resolved)]"
3
+ h1.title Configuration
4
+ .configuration-info-container
5
+ #configuration-info
6
+ div ng-if="config"
7
+ h2.heading Firebase
8
+ table.info.firebase
9
+ tbody
10
+ tr
11
+ td.name
12
+ | Firebase Path
13
+ td.value
14
+ | {{ config.firebase_path }}
15
+
16
+ h2.heading Threads
17
+ table.info.threads
18
+ tbody
19
+ tr ng-repeat="thread in config.threads"
20
+ td.name
21
+ .cell
22
+ | {{ thread.name }}
23
+ td.options
24
+ .cell
25
+ .pattern
26
+ | {{ thread.file_pattern }}
27
+ .tags
28
+ | {{ thread.tag }} {{ thread.tags.join(',') }}
@@ -1,5 +1,5 @@
1
1
  #revisions-container
2
- span.loader ng-class="{ true: 'invisible' }[(revisions && revisions.$resolved)]"
2
+ span.loader ng-class="{ true: 'invisible' }[(revisionsPromise && revisionsPromise.$resolved)]"
3
3
  h2.revisions-header Revisions
4
4
  .controls
5
5
  .list ng-if="revisions && (revisions.length > 0)"
@@ -13,8 +13,9 @@
13
13
  th Status
14
14
  tr.has-status ng-class="revision.data.status.name" ng-repeat="revision in revisions | orderBy: '-data.time'" ui-sref="revision(revision.data)"
15
15
  td
16
- strong
17
- | {{ revision.data.name || revision.data.time }}
16
+ a.has-status ui-sref="revision(revision.data)" ng-class="revision.data.status.name"
17
+ strong
18
+ | {{ revision.data.name || revision.data.time }}
18
19
  td
19
20
  | {{ revision.data.branch }}
20
21
  td
@@ -0,0 +1,13 @@
1
+ h1.revision
2
+ revision-name revision="revision" ng-if="(revisionPromise && revisionPromise.$resolved)"
3
+
4
+ span.revision-status ng-class="revision.data.status.name"
5
+ | {{ ' '+revision.data.status.label }}
6
+ span.loader ng-class="{ true: 'invisible' }[(revisionPromise && revisionPromise.$resolved)]"
7
+ .controls
8
+ button.btn.revisions ui-sref="revisions" title="See all revisions list" ng-disabled="(currentState == 'revisions')"
9
+ | Revisions
10
+ button.btn.revisions ui-sref="summary(revision.data)" title="See this revision summary" ng-disabled="(!revision || currentState == 'summary')"
11
+ | Summary
12
+ button.btn.revisions ui-sref="revision(revision.data)" title="See this revision tests" ng-disabled="(!revision || currentState == 'revision')"
13
+ | Tests
@@ -1,17 +1,5 @@
1
1
  #revision-info
2
- h1.revision
3
- revision-name revision="revision" ng-if="(revisionPromise && revisionPromise.$resolved)"
4
-
5
- span.revision-status ng-class="revision.data.status.name"
6
- | {{ ' '+revision.data.status.label }}
7
- span.loader ng-class="{ true: 'invisible' }[(revisionPromise && revisionPromise.$resolved)]"
8
- .controls
9
- button.btn.revisions ui-sref="revisions" title="See all revisions list"
10
- | Go to Revisions
11
- button.btn.revisions ui-sref="summary(revision.data)" title="See this revision summary" ng-disabled="!revision"
12
- | Summary
13
- button.btn.reload ng-click="reloadData()" title="Refresh this revision"
14
- | Refresh
2
+ = render partial: 'swat/pages/revisions/partials/revision_header'
15
3
 
16
4
  div
17
5
  tabset
@@ -1,31 +1,18 @@
1
1
  #revision-info
2
- h1.revision
3
- revision-name revision="revision" ng-if="(revisionPromise && revisionPromise.$resolved)"
4
-
5
- span.revision-status ng-class="revision.data.status.name"
6
- | {{ ' '+revision.data.status.label }}
7
- span.loader ng-class="{ true: 'invisible' }[(revisionPromise && revisionPromise.$resolved)]"
8
- .controls
9
- button.btn.revisions ui-sref="revisions" title="See all revisions list"
10
- | Go to Revisions
11
- button.btn.revisions ui-sref="revision(revision.data)" title="See this revision tests" ng-disabled="!revision"
12
- | Tests
13
- button.btn.reload ng-click="reloadData()" title="Refresh this revision"
14
- | Refresh
2
+ = render partial: 'swat/pages/revisions/partials/revision_header'
15
3
 
16
4
  div
17
5
  tabset
18
6
  tab
19
7
  tab-heading
20
- span.label Graph
8
+ span.label Statistics
21
9
  .tab-content
22
10
  #metrics-container
23
11
  #global-stats-container
24
- table#global-stats.table.table-bordered.table-hover
12
+ table#global-stats.info
25
13
  tr ng-repeat="metric in summary.metrics"
26
14
  td.name
27
- strong
28
- | {{ metric.name }}
15
+ | {{ metric.name }}
29
16
  td.value
30
17
  | {{ metric.value }}
31
18
 
@@ -1,4 +1,5 @@
1
1
  #header-label
2
+ .control ng-class="globalControl.status" ng-click="globalControl.toggle()" title="Main Menu"
2
3
  h2.header-label
3
4
  a href="/swat"
4
5
  .S
@@ -6,3 +7,4 @@
6
7
  .to
7
8
  .A
8
9
  .T
10
+ .control.refresh ng-click="globalControl.reload()" title="Refresh"
@@ -0,0 +1,22 @@
1
+ #global-nav
2
+ h2.menu Main Menu
3
+ ul
4
+ li
5
+ a.revisions ui-sref="revisions" title="See all revisions list"
6
+ | Revisions
7
+
8
+ li
9
+ a.revisions ui-sref="configuration" title="Configuration"
10
+ | Configuration
11
+
12
+ li
13
+ a.revisions href="#" title="Run new revision" ng-disabled="true"
14
+ | Run
15
+
16
+ li
17
+ a.revisions href="#" title="Open console" ng-disabled="true"
18
+ | Console
19
+
20
+ li
21
+ a.revisions href="#" title="Read about us" ng-disabled="true"
22
+ | About Us
data/config/routes.rb CHANGED
@@ -7,8 +7,11 @@ Swat::Engine.routes.draw do
7
7
  namespace :api do
8
8
  resources :test_cases
9
9
  resources :revisions
10
+
10
11
  get 'revision', to: 'revisions#show'
11
12
  put 'revision/name/:name', to: 'revisions#set_name'
13
+
14
+ get 'configuration', to: 'configuration#show'
12
15
  end
13
16
 
14
17
  # Helper Methods
@@ -34,6 +37,13 @@ Swat::Engine.routes.draw do
34
37
  get p, to: p
35
38
  end
36
39
  end
40
+
41
+ namespace :management do
42
+ pages = [ :console, :configuration, :about ]
43
+ pages.each do |p|
44
+ get p, to: p
45
+ end
46
+ end
37
47
  end
38
48
 
39
49
  end