Browse Source

Primeiro commit

master
João Barbosa 5 years ago
commit
3f9d2d97a2
58 changed files with 91584 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/app.mv.db
  6. +3930
    -0
      dbs/app.trace.db
  7. BIN
      public/images/logo-main.png
  8. BIN
      public/images/logo.png
  9. +86229
    -0
      public/scripts/main.js
  10. +1
    -0
      public/scripts/main.js.map
  11. +13
    -0
      public/styles/main.css
  12. +22
    -0
      server/core/_config.js
  13. +5
    -0
      server/core/_init.js
  14. +0
    -0
      server/core/_request_close.js
  15. +0
    -0
      server/core/_request_end.js
  16. +17
    -0
      server/core/_request_error.js
  17. +2
    -0
      server/core/_request_start.js
  18. +14
    -0
      server/core/_request_url.js
  19. +13
    -0
      server/core/_service_config.js
  20. +0
    -0
      server/core/_service_end.js
  21. +5
    -0
      server/core/_service_error.js
  22. +0
    -0
      server/core/_service_start.js
  23. +7
    -0
      server/package.json
  24. +57
    -0
      server/services/funcionario/get.js
  25. +17
    -0
      server/services/funcionario/salario/post.js
  26. +0
    -0
      server/setup/_end.js
  27. +117
    -0
      server/setup/_schema-form-1-armazem.js
  28. +57
    -0
      server/setup/_schema-form-2-especialidade.js
  29. +177
    -0
      server/setup/_schema-form-3-funcionario.js
  30. +57
    -0
      server/setup/_schema-form-4-salario.js
  31. +88
    -0
      server/setup/_schema-form-5-func_armazem.js
  32. +88
    -0
      server/setup/_schema-form-6-func_especialidade.js
  33. +88
    -0
      server/setup/_schema-form-7-func_salario.js
  34. +0
    -0
      server/setup/_start.js
  35. +24
    -0
      server/templates/dashboard.html
  36. +31
    -0
      server/templates/dev/dashboard.html
  37. +1
    -0
      server/templates/scripts.html
  38. +0
    -0
      server/templates/scripts_dev.html
  39. +0
    -0
      server/templates/scripts_login.html
  40. +1
    -0
      server/templates/styles.html
  41. +1
    -0
      server/templates/styles_dev.html
  42. +0
    -0
      server/templates/styles_login.html
  43. +4
    -0
      storage/filesystem/private/info.txt
  44. +2
    -0
      storage/filesystem/public/info.txt
  45. +4
    -0
      storage/filesystem/server/info.txt
  46. +9
    -0
      ui/.babelrc
  47. +18
    -0
      ui/.gitignore
  48. +24
    -0
      ui/README.md
  49. +36
    -0
      ui/package.json
  50. +17
    -0
      ui/src/components/MyButton/index.jsx
  51. +53
    -0
      ui/src/components/TabelaFuncionario/JanelaSalario/index.jsx
  52. +72
    -0
      ui/src/components/TabelaFuncionario/index.jsx
  53. +76
    -0
      ui/src/containers/DashboardContainer/index.jsx
  54. +8
    -0
      ui/src/containers/DashboardContainer/index.less
  55. +42
    -0
      ui/src/index.jsx
  56. +4
    -0
      ui/src/styles/main.less
  57. +48
    -0
      ui/src/utils/Service.js
  58. +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/app.mv.db View File


+ 3930
- 0
dbs/app.trace.db
File diff suppressed because it is too large
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

+ 86229
- 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"
}

+ 57
- 0
server/services/funcionario/get.js View File

@ -0,0 +1,57 @@
const dbFuncionarios = _db.query(
`select
funcionario.id, funcionario.uid, funcionario.nome, funcionario.idade, funcionario.email, funcionario.telemovel, armazem.id "Armazem"
from funcionario
inner join armazem
on funcionario.armazem_id = armazem.id`
)
const func = _val.list();
for (const dbFuncionario of dbFuncionarios){
const dbEspecialidades = _db.query(
`select
especialidade.nome
from especialidade
inner join func_especialidade
on especialidade.id = func_especialidade.especialidade_id
where func_especialidade.funcionario_id = ?
`, dbFuncionario.getInt("id")
);
const esp = _val.list()
for (const dbEspecialidade of dbEspecialidades){
esp.add(dbEspecialidade.getString("nome"))
}
const dbArmazens = _db.query(
`select
armazem.nome
from armazem
inner join func_armazem
on armazem.id = func_armazem.armazem_id
where func_armazem.funcionario_id = ?
`, dbFuncionario.getInt("id")
)
const armz = _val.list()
for (const dbArmazem of dbArmazens){
armz.add(dbArmazem.getString("nome"))
}
func.add(
_val.map()
.set("uid", dbFuncionario.getString("uid"))
.set("name", dbFuncionario.getString("nome"))
.set("age", dbFuncionario.getString("idade"))
.set("email", dbFuncionario.getString("email"))
.set("phone", dbFuncionario.getString("telemovel"))
.set("esp", esp)
.set("armz", armz)
)
}
_out.json(
func
)

+ 17
- 0
server/services/funcionario/salario/post.js View File

@ -0,0 +1,17 @@
const dbSalarios = _db.query(`
select
funcionario.uid,
salario.quantia,
especialidade.nome
from funcionario
inner join func_especialidade on func_especialidade.funcionario_id = funcionario.id
inner join especialidade on func_especialidade.especialidade_id = especialidade.id
inner join func_salario on func_salario.funcionario_id = funcionario.id
inner join salario on func_salario.salario_id = salario.id
where funcionario.uid = ?
`, _req.getString("uid"))
java.lang.Thread.sleep(1000)
_out.json(
dbSalarios
)

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


+ 117
- 0
server/setup/_schema-form-1-armazem.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", "Armaz\u00E9m")
.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", "armazem")
.set("report", false)
.set("show_id", true)
.set("uid", "591e3d01-d644-43d7-b1fe-7b1af1cb7507")
)
_form.createComponentIfNotExists(
"591e3d01-d644-43d7-b1fe-7b1af1cb7507",
_val.init()
.set("colspan", 0)
.set("displayname", "Espa\u00E7o")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "espaco")
.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", "textnum")
.set("uid", "da2abae3-e7c3-491c-b602-7ef61b867454")
.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(
"591e3d01-d644-43d7-b1fe-7b1af1cb7507",
_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", "aeeecc52-4ea4-4fb1-97b4-22315729ec7d")
.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)
)
_form.createComponentIfNotExists(
"591e3d01-d644-43d7-b1fe-7b1af1cb7507",
_val.init()
.set("colspan", 0)
.set("displayname", "Tipo")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "tipo")
.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", "107de04b-137f-4d11-810a-6a37f0378d56")
.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)
)

+ 57
- 0
server/setup/_schema-form-2-especialidade.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", "Especialidade")
.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", "especialidade")
.set("report", false)
.set("show_id", true)
.set("uid", "d3e05955-5bd2-44bd-b34c-3b67d38f6747")
)
_form.createComponentIfNotExists(
"d3e05955-5bd2-44bd-b34c-3b67d38f6747",
_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", "ace09c42-e39e-4539-98c9-3b8e8df5dc6f")
.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-funcionario.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", "Funcion\u00E1rio")
.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", "funcionario")
.set("report", false)
.set("show_id", true)
.set("uid", "3d160481-06ad-485e-9980-245108f82071")
)
_form.createComponentIfNotExists(
"3d160481-06ad-485e-9980-245108f82071",
_val.init()
.set("colspan", 0)
.set("displayname", "Armaz\u00E9m")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "armazem_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\":\"armazem: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", "16d78f8c-6360-4d00-8b41-003f67555f6f")
.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(
"3d160481-06ad-485e-9980-245108f82071",
_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", false)
.set("properties", "{}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "email")
.set("uid", "23a41861-3659-4d9e-9444-ba51057d098b")
.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(
"3d160481-06ad-485e-9980-245108f82071",
_val.init()
.set("colspan", 0)
.set("displayname", "Idade")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "idade")
.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", "textnum")
.set("uid", "470c87f5-ebad-4fbf-a21c-74902847fd23")
.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(
"3d160481-06ad-485e-9980-245108f82071",
_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", "3107145f-35d8-4d45-82ab-522df690297d")
.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)
)
_form.createComponentIfNotExists(
"3d160481-06ad-485e-9980-245108f82071",
_val.init()
.set("colspan", 0)
.set("displayname", "Telem\u00F3vel")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "telemovel")
.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", "textnum")
.set("uid", "72920ce9-761d-4146-ba30-2da2bc27d53c")
.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)
)

+ 57
- 0
server/setup/_schema-form-4-salario.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", "Sal\u00E1rio")
.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", "salario")
.set("report", false)
.set("show_id", true)
.set("uid", "a78f6d92-d859-46bd-845d-285f094e1638")
)
_form.createComponentIfNotExists(
"a78f6d92-d859-46bd-845d-285f094e1638",
_val.init()
.set("colspan", 0)
.set("displayname", "Quantia")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "quantia")
.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", "textnum")
.set("uid", "22256f32-576e-4934-8491-6bd36571c756")
.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-5-func_armazem.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", "Armazem")
.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", "func_armazem")
.set("parent_uid", "3d160481-06ad-485e-9980-245108f82071")
.set("report", false)
.set("show_id", true)
.set("uid", "5f7968da-1477-49e2-8f26-5503dbdc701e")
)
_form.createComponentIfNotExists(
"5f7968da-1477-49e2-8f26-5503dbdc701e",
_val.init()
.set("colspan", 0)
.set("displayname", "Armazem")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "armazem_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\":\"armazem: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", "ff02e71e-c3b5-42ce-8b22-2164180beae0")
.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)
)
_form.createComponentIfNotExists(
"5f7968da-1477-49e2-8f26-5503dbdc701e",
_val.init()
.set("colspan", 0)
.set("displayname", "Funcionario")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "funcionario_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\":\"funcionario:nome,email,idade\"},\"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", "889a23db-184b-4a02-a792-2aff4d8ef826")
.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)
)

+ 88
- 0
server/setup/_schema-form-6-func_especialidade.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", "Especialidade")
.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", "func_especialidade")
.set("parent_uid", "3d160481-06ad-485e-9980-245108f82071")
.set("report", false)
.set("show_id", true)
.set("uid", "9d512a9d-0901-4f81-9b5d-50f02e6fe038")
)
_form.createComponentIfNotExists(
"9d512a9d-0901-4f81-9b5d-50f02e6fe038",
_val.init()
.set("colspan", 0)
.set("displayname", "Especialidade")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "especialidade_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\":\"especialidade: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", "a266c829-547e-426b-806c-6a9d296c85a1")
.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(
"9d512a9d-0901-4f81-9b5d-50f02e6fe038",
_val.init()
.set("colspan", 0)
.set("displayname", "Funcionario")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "funcionario_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\":\"funcionario:nome,email,idade\"},\"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", "53b6be5a-f227-4988-bb77-b3cff8c7dd35")
.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-7-func_salario.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", "Salario")
.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", "func_salario")
.set("parent_uid", "3d160481-06ad-485e-9980-245108f82071")
.set("report", false)
.set("show_id", true)
.set("uid", "d9350bad-e976-4d9f-96f9-390114ab6a35")
)
_form.createComponentIfNotExists(
"d9350bad-e976-4d9f-96f9-390114ab6a35",
_val.init()
.set("colspan", 0)
.set("displayname", "Funcionario")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "funcionario_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\":\"funcionario: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", "7f11e252-ac5d-466b-a446-1902b114e412")
.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)
)
_form.createComponentIfNotExists(
"d9350bad-e976-4d9f-96f9-390114ab6a35",
_val.init()
.set("colspan", 0)
.set("displayname", "Sal\u00E1rio")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "salario_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\":\"salario:quantia\"},\"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", "ac1d2990-7537-4eb0-a9e7-8c4b5d8669b0")
.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)
)

+ 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;

+ 53
- 0
ui/src/components/TabelaFuncionario/JanelaSalario/index.jsx View File

@ -0,0 +1,53 @@
import React, { useState, useEffect } from "react";
import PropTypes from "prop-types";
import Modal from 'antd/lib/modal';
import Typography from 'antd/lib/typography';
import Service from "../../../utils/Service";
const { Title } = Typography;
const JanelaSalario = ({ funcionario, onClose }) => {
const [ loading, setLoading ] = useState(false);
const [ data, setData ] = useState([]);
useEffect(() => {
Service.call ({
url: `funcionario/salario`,
method: "post",
body: JSON.stringify({
uid: funcionario.uid
}),
setLoading,
setData,
errorTitle: 'Lista de Salários',
errorMessage: 'Houve uma falha ao carregar a lista das Salários...'
});
}, []);
return <Modal
title="Salários"
visible={true}
onOk={()=> { onClose() } }
onCancel={()=> { onClose() } }>
<Title level={4}>Salário Mensal:</Title>
<p>Email: { funcionario.email }</p>
<p>Telemovel: {funcionario.telemovel}</p>
{ Service.spin(loading) }
{ data.length > 0 ?
data.map(
(item)=> (
<div>
<p>Quantia: { item.quantia }</p>
<p>Especialidade: {item.nome}</p>
</div>
)
)
: <p>Estamos a carregar os seus dados.</p> }
</Modal>;
};
JanelaSalario.propTypes = {
funcionario: PropTypes.object.isRequired,
onClose: PropTypes.func.isRequired
};
export default JanelaSalario;

+ 72
- 0
ui/src/components/TabelaFuncionario/index.jsx View File

@ -0,0 +1,72 @@
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 JanelaSalario from "./JanelaSalario/index.jsx";
import Service from "../../utils/Service";
const TabelaFuncionario = () => {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(false);
const [funcSalario, setFuncSalario] = useState(null);
useEffect(() => {
Service.call ({
url: `funcionario`,
method: "get",
body: "",
setLoading,
setData,
errorTitle: 'Tabela Funcionarios',
errorMessage: 'Houve uma falha na tabela dos funcionarios...'
});
}, []);
const columns = [
{
title: "Nome",
dataIndex: "name"
},
{
title: "Armazém",
dataIndex: "armz"
},
{
title: "Especialidade",
dataIndex: "esp",
render: (Especialidade) => (
<div>
{
Especialidade.map((nome) => (
<Tag>{nome}</Tag>
))
}
</div>
)
},
{
title: "Salários",
render: (text, record, index) => (
<div>
{ <Button onClick={ () => setFuncSalario(record) }>Salários</Button>}
</div>
)
}
];
return <>
{ !!funcSalario && <JanelaSalario
funcionario={funcSalario}
onClose={ () => setFuncSalario(null) }
/> }
<Table dataSource={data} {...{columns, loading} }/>
</>
};
export default TabelaFuncionario;

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

@ -0,0 +1,76 @@
import React, { Component } from "react";
import TabelaFuncionario from "../../components/TabelaFuncionario/index.jsx";
import "./index.less";
export default class DashboardContainer extends Component {
constructor(props) {
super(props);
}
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);
}
render() {
return (
<div className="my-dashboard">
<TabelaFuncionario />
</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';

+ 48
- 0
ui/src/utils/Service.js View File

@ -0,0 +1,48 @@
import React from "react";
import Spin from 'antd/lib/spin';
import notification from 'antd/lib/notification';
export default class Service {
static spin(loading){
return loading && <Spin/>
}
static call(settings){
if(!settings.url || !settings.setData || !settings.setLoading){
console.error("Services.call", settings);
return;
}
settings.setLoading(true);
const fail = ()=> {
settings.setLoading(false);
notification["error"]({
message: settings.errorTitle ? settings.errorTitle: "Erro no Serviço",
description: settings.errorMessage ? settings.errorMessage: url,
style: {
marginTop: 100,
}
});
};
netuno.service({
url: `/services/${settings.url}`,
method: settings.method ? settings.method.toUpperCase(): "GET",
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
body: settings.body ? settings.body: null,
success: (response)=> {
if (response.json) {
settings.setData(response.json);
settings.setLoading(false);
} else {
fail();
}
},
fail: ()=> {
fail();
}
});
}
}

+ 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