|
4 | 4 | swap: Either[String, gitbucket.monitoring.models.Swap], |
5 | 5 | diskSpace: gitbucket.monitoring.models.DiskSpace)(implicit context: gitbucket.core.controller.Context) |
6 | 6 | @import context._ |
| 7 | +@import gitbucket.monitoring.utils.Message |
7 | 8 | @gitbucket.core.html.main("Monitoring") { |
8 | 9 | @gitbucket.core.admin.html.menu("monitoring") { |
9 | 10 | @gitbucket.monitoring.html.navigation(context) |
|
43 | 44 | <div class="panel panel-default"> |
44 | 45 | <div class="panel-heading strong">Used</div> |
45 | 46 | <div class="panel-body text-right"> |
46 | | - @m.used / @m.total MB |
| 47 | + <!--HACK: For Windows. Not so good code...--> |
| 48 | + @m.used match { |
| 49 | + case Message.notSupported => { @gitbucket.monitoring.helper.html.coloring(m.used) } |
| 50 | + case _ => { @gitbucket.monitoring.helper.html.coloring(m.used) / @m.total MB } |
| 51 | + } |
47 | 52 | </div> |
48 | 53 | </div> |
49 | | - </div> |
| 54 | + </div> |
50 | 55 | <div class="col-sm-2"> |
51 | 56 | <div class="panel panel-default"> |
52 | 57 | <div class="panel-heading strong">Free</div> |
53 | 58 | <div class="panel-body text-right"> |
54 | | - @m.free / @m.total MB |
| 59 | + <!--HACK: For Windows. Not so good code...--> |
| 60 | + @m.free match { |
| 61 | + case Message.notSupported => { @gitbucket.monitoring.helper.html.coloring(m.free) } |
| 62 | + case _ => { @gitbucket.monitoring.helper.html.coloring(m.free) / @m.total MB } |
| 63 | + } |
55 | 64 | </div> |
56 | 65 | </div> |
57 | 66 | </div> |
58 | 67 | <div class="col-sm-2"> |
59 | 68 | <div class="panel panel-default"> |
60 | 69 | <div class="panel-heading strong">Shared</div> |
61 | 70 | <div class="panel-body text-right"> |
62 | | - @m.shared / @m.total MB |
| 71 | + <!--HACK: For Windows. Not so good code...--> |
| 72 | + @m.shared match { |
| 73 | + case Message.notSupported => { @gitbucket.monitoring.helper.html.coloring(m.shared) } |
| 74 | + case _ => { @gitbucket.monitoring.helper.html.coloring(m.shared) / @m.total MB } |
| 75 | + } |
63 | 76 | </div> |
64 | 77 | </div> |
65 | 78 | </div> |
66 | 79 | <div class="col-sm-2"> |
67 | 80 | <div class="panel panel-default"> |
68 | 81 | <div class="panel-heading strong">Buff/Cache</div> |
69 | 82 | <div class="panel-body text-right"> |
70 | | - @m.buff_cache / @m.total MB |
| 83 | + <!--HACK: For Windows. Not so good code...--> |
| 84 | + @m.buff_cache match { |
| 85 | + case Message.notSupported => { @gitbucket.monitoring.helper.html.coloring(m.buff_cache) } |
| 86 | + case _ => { @gitbucket.monitoring.helper.html.coloring(m.buff_cache) / @m.total MB } |
| 87 | + } |
71 | 88 | </div> |
72 | 89 | </div> |
73 | 90 | </div> |
74 | 91 | <div class="col-sm-2"> |
75 | 92 | <div class="panel panel-default"> |
76 | 93 | <div class="panel-heading strong">Available</div> |
77 | 94 | <div class="panel-body text-right"> |
78 | | - @m.available / @m.total MB |
| 95 | + @gitbucket.monitoring.helper.html.coloring(m.available) / @m.total MB |
79 | 96 | </div> |
80 | 97 | </div> |
81 | 98 | </div> |
|
0 commit comments