Browse Source

first commit

master
Nuno Martinho 5 years ago
commit
bca0e468e6
54 changed files with 87573 additions and 0 deletions
  1. +18
    -0
      .gitignore
  2. +3
    -0
      config/_development.js
  3. +3
    -0
      config/_production.js
  4. BIN
      config/icon.png
  5. BIN
      dbs/social.mv.db
  6. BIN
      public/images/logo-main.png
  7. BIN
      public/images/logo.png
  8. +86254
    -0
      public/scripts/main.js
  9. +1
    -0
      public/scripts/main.js.map
  10. +13
    -0
      public/styles/main.css
  11. +22
    -0
      server/core/_config.js
  12. +5
    -0
      server/core/_init.js
  13. +0
    -0
      server/core/_request_close.js
  14. +0
    -0
      server/core/_request_end.js
  15. +17
    -0
      server/core/_request_error.js
  16. +2
    -0
      server/core/_request_start.js
  17. +14
    -0
      server/core/_request_url.js
  18. +13
    -0
      server/core/_service_config.js
  19. +0
    -0
      server/core/_service_end.js
  20. +5
    -0
      server/core/_service_error.js
  21. +0
    -0
      server/core/_service_start.js
  22. +7
    -0
      server/package.json
  23. +33
    -0
      server/services/pessoas/get.js
  24. +14
    -0
      server/services/pessoas/publicacoes/post.js
  25. +0
    -0
      server/setup/_end.js
  26. +57
    -0
      server/setup/_schema-form-1-cidade.js
  27. +117
    -0
      server/setup/_schema-form-2-comunidade.js
  28. +177
    -0
      server/setup/_schema-form-3-pessoa.js
  29. +88
    -0
      server/setup/_schema-form-4-pessoa_comunidade.js
  30. +147
    -0
      server/setup/_schema-form-5-publicacao.js
  31. +0
    -0
      server/setup/_start.js
  32. +24
    -0
      server/templates/dashboard.html
  33. +31
    -0
      server/templates/dev/dashboard.html
  34. +1
    -0
      server/templates/scripts.html
  35. +0
    -0
      server/templates/scripts_dev.html
  36. +0
    -0
      server/templates/scripts_login.html
  37. +1
    -0
      server/templates/styles.html
  38. +1
    -0
      server/templates/styles_dev.html
  39. +0
    -0
      server/templates/styles_login.html
  40. +4
    -0
      storage/filesystem/private/info.txt
  41. +2
    -0
      storage/filesystem/public/info.txt
  42. +4
    -0
      storage/filesystem/server/info.txt
  43. +9
    -0
      ui/.babelrc
  44. +18
    -0
      ui/.gitignore
  45. +24
    -0
      ui/README.md
  46. +36
    -0
      ui/package.json
  47. +17
    -0
      ui/src/components/MyButton/index.jsx
  48. +80
    -0
      ui/src/components/TabelaPessoas/JanelaPublicacoes/index.jsx
  49. +86
    -0
      ui/src/components/TabelaPessoas/index.jsx
  50. +90
    -0
      ui/src/containers/DashboardContainer/index.jsx
  51. +8
    -0
      ui/src/containers/DashboardContainer/index.less
  52. +42
    -0
      ui/src/index.jsx
  53. +4
    -0
      ui/src/styles/main.less
  54. +81
    -0
      ui/webpack.config.js

+ 18
- 0
.gitignore View File

@ -0,0 +1,18 @@
node_modules/
.DS_Store
*.log
.idea/
.metadata/
.vscode
package-lock.json
/trash/*
.Trash
*~*
*#*
config/_development.json
config/_production.json

+ 3
- 0
config/_development.js View File

@ -0,0 +1,3 @@
/*
* Development dynamic configurations is here.
*/

+ 3
- 0
config/_production.js View File

@ -0,0 +1,3 @@
/*
* Production dynamic configurations is here.
*/

BIN
config/icon.png View File

Before After
Width: 1024  |  Height: 1024  |  Size: 68 KiB

BIN
dbs/social.mv.db View File


BIN
public/images/logo-main.png View File

Before After
Width: 740  |  Height: 225  |  Size: 12 KiB

BIN
public/images/logo.png View File

Before After
Width: 600  |  Height: 180  |  Size: 22 KiB

+ 86254
- 0
public/scripts/main.js
File diff suppressed because it is too large
View File


+ 1
- 0
public/scripts/main.js.map
File diff suppressed because it is too large
View File


+ 13
- 0
public/styles/main.css View File

@ -0,0 +1,13 @@
/**
HERE YOUR CUSTOM CSS
**/
.navbar, .navbar-inverse {
background-color: #5b5ce1 !important;
}
.dev .navbar, .dev .navbar-inverse {
background-color: #333333 !important;
}

+ 22
- 0
server/core/_config.js View File

@ -0,0 +1,22 @@
_config.set("_lang", _config.get("_lang:default"))
if (_env.is("dev")
&& (_url.equals("/") || _url.equals("/Index.netuno"))) {
_config
.set("_login:user", "dev")
.set("_login:pass", "dev")
.set("_login:auto", _req.getString("action") != "logout")
}
/**
* DISABLE BROWSER CACHE
*/
if (_url.download.isDownloadable()) {
if (_env.is("dev") && _url.indexOf("/public/scripts/main.js") > 0) {
_header.noCache()
} else {
_header.cache(2628000)
}
}

+ 5
- 0
server/core/_init.js View File

@ -0,0 +1,5 @@
/**
* FIREBASE - Set your listeners
*/
// _firebase.listener("my-test", _header.baseURL() + "/services/firebase/listener/my-test.netuno")

+ 0
- 0
server/core/_request_close.js View File


+ 0
- 0
server/core/_request_end.js View File


+ 17
- 0
server/core/_request_error.js View File

@ -0,0 +1,17 @@
if (!_out.isClosed()) {
_out.print(
"### SERVER ERROR ###"
)
/*
// Is insecure but the code below will print errors with more details...
_out.print(
"SERVER ERROR # " +
_error.data().getString("file")
+":"+
_error.data().getString("line")
+" # "+
_error.data().getString("message")
)
*/
}

+ 2
- 0
server/core/_request_start.js View File

@ -0,0 +1,2 @@
_config.set("_script:_request_end", true)

+ 14
- 0
server/core/_request_url.js View File

@ -0,0 +1,14 @@
// _log.info(_url.url())
/**
* ALLOW CORS
*/
/*
_header.response.set("Access-Control-Allow-Origin", "https://www.netuno.org")
_header.response.set("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE,OPTIONS")
_header.response.set("Access-Control-Allow-Headers", "content-type,x-requested-with,authorization")
_header.response.set("Access-Control-Allow-Credentials", true)
*/
_url.to(_url.request())

+ 13
- 0
server/core/_service_config.js View File

@ -0,0 +1,13 @@
/**
* When service need public access...
*/
if (_env.is("dev")) {
_service.allow()
}
/*
if (_service.path == 'samples/my-service') {
_service.allow()
}
*/

+ 0
- 0
server/core/_service_end.js View File


+ 5
- 0
server/core/_service_error.js View File

@ -0,0 +1,5 @@
/*
// Print error:
_log.fatal("Service "+ _service.path, _error.data().get("throwable"))
*/

+ 0
- 0
server/core/_service_start.js View File


+ 7
- 0
server/package.json View File

@ -0,0 +1,7 @@
{
"name": "server",
"version": "1.0.0",
"description": "Server modules dependencies.",
"author": "netuno.org",
"license": "ISC"
}

+ 33
- 0
server/services/pessoas/get.js View File

@ -0,0 +1,33 @@
const dbPessoas = _db.query(`
select pessoa.id, pessoa.uid, pessoa.nome, pessoa.apelido, cidade.nome "cidade"
from pessoa
inner join cidade
on pessoa.cidade_id = cidade.id
`);
const dados = _val.list();
for (const dbPessoa of dbPessoas) {
dbComunidades = _db.query(`
select comunidade.nome
from comunidade
inner join pessoa_comunidade
on comunidade.id = pessoa_comunidade.comunidade_id
where pessoa_comunidade.pessoa_id = ?
`, dbPessoa.getInt("id"))
const dadosComunidades = _val.list()
for (const dbComunidade of dbComunidades) {
dadosComunidades.add(
dbComunidade.getString("nome")
)
}
dados.add(
_val.map()
.set("uid", dbPessoa.getString("uid"))
.set("nome", `${dbPessoa.getString("nome")} ${dbPessoa.getString("apelido")}`)
.set("apelido", dbPessoa.getString("apelido"))
.set("cidade", dbPessoa.getString("cidade"))
.set("comunidades", dadosComunidades)
)
}
_out.json(dados)

+ 14
- 0
server/services/pessoas/publicacoes/post.js View File

@ -0,0 +1,14 @@
const dbPublicacoes = _db.query(`
select
publicacao.uid,
comunidade.nome,
publicacao.momento,
publicacao.mensagem
from publicacao
inner join pessoa on publicacao.pessoa_id = pessoa.id
inner join comunidade on publicacao.comunidade_id = comunidade.id
where pessoa.uid = ?
`, _req.getString("uid"))
//console.log(_req);
//java.lang.Thread.sleep(4000)
_out.json(dbPublicacoes)

+ 0
- 0
server/setup/_end.js View File


+ 57
- 0
server/setup/_schema-form-1-cidade.js View File

@ -0,0 +1,57 @@
/**
*
* CODE GENERATED AUTOMATICALLY
*
* THIS FILE SHOULD NOT BE EDITED BY HAND
*
*/
_form.createIfNotExists(
_val.init()
.set("big", false)
.set("control_active", true)
.set("control_group", false)
.set("control_user", false)
.set("displayname", "Cidade")
.set("export_id", false)
.set("export_json", true)
.set("export_lastchange", false)
.set("export_uid", true)
.set("export_xls", true)
.set("export_xml", true)
.set("firebase", "")
.set("name", "cidade")
.set("report", false)
.set("show_id", true)
.set("uid", "60914efe-dfb3-4051-a523-f53d0d9d706c")
)
_form.createComponentIfNotExists(
"60914efe-dfb3-4051-a523-f53d0d9d706c",
_val.init()
.set("colspan", 0)
.set("displayname", "Nome")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "nome")
.set("notnull", true)
.set("primarykey", true)
.set("properties", "{\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "text")
.set("uid", "bee13b18-aeea-4a7c-a9b9-b30dddddb777")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 1)
)

+ 117
- 0
server/setup/_schema-form-2-comunidade.js View File

@ -0,0 +1,117 @@
/**
*
* CODE GENERATED AUTOMATICALLY
*
* THIS FILE SHOULD NOT BE EDITED BY HAND
*
*/
_form.createIfNotExists(
_val.init()
.set("big", false)
.set("control_active", true)
.set("control_group", false)
.set("control_user", false)
.set("displayname", "Comunidade")
.set("export_id", false)
.set("export_json", true)
.set("export_lastchange", false)
.set("export_uid", true)
.set("export_xls", true)
.set("export_xml", true)
.set("firebase", "")
.set("name", "comunidade")
.set("report", false)
.set("show_id", true)
.set("uid", "0f47df33-0eda-4cf5-b317-d991ee34cfb6")
)
_form.createComponentIfNotExists(
"0f47df33-0eda-4cf5-b317-d991ee34cfb6",
_val.init()
.set("colspan", 0)
.set("displayname", "Cidade")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "cidade_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"cidade:nome\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "660f7c28-f934-489d-8290-c0a7b95e49f9")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 3)
)
_form.createComponentIfNotExists(
"0f47df33-0eda-4cf5-b317-d991ee34cfb6",
_val.init()
.set("colspan", 0)
.set("displayname", "Descri\u00E7\u00E3o")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "descricao")
.set("notnull", false)
.set("primarykey", false)
.set("properties", "{}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "textarea")
.set("uid", "474fcaf4-5632-4d0e-9fe1-4b1606b81fae")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 2)
)
_form.createComponentIfNotExists(
"0f47df33-0eda-4cf5-b317-d991ee34cfb6",
_val.init()
.set("colspan", 0)
.set("displayname", "Nome")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "nome")
.set("notnull", true)
.set("primarykey", true)
.set("properties", "{\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "text")
.set("uid", "3eb723bd-1e84-4e21-b150-4aa8ed6cade1")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 1)
)

+ 177
- 0
server/setup/_schema-form-3-pessoa.js View File

@ -0,0 +1,177 @@
/**
*
* CODE GENERATED AUTOMATICALLY
*
* THIS FILE SHOULD NOT BE EDITED BY HAND
*
*/
_form.createIfNotExists(
_val.init()
.set("big", false)
.set("control_active", true)
.set("control_group", false)
.set("control_user", false)
.set("displayname", "Pessoa")
.set("export_id", false)
.set("export_json", true)
.set("export_lastchange", false)
.set("export_uid", true)
.set("export_xls", true)
.set("export_xml", true)
.set("firebase", "")
.set("name", "pessoa")
.set("report", false)
.set("show_id", true)
.set("uid", "2a42d3f3-7c64-4203-894a-42b24587bda5")
)
_form.createComponentIfNotExists(
"2a42d3f3-7c64-4203-894a-42b24587bda5",
_val.init()
.set("colspan", 0)
.set("displayname", "Apelido")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "apelido")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "text")
.set("uid", "121c9fa9-f47b-41d7-9138-733833381497")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 2)
)
_form.createComponentIfNotExists(
"2a42d3f3-7c64-4203-894a-42b24587bda5",
_val.init()
.set("colspan", 0)
.set("displayname", "Cidade")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "cidade_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"cidade:nome\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "ba2b5263-0e27-4f55-b61c-8ca4f93f1cde")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 3)
)
_form.createComponentIfNotExists(
"2a42d3f3-7c64-4203-894a-42b24587bda5",
_val.init()
.set("colspan", 0)
.set("displayname", "Comunidades")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "comunidades")
.set("notnull", false)
.set("primarykey", false)
.set("properties", "{\"ITEM_SEPARATOR\":{\"default\":\" # \",\"type\":\"STRING\",\"value\":\" # \"},\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"REFERENCE\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"pessoa_comunidade:pessoa_id\"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"pessoa_comunidade:comunidade_id\"},\"SERVICE\":{\"default\":\"com/MultiSelect.netuno\",\"type\":\"STRING\",\"value\":\"com/MultiSelect.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "multiselect")
.set("uid", "bedb4488-c414-4b9b-bf40-a0aef1d0de66")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", false)
.set("whennew", true)
.set("whenresult", false)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 5)
)
_form.createComponentIfNotExists(
"2a42d3f3-7c64-4203-894a-42b24587bda5",
_val.init()
.set("colspan", 0)
.set("displayname", "Email")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "email")
.set("notnull", true)
.set("primarykey", true)
.set("properties", "{\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "text")
.set("uid", "731bc8d8-9f73-4b74-9370-e92208b90a06")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 4)
)
_form.createComponentIfNotExists(
"2a42d3f3-7c64-4203-894a-42b24587bda5",
_val.init()
.set("colspan", 0)
.set("displayname", "Nome")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "nome")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "text")
.set("uid", "9e598b7c-e7d1-46c5-bf88-e06af499825f")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 1)
)

+ 88
- 0
server/setup/_schema-form-4-pessoa_comunidade.js View File

@ -0,0 +1,88 @@
/**
*
* CODE GENERATED AUTOMATICALLY
*
* THIS FILE SHOULD NOT BE EDITED BY HAND
*
*/
_form.createIfNotExists(
_val.init()
.set("big", false)
.set("control_active", true)
.set("control_group", false)
.set("control_user", false)
.set("displayname", "Comunidade")
.set("export_id", false)
.set("export_json", true)
.set("export_lastchange", false)
.set("export_uid", true)
.set("export_xls", true)
.set("export_xml", true)
.set("firebase", "")
.set("name", "pessoa_comunidade")
.set("parent_uid", "2a42d3f3-7c64-4203-894a-42b24587bda5")
.set("report", false)
.set("show_id", true)
.set("uid", "27a35c62-7627-4e59-8636-d0147af8574b")
)
_form.createComponentIfNotExists(
"27a35c62-7627-4e59-8636-d0147af8574b",
_val.init()
.set("colspan", 0)
.set("displayname", "Comunidade")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "comunidade_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"comunidade:nome,cidade_id\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "bf17b11f-fbf0-4356-b719-6b5f0ea5099c")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 3)
)
_form.createComponentIfNotExists(
"27a35c62-7627-4e59-8636-d0147af8574b",
_val.init()
.set("colspan", 0)
.set("displayname", "Pessoa")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "pessoa_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"pessoa:nome,apelido,email\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "dc33785d-c5f8-40db-ae90-761f515d93a6")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 1)
)

+ 147
- 0
server/setup/_schema-form-5-publicacao.js View File

@ -0,0 +1,147 @@
/**
*
* CODE GENERATED AUTOMATICALLY
*
* THIS FILE SHOULD NOT BE EDITED BY HAND
*
*/
_form.createIfNotExists(
_val.init()
.set("big", false)
.set("control_active", true)
.set("control_group", false)
.set("control_user", false)
.set("displayname", "Publica\u00E7\u00E3o")
.set("export_id", false)
.set("export_json", true)
.set("export_lastchange", false)
.set("export_uid", true)
.set("export_xls", true)
.set("export_xml", true)
.set("firebase", "")
.set("name", "publicacao")
.set("report", false)
.set("show_id", true)
.set("uid", "486325ff-4031-4d34-b48c-9b0246f83fe9")
)
_form.createComponentIfNotExists(
"486325ff-4031-4d34-b48c-9b0246f83fe9",
_val.init()
.set("colspan", 0)
.set("displayname", "Comunidade")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "comunidade_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"comunidade:nome,cidade_id\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "0277798c-14bf-4f8f-9a06-d9c015014a9f")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 3)
)
_form.createComponentIfNotExists(
"486325ff-4031-4d34-b48c-9b0246f83fe9",
_val.init()
.set("colspan", 0)
.set("displayname", "Mensagem")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "mensagem")
.set("notnull", false)
.set("primarykey", false)
.set("properties", "{}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "textarea")
.set("uid", "5f5f0723-2e67-4fc2-aa25-71d03448e45d")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 4)
)
_form.createComponentIfNotExists(
"486325ff-4031-4d34-b48c-9b0246f83fe9",
_val.init()
.set("colspan", 0)
.set("displayname", "Momento")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "momento")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"DEFAULT_CURRENT\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"true\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "datetime")
.set("uid", "9b2798b4-01bd-48d3-9026-f6773fbac5d1")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 5)
)
_form.createComponentIfNotExists(
"486325ff-4031-4d34-b48c-9b0246f83fe9",
_val.init()
.set("colspan", 0)
.set("displayname", "Pessoa")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "pessoa_id")
.set("notnull", true)
.set("primarykey", false)
.set("properties", "{\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"pessoa:nome,apelido,email\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "select")
.set("uid", "b57a44d3-dc9c-4483-81be-5a25822e5a56")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 1)
)

+ 0
- 0
server/setup/_start.js View File


+ 24
- 0
server/templates/dashboard.html View File

@ -0,0 +1,24 @@
<div class="row">
<div class="col-lg-12">
<div class="with-form">
<h1 class="page-header">
_{&lang=netuno.main.dashboard.title}
</h1>
</div>
<div class="no-form">
<h1 class="page-header">
_{&lang=netuno.main.dashboard.welcome_netuno}
</h1>
<p>_{&lang=netuno.main.dashboard.you_not_form}</p>
<p>_{&lang=netuno.main.dashboard.you_can_start_by_clicking_top_bar}</p>
<br>
<img src="_{netuno-config=url-styles}/build-button-tutorial.png" height="80">
</div>
</div>
</div>
<div id="app-dashboard"></div>

+ 31
- 0
server/templates/dev/dashboard.html View File

@ -0,0 +1,31 @@
<div class="row">
<div class="col-lg-12">
<div class="with-form">
<h1 class="page-header">
_{&lang=netuno.main.dashboard.title}
</h1>
<p>_{&lang=netuno.main.dashboard.description}</p>
</div>
<div class="no-form">
<h1 class="page-header">
_{&lang=netuno.main.dashboard.welcome_netuno}
</h1>
<p>_{&lang=netuno.dev.main.you_not_form}</p>
<p>_{&lang=netuno.dev.main.you_can_start_by_clicking_top_bar}</p>
<br>
<img src="_{netuno-config=url-styles}/build-button-tutorial-dev.png" height="200">
</div>
#macro(listFormItems $items)
<ul>
#foreach($item in $items)
<li>
<a href="#" netuno-dev-form="$item.getString('name')">$item.getString('text')</a>
#listFormItems($item.get('items'))
</li>
#end
</ul>
#end
#listFormItems($data.get('menu').get('forms'))
</div>
</div>

+ 1
- 0
server/templates/scripts.html View File

@ -0,0 +1 @@
<script src="_{netuno-config=url-app-scripts}/main.js?_{util=requestuuid}"></script>

+ 0
- 0
server/templates/scripts_dev.html View File


+ 0
- 0
server/templates/scripts_login.html View File


+ 1
- 0
server/templates/styles.html View File

@ -0,0 +1 @@
<link href='_{netuno-config=url-app-styles}/main.css' rel='stylesheet' />

+ 1
- 0
server/templates/styles_dev.html View File

@ -0,0 +1 @@
<link href='_{netuno-config=url-app-styles}/main.css' rel='stylesheet' />

+ 0
- 0
server/templates/styles_login.html View File


+ 4
- 0
storage/filesystem/private/info.txt View File

@ -0,0 +1,4 @@
Secure data files comes here...
Only accessible for logged users!

+ 2
- 0
storage/filesystem/public/info.txt View File

@ -0,0 +1,2 @@
Public storage files comes here...

+ 4
- 0
storage/filesystem/server/info.txt View File

@ -0,0 +1,4 @@
Secure data files comes here...
Only accessible through server side!

+ 9
- 0
ui/.babelrc View File

@ -0,0 +1,9 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
["import", { "libraryName": "antd", "style": true } ]
]
}

+ 18
- 0
ui/.gitignore View File

@ -0,0 +1,18 @@
node_modules/
.DS_Store
*.log
.idea/
.metadata/
.vscode
package-lock.json
yarn.lock
.Trash
*~*
*#*

+ 24
- 0
ui/README.md View File

@ -0,0 +1,24 @@
### Install Packages
`npm install`
### Watch changes and auto recompile
`npm run watch`
### Installation requirements
On Windows with an Administrator terminal, run:
```
npm install --global --production windows-build-tools
npm install --global node-gyp
```
With others Python version, then configure the Python 2.7 path:
```
node-gyp --python /path/to/python2.7
npm config set python /path/to/executable/python2.7
```

+ 36
- 0
ui/package.json View File

@ -0,0 +1,36 @@
{
"name": "public",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --mode production",
"watch": "webpack --mode development --watch"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/plugin-proposal-object-rest-spread": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@babel/preset-react": "^7.9.4",
"babel-loader": "^8.1.0",
"babel-plugin-import": "^1.13.0",
"less": "^3.11.1",
"less-loader": "^5.0.0",
"css-loader": "^3.4.2",
"style-loader": "^1.1.3",
"prop-types": "^15.7.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"webpack": "^4.42.1",
"webpack-cli": "^3.3.11"
},
"dependencies": {
"antd": "^4.1.0",
"chart.js": "^2.9.3",
"react-chartjs-2": "^2.9.0"
}
}

+ 17
- 0
ui/src/components/MyButton/index.jsx View File

@ -0,0 +1,17 @@
import React from "react";
import PropTypes from "prop-types";
import Button from 'antd/lib/button';
const MyButton = ({ buttonRef, text, click }) => (
<div ref={ buttonRef }><Button type="primary" onClick={ click }>
{ text }
</Button></div>
);
MyButton.propTypes = {
buttonRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
text: PropTypes.string.isRequired,
click: PropTypes.func.isRequired
};
export default MyButton;

+ 80
- 0
ui/src/components/TabelaPessoas/JanelaPublicacoes/index.jsx View File

@ -0,0 +1,80 @@
import React, { useState, useEffect } from "react";
import PropTypes from "prop-types";
import Modal from 'antd/lib/modal';
import Spin from 'antd/lib/spin';
import Typography from 'antd/lib/typography';
const { Title } = Typography;
const JanelaPublicacoes = ({pessoa, onClose}) => {
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
useEffect( () => {
setLoading(true);
const fail = ()=> {
setLoading(false);
notification["error"]({
message: 'Lista de Publicações',
description: 'Houve uma falha ao carregar a lista das publicações...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/pessoas/publicacoes',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
uid: pessoa.uid
}),
success: (response)=> {
if (response.json) {
setData(response.json);
setLoading(false);
} else {
fail();
}
},
fail: ()=> {
fail();
}
});
}, []);
return <Modal
title="Publicações"
visible={true}
onOk = {() => {onClose()}}
onCancel = { () => {onClose()} }>
{loading && <Spin />}
{data.length > 0 ?
data.map(
(item) => (
<div>
<Title level={3}>{item.nome}</Title>
{item.mensagem}
<p>{item.momento.replace(".0", "")}</p>
</div>
)
)
: <p> Não fez publicacoes ainda.... </p> }
</Modal>;
};
JanelaPublicacoes.propTypes = {
pessoa: PropTypes.object.isRequired,
onClose: PropTypes.func.isRequired
};
export default JanelaPublicacoes;

+ 86
- 0
ui/src/components/TabelaPessoas/index.jsx View File

@ -0,0 +1,86 @@
import React, { useState, useEffect } from "react";
import Table from 'antd/lib/table';
import Tag from 'antd/lib/tag';
import Button from 'antd/lib/button';
import JanelaPublicacoes from "./JanelaPublicacoes/index.jsx";
const TabelaPessoas = () => {
const [ data, setData ] = useState([]);
const [ pessoaPublicacoes, setPessoaPublicacoes ] = useState(null);
const [ loading, setLoading ] = useState(false);
useEffect(() => {
setLoading(true);
const fail = ()=> {
setLoading(false);
notification["error"]({
message: 'Tabela de Pessoas',
description: 'Houve uma falha ao carregar a tabela das pessoas...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/pessoas',
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: (response)=> {
if (response.json) {
setData(response.json);
setLoading(false);
} else {
fail();
}
},
fail: ()=> {
fail();
}
});
}, [ ]);
const columns = [
{
title: "Nome",
dataIndex: "nome"
},
{
title: "Cidade",
dataIndex: "cidade"
},
{
title: "Comunidades",
dataIndex: "comunidades",
render: (comunidades) => (
<div>
{
comunidades.map((nome) => (
<Tag>{nome}</Tag>
))
}
</div>
)
},
{
title: "Ações",
render: (text, record, index) => (
<div>
{ <Button onClick={ () => setPessoaPublicacoes(record) }>Publicações</Button>}
</div>
)
}
];
return <>
{ !!pessoaPublicacoes && <JanelaPublicacoes
pessoa={pessoaPublicacoes}
onClose={ () => setPessoaPublicacoes(null) }
/> }
<Table dataSource={data} { ...{ columns, loading } } />
</>;
};
export default TabelaPessoas;

+ 90
- 0
ui/src/containers/DashboardContainer/index.jsx View File

@ -0,0 +1,90 @@
import React, { Component } from "react";
import MyButton from "../../components/MyButton/index.jsx";
import TabelaPessoas from "../../components/TabelaPessoas/index.jsx";
import "./index.less";
export default class DashboardContainer extends Component {
constructor(props) {
super(props);
this.state = {
counter: 0
};
this.button = React.createRef();
this.click = this.click.bind(this);
}
componentWillMount() {
/*
// Basic sample of the service call:
fetch('/services/my-test.netuno', {
credentials: 'include'
}).then((response) => {
return response.json();
}).then((json) => {
// json...;
});
*/
/*
// Better sample of the recommended way to call services:
const fail = ()=> {
this.setState({ loading: false });
notification["error"]({
message: 'Error',
description: 'Data loading error...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/my-data-service',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
param1: 'value1',
param2: 'value2'
}),
success: (response)=> {
console.log(response);
if (response.json) {
this.setState({
loading: false,
data: response.json
});
} else {
fail();
}
},
fail: ()=> {
fail();
}
});
*/
}
componentDidUpdate(prevProps, prevState, snapshot) {
$(this.button.current).fadeOut(250).fadeIn(250);
}
click() {
this.setState({ counter: this.state.counter + 1 });
}
render() {
const { counter } = this.state;
return (
<div className="my-dashboard">
<TabelaPessoas />
<div className="my-dashboard__button">
<MyButton mainRef={ this.button } text={ `ReactJS ⚡ Ant.Design 👉 Click me! ${ counter }` } click={ this.click } />
</div>
</div>
);
}
}

+ 8
- 0
ui/src/containers/DashboardContainer/index.less View File

@ -0,0 +1,8 @@
.my-dashboard {
width: 100%;
&__button {
padding: 80px;
text-align: center;
}
}

+ 42
- 0
ui/src/index.jsx View File

@ -0,0 +1,42 @@
import React from "react";
import ReactDOM from "react-dom";
import DashboardContainer from "./containers/DashboardContainer/index.jsx";
const dashboardDiv = document.getElementById("app-dashboard");
const dashboardContainer = dashboardDiv ? ReactDOM.render(<DashboardContainer />, dashboardDiv) : false;
netuno.addNavigationLoad(() => {
$('[netuno-navigation]').find('a').on('netuno:click', (e)=> {
const link = $(e.target);
if (dashboardContainer && link.is('[netuno-navigation-dashboard]')) {
// Menu > Dashboard > Clicked!
}
});
});
netuno.addContentLoad((container) => {
// When any content is loaded dinamically this is executed...
if (container.is('[netuno-form-search="YOUR_FORM_NAME"]')) {
// When search page is loaded...
} else if (container.is('[netuno-form-edit="YOUR_FORM_NAME"]')) {
// When form edit is loaded...
}
});
netuno.addPageLoad(() => {
// When page is loaded...
let modal = $('#app-dashboard-modal-form');
modal.on('hidden.bs.modal', ()=> {
modal.find('[netuno-form-edit]').empty();
});
$('#app-dashboard-modal-form-button').on('click', ()=> {
modal.modal('show');
netuno.loadFormEdit(modal.find('[netuno-form]'));
});
modal.find('[netuno-form]').on('netuno:save', ()=> {
modal.modal('hide');
});
});

+ 4
- 0
ui/src/styles/main.less View File

@ -0,0 +1,4 @@
/*** GLOBAL CSS ***/
@import '~antd/dist/antd';

+ 81
- 0
ui/webpack.config.js View File

@ -0,0 +1,81 @@
const path = require('path');
module.exports = {
entry: [ './src/index.jsx', './src/styles/main.less' ],
devtool: "source-map",
output: {
path: __dirname +'/../public/scripts',
filename: 'main.js'
},
module: {
rules: [
{
test: /\.jsx$/,
include: [
path.resolve(__dirname, 'src')
],
exclude: /node_modules/,
use: [{
loader: 'babel-loader'
}]
},
{
test: /\.js$/,
include: [
path.resolve(__dirname, 'src')
],
exclude: /node_modules/,
use: [{
loader: 'babel-loader'
}]
},
{
test: /\.less$/,
include: [
path.resolve(__dirname, 'src')
],
exclude: /node_modules/,
use: [
{
loader: 'style-loader' // creates style nodes from JS strings
},
{
loader: 'css-loader', // translates CSS into CommonJ,
options: {
sourceMap: true/*,
modules: {
mode: 'local',
localIdentName: "[local]___[hash:base64:5]",
context: path.resolve(__dirname, 'src'),
hashPrefix: 'app',
}*/
}
},
{
loader: 'less-loader', // compiles Less to CSS
options: {
modifyVars: {
'primary-color': '#5b5ce1',
'link-color': '#5b5ce1',
'border-radius-base': '5px'
},
javascriptEnabled: true
}
}
]
},
{
test: /\.css$/,
include: [
path.resolve(__dirname, 'src')
],
exclude: /node_modules/,
use: [
'style-loader',
'css-loader'
]
}
]
}
};

Loading…
Cancel
Save