diff --git a/languages/en_CA.json b/languages/en_CA.json index ad8aebf5..55738d8c 100644 --- a/languages/en_CA.json +++ b/languages/en_CA.json @@ -32,6 +32,7 @@ "Pause": "Pause", "RAM": "RAM", "CPU": "CPU", + "Cores": "Cores", "on": "on", "OAuth Credentials": "OAuth Credentials", "Token": "Token", @@ -201,6 +202,7 @@ "End Time": "End Time", "Time": "Time", "On Unexpected Exit": "On Unexpected Exit", + "Bandwidth": "Bandwidth", "Methods": "Methods", "Notifications": "Notifications", "Monitor ID": "Monitor ID", diff --git a/web/libs/js/super.easyRemoteAccess.js b/web/libs/js/super.easyRemoteAccess.js index e25fb47a..3d89ae86 100644 --- a/web/libs/js/super.easyRemoteAccess.js +++ b/web/libs/js/super.easyRemoteAccess.js @@ -2,6 +2,27 @@ $(document).ready(function(){ var easyRemoteAccessTab = $('#easyRemoteAccess') var p2pHostSelectedContainer = $('#p2pHostSelected') var easyRemoteAccessForm = easyRemoteAccessTab.find('form') + function beginStatusConnectionForServer(key,server){ + var cardEl = easyRemoteAccessTab.find(`[drawn-id="${key}"]`) + var cpuUsageEl = cardEl.find('.cpuUsage') + var ramPercentEl = cardEl.find('.ramPercent') + var ramUsedEl = cardEl.find('.ramUsed') + var cpuCoresEl = cardEl.find('.cpuCores') + var socketConnection = io(`ws://${server.host}:${server.p2pPort}`,{ + transports: ['websocket'], + query: { + charts: '1' + } + }) + socketConnection.on('initUI',function(data){ + cpuCoresEl.text(data.cpuCores) + }) + socketConnection.on('charts',function(data){ + cpuUsageEl.text(data.cpu) + ramUsedEl.text(data.ram.used) + ramPercentEl.text(data.ram.percent) + }) + } easyRemoteAccessTab.find('.submit').click(function(){ easyRemoteAccessForm.submit() }) @@ -49,4 +70,7 @@ $(document).ready(function(){ } return false; }) + $.each(p2pServerList,function(key,server){ + beginStatusConnectionForServer(key,server) + }) }) diff --git a/web/pages/blocks/easyRemoteAccess.ejs b/web/pages/blocks/easyRemoteAccess.ejs index 2994f483..034e6099 100644 --- a/web/pages/blocks/easyRemoteAccess.ejs +++ b/web/pages/blocks/easyRemoteAccess.ejs @@ -1,6 +1,13 @@ <% const p2pServerList = config.p2pServerList || {} const selectedServer = p2pServerList[config.p2pHostSelected] %> +