Skip to content
Snippets Groups Projects
Commit 6694c085 authored by Rodrigo Nascimento's avatar Rodrigo Nascimento
Browse files

Add more data and improve layout of admin info

parent 3945da87
No related merge requests found
......@@ -52,6 +52,7 @@ RocketChat.models.Settings = new class extends RocketChat.models._Base
record =
_id: _id
value: value
_createdAt: new Date
return @insert record
......
......@@ -3,6 +3,7 @@ RocketChat.statistics.get = ->
# Version
statistics.uniqueId = RocketChat.settings.get("uniqueID")
statistics.createdAt = RocketChat.models.Settings.findOne("uniqueID")?._createdAt
statistics.version = RocketChat.Info?.version
statistics.tag = RocketChat.Info?.tag
statistics.branch = RocketChat.Info?.branch
......@@ -85,4 +86,13 @@ RocketChat.statistics.get = ->
freemem: os.freemem()
cpus: os.cpus()
statistics.process =
nodeVersion: process.version
pid: process.pid
uptime: process.uptime()
statistics.migration = RocketChat.Migrations._getControl()
statistics.instanceCount = InstanceStatus.getCollection().find().count()
return statistics
......@@ -3919,24 +3919,25 @@ a.github-fork {
.statistics-table {
margin-bottom: 30px;
border: 1px solid;
width:100%;
border: 2px solid #F5F5F5;
width: 100%;
tr {
background-color:#FFFFFF;
background-color: #FFFFFF;
&:nth-of-type(even) {
background-color:#FBFBFB;
background-color: #F5F5F5;
}
}
th, td {
text-align: left;
padding: 3px 10px;
padding: 6px 8px;
}
th {
width: 20%;
text-align: right;
width: 30%;
}
td {
width: 80%;
width: 70%;
}
}
......
......@@ -1183,7 +1183,7 @@ a.github-fork {
}
.statistics-table {
border-color: #F9F9F9;
border-color: #eee;
}
@media all and(max-width: 780px) {
......@@ -1214,4 +1214,4 @@ a.github-fork {
.attention-message {
color: white;
}
\ No newline at end of file
}
......@@ -29,12 +29,8 @@ Template.adminInfo.helpers
return _.numberFormat(number, 2)
optOut: ->
return RocketChat.settings.get 'Statistics_opt_out'
server: ->
info: ->
return RocketChat.Info
commit: ->
return _.extend(RocketChat.Info?.commit, { tag: RocketChat.Info?.tag, branch: RocketChat.Info?.branch })
migration: ->
return Template.instance().migration.get()
build: ->
return RocketChat.Info?.compile || RocketChat.Info?.build
......@@ -71,7 +67,6 @@ Template.adminInfo.onRendered ->
Template.adminInfo.onCreated ->
instance = @
@statistics = new ReactiveVar {}
@migration = new ReactiveVar {}
@ready = new ReactiveVar false
Meteor.call 'getStatistics', (error, statistics) ->
......
......@@ -11,31 +11,35 @@
<table class="statistics-table">
<tr>
<th>{{_ "Version"}}</th>
<td>{{server.version}}</td>
<td>{{statistics.version}}</td>
</tr>
<tr>
<th>{{_ "DB_Migration"}}</th>
<td>{{migration.version}}</td>
<td>{{statistics.migration.version}}</td>
</tr>
<tr>
<th>{{_ "DB_Migration_Date"}}</th>
<td>{{statistics.migration.lockedAt}}</td>
</tr>
<tr>
<th>{{_ "Installed_at"}}</th>
<td></td>
<td>{{statistics.createdAt}}</td>
</tr>
<tr>
<th>{{_ "Started_at"}}</th>
<td></td>
<th>{{_ "Uptime"}}</th>
<td>{{humanReadableTime statistics.process.uptime}}</td>
</tr>
<tr>
<th>{{_ "Deployment_ID"}}</th>
<td></td>
<td>{{statistics.uniqueId}}</td>
</tr>
<tr>
<th>{{_ "Instance_ID"}}</th>
<td></td>
<th>{{_ "PID"}}</th>
<td>{{statistics.process.pid}}</td>
</tr>
<tr>
<th>{{_ "Running_Instances"}}</th>
<td></td>
<td>{{statistics.instanceCount}}</td>
</tr>
</table>
......@@ -43,27 +47,27 @@
<table class="statistics-table">
<tr>
<th>{{_ "Hash"}}</th>
<td>{{commit.hash}}</td>
<td>{{info.commit.hash}}</td>
</tr>
<tr>
<th>{{_ "Date"}}</th>
<td>{{commit.date}}</td>
<td>{{info.commit.date}}</td>
</tr>
<tr>
<th>{{_ "Branch"}}</th>
<td>{{commit.branch}}</td>
<td>{{info.commit.branch}}</td>
</tr>
<tr>
<th>{{_ "Tag"}}</th>
<td>{{commit.tag}}</td>
<td>{{info.commit.tag}}</td>
</tr>
<tr>
<th>{{_ "Author"}}</th>
<td>{{commit.author}}</td>
<td>{{info.commit.author}}</td>
</tr>
<tr>
<th>{{_ "Subject"}}</th>
<td>{{commit.subject}}</td>
<td>{{info.commit.subject}}</td>
</tr>
</table>
......@@ -91,7 +95,7 @@
</tr>
<tr>
<th>{{_ "Node_version"}}</th>
<td></td>
<td>{{statistics.process.nodeVersion}}</td>
</tr>
<tr>
<th>{{_ "OS_Uptime"}}</th>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment