-
Notifications
You must be signed in to change notification settings - Fork 3
Spring Feature: Offline Netgraph Viewing #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…andler, which set NetMessage OFFLINE mode
…tMessage to suppress traffic to net
…host:3000/#/edit/MEEP-ONE-9V3)
Hi, all—
I’m just writing to confirm that the offline mode will allow us to post a version of the final network somewhere, rather than requiring that someone cache a Net.Create package that results from active participation in the network building.
We’ll have students who didn’t have laptops (or we’ll have directed students to only use 1 laptop for every 3 students), so the method below wouldn’t let us distribute to the whole participant base.
Let me know if I’m missing something.
—Kalani
… On Jan 9, 2019, at 4:08 AM, Dave Seah ***@***.***> wrote:
PLACEHOLDER
This pull request closes #39 <#39> "Offline Viewing Mode", which implements the technical needs to view and interacting with the netgraph in READ ONLY mode when the NetCreate AppServer is offline. This commit handles two cases when the server is offline:
The server shuts down: the netgraph is still usable by client browsers, and clients cache the data to local storage so...
When a client browser accesses the URL last used, the cached data is restored.
TESTING
THIS FEATURE IS NOT COMPLETE as I'll need Ben to add additional the additional UI hooks to reflect "read only" mode.
START TESTING PROCEDURE (WIP)
Start NetCreate npm run dev from Terminal.
Connect to the NetCreate AppServer with Chrome. Open the Javascript Console (CMD-OPT-J). Note the "application cache" messages in the console indicating what files are cached.
Login to NetCreate using a valid access token (e.g. MEEP-ONE-9V3). Manipulate the netgraph data to see that it works as expected
TEST OFFLINE DATA CACHING
in the Terminal window running NetCreate, CTRL-C to stop the server
in the Chrome Javascript console, look for messages indicating that data is cached
in the Terminal window, restart NetCreate and reconnect, and see that the application works normally and that the data is as expected (e.g. nothing was lost)
TEST OFFLINE VIEW FROM CACHE
Copy the URL from the Chrome address bar used in the previous test. It looks something like https://localhost/#/edit/MEEP-ONE-9V3.
In the Terminal window, CTRL-C again to stop the server
close Chrome, then reopen it.
enter the exact URL you copied a few steps ago
check that the browser loads the last view with cached data
confirm that the NetCreate AppServer isn't running
try reloading the page
try visiting another URL
KNOWN ISSUES
The AppCache mechanism relies on a manifest file called netcreate.cache that's stored in the app/assets directory and copied to /public, and this makes it difficult to debug code changes with live reload since the OLD scripts are cached. A workaround is in progress.
NOTE: All template files have to be listed in the netcreate.cache manifest. Currently only alexander.json is listed
There is no UI indicating that NetCreate is in an offline state
The EDGE lines are not being initialized correctly in the netgraph when loading from cache
You can view, comment on, or merge this pull request online at:
#41 <#41>
Commit Summary
dev-ds/spring-fixes: add a .nvmrc file to specify version of node to use
dev-ds/offline-view: try cache manifest hacks
dev-ds/offline-view: add M_OFFLINE state to client-network.js error handler, which set NetMessage OFFLINE mode
dev-ds/offline-view: add GlobalOfflineMode() calls from Network to NetMessage to suppress traffic to net
dev-ds/offline-view: reformat datastore.js whitespace
dev-ds/offline-view: whitespace reformat to experimental code standards
dev-ds/offline-view: rudimentary cached app by URL (e.g. http://localhost:3000/#/edit/MEEP-ONE-9V3)
File Changes
A build/.nvmrc <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-0> (1)
M build/app/assets/index.ejs <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-1> (2)
A build/app/assets/netcreate.cache <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-2> (10)
M build/app/init.jsx <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-3> (146)
M build/app/system/datastore.js <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-4> (216)
M build/app/unisys/client-lifecycle.js <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-5> (244)
M build/app/unisys/client-network.js <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-6> (417)
M build/app/unisys/client.js <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-7> (350)
M build/app/unisys/common-netmessage-class.js <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-8> (576)
M build/app/view/netcreate/nc-logic.js <https://github.com/daveseah/netcreate-2018/pull/41/files#diff-9> (1224)
Patch Links:
https://github.com/daveseah/netcreate-2018/pull/41.patch <https://github.com/daveseah/netcreate-2018/pull/41.patch>
https://github.com/daveseah/netcreate-2018/pull/41.diff <https://github.com/daveseah/netcreate-2018/pull/41.diff>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#41>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AJS-NG93YHxRoB6BulfQKM57rZ64mtlCks5vBbGhgaJpZM4Z3DSk>.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/daveseah/netcreate-2018","title":"daveseah/netcreate-2018","subtitle":"GitHub repository","main_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/daveseah/netcreate-2018"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Spring Feature: Offline Netgraph Viewing (#41)"}],"action":{"name":"View Pull Request","url":"#41"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#41", "url": "#41", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
|
# Conflicts: # build/app/unisys/common-netmessage-class.js # build/app/view/netcreate/nc-logic.js
@kalanicraig Ooops, I had lost that target when reviewing the change notes. I will have to rework the feature. |
@kalanicraig Ok, I think I see where we are deviating! From notes:
I interpreted this as meaning "we want students can view the network data after the server disappears. I assumed that this was the "take away your laptop, access the data later" scenario we talked about, where "the data is still working in the laptop after the server goes away, so maybe it's easy to just retain it". My current implementation does this. I had missed the implications you outlined in your comment: We’ll have students who didn’t have laptops (or we’ll have directed students to only use 1 laptop for every 3 students). I think I remember you talking about being able to distribute NetCreate stand-alone apps (but thought it was a future thing) I think I can probably get something to work; thankfully the work I did implementing the above feature is related to being able to make a stand-alone package! :D Will check back later. Thanks for staying on top of the pull requests reports, @kalanicraig ! |
I don’t always go in and pull right away but I try to read all the reports! Danish is on it too.
Glad to hear that the cache solution is part of the way there.
… On Jan 9, 2019, at 10:41 PM, Dave Seah ***@***.***> wrote:
@kalanicraig <https://github.com/kalanicraig> Ok, I think I see where we are deviating! From notes:
Finish class, instructor triggers a save, have a file (e.g. a self-contained HTML file with current dataset) that they can share with students so students can view (and not edit) the network (after the server disappears being shut off).
I interpreted this as meaning "we want students can view the network data after the server disappears. I assumed that this was the "take away your laptop, access the data later" scenario we talked about, where "the data is still working in the laptop after the server goes away, so maybe it's easy to just retain it". My current implementation does this.
I had missed the implications you outlined in your comment: We’ll have students who didn’t have laptops (or we’ll have directed students to only use 1 laptop for every 3 students). I think I remember you talking about being able to distribute NetCreate stand-alone apps
I think I can probably get something to work; thankfully the work I did implementing the above feature is related to being able to make a stand-alone package! :D Will check back later.
Thanks for staying on top of the pull requests reports, @kalanicraig <https://github.com/kalanicraig> !
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#41 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AJS-NKa1dq1c3ZV48y2PPinf13HlF2E-ks5vBraFgaJpZM4Z3DSk>.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/daveseah/netcreate-2018","title":"daveseah/netcreate-2018","subtitle":"GitHub repository","main_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #41: @kalanicraig Ok, I think I see where we are deviating! From notes:\r\n\r\n\u003e Finish class, instructor triggers a save, have a file (e.g. a self-contained HTML file with current dataset) that they can share with students so students can view (and not edit) the network (after the server disappears being shut off).\r\n\r\nI interpreted this as meaning \"we want students can view the network data after the server disappears. I assumed that this was the \"take away your laptop, access the data later\" scenario we talked about, where \"the data is still working in the laptop after the server goes away, so maybe it's easy to just retain it\". My current implementation does this. \r\n\r\nI had missed the implications you outlined in your comment: **We’ll have students who didn’t have laptops** (or we’ll have directed students to only use 1 laptop for every 3 students). I think I remember you talking about being able to distribute NetCreate stand-alone apps\r\n\r\nI think I can probably get something to work; thankfully the work I did implementing the above feature is related to being able to make a stand-alone package! :D Will check back later.\r\n\r\nThanks for staying on top of the pull requests reports, @kalanicraig ! "}],"action":{"name":"View Pull Request","url":"#41 (comment)"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#41 (comment)", "url": "#41 (comment)", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
|
Also @kalanicraig @jdanish I've asked for clarification on the offline data logging requirement (at least this is what I think it is) here on the next steps doc |
An offline format that we can upload to an FTP server would let us embed a Google analytics tag. The IU team would figure out how to set a cookie from (or link through) a URL from our course management system (Canvas) that gives us each student’s university ID for research tracking.
This assumes that a google analytics tag would get triggered as with any basic HTML page on the main index that loads all the other assets so that we can see how long they’re on the page.
… On Jan 9, 2019, at 10:53 PM, Dave Seah ***@***.***> wrote:
Also @kalanicraig @jdanish I've asked for clarification on the offline data logging requirement (at least this is what I think it is) here on the next steps doc
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/daveseah/netcreate-2018","title":"daveseah/netcreate-2018","subtitle":"GitHub repository","main_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #41: Also @kalanicraig @jdanish I've asked for clarification on the offline data logging requirement (at least this is what I think it is) here on the [next steps doc](https://docs.google.com/document/d/1UL_8PckI2TFL1T9f5_EedPXqTRZyfZpf_Yhxha9KJYQ/edit?disco=AAAACc7Nayg)"}],"action":{"name":"View Pull Request","url":"#41 (comment)"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#41 (comment)", "url": "#41 (comment)", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
|
So to be clear: we are assuming that for this round (maybe even this entire grant) we’ll handle that given an exported html file. Long-term we might want to explore how to do that with greater nuance, but that’s outside the scope of the current work.
Joshua
…----
Joshua A. Danish
Pronouns: he, him, his (https://www.mypronouns.org/ <https://www.mypronouns.org/>)
[email protected]
http://www.joshuadanish.com
On Jan 9, 2019, at 11:17 PM, kalanicraig ***@***.***> wrote:
An offline format that we can upload to an FTP server would let us embed a Google analytics tag. The IU team would figure out how to set a cookie from (or link through) a URL from our course management system (Canvas) that gives us each student’s university ID for research tracking.
This assumes that a google analytics tag would get triggered as with any basic HTML page on the main index that loads all the other assets so that we can see how long they’re on the page.
> On Jan 9, 2019, at 10:53 PM, Dave Seah ***@***.***> wrote:
>
> Also @kalanicraig @jdanish I've asked for clarification on the offline data logging requirement (at least this is what I think it is) here on the next steps doc
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
> {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/daveseah/netcreate-2018","title":"daveseah/netcreate-2018","subtitle":"GitHub repository","main_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-git.f3mw1.com/images/email/message_cards/avatar.png","action":{"name":"Open in ***@***.*** in #41: Also @kalanicraig @jdanish I've asked for clarification on the offline data logging requirement (at least this is what I think it is) here on the [next steps doc](https://docs.google.com/document/d/1UL_8PckI2TFL1T9f5_EedPXqTRZyfZpf_Yhxha9KJYQ/edit?disco=AAAACc7Nayg)"}],"action":{"name":"View Pull Request","url":"#41 (comment)"}}} [ { ***@***.***": "http://schema.org", ***@***.***": "EmailMessage", "potentialAction": { ***@***.***": "ViewAction", "target": "#41 (comment)", "url": "#41 (comment)", "name": "View Pull Request" }, "description": "View this Pull Request on GitHub", "publisher": { ***@***.***": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#41 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFRhKp6GWoXjJ8FCtkxyj8Jr8vpzjg_8ks5vBr7kgaJpZM4Z3DSk>.
|
Ok, here is what I am thinking of implementing...double-check please! The "OFFLINE PACKAGE" is:
CANVAS LMS and LOGGING SUPPORT for OFFLINE PACKAGE
|
Hi Dave,
Yes, I believe that works with one clarification: I assume our work-flow will be to take the ZIP, open it up, play the files on a web server (either NetCreate, or inside Canvas). Then we will send a link to the students. Assuming the page will run in that environment, we should be AOK!
Yes, short-term, we will do our own surgery on the file. Our expectation is that by placing the file or link within Canvas, Canvas will tell us which students have clicked on the link / file. Then, the google api stuff just needs to be in the HTML file (we’ll add it) and that’ll tell us how much time de-identified users spend on the page.
Down the road it might be nice to be able to add “hooks” for specific links into an external logging package like google analytics so that we don’t need to have a server always running to log how students use the exported files, but that isn’t an issue right now so we can address it later as-needed (and as-funded).
Thanks!
Joshua
…----
Joshua A. Danish
Pronouns: he, him, his (https://www.mypronouns.org/ <https://www.mypronouns.org/>)
[email protected]
http://www.joshuadanish.com
On Jan 10, 2019, at 10:58 AM, Dave Seah ***@***.***> wrote:
@kalanicraig <https://github.com/kalanicraig> @jdanish <https://github.com/jdanish> @benloh <https://github.com/benloh>
Ok, here is what I am thinking of implementing...double-check please!
The "OFFLINE PACKAGE" is:
A HTML file that a student can double-click after downloading and unpacking a ZIP archive.
The ZIP archive is generated at the end of a classroom session on the AppServer laptop (the laptop that has the NetCreate development environment installed) by executing a command like npm run makepackage after the server has been stopped.
NOTE: The ZIP archive will contain multiple files (e.g. combined scripts, css), so it would be distributed as a zip archive that is unpacked on a computer. I'm thinking the HTML file will be called something like RunNetCreate.html
CANVAS LMS and LOGGING SUPPORT for OFFLINE PACKAGE
To support Canvas, the RunNetCreate.html file will have a script link that magically logs the data you need. I don't have any information on this at all. If you are planning on doing surgery on the standalone file yourself I won't worry about it for the first pass.
I'm guessing that logging will be limited to "the file has been viewed on such-and-such a date by anonymous user" since we have no integration information for Canvas that I know of.
The OFFLINE PACKAGE does not export any other data.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#41 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFRhKmtmgHsPqTyK8Po1Cwom09HmcIwCks5vB2McgaJpZM4Z3DSk>.
|
Sorry, that should read place, not play!
----
Joshua A. Danish
Pronouns: he, him, his (https://www.mypronouns.org/ <https://www.mypronouns.org/>)
[email protected]
http://www.joshuadanish.com
… On Jan 10, 2019, at 11:16 AM, Joshua Danish ***@***.***> wrote:
Hi Dave,
Yes, I believe that works with one clarification: I assume our work-flow will be to take the ZIP, open it up, play the files on a web server (either NetCreate, or inside Canvas). Then we will send a link to the students. Assuming the page will run in that environment, we should be AOK!
Yes, short-term, we will do our own surgery on the file. Our expectation is that by placing the file or link within Canvas, Canvas will tell us which students have clicked on the link / file. Then, the google api stuff just needs to be in the HTML file (we’ll add it) and that’ll tell us how much time de-identified users spend on the page.
Down the road it might be nice to be able to add “hooks” for specific links into an external logging package like google analytics so that we don’t need to have a server always running to log how students use the exported files, but that isn’t an issue right now so we can address it later as-needed (and as-funded).
Thanks!
Joshua
----
Joshua A. Danish
Pronouns: he, him, his (https://www.mypronouns.org/ <https://www.mypronouns.org/>)
***@***.*** ***@***.***>
http://www.joshuadanish.com <http://www.joshuadanish.com/>
> On Jan 10, 2019, at 10:58 AM, Dave Seah ***@***.*** ***@***.***>> wrote:
>
> @kalanicraig <https://github.com/kalanicraig> @jdanish <https://github.com/jdanish> @benloh <https://github.com/benloh>
> Ok, here is what I am thinking of implementing...double-check please!
>
> The "OFFLINE PACKAGE" is:
>
> A HTML file that a student can double-click after downloading and unpacking a ZIP archive.
> The ZIP archive is generated at the end of a classroom session on the AppServer laptop (the laptop that has the NetCreate development environment installed) by executing a command like npm run makepackage after the server has been stopped.
> NOTE: The ZIP archive will contain multiple files (e.g. combined scripts, css), so it would be distributed as a zip archive that is unpacked on a computer. I'm thinking the HTML file will be called something like RunNetCreate.html
> CANVAS LMS and LOGGING SUPPORT for OFFLINE PACKAGE
>
> To support Canvas, the RunNetCreate.html file will have a script link that magically logs the data you need. I don't have any information on this at all. If you are planning on doing surgery on the standalone file yourself I won't worry about it for the first pass.
> I'm guessing that logging will be limited to "the file has been viewed on such-and-such a date by anonymous user" since we have no integration information for Canvas that I know of.
> The OFFLINE PACKAGE does not export any other data.
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <#41 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFRhKmtmgHsPqTyK8Po1Cwom09HmcIwCks5vB2McgaJpZM4Z3DSk>.
>
|
Thanks for the clarification! Knowing that you will deploy on a web server somewhere, as opposed to providing the files on an FTP server, is very helpful in picking a shorter path to feature delivery! SPECIFICATION 1.1 The "OFFLINE PACKAGE" is a "snapshot" of NetCreate data that is deployed on a web page by IU. This is a stand-alone READ-ONLY version of the NetCreate webapp, provided as a ZIP archive.
|
Works for me!!
Joshua
…----
Joshua A. Danish
Pronouns: he, him, his (https://www.mypronouns.org/ <https://www.mypronouns.org/>)
[email protected]
http://www.joshuadanish.com
On Jan 10, 2019, at 4:11 PM, Dave Seah ***@***.***> wrote:
@jdanish <https://github.com/jdanish>
Thanks for the clarification! Knowing that you will deploy on a web server somewhere, as opposed to providing the files on an FTP server, is very helpful in picking a shorter path to feature delivery!
SPECIFICATION 1.1
The "OFFLINE PACKAGE" is a "snapshot" of NetCreate data that is deployed on a web page by IU. This is a stand-alone READ-ONLY version of the NetCreate webapp, provided as a ZIP archive.
The ZIP archive is generated at the end of a classroom session on the AppServer laptop (the laptop that has the NetCreate development environment installed) by executing a command like npm run makepackage after the server has been stopped.
The ZIP archive is unpacked to a directory, which is uploaded to a webserver. The HTML file will be called index.html,
CANVAS LMS SUPPORT is inserted into index.html by IU manually.
The OFFLINE PACKAGE does not export any other data.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#41 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AFRhKrVi0hnyfek-LT_1YR3p_4AHdZrpks5vB6x_gaJpZM4Z3DSk>.
|
…tions, with NPM script entries
…tandalone version of netcreate
…nd clean up prompting
I'm writing a new pull request that reflects the updated functionality. Closing this one. |
PLACEHOLDER
This pull request closes #39 "Offline Viewing Mode", which implements the technical needs to view and interacting with the netgraph in READ ONLY mode when the NetCreate AppServer is offline. This commit handles two cases when the server is offline:
TESTING
THIS FEATURE IS NOT COMPLETE as I'll need Ben to add additional the additional UI hooks to reflect "read only" mode.
START TESTING PROCEDURE (WIP)
npm run dev
from Terminal.MEEP-ONE-9V3
). Manipulate the netgraph data to see that it works as expectedTEST OFFLINE DATA CACHING
CTRL-C
to stop the serverTEST OFFLINE VIEW FROM CACHE
https://localhost/#/edit/MEEP-ONE-9V3
.CTRL-C
again to stop the serverKNOWN ISSUES
netcreate.cache
that's stored in theapp/assets
directory and copied to/public
, and this makes it difficult to debug code changes with live reload since the OLD scripts are cached. A workaround is in progress.netcreate.cache
manifest. Currently onlyalexander.json
is listed