Is Gmail a Single page application - javascript

Today I was going through the my mail box. I just seen that when I am navigating through different folders after # that folder name is changing and data being refreshed. I just want to confirm is Gmail a single page application. I also want to develop a mail box kind of application using Single page application concept. Below is sample URL for inbox folder.
https://mail.google.com/mail/u/0/#inbox
Can I develop sample mail box application using angular js as angular js supports concept of SPA?

Yes, Gmail is a single-page application.
That is the reason before loading Gmail you see a progress bar, as it fetches everything from server once and then all the rendering is done on the client side with calls to server only for fetching data and not the DOM.
Apart from Gmail, other services in the suite like Google Calendar, Google Drive etc. are also Single Page Applications.

Related

User Extendable Front-end With Web Technologies

About My App
I have a spring boot application which I develop for desktop. The embedded server runs on end-user's computer, not on hosting provider's server. After server starts, application opens localhost with the default browser. Then the user is greeted with my front-end.
My Problem
I have some entity/model(will be provided by my back-end) which I want to represent on my front-end with a view (Which is just a part of my layout). Now, I want my end-user to be able to write his/her own views with JS, HTML, CSS while having access to this entity/model and somehow register this view to my application. Then my application should be able to insert it as a view when needed. But I have no idea how to implement such a system. My best guess was to use a iframe and embed it inside my layout. Which still begs the question: How to register it?
Questions
How would one design a system like this?
Is there any example application which does something like this?
Any tip or source is welcomed.
Thanks in advance.

Serverside Dashboard buildup (Node.JS)

I´m sending some sensordata to my azure IoT-Hub and now I want to display them on different Dashboards.
To get started I used the template from a Microsoft Tutorial and it works fine:
https://github.com/Azure-Samples/web-apps-node-iot-hub-data-visualization.git
The only problem is, that the Dashboard only show the new data that comes in for the client.
After every reload of the page (from the client side) the Dashboards are completely blank at first and then build up the data that comes up next.
(I think the client loads the script and builds the Dashboard up itself?)
I load the index.html file and in the html-file are linked some js-files.
My question is now if it´s possible to build up the Dashboards the whole time on the serverside in Node.js?
So if a client connects to my site, it automatically shows all saved data from my Dashboards (even from the past)
TLTR:
Can you generate data on Dashboards on the serverside and then just "mirror" the Dashboard to the Client?
Probably you are looking for a solution with Dashboard that can show previous day data as well.If so you need to push data from IoT hub to some other storage like CosmosDB etc and built your custom dashboard on it.
I had a similar requirement like that and used Azure Time Series Insights for that purpose.The API would return data to UI which has Dashboard build on Angular. Have documented the same here :
http://learniotwithzain.com/2019/03/near-real-time-iot-data-exploration-using-azure-time-series-insights/
Azure Time Series Insights product has some ClientSide SDK as well. Please do check the cost associated and see if this suits your requirement.

Angular JS +ASP.NET WEB API+SITEMINDER

We are building a web app on angularJS and WEB API 2.2, basic funtctionality of the app is to download documents from certain Fileshare.
Talking in architectural details, these two apps (angular JS and REST API) will be hosted on two different websites(ie clientAPP.com and RESTAPI.com).
We need to protect our ClientAPP with siteminder here but also which can be done easily, complexity here is, for downloading the files instead of using APIController i have used MVCController for its FILECONTENTRESULT behaviour, so basically i redirect my users(when they click on the file links provided on angular UI) to that controller using:
$window.location.href="DOWNLOADCONTROLLER/DownloadFile/IDOfTheDocument"
In turn this url returns the intended file by searching it on the basis of id provided in URL and returns filecontentresult which automatically downloads the file on browser.
We need another functionality where we can share this download file URL with other users, we need to implement security around this URL as well which is part of RESTAPI MVC app, we are marking our options on "how do we protect this URL" since it's an MVC controller we cannot go for token based security like we have done it for API controllers so and also we cannot share tioken with users so, is it possible make this URL siteminder protected so that when user hits this url from browser instead of app it gets the SSO login screen? if yes, how do we ensure that when my user is already logged in to client app,REST API doesn't ask for authentication when he tries to download the file from the client APP,.

Uploading to Google Cloud via an asp.net webpage

I have a webpage through which my users, using a mobile phone, can take pictures and upload them (hopefully) to the Google Cloud (I've got a JSON file, a platform project and an associated storage bucket, as well as all the login details).
However, I'm pretty new to all this and need to know how I'd get the file (coming from a standard <input file="" name="fileupload"/> ) to the Google Cloud space, and also to retrieve the URI of the file. Given that it's an asp.net webpage, I have access to Javascript and C#.
Thanks!
I have a couple of suggestions for you. We have other customers that have solutions which are similar to this architecture and so your proposed solution is good.
Google Cloud Storage (GCS) has a feature called Signed URLs. This allows you to generate a secure URL to an object in a GCS bucket. My colleague wrote the C# sample for this:
https://cloud.google.com/storage/docs/access-control#signing-code-csharp
There's a method in here that you can reuse GetSigningURL.
Each time a user requests the web page, you should generate a Signed URL and use this as the destination URL for the file upload location in your HTML.
If your HTML is generated by ASP.NET (MVC, Web Forms, Web Page), then you can make the call to GetSigningURL when the page is generated server-side. If not, you should wrap the C# code in a Web API and then you could use, e.g. jQuery ($.ajax), to call it from your client.
You may run your ASP.NET code on Google Cloud Platform using either Windows on Google Compute Engine or using Custom Runtimes on Google App Engine.
Full disclosure: I'm a Googler working in cloud as a Strategic Customer Engineer.

Generating a PDF from a Tomcat-served webpage

I'm having issues trying to figure out how to generate on server side a PDF from a javascript-heavy webpage that is served from Tomcat (the application is Pentaho CE). The content is a dashboard that responds to user interaction. Pentaho (the application) replaces divs dynamically with various content through AJAX calls. I'd like to export to pdf whatever state the user has the dashboard at. There are no restrictions on what I can put on the server, but I need to avoid having the client install anything.
I've taken a look at this, along with a bunch of other google-fu:
JSP/HTML Page to PDF conversion
wkhtmltopdf seems to be a popular choice; before I start banging my head against it, I have a few questions:
Can wkhtmltopdf handle going to password protected jsps where authentication is handled by the application? Would the dynamically loaded divs break it?
Is there a way to perhaps return the client view to the server for processing? I read about screen capturing...
Another option that could work out would be to automate a local access to the dashboard on the server through a server-hosted web browser and generate a PDF that way...is this possible, given the constraints of Tomcat and password protection that's handled by the application? The javascript components that Pentaho generates cannot be accessed outside of the application.
Thanks!
EDIT:
Good news! wkhtmltopdf works! Kind of. I got past the password authentication through putting the login details through a query string, and I'm getting a pdf of the correct page now. The issue is that no javascript components are showing up... (they work for pages like yahoo.com, so maybe I'm missing something here).
If you have a lot of AJAX calls you should wait for them. Use the --javascript-delay x argument, where is x is the time to wait.

Categories

Resources