Merge branch 'socket.io-v4' into 'dashboard-v3'
Upgrade Socket.IO to version 4 See merge request Shinobi-Systems/Shinobi!356update-dependencies
commit
4241c1176b
|
@ -8,7 +8,7 @@
|
|||
// Subscribe : https://licenses.shinobi.video/subscribe?planSubscribe=plan_G31AZ9mknNCa6z
|
||||
// PayPal : paypal@m03.ca
|
||||
//
|
||||
const io = new (require('socket.io'))()
|
||||
const io = new (require('socket.io').Server)()
|
||||
//process handlers
|
||||
const s = require('./libs/process.js')(process,__dirname)
|
||||
//load extender functions
|
||||
|
|
|
@ -15,11 +15,13 @@ module.exports = function(s,config,lang,app){
|
|||
}
|
||||
if(!customerServerList){
|
||||
config.p2pServerList = {
|
||||
"vancouver-1": {
|
||||
"vancouver-1-v2": {
|
||||
name: 'Vancouver-1',
|
||||
host: 'p2p-vancouver-1.shinobi.cloud',
|
||||
p2pPort: '8084',
|
||||
webPort: '8000',
|
||||
v2: true,
|
||||
p2pPort: '81',
|
||||
webPort: '80',
|
||||
chartPort: '82',
|
||||
maxNetworkSpeed: {
|
||||
up: 5000,
|
||||
down: 5000,
|
||||
|
@ -30,11 +32,13 @@ module.exports = function(s,config,lang,app){
|
|||
lon: -123.1140607
|
||||
}
|
||||
},
|
||||
"toronto-1": {
|
||||
"toronto-1-v2": {
|
||||
name: 'Toronto-1',
|
||||
host: 'p2p-toronto-1.shinobi.cloud',
|
||||
p2pPort: '8084',
|
||||
webPort: '8000',
|
||||
v2: true,
|
||||
p2pPort: '81',
|
||||
webPort: '80',
|
||||
chartPort: '82',
|
||||
maxNetworkSpeed: {
|
||||
up: 5000,
|
||||
down: 5000,
|
||||
|
@ -45,11 +49,13 @@ module.exports = function(s,config,lang,app){
|
|||
lon: -79.3862837
|
||||
}
|
||||
},
|
||||
"paris-1": {
|
||||
"paris-1-v2": {
|
||||
name: 'Paris-1',
|
||||
host: 'p2p-paris-1.shinobi.cloud',
|
||||
p2pPort: '8084',
|
||||
webPort: '8000',
|
||||
v2: true,
|
||||
p2pPort: '81',
|
||||
webPort: '80',
|
||||
chartPort: '82',
|
||||
maxNetworkSpeed: {
|
||||
up: 200,
|
||||
down: 200,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -49,8 +49,8 @@
|
|||
"shinobi-onvif": "0.1.9",
|
||||
"shinobi-sound-detection": "^0.1.8",
|
||||
"smtp-server": "^3.5.0",
|
||||
"socket.io": "^2.3.0",
|
||||
"socket.io-client": "^2.3.0",
|
||||
"socket.io": "^4.4.1",
|
||||
"socket.io-client": "^4.4.1",
|
||||
"tree-kill": "1.2.2",
|
||||
"unzipper": "0.10.11",
|
||||
"webdav-fs": "^3.0.0"
|
||||
|
|
|
@ -304,7 +304,7 @@ module.exports = function(__dirname, config){
|
|||
if(config.mode === 'host'){
|
||||
plugLog('Plugin started as Host')
|
||||
//start plugin as host
|
||||
var io = require('socket.io')(server,{
|
||||
const io = new (require('socket.io').Server)(server,{
|
||||
transports: ['websocket']
|
||||
})
|
||||
io.engine.ws = new (require('cws').Server)({
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,6 +2,7 @@ $(document).ready(function(){
|
|||
var easyRemoteAccessTab = $('#easyRemoteAccess')
|
||||
var p2pHostSelectedContainer = $('#p2pHostSelected')
|
||||
var easyRemoteAccessForm = easyRemoteAccessTab.find('form')
|
||||
var remoteDashboardLinkButton = easyRemoteAccessTab.find('.remote-dashboard-link')
|
||||
var loadingRegistration = false
|
||||
var currentlyRegisteredP2PServer = currentlySelectedP2PServerId ? currentlySelectedP2PServerId + '' : undefined
|
||||
function copyToClipboard(str) {
|
||||
|
@ -35,11 +36,13 @@ $(document).ready(function(){
|
|||
var chartViewerCount = cardEl.find('.chartViewerCount')
|
||||
var connectedUsers = cardEl.find('.connectedUsers')
|
||||
var registeredServers = cardEl.find('.registeredServers')
|
||||
var socketConnection = io(`ws://${server.host}:${server.p2pPort}`,{
|
||||
var chartPort = server.v2 ? server.chartPort || parseInt(server.webPort) + 2 : server.p2pPort
|
||||
var socketConnection = io(`ws://${server.host}:${chartPort}`,{
|
||||
transports: ['websocket'],
|
||||
query: {
|
||||
charts: '1'
|
||||
}
|
||||
},
|
||||
reconnect: false,
|
||||
})
|
||||
socketConnection.on('initUI',function(data){
|
||||
cardEl.find('.ramTotal').text(bytesToSize(data.ram))
|
||||
|
@ -74,6 +77,22 @@ $(document).ready(function(){
|
|||
var cardEl = easyRemoteAccessTab.find(`[drawn-id="${key}"]`)
|
||||
easyRemoteAccessTab.find(`[drawn-id].selected`).removeClass('selected')
|
||||
cardEl.addClass('selected')
|
||||
setCurrentRemoteLink()
|
||||
}
|
||||
}
|
||||
function setCurrentRemoteLink(){
|
||||
var apiKey = easyRemoteAccessForm.find('[name="p2pApiKey"]').val()
|
||||
var selectedServer = p2pServerList[currentlyRegisteredP2PServer]
|
||||
console.log(selectedServer,currentlySelectedP2PServerId,p2pServerList)
|
||||
if(selectedServer && selectedServer.host){
|
||||
var href = `http://${selectedServer.host}:${selectedServer.webPort}/s/${apiKey}/${window.useBetterP2P ? '' : '?p2p=1'}`
|
||||
remoteDashboardLinkButton.attr('href',href)
|
||||
}else{
|
||||
new PNotify({
|
||||
type: 'warning',
|
||||
title: lang['P2P Server Not Selected'],
|
||||
text: lang.p2pServerNotSelectedText,
|
||||
})
|
||||
}
|
||||
}
|
||||
easyRemoteAccessTab.find('.submit').click(function(){
|
||||
|
@ -96,6 +115,7 @@ $(document).ready(function(){
|
|||
title: lang['P2P Settings Applied'],
|
||||
text: lang.p2pSettingsText1,
|
||||
})
|
||||
setCurrentRemoteLink()
|
||||
setTimeout(enableForm,5000)
|
||||
}
|
||||
})
|
||||
|
@ -108,26 +128,6 @@ $(document).ready(function(){
|
|||
el.addClass('active')
|
||||
currentlySelectedP2PServerId = p2pServerId
|
||||
})
|
||||
easyRemoteAccessTab.on('click','.remote-dashboard-link',function(e){
|
||||
e.preventDefault()
|
||||
if(!loadingRegistration){
|
||||
var apiKey = easyRemoteAccessForm.find('[name="p2pApiKey"]').val()
|
||||
var selectedServer = p2pServerList[currentlyRegisteredP2PServer]
|
||||
console.log(selectedServer,currentlySelectedP2PServerId,p2pServerList)
|
||||
if(selectedServer && selectedServer.host){
|
||||
var href = `http://${selectedServer.host}:${selectedServer.webPort}/s/${apiKey}/?p2p=1`
|
||||
var win = window.open(href, '_blank');
|
||||
win.focus();
|
||||
}else{
|
||||
new PNotify({
|
||||
type: 'warning',
|
||||
title: lang['P2P Server Not Selected'],
|
||||
text: lang.p2pServerNotSelectedText,
|
||||
})
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})
|
||||
easyRemoteAccessTab.on('click','.remote-dashboard-link-copy',function(e){
|
||||
e.preventDefault()
|
||||
if(!loadingRegistration){
|
||||
|
@ -135,7 +135,7 @@ $(document).ready(function(){
|
|||
var selectedServer = p2pServerList[currentlyRegisteredP2PServer]
|
||||
console.log(selectedServer,currentlySelectedP2PServerId,p2pServerList)
|
||||
if(selectedServer && selectedServer.host){
|
||||
var href = `http://${selectedServer.host}:${selectedServer.webPort}/s/${apiKey}?p2p=1`
|
||||
var href = `http://${selectedServer.host}:${selectedServer.webPort}/s/${apiKey}/${window.useBetterP2P ? '' : '?p2p=1'}`
|
||||
copyToClipboard(href)
|
||||
new PNotify({
|
||||
type: 'success',
|
||||
|
@ -154,6 +154,7 @@ $(document).ready(function(){
|
|||
})
|
||||
$.each(p2pServerList,function(key,server){
|
||||
server.key = key
|
||||
if(window.useBetterP2P && !server.v2)return;
|
||||
beginStatusConnectionForServer(key,server)
|
||||
})
|
||||
displayCurrentlySelectedInternally()
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
<% }) %>
|
||||
</body>
|
||||
<script><% include ../libs/js/basic.js %></script>
|
||||
<script><% include ../libs/js/socket.io.js %></script>
|
||||
<script><% include ../libs/js/socket.io.min.js %></script>
|
||||
<script><% include ../libs/js/pnotify.custom.min.js %></script>
|
||||
<script><% include ../libs/js/moment.js %></script>
|
||||
<script><% include ../libs/js/livestamp.min.js %></script>
|
||||
|
|
|
@ -1,28 +1,20 @@
|
|||
<form>
|
||||
<div class="mb-4"><a href="#" class="submit btn btn-block btn-default"><i class="fa fa-check"></i> <%- lang.Save %></a></div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<div><span><%-lang.Email%></span></div>
|
||||
<div><input class="form-control" type="email" name="mail" value="<%- $user.mail %>"></div>
|
||||
</label>
|
||||
<span><%-lang.Email%></span>
|
||||
<input class="form-control" type="email" name="mail" value="<%- $user.mail %>">
|
||||
</div>
|
||||
<!-- <div class="form-group">
|
||||
<label>
|
||||
<div><span><%-lang.Username%></span></div>
|
||||
<div><input class="form-control" type="text" name="pass"></div>
|
||||
</label>
|
||||
<span><%-lang.Username%></span>
|
||||
<input class="form-control" type="text" name="pass">
|
||||
</div> -->
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<div><span><%-lang.Password%></span></div>
|
||||
<div><input class="form-control" type="password" name="pass"></div>
|
||||
</label>
|
||||
<span><%-lang.Password%></span>
|
||||
<input class="form-control" type="password" name="pass">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<div><span><%-lang['Password Again']%></span></div>
|
||||
<div><input class="form-control" type="password" name="pass_again"></div>
|
||||
</label>
|
||||
<span><%-lang['Password Again']%></span>
|
||||
<input class="form-control" type="password" name="pass_again">
|
||||
</div>
|
||||
</form>
|
||||
<script src="<%-window.libURL%>libs/js/super.preferences.js" type="text/javascript"></script>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
</style>
|
||||
<script>
|
||||
window.p2pServerList = <%- JSON.stringify(p2pServerList) %>
|
||||
window.useBetterP2P = <%- !!config.useBetterP2P %>
|
||||
window.currentlySelectedP2PServerId = `<%- config.p2pHostSelected %>`
|
||||
</script>
|
||||
<link rel="stylesheet" href="<%-window.libURL%>libs/css/super.easyRemoteAccess.css">
|
||||
|
@ -29,23 +30,19 @@
|
|||
<a style="flex:12" href="#" class="submit btn btn-success"><i class="fa fa-check"></i> <%- lang.Save %></a>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<div><span><%-lang['Enabled']%></span></div>
|
||||
<div><select class="form-control" type="email" name="p2pEnabled">
|
||||
<option <% if(config.p2pEnabled === true){ %>selected<% } %> value="1">Yes</option>
|
||||
<option <% if(config.p2pEnabled !== true){ %>selected<% } %> value="0">No</option>
|
||||
</select></div>
|
||||
</label>
|
||||
<span><%-lang['Enabled']%></span>
|
||||
<select class="form-control" type="email" name="p2pEnabled">
|
||||
<option <% if(config.p2pEnabled === true){ %>selected<% } %> value="1">Yes</option>
|
||||
<option <% if(config.p2pEnabled !== true){ %>selected<% } %> value="0">No</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>
|
||||
<div><span><%-lang['P2P API Key']%></span></div>
|
||||
<div><input class="form-control" type="text" name="p2pApiKey" value="<%- config.p2pApiKey %>"></div>
|
||||
</label>
|
||||
<span><%-lang['P2P API Key']%></span>
|
||||
<input class="form-control" type="text" name="p2pApiKey" value="<%- config.p2pApiKey %>">
|
||||
</div>
|
||||
<div class="form-group btn-group" style="display:flex">
|
||||
<a style="flex:6" target="_blank" href="#" class="btn btn-default remote-dashboard-link-copy"><i class="fa fa-copy"></i> <%- lang['Copy Remote Link'] %></a>
|
||||
<a style="flex:6" target="_blank" href="#" class="btn btn-info remote-dashboard-link"><i class="fa fa-external-link"></i> <%- lang['Open Remote Dashboard'] %></a>
|
||||
<a style="flex:6" target="_blank" href="#" class="btn btn-info remote-dashboard-link" target="_blank"><i class="fa fa-external-link"></i> <%- lang['Open Remote Dashboard'] %></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 pt-2 pb-4">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!-- Core JS Files -->
|
||||
<script src="<%-window.libURL%>libs/js/jquery-ui.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/pnotify.custom.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/jquery.serialize.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/livestamp.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/poseidon.js"></script>
|
||||
|
|
|
@ -20,7 +20,7 @@ requires https or firefox
|
|||
<video id="video"><source></video>
|
||||
<canvas id="canvas"></canvas>
|
||||
<script src="<%-window.libURL%>libs/js/jquery.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/basic.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/menu.js"></script>
|
||||
<script>
|
||||
|
|
|
@ -16,7 +16,7 @@ if(data.url.charAt(data.url.length - 1) !== '/'){
|
|||
data.url += '/'
|
||||
}
|
||||
%>
|
||||
<script src="<%=data.url%>libs/js/socket.io.js"></script>
|
||||
<script src="<%=data.url%>libs/js/socket.io.min.js"></script>
|
||||
<script src="<%=data.url%>libs/js/poseidon.js"></script>
|
||||
<script src="<%=data.url%>libs/js/hls.min.js"></script>
|
||||
<script src="<%=data.url%>libs/js/flv.min.js"></script>
|
||||
|
|
|
@ -18,7 +18,7 @@ requires https or firefox
|
|||
<video id="video"><source></video>
|
||||
<canvas id="canvas"></canvas>
|
||||
<script src="<%-window.libURL%>libs/js/jquery.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.min.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/basic.js"></script>
|
||||
<script src="<%-window.libURL%>libs/js/menu.js"></script>
|
||||
<script>
|
||||
|
|
|
@ -162,7 +162,7 @@
|
|||
<script src="<%-window.libURL%>libs/js/pnotify.custom.min.js" type="text/javascript"></script>
|
||||
<script><% include ../libs/js/moment.js %></script>
|
||||
<script src="<%-window.libURL%>libs/js/livestamp.min.js" type="text/javascript"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.js" type="text/javascript"></script>
|
||||
<script src="<%-window.libURL%>libs/js/socket.io.min.js" type="text/javascript"></script>
|
||||
<script src="<%-window.libURL%>libs/js/placeholder.js" type="text/javascript"></script>
|
||||
<script src="<%-window.libURL%>libs/js/now-ui-kit.js?v=1.1.0" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
|
|
Loading…
Reference in New Issue