Skip to content
Snippets Groups Projects
Commit cc14a79d authored by Martin Schoeler's avatar Martin Schoeler
Browse files

Merge remote-tracking branch 'origin/develop' into ui-account-to-js

parents a1d215be 079b7ff7
No related branches found
No related tags found
No related merge requests found
Showing
with 1144 additions and 874 deletions
......@@ -72,16 +72,24 @@ before_deploy:
- ".travis/namefiles.sh"
- echo ".travis/sandstorm.sh"
deploy:
provider: s3
access_key_id: AKIAIKIA7H7D47KUHYCA
secret_access_key: "$ACCESSKEY"
bucket: download.rocket.chat
skip_cleanup: true
upload_dir: build
local_dir: "$ROCKET_DEPLOY_DIR"
on:
condition: "$TRAVIS_PULL_REQUEST=false"
all_branches: true
- provider: s3
access_key_id: AKIAIKIA7H7D47KUHYCA
secret_access_key: "$ACCESSKEY"
bucket: download.rocket.chat
skip_cleanup: true
upload_dir: build
local_dir: "$ROCKET_DEPLOY_DIR"
on:
condition: "$TRAVIS_PULL_REQUEST=false"
all_branches: true
- provider: releases
api-key: "$GITHUB_TOKEN"
file_glob: true
file: build/*
skip_cleanup: true
on:
tags: true
after_deploy:
- ".travis/docker.sh"
- ".travis/update-releases.sh"
......
......@@ -267,6 +267,7 @@
"BotHelpers_userFields": "User Fields",
"BotHelpers_userFields_Description": "CSV of user fields that can be accessed by bots helper methods.",
"Branch": "Branch",
"Broadcast_Connected_Instances": "Broadcast Connected Instances",
"Bugsnag_api_key": "Bugsnag API Key",
"busy": "busy",
"Busy": "Busy",
......@@ -362,6 +363,7 @@
"CROWD_Reject_Unauthorized": "Reject Unauthorized",
"CRM_Integration": "CRM Integration",
"Current_Chats": "Current Chats",
"Current_Status": "Current Status",
"Custom": "Custom",
"Custom_Emoji": "Custom Emoji",
"Custom_Emoji_Add": "Add New Emoji",
......@@ -706,6 +708,7 @@
"Install_FxOs_follow_instructions": "Please confirm the app installation on your device (press \"Install\" when prompted).",
"Installation": "Installation",
"Installed_at": "Installed at",
"Instance_Record": "Instance Record",
"Instructions_to_your_visitor_fill_the_form_to_send_a_message": "Instructions to your visitor fill the form to send a message",
"Impersonate_user": "Impersonate User",
"Impersonate_user_description": "When enabled, integration posts as the user that triggered integration",
......@@ -1256,6 +1259,7 @@
"Reset_password": "Reset password",
"Restart": "Restart",
"Restart_the_server": "Restart the server",
"Retry_Count": "Retry Count",
"Role": "Role",
"Role_Editing": "Role Editing",
"Role_removed": "Role removed",
......@@ -1560,6 +1564,7 @@
"Unread_Rooms": "Unread Rooms",
"Unread_Rooms_Mode": "Unread Rooms Mode",
"Unstar_Message": "Remove Star",
"Updated_at": "Updated at",
"Upload_file_description": "File description",
"Upload_file_name": "File name",
"Upload_file_question": "Upload file?",
......@@ -1719,4 +1724,4 @@
"your_message_optional": "your message (optional)",
"Your_password_is_wrong": "Your password is wrong!",
"Your_push_was_sent_to_s_devices": "Your push was sent to %s devices"
}
\ No newline at end of file
}
......@@ -5,6 +5,8 @@ Template.adminInfo.helpers
return Template.instance().ready.get()
statistics: ->
return Template.instance().statistics.get()
instances: ->
return Template.instance().instances.get()
inGB: (size) ->
if size > 1073741824
return _.numberFormat(size / 1024 / 1024 / 1024, 2) + ' GB'
......@@ -52,13 +54,20 @@ Template.adminInfo.onRendered ->
Template.adminInfo.onCreated ->
instance = @
@statistics = new ReactiveVar {}
@instances = new ReactiveVar []
@ready = new ReactiveVar false
if RocketChat.authz.hasAllPermission('view-statistics')
Meteor.call 'getStatistics', (error, statistics) ->
instance.ready.set true
if error
handleError(error)
else
instance.statistics.set statistics
Meteor.call 'instances/get', (error, instances) ->
instance.ready.set true
if error
handleError(error)
else
instance.instances.set instances
......@@ -226,6 +226,50 @@
</tr>
</table>
{{#if instances}}
<h3>{{_ "Broadcast_Connected_Instances"}}</h3>
{{#each instances}}
<table class="statistics-table secondary-background-color">
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Address"}}</th>
<td class="border-component-color">{{address}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Auth"}}</th>
<td class="border-component-color">{{broadcastAuth}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Current_Status"}} > {{_ "Connected"}}</th>
<td class="border-component-color">{{currentStatus.connected}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Current_Status"}} > {{_ "Retry_Count"}}</th>
<td class="border-component-color">{{currentStatus.retryCount}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Current_Status"}} > {{_ "Status"}}</th>
<td class="border-component-color">{{currentStatus.status}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Instance_Record"}} > {{_ "ID"}}</th>
<td class="border-component-color">{{instanceRecord._id}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Instance_Record"}} > {{_ "PID"}}</th>
<td class="border-component-color">{{instanceRecord.pid}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Instance_Record"}} > {{_ "Created_at"}}</th>
<td class="border-component-color">{{formatDate instanceRecord._createdAt}}</td>
</tr>
<tr class="admin-table-row">
<th class="content-background-color border-component-color">{{_ "Instance_Record"}} > {{_ "Updated_at"}}</th>
<td class="border-component-color">{{formatDate instanceRecord._updatedAt}}</td>
</tr>
</table>
{{/each}}
{{/if}}
<button type="button" class="button primary refresh">Refresh</button>
{{else}}
{{_ "Loading..."}}
......
......@@ -9,6 +9,8 @@ getUploadPreview = (file, callback) ->
# If greater then 10MB don't try and show a preview
if file.file.size > 10 * 1000000
callback(file, null)
else if not file.file.type?
callback(file, null)
else
if file.file.type.indexOf('audio') > -1 or file.file.type.indexOf('video') > -1 or file.file.type.indexOf('image') > -1
file.type = file.file.type.split('/')[0]
......
This diff is collapsed.
This diff is collapsed.
/* globals ChromeScreenShare, fireGlobalEvent */
this.ChromeScreenShare = {
screenCallback: undefined,
getSourceId(navigator, callback) {
if (callback == null) {
throw '"callback" parameter is mandatory.';
}
ChromeScreenShare.screenCallback = callback;
if (navigator === 'electron') {
return fireGlobalEvent('get-sourceId', '*');
}
return window.postMessage('get-sourceId', '*');
}
};
window.addEventListener('message', function(e) {
if (e.origin !== window.location.origin) {
return;
}
if (e.data === 'PermissionDeniedError') {
if (ChromeScreenShare.screenCallback != null) {
return ChromeScreenShare.screenCallback('PermissionDeniedError');
}
throw new Error('PermissionDeniedError');
}
if (e.data.sourceId != null) {
return typeof ChromeScreenShare.screenCallback === 'function' && ChromeScreenShare.screenCallback(e.data.sourceId);
}
});
......@@ -7,16 +7,15 @@ Package.describe({
Package.onUse(function(api) {
api.use('rocketchat:lib');
api.use('coffeescript');
api.use('ecmascript');
api.use('templating', 'client');
api.mainModule('client/WebRTCClass.js', 'client');
api.addFiles('client/adapter.js', 'client');
// api.addFiles(');
api.addFiles('client/screenShare.js', 'client');
api.addFiles('adapter.js', 'client');
api.addFiles('WebRTCClass.coffee', 'client');
api.addFiles('screenShare.coffee', 'client');
api.addFiles('server/settings.js', 'server');
api.addFiles('server/settings.coffee', 'server');
api.export('WebRTC');
api.export('WebRTC', 'client');
});
@ChromeScreenShare =
screenCallback: undefined
getSourceId: (navigator, callback) ->
if not callback? then throw '"callback" parameter is mandatory.'
ChromeScreenShare.screenCallback = callback
if navigator is 'electron'
fireGlobalEvent('get-sourceId', '*')
else
window.postMessage('get-sourceId', '*')
window.addEventListener 'message', (e) ->
if e.origin isnt window.location.origin
return
# "cancel" button was clicked
if e.data is 'PermissionDeniedError'
if ChromeScreenShare.screenCallback?
return ChromeScreenShare.screenCallback('PermissionDeniedError')
else
throw new Error('PermissionDeniedError')
# extension shared temp sourceId
if e.data.sourceId?
ChromeScreenShare.screenCallback?(e.data.sourceId)
RocketChat.settings.addGroup 'WebRTC', ->
@add 'WebRTC_Enable_Channel', false, { type: 'boolean', group: 'WebRTC', public: true}
@add 'WebRTC_Enable_Private', true , { type: 'boolean', group: 'WebRTC', public: true}
@add 'WebRTC_Enable_Direct' , true , { type: 'boolean', group: 'WebRTC', public: true}
@add 'WebRTC_Servers', 'stun:stun.l.google.com:19302, stun:23.21.150.121, team%40rocket.chat:demo@turn:numb.viagenie.ca:3478', { type: 'string', group: 'WebRTC', public: true}
RocketChat.settings.addGroup('WebRTC', function() {
this.add('WebRTC_Enable_Channel', false, {
type: 'boolean',
group: 'WebRTC',
'public': true
});
this.add('WebRTC_Enable_Private', true, {
type: 'boolean',
group: 'WebRTC',
'public': true
});
this.add('WebRTC_Enable_Direct', true, {
type: 'boolean',
group: 'WebRTC',
'public': true
});
return this.add('WebRTC_Servers', 'stun:stun.l.google.com:19302, stun:23.21.150.121, team%40rocket.chat:demo@turn:numb.viagenie.ca:3478', {
type: 'string',
group: 'WebRTC',
'public': true
});
});
......@@ -257,3 +257,18 @@ function startStreamBroadcast() {
Meteor.startup(function() {
return startStreamBroadcast();
});
Meteor.methods({
'instances/get'() {
if (!RocketChat.authz.hasPermission(Meteor.userId(), 'view-statistics')) {
throw new Meteor.Error('error-action-not-allowed', 'List instances is not allowed', {
method: 'instances/get'
});
}
return Object.keys(connections).map(address => {
const conn = connections[address];
return Object.assign({ address, currentStatus: conn._stream.currentStatus }, _.pick(conn, 'instanceRecord', 'broadcastAuth'));
});
}
});
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