Detecting when a user is away outside of the browser - node.js

I am building a "status" stand alone application customized specifically for my company. In my app, a user will open the web site and update his/her status to one of several buckets (away, at my desk, out of office, etc) and THEN the user will most likely minimize the application. My issue is how to detect when a user is away if they are not navigating within the status application browser window. If a user were only navigating within the app, detection is easy-
#HostListener('mousemove', ['$event'])
However, I need a solution where I can detect desktop inactivity and then (after 15 minutes) update the user status to 'away' in the database.
I am early in the development process, and am open to a different approach. The technologies I am using is Angular 8, Node js API, and Postgres SQL. Ideas?
EDIT: From the comments, I understand that communicating with the desktop is not possible. So at this point I am hoping on high level ideas on how to architect this while achieving similar results described in my post. tcp/ip socket that updates user status from the api if the connection is broken when a desktop enters sleep mode? Any crazy ideas?

Related

Understanding an application launch from web

I'm curious as to how an application is being launched from a web control panel. I am using Splashtop Business, a remote desktop management system. The system allows one to select a workstation to connect to, select "Connect", and the native app will be launched, and initiate the connection.
I want to know how this app is being launched, with the information being transmitted from the browser to the application.
I checked the official documentation, and couldn't find anything on a custom URI being used for the application I'm using.
I watched the network traffic, and found the only thing of plausible importance (in my eyes) was a cookie being set. (I can clean and post some cookies if that would be helpful.)
I watched the local storage of the browser, nothing changed between different launches.
Other things of import:
The site said pop-ups needed to be enabled for the application to launch
There is a small delay while the site says it is "Locating the Splashtop Business app"
This works in multiple browsers (Firefox, Chrome)
Any plausible solutions and especially ways to verify this would be appreciated. I don't want to accept that "its a blackbox solution" and just try and find another way to do the same thing. I'd rather know what is going on with my computer, as this is fairly significant in respect to security.

What solutions are there for a Nodejs app control panel?

Apologies if this should be somewhere else but I was hoping to get some help, I'm currently learning Node whilst building a private project and was wondering what solutions for a control panel/dashboard for the application?
I will be making API requests to check for changes in intervals (the provider does not support sockets) and I would like to log into a dashboard and do things such as change the frequency in which the requests are made. Where would be the best place to start?

Can one use Fiddler to monitor a PCOMM session, or any 3270 Emulator session?

Can one use Fiddler to monitor a Mainframe PCOMM session? Or a Mainframe session with any 3270 Emulator software? If so, how? I have looked at the Fiddler documentation, and searched, and it is not mentioned.
The ultimate goal is to connect to the mainframe using Java code. I have already provided a PCOMM automation solution that logs on, goes to CICS, performs the transaction, screen scrapes the screens, and puts the screen data to a file. Now the client wants me to do the same thing without PCOMM. The user wants to use a Java solution. I have Java program that connects to the mainframe. But the initial menu screen is not returned in order to "log on" to the mainframe. I am seeing a series of 3270 codes, such as 255 (IAC) 253 (DO) 40 (?), I reply with 255, 253 (Will do) 40 (?) EOR. The mainframe comes back with 255, 250 (Subnegotiate) 40 (?), and so on. I tried such codes in different ways, but so far no luck. See http://www.faqs.org/rfcs/rfc1576.html for more info on the codes to negotiate a session 3270. It is a very old document and may have been updated since. Also http://www.faqs.org/rfcs/rfc854.html
My thought was to monitor the PCOMM session, to discover the correct conversation to negotiate a connection to a 3270 session. After all, PCOMM is working to make that session happen.
thanks,
Baruch Atta
I see what you are doing. You have a couple of options:
Use either HATS or the Host on Demand (HOD) API to access the screens. This API is designed to transform the screens into Java objects that you can work with. Actually, you can use HATS to create web services (either SOAP or REST based), to which you can leverage any client to access. This is the quickest, and fastest method. Here is an overview of HATS web services. If you try just hitting the telnet stream with Java, you will spend months if not years recreating what the HATS/HOD API already offers.
Modify your CICS applications and setup CICS web services. These are OSGi bundles that you deploy to JVM regions in CICS. This is the most elegant method, but requires a steeper learning curve, and time to implement. However, once you've done the first CICS program, the rest start to fall in place like dominoes. Check out this Redbook.
Working with other staff on site here, we have concluded that Fiddler can not view PCOMM communications. We have concluded that Fiddler can only monitor BROWSER based communications. Our staff claim to be "experts" in Fiddler, with lots of experience. If anyone on STACK Overflow can actually use Fiddler to monitor PCOMM communications with a mainframe, I would love to be proven wrong.

iPhone app freezes briefly during fetch for content updates. Can this be fixed?

I have an iPhone app that displays blog articles. You can drill into one article and look at it's entire story. At the bottom of the story are comments from other users.
The app fetches latest comments from the server every 15 seconds. If there are more comments returned, the app prepends them to the top of the list. This is all working pretty well.
The problem is that, whenever the app does the fetch (every 15 seconds), the app sort of "freezes" for about 1 second, sometimes 2 seconds. If you are scrolling through the comments, this delay becomes pretty noticeable because the scrolling stops in place while the update processes.
This iPhone app is being developed by a third-party dev team who is remote. I have asked the dev team to stop the "freeze" from happening, but they insist that it's normal functionality when updating a table in the iPhone.
I am not an iPhone developer and have no knowledge or experience of working in that environment, so I am not able to really argue against this. But, I have to imagine that there is some way to do a background fetch and update of the table without causing lag to the user experience.
Does anyone have any thoughts around this? Are there techniques that the devs could be employing to create a smooth experience during the update process?
They are fetching comments in synchronous mode in which UI will hang until it downloads completely. Tell them to download content in asynchronous mode so that it will fetch comments in background and UI scrolling will be smooth then.
Example Codes:
[connection startAsynchronous];
https://gist.github.com/fspeirs/106457
http://allseeing-i.com/ASIHTTPRequest/How-to-use
Let me know if you find any difficulty.

Node.js online app with intranet DB

What I want to build is an application that sits online and it's used by different groups that each have their own intranet. Now, because of a stupid security policy the data can't sit outside the intranet. How would you go about building an app that it's still online, so you can push updates to everyone at once, but has a DB on each intranet's server?
My initial plan is to use Node.js and MongoDB.
If your db really has to be onsite, and your app really has to be offsite, then probably your only option is to set up a secure connection from your app, to the onsite db, and pretend as if its hosted locally to the app. This may/may not violate the security policies. You could in theory lock it down pretty well, with a vpn between the two networks. But this is not for the faint of heart, performance will suffer, and it does have security issues. It also means a bit of work for every site.
If the only reason you're wanting it to be "online" is for pushing updates as you stated, then you'll do better installing the app on-premise, and getting it to poll into a central server for notifications about new versions, download updates to itself, and install them automatically. Once you've created this, a new installation requires no new work.
I'm facing a similar problem right now, so here's my take on it, not really mongo or node specifc.
Put a db and a simple restful server on each of client's intranets. Servers can be exactly the same.
Put a routing facade accesible from internet that redirects requests to apropriate server based on url, ie: http://facade/server/resource becomes a request to http://server/resouce.
Configure the facade so that a requests to http://facade/resource go to each server, retrieve results and return all of them in some aggregated form.
Obviously there are more details to take into account, like permissions (can everybody publish to each server? if not, who can?), but the general idea is there.

Resources