Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
63c1be3
export: Fix node header key typo. `Notes` header was not being expor…
benloh Jan 19, 2022
ebac845
toml: Document `delete` functionality in default template.
benloh Jan 24, 2022
69a181e
toml: Add `IsAdmin` to settings so NodeSelector and More can use it t…
benloh Jan 24, 2022
3fd6308
toml: Add Template, template-logic, and show on More panel.
benloh Jan 24, 2022
3a3c674
toml: Only show Template editor for admins.
benloh Jan 24, 2022
acf70fc
toml: Add json-editor.
benloh Jan 24, 2022
07a9dd8
toml: Add TOML file support.
benloh Jan 24, 2022
b94776a
toml: Lint/doc.
benloh Jan 24, 2022
db5f2ba
toml: Pull out LoadTemplate as its own function so it can be re-used.
benloh Jan 24, 2022
9b030b2
toml: Load TOML template.
benloh Jan 24, 2022
1b9ed38
toml: Save TOML template file to disk.
benloh Jan 24, 2022
f443d2a
toml: Note WriteTemplateJSON is now deprecated.
benloh Jan 24, 2022
c4af672
toml: Lint.
benloh Jan 24, 2022
7c4b7b0
toml: Lint/doc.
benloh Jan 24, 2022
ba88459
toml: Validate toml template. Convert from JSON.
benloh Jan 24, 2022
fb3c4ed
toml: Convert JSON template fields to updated TOML fields.
benloh Jan 24, 2022
af27e9f
toml: Validate TOML file when importing file. (Does not check fields…
benloh Jan 24, 2022
2ebb03c
toml: Convert JSON to TOML in Filters. Also fix bug where default tr…
benloh Jan 24, 2022
6bf9154
toml: Fall back to and migrate JSON template if available if no TOML …
benloh Jan 25, 2022
9557072
toml: lint/doc
benloh Jan 25, 2022
32a02c8
toml: Update TEMPLATE value in nc-logic if AppState changed.
benloh Jan 25, 2022
fa621b2
toml: Return curren template when EDIT_CURRENT_TEMPLATE is received.
benloh Jan 25, 2022
55a30cd
toml: Update descriptions for `exportLabel`. Clarify that it's for a…
benloh Jan 25, 2022
89202f8
toml: lint/doc
benloh Jan 25, 2022
3bde1e0
toml: Remove deprecated fields during migration.
benloh Jan 25, 2022
64667a0
toml: Add `category` to edge schema.
benloh Jan 25, 2022
4d54c1d
toml: Add `id` to node/edge import AFTER importing fields to overwrit…
benloh Jan 25, 2022
ae3fd33
toml: Simplify node type options by removing `id`. It was not used a…
benloh Jan 25, 2022
0b54555
toml: Add `_default.template.toml`
benloh Jan 25, 2022
32ee3e6
toml: Set default template and schema nodeDefaultTransparency to 1.0.
benloh Jan 25, 2022
4c12524
toml: Disallow hiding id, label, source, and target fields.
benloh Jan 25, 2022
de7140d
toml: Add `searchColor` and `sourceColor` to template.
benloh Jan 25, 2022
f2245d9
toml: Flesh out 'created' and 'updated' fields. Remove bad options.
benloh Jan 25, 2022
87624a5
toml: Remove second template load after JSON conversion.
benloh Jan 26, 2022
06b5c69
toml: lint
benloh Jan 26, 2022
4055d5d
toml: Update editor options to allow users to add missing properties …
benloh Jan 26, 2022
f4cf266
toml: lint/doc
benloh Jan 26, 2022
b933604
toml: Add note to readme to run `./nc.js` on first run to create `net…
benloh Jan 26, 2022
e01151f
toml: Default template should not require login.
benloh Jan 26, 2022
4601151
toml: lint
benloh Jan 27, 2022
baa5a49
toml: Disable Template when Node / Edge being edited and vice versa.
benloh Jan 27, 2022
065e7b8
flatten: Migrate old attribute data to flattened node/edge object pro…
benloh Jan 27, 2022
51ede11
flatten: Graph flattened data.
benloh Jan 27, 2022
fe7a789
flatten: Display flattened nodes
benloh Jan 27, 2022
4b877ad
flatten: Display flattened edge data
benloh Jan 27, 2022
910b77b
flatten: Display flattened Node Table data.
benloh Jan 27, 2022
e47999b
flatten: Display flattened Edge Table data
benloh Jan 27, 2022
7f86465
flatten: lint/doc
benloh Jan 27, 2022
7facf0f
flatten: Remove deprecated flattening maps for filters.
benloh Jan 27, 2022
f1c0e57
flatten: Use TEMPLATE settings for export. Deprecate attributes call…
benloh Jan 27, 2022
da520dc
flatten: Fix JSONtoTOML migration: auto-set 'type' nodeDef and edgeDe…
benloh Jan 28, 2022
02699bc
flatten: Fix default template label defautls.
benloh Jan 28, 2022
7a45819
flatten: Fix filters to use flattened object key references (removed …
benloh Jan 28, 2022
08a914c
toml: Add description, examples, for Template Name
benloh Jan 28, 2022
a34e319
toml: Make 'hideDeleteNodeButton` a checkbox.
benloh Jan 28, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ The Wiki has [detailed instructions](https://github.com/netcreateorg/netcreate-2

This will get NetCreate installed and ready to run. It may take some time for the `npm ci` command to finish installing, so be patient!

The first time you run Net.Create, you also need to create a `net-create.config` file. This will tell Net.Create which dataset to open and which ports to use. We have a script that can do this for you. Run:
* `./nc.js --dataset=demo` -- where `demo` will be the name of the dataset you want to use.

## QUICK OPERATION GUIDE

Once you have NetCreate installed, make sure you are in the `netcreate-2018/build` directory. From there, you can execute **scripts** through the `npm` tool that is installed as part of NodeJS.
Expand Down
1 change: 1 addition & 0 deletions build/app/assets/templates/_default.template
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"_cmt4": "//updated is included in the edge tables if in admin mode, and in the graph tooltip if indicated here. Probably those should be more consistent."
},
"delete": {
"_cmt5": "// Only admins see the delete button. This hides delete button even for admins.",
"type": "hidden",
"hidden": false
}
Expand Down
175 changes: 175 additions & 0 deletions build/app/assets/templates/_default.template.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name = "Untitled"
description = "Default empty template"
requireLogin = false
hideDeleteNodeButton = false
duplicateWarning = "You’re entering a duplicate node. Do you want to View the Existing node, or Continue creating?"
nodeIsLockedMessage = "This node is currently being edited by someone else, please try again later."
edgeIsLockedMessage = "This edge is currently being edited by someone else, please try again later."
nodeDefaultTransparency = 1.0
edgeDefaultTransparency = 0.3
searchColor = "#FFFF00"
sourceColor = "#FFa500"

[citation]
text = "No citation set"
hidden = false

[nodeDefs.id]
type = "number"
displayLabel = "Id"
exportLabel = "ID"
help = "System-generated unique id number"

[nodeDefs.label]
type = "string"
displayLabel = "Label"
exportLabel = "Label"
help = "Display name of the node"
includeInGraphTooltip = true

[nodeDefs.type]
type = "select"
displayLabel = "Type"
exportLabel = "Type"
help = "Multiple people are a 'Group'"
includeInGraphTooltip = true
hidden = false

[[nodeDefs.type.options]]
label = ""
color = "#eeeeee"

[[nodeDefs.type.options]]
label = "Person"
color = "#00fbff"

[[nodeDefs.type.options]]
label = "Group"
color = "#3399ff"

[[nodeDefs.type.options]]
label = "Place"
color = "#00ff00"

[[nodeDefs.type.options]]
label = "Thing"
color = "#009999"

[[nodeDefs.type.options]]
label = "Event"
color = "#ff0000"

[nodeDefs.notes]
type = "string"
displayLabel = "Significance"
exportLabel = "Notes"
help = "Add some details"
includeInGraphTooltip = true
hidden = false

[nodeDefs.info]
type = "number"
displayLabel = "Number"
exportLabel = "Info"
help = "Some number comparison"
includeInGraphTooltip = true
hidden = false

[nodeDefs.degrees]
type = "number"
displayLabel = "Degrees"
exportLabel = "Degrees"
help = "Number of edges"
includeInGraphTooltip = true
hidden = false

[nodeDefs.created]
type = "string"
displayLabel = "Created"
exportLabel = "Created"
help = "Date and time node was created"
includeInGraphTooltip = true
hidden = false

[nodeDefs.updated]
type = "string"
displayLabel = "Last Updated"
exportLabel = "Last Updated"
help = "Date and time node was last modified"
includeInGraphTooltip = true
hidden = false

[edgeDefs.id]
type = "number"
displayLabel = "Id"
exportLabel = "ID"
help = "System-generated unique id number"

[edgeDefs.source]
type = "node"
displayLabel = "Source"
exportLabel = "Source"
help = ""
hidden = false

[edgeDefs.target]
type = "node"
displayLabel = "Target"
exportLabel = "Target"
help = ""
hidden = false

[edgeDefs.type]
type = "select"
displayLabel = "Type"
exportLabel = "Type"
help = ""
hidden = false

[[edgeDefs.type.options]]
label = ""
color = "#c2c2c2"

[[edgeDefs.type.options]]
label = "you've got, a \"friend\""
color = "#0dbd00"

[[edgeDefs.type.options]]
label = "has unfriendly interaction with"
color = "#ff0000"

[[edgeDefs.type.options]]
label = "is a member of"
color = "#9ebeff"

[[edgeDefs.type.options]]
label = "visits"
color = "#ffae00"

[edgeDefs.notes]
type = "string"
displayLabel = "Significatnce"
exportLabel = "Significatnce"
help = ""
hidden = false

[edgeDefs.info]
type = "number"
displayLabel = "Date"
exportLabel = "Date"
help = "'YYYY-MM-DD' format"
hidden = false

[edgeDefs.citation]
type = "string"
displayLabel = "Citation"
exportLabel = "Citation"
help = "Source Book.Chapter (Part 2 06.03)"
hidden = false

[edgeDefs.category]
type = "string"
displayLabel = "Category"
exportLabel = "Category"
help = "Category?"
hidden = false
6 changes: 6 additions & 0 deletions build/app/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ let RELOAD_TIMER = null;
/*/ MOD.CurrentTime = () => {
return DATE.toDateString();
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/
/*/ MOD.IsAdmin = () => {
return (MOD.EJSProp('client').ip === '127.0.0.1') ||
location.href.includes('admin=true');
}

/// SERVER-PROVIDED PROPERTIES ////////////////////////////////////////////////
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down
18 changes: 16 additions & 2 deletions build/app/system/datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,26 @@ DSTOR.PromiseJSONFile = function(jsonFile) {
/*/
DSTOR.PromiseD3Data = function() {
// UDATA.Call() returns a promise
return UDATA.Call("SRV_DBGET", {});
return UDATA.Call("SRV_DBGET", {}); // server.js
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: Write Template file to Server
/*/
DSTOR.SaveTemplateFile = template => {
// UDATA.Call() returns a promise
return UDATA.Call("SRV_TEMPLATESAVE", {template}); // server.js
};
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: Get Template File Path.
Called by template-logic when downloading template file.
/*/
DSTOR.GetTemplateTOMLFileName = () => {
return UDATA.Call("SRV_GET_TEMPLATETOML_FILENAME");
}
/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/*/ API: (WIP) write database from d3data-formatted object
/*/
DSTOR.OverwriteDataPromise = function(d3data) {
DSTOR.OverwriteDataPromise = function (d3data) {
return new Promise((resolve, reject) => {
UDATA.Call("SRV_DBSET", d3data).then(res => {
if (res.OK) {
Expand Down
Loading