| @ -1 +1,12 @@ | |||||
| # ORBITAPP | |||||
| # ORBITAPP | |||||
| Projecto desenvolvido no âmbito do desafio final do Bootcamp 23.1. | |||||
| ## Introdução - Desafio | |||||
| ## Implementação | |||||
| Projecto criado com recurso ao CLUAR e inspirado no projecto Helipacity desenvolvido nas aulas do Bootcamp. | |||||
| ### Fonte de Informação | |||||
| @ -0,0 +1,29 @@ | |||||
| const dbAstro = _db.get('astro', _req.getString('uid')) | |||||
| _log.info( dbAstro ); | |||||
| if (dbAstro) { | |||||
| const dbAstroImageName = dbAstro.getString('image') | |||||
| const storageAstroImageFile = _storage.database( | |||||
| 'astro', | |||||
| 'image', | |||||
| dbAstroImageName | |||||
| ) | |||||
| switch (storageAstroImageFile.extension()){ | |||||
| case 'jpg': | |||||
| _header.contentTypeJPG() | |||||
| break; | |||||
| case 'png': | |||||
| _header.contentTypePNG() | |||||
| break; | |||||
| default: | |||||
| _error.fatal(`Invalid image extension ${storageAstroImageFile.extension()}`) | |||||
| } | |||||
| _header.noCache() | |||||
| _out.copy(storageAstroImageFile.inputStream()) | |||||
| } else { | |||||
| _header.status(404) | |||||
| _out.json( | |||||
| _val.map() | |||||
| .set("error", "astro-image-not-found") | |||||
| ) | |||||
| } | |||||
| @ -0,0 +1,25 @@ | |||||
| // DEBUG... COMENTAR DEPOIS | |||||
| _log.info('service called...'); | |||||
| const dbAstros = _db.query(` | |||||
| SELECT * | |||||
| FROM astro | |||||
| WHERE active = true | |||||
| `); | |||||
| const astros = _val.list(); | |||||
| for (const astro of dbAstros) { | |||||
| astros.add( | |||||
| _val.map() | |||||
| .set('id', astro.getString('uid')) | |||||
| .set('name', astro.getString('name')) | |||||
| ) | |||||
| } | |||||
| // DEBUG...COMENTAR DEPOIS! | |||||
| _log.info( 'DB return...', astros ); | |||||
| _out.json(astros) | |||||
| // DEBUG...COMENTAR DEPOIS! | |||||
| _log.info('service ended!'); | |||||
| @ -0,0 +1,26 @@ | |||||
| // DEBUG... COMENTAR DEPOIS | |||||
| _log.info('service called...'); | |||||
| const dbAstros = _db.query(` | |||||
| SELECT uid, name, | |||||
| FROM astro | |||||
| WHERE active = true | |||||
| AND type_id = 1 | |||||
| `); | |||||
| const astros = _val.list(); | |||||
| for (const astro of dbAstros) { | |||||
| astros.add( | |||||
| _val.map() | |||||
| .set('id', astro.getString('uid')) | |||||
| .set('name', astro.getString('name')) | |||||
| ) | |||||
| } | |||||
| // DEBUG...COMENTAR DEPOIS! | |||||
| _log.info( 'DB return...', astros ); | |||||
| _out.json(astros) | |||||
| // DEBUG...COMENTAR DEPOIS! | |||||
| _log.info('service ended!'); | |||||
| @ -0,0 +1,26 @@ | |||||
| // DEBUG... COMENTAR DEPOIS | |||||
| _log.info('service called...'); | |||||
| const dbAstroTypes = _db.query(` | |||||
| SELECT uid, name | |||||
| FROM astro_type | |||||
| WHERE active = TRUE | |||||
| `); | |||||
| const astroTypes = _val.list(); | |||||
| for (const type of dbAstroTypes) { | |||||
| astroTypes.add( | |||||
| _val.map() | |||||
| .set('uid', type.getString('uid')) | |||||
| .set('code', type.getString('id')) | |||||
| .set('name', type.getString('name')) | |||||
| ); | |||||
| } | |||||
| // DEBUG...COMENTAR DEPOIS! | |||||
| //_log.info( 'DB return...', astroTypes ); | |||||
| _out.json(astroTypes); | |||||
| // DEBUG...COMENTAR DEPOIS! | |||||
| _log.info('service ended!'); | |||||
| @ -0,0 +1,276 @@ | |||||
| /** | |||||
| * | |||||
| * CODE GENERATED AUTOMATICALLY | |||||
| * | |||||
| * THIS FILE SHOULD NOT BE EDITED BY HAND | |||||
| * | |||||
| */ | |||||
| _form.createIfNotExists( | |||||
| _val.init() | |||||
| .set("big", false) | |||||
| .set("control_active", false) | |||||
| .set("control_group", false) | |||||
| .set("control_user", false) | |||||
| .set("description", "") | |||||
| .set("displayname", "Astro") | |||||
| .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", "astro") | |||||
| .set("reorder", 0) | |||||
| .set("report", false) | |||||
| .set("show_id", true) | |||||
| .set("uid", "6cec90a5-28c5-4522-a919-05b4593b4074") | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Apoastro") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "apoapsis") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"#.##0,00\",\"type\":\"STRING\",\"value\":\"#.##0,00\"},\"MASK_REVERSE\":{\"default\":\"true\",\"type\":\"BOOLEAN\",\"value\":\"true\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "textfloat") | |||||
| .set("uid", "b6b79373-13f8-4e7f-ba69-1be15b065939") | |||||
| .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", 9) | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Orbita astro") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "around_astro_id") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"astro:name\"},\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "select") | |||||
| .set("uid", "9bf61f84-4bd3-4d59-9022-d4b73ea28ccb") | |||||
| .set("user_id", 0) | |||||
| .set("whenedit", true) | |||||
| .set("whenexport", true) | |||||
| .set("whenfilter", true) | |||||
| .set("whennew", false) | |||||
| .set("whenresult", false) | |||||
| .set("whenview", true) | |||||
| .set("width", 0) | |||||
| .set("x", 1) | |||||
| .set("y", 6) | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Raio equatorial") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "equatorial_radius") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"#.##0,00\",\"type\":\"STRING\",\"value\":\"#.##0,00\"},\"MASK_REVERSE\":{\"default\":\"true\",\"type\":\"BOOLEAN\",\"value\":\"true\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "textfloat") | |||||
| .set("uid", "95868703-8ed4-475f-ab72-1b1b448d2303") | |||||
| .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( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Imagem") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "image") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "image") | |||||
| .set("uid", "4c1fc07d-8c1c-4bbd-8542-0fc4104a8449") | |||||
| .set("user_id", 0) | |||||
| .set("whenedit", true) | |||||
| .set("whenexport", true) | |||||
| .set("whenfilter", false) | |||||
| .set("whennew", true) | |||||
| .set("whenresult", true) | |||||
| .set("whenview", true) | |||||
| .set("width", 0) | |||||
| .set("x", 1) | |||||
| .set("y", 7) | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _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", "name") | |||||
| .set("notnull", true) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"},\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "text") | |||||
| .set("uid", "aa664157-55b2-4d49-a6d4-a37c03f9ed49") | |||||
| .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( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Periastro") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "periapsis") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"#.##0,00\",\"type\":\"STRING\",\"value\":\"#.##0,00\"},\"MASK_REVERSE\":{\"default\":\"true\",\"type\":\"BOOLEAN\",\"value\":\"true\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "textfloat") | |||||
| .set("uid", "42e699da-c882-4803-8602-cc0112b437cc") | |||||
| .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", 8) | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Velocidade rota\u00E7\u00E3o") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "rotation_velocity") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"#.##0,00\",\"type\":\"STRING\",\"value\":\"#.##0,00\"},\"MASK_REVERSE\":{\"default\":\"true\",\"type\":\"BOOLEAN\",\"value\":\"true\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "textfloat") | |||||
| .set("uid", "5777bc24-062b-4bd7-a279-bf64150d9357") | |||||
| .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( | |||||
| "6cec90a5-28c5-4522-a919-05b4593b4074", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Tipo") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "type_id") | |||||
| .set("notnull", true) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"astro_type:nome,name\"},\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"true\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "select") | |||||
| .set("uid", "1cf40cc0-2798-4a81-a294-a13915958b28") | |||||
| .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) | |||||
| ) | |||||
| @ -0,0 +1,61 @@ | |||||
| /** | |||||
| * | |||||
| * CODE GENERATED AUTOMATICALLY | |||||
| * | |||||
| * THIS FILE SHOULD NOT BE EDITED BY HAND | |||||
| * | |||||
| */ | |||||
| _form.createIfNotExists( | |||||
| _val.init() | |||||
| .set("big", false) | |||||
| .set("control_active", false) | |||||
| .set("control_group", false) | |||||
| .set("control_user", false) | |||||
| .set("description", "") | |||||
| .set("displayname", "Tipo") | |||||
| .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", "astro_type") | |||||
| .set("parent_uid", "6cec90a5-28c5-4522-a919-05b4593b4074") | |||||
| .set("reorder", 0) | |||||
| .set("report", false) | |||||
| .set("show_id", false) | |||||
| .set("uid", "04e4305e-4734-4c56-879b-bce5dd848cca") | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "04e4305e-4734-4c56-879b-bce5dd848cca", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Nome") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "name") | |||||
| .set("notnull", true) | |||||
| .set("primarykey", true) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"},\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "text") | |||||
| .set("uid", "11eb7345-15e4-415b-8e10-97428adbaf3f") | |||||
| .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 +1,91 @@ | |||||
| /** | |||||
| * | |||||
| * 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("description", "") | |||||
| .set("displayname", "Planeta") | |||||
| .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", "planet") | |||||
| .set("reorder", 0) | |||||
| .set("report", false) | |||||
| .set("show_id", true) | |||||
| .set("uid", "5252799b-b5f4-4a99-9c95-cf94e20ad05b") | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "5252799b-b5f4-4a99-9c95-cf94e20ad05b", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "\u00C9 an\u00E3o?") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "is_dwarf") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"DEFAULT\":{\"default\":\"true\",\"type\":\"BOOLEAN\",\"value\":\"true\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "checkbox") | |||||
| .set("uid", "f6d86abd-0210-40f1-8457-75e5f9dab6c8") | |||||
| .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( | |||||
| "5252799b-b5f4-4a99-9c95-cf94e20ad05b", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "N\u00FAmero sat\u00E9lites") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "satellites_number") | |||||
| .set("notnull", true) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"},\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "textnum") | |||||
| .set("uid", "be23c0cc-1ddf-4be3-bc95-eb40f0d5928c") | |||||
| .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 +1,91 @@ | |||||
| /** | |||||
| * | |||||
| * 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("description", "") | |||||
| .set("displayname", "Estrela") | |||||
| .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", "star") | |||||
| .set("reorder", 0) | |||||
| .set("report", false) | |||||
| .set("show_id", true) | |||||
| .set("uid", "1bc12ea0-cd12-4ab1-8262-b516e4424114") | |||||
| ) | |||||
| _form.createComponentIfNotExists( | |||||
| "1bc12ea0-cd12-4ab1-8262-b516e4424114", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Astro") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "astro_id") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"COLUMN_SEPARATOR\":{\"default\":\" - \",\"type\":\"LINK_SEPARATOR\",\"value\":\" - \"},\"LINK\":{\"default\":\"\",\"type\":\"LINK\",\"value\":\"astro:name,type_id\"},\"MAX_COLUMN_LENGTH\":{\"default\":\"0\",\"type\":\"INTEGER\",\"value\":\"0\"},\"ONLY_ACTIVES\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"SERVICE\":{\"default\":\"com/Select.netuno\",\"type\":\"STRING\",\"value\":\"com/Select.netuno\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "select") | |||||
| .set("uid", "0795b242-4e57-4900-a2dc-dcffac3dc51e") | |||||
| .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( | |||||
| "1bc12ea0-cd12-4ab1-8262-b516e4424114", | |||||
| _val.init() | |||||
| .set("colspan", 0) | |||||
| .set("description", "") | |||||
| .set("displayname", "Sistema") | |||||
| .set("firebase", "") | |||||
| .set("group_id", 0) | |||||
| .set("height", 0) | |||||
| .set("max", 0) | |||||
| .set("min", 0) | |||||
| .set("name", "system") | |||||
| .set("notnull", false) | |||||
| .set("primarykey", false) | |||||
| .set("properties", "{\"MASK\":{\"default\":\"\",\"type\":\"STRING\",\"value\":\"\"},\"MASK_REVERSE\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"},\"MASK_SELECTONFOCUS\":{\"default\":\"false\",\"type\":\"BOOLEAN\",\"value\":\"false\"}}") | |||||
| .set("rowspan", 0) | |||||
| .set("tdheight", 0) | |||||
| .set("tdwidth", 0) | |||||
| .set("type", "text") | |||||
| .set("uid", "e610350c-d4b5-4798-89d3-c2476aa0ef99") | |||||
| .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 +1,23 @@ | |||||
| /* | |||||
| INSERT INTO astro_type (id, name) VALUES | |||||
| (1,'Estrela') | |||||
| ,(2,'Planeta') | |||||
| ,(3,'Satélite Natural') | |||||
| ; | |||||
| */ | |||||
| INSERT INTO astro ( | |||||
| id, name, type_id, equatorial_radius, rotation_velocity, around_astro_id, periapsis, apoapsis, image ) VALUES | |||||
| (1, 'Sol', 1, 696300, 1997, null, 0, 0, 'sun_small.jpg'), | |||||
| (2, 'Mercúrio', 2, 2439.7, 47.362, 1, 57909050, 46001200, 'mercurio_small.jpg'), | |||||
| (3, 'Vénus', 2, 6051.80, 35.02, 1, 107476000, 108942000, 'Venus_small-jBl5UbjV.jpg'), | |||||
| (4, 'Terra', 2, 6378.10, 29.78, 1, 147098290, 152098232, 'earth_small.jpg'), | |||||
| (5, 'Lua', 3, 1737.40, 1.022, 4, 363104, 405696, 'moon_small.jpg'), | |||||
| ; | |||||
| /* | |||||
| COMMANDS: | |||||
| -- SELECT id,name,type_id,equatorial_radius,rotation_velocity,around_astro_id,periapsis,apoapsis,image FROM astro; | |||||
| -- UPDATE astro SET type_id=2, periapsis=57909050, apoapsis=46001200,image='mercurio_small.jpg' WHERE id=2; | |||||
| */ | |||||
| @ -0,0 +1,51 @@ | |||||
| import React, { useEffect, useState } from "react"; | |||||
| import { Button, Space } from "antd"; | |||||
| import "./index.less"; | |||||
| import _service from "@netuno/service-client"; | |||||
| function Filter({onAstroTypeChange}) { | |||||
| const [selected, setSelected] = useState("all"); | |||||
| const [list, setList] = useState([]); | |||||
| useEffect(() => { | |||||
| _service({ | |||||
| url: "/astro/type", | |||||
| success: (response) => { | |||||
| setList(response.json); | |||||
| }, | |||||
| fail: (e) => { | |||||
| console.log("Service Error", e); | |||||
| }, | |||||
| }); | |||||
| }, []); | |||||
| return ( | |||||
| <div className="astro-list__filter"> | |||||
| <Space wrap> | |||||
| <Button | |||||
| type={selected == "all" ? "primary" : "default"} | |||||
| onClick={() => { | |||||
| setSelected("all"); | |||||
| if (onAstroTypeChange) { | |||||
| onAstroTypeChange("all"); | |||||
| } | |||||
| }} | |||||
| >Todos</Button> | |||||
| {list.map((item) => { | |||||
| return ( | |||||
| <Button | |||||
| type={selected == item.id ? "primary" : "default"} | |||||
| onClick={() => { | |||||
| setSelected(item.code); | |||||
| if (onAstroTypeChange) { | |||||
| onAstroTypeChange(item.code); | |||||
| } | |||||
| }} | |||||
| >{item.name}</Button> | |||||
| ); | |||||
| })} | |||||
| </Space> | |||||
| </div> | |||||
| ); | |||||
| } | |||||
| export default Filter; | |||||
| @ -0,0 +1,147 @@ | |||||
| @import "../../../../styles/variables.less"; | |||||
| .establishment-list__results { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| margin-right: auto; | |||||
| margin-left: auto; | |||||
| // margin-top: 1rem; | |||||
| //width: @site-width; | |||||
| max-width: calc(@site-max-width + 16px); | |||||
| text-align: center; | |||||
| padding: 0 5px 0 5px; | |||||
| .ant-card { | |||||
| clip-path: polygon(0 3.5%, 100% 0, 100% 100%, 0% 100%); | |||||
| padding-top: 0; | |||||
| border: 2px solid @primary-color; | |||||
| border-radius: 0; | |||||
| background-color: @primary-color; | |||||
| margin-left: auto; | |||||
| margin-right: auto; | |||||
| margin-bottom: 1rem; | |||||
| color: white; | |||||
| @media only screen and (min-width: @header-mobile-width) { | |||||
| margin-left: 0; | |||||
| margin-right: 0; | |||||
| } | |||||
| .ant-card-meta-title { | |||||
| font-size: 1.5rem; | |||||
| color: white; | |||||
| font-family: Poppins; | |||||
| margin:0; | |||||
| } | |||||
| .ant-card-meta-description { | |||||
| color: white; | |||||
| } | |||||
| .shadow { | |||||
| position: relative; | |||||
| top: -25px; | |||||
| background-image: linear-gradient( | |||||
| to bottom, | |||||
| rgba(255, 0, 0, 0), | |||||
| @primary-color | |||||
| ); | |||||
| width: 100%; | |||||
| z-index: 200; | |||||
| color: transparent; | |||||
| } | |||||
| .ant-card-body { | |||||
| width: 100%; | |||||
| padding: 0; | |||||
| p { | |||||
| position: relative; | |||||
| display: flex; | |||||
| top: -10px; | |||||
| text-align: center; | |||||
| justify-content: center; | |||||
| } | |||||
| } | |||||
| img { | |||||
| clip-path: polygon(0 7%, 100% 1%, 100% 100%, 0% 100%); | |||||
| border: 2px solid @primary-color; | |||||
| border-radius: 0; | |||||
| height: 200px; | |||||
| } | |||||
| P { | |||||
| margin: 0; | |||||
| } | |||||
| .end { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| .anticon { | |||||
| color: white; | |||||
| font-size: 1.2rem; | |||||
| margin-top: 4%; | |||||
| } | |||||
| h5 { | |||||
| position: relative; | |||||
| top: 10px; | |||||
| color: white; | |||||
| margin: 0; | |||||
| } | |||||
| } | |||||
| .whats { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| .anticon { | |||||
| position: relative; | |||||
| color: rgb(52, 175, 35); | |||||
| font-size: 2rem; | |||||
| top: -5px; | |||||
| /*.span { | |||||
| }*/ | |||||
| } | |||||
| a { | |||||
| font-family: Poppins; | |||||
| color: white; | |||||
| margin-left: 5px; | |||||
| margin-right: 10px; | |||||
| margin-top: 0; | |||||
| text-decoration: none; | |||||
| } | |||||
| } | |||||
| .insta { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| .anticon { | |||||
| color: white; | |||||
| font-size: 2rem; | |||||
| background: #f09433; | |||||
| background: -moz-linear-gradient( | |||||
| 45deg, | |||||
| #f09433 0%, | |||||
| #e6683c 25%, | |||||
| #dc2743 50%, | |||||
| #cc2366 75%, | |||||
| #bc1888 100% | |||||
| ); | |||||
| background: -webkit-linear-gradient( | |||||
| 45deg, | |||||
| #f09433 0%, | |||||
| #e6683c 25%, | |||||
| #dc2743 50%, | |||||
| #cc2366 75%, | |||||
| #bc1888 100% | |||||
| ); | |||||
| // filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f09433', endColorstr='#bc1888',GradientType=1 ); | |||||
| border-radius: 10px; | |||||
| height: 2rem; | |||||
| } | |||||
| h4 { | |||||
| font-family: Poppins; | |||||
| color: white; | |||||
| margin-top: 3%; | |||||
| margin-left: 5px; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,92 @@ | |||||
| import React, { useEffect, useState } from "react"; | |||||
| import _service from "@netuno/service-client"; | |||||
| import { Card, Row, Col, notification, Button } from "antd"; | |||||
| import { Link } from "react-router-dom"; | |||||
| import "./index.less"; | |||||
| const { Meta } = Card; | |||||
| function Result({astroType}) { | |||||
| const servicePrefix = _service.config().prefix; | |||||
| const [list, setList] = useState([]); | |||||
| const [page, setPage] = useState(1); | |||||
| const [showMore, setShowMore] = useState(true); | |||||
| const [loading, setLoading] = useState(true); | |||||
| useEffect(() => { | |||||
| if (page > 1) { | |||||
| onLoadData({astroType, page, list}); | |||||
| } | |||||
| }, [page]); | |||||
| useEffect( () => { | |||||
| onLoadData({astroType, page:1, list:[]}); | |||||
| return () => { | |||||
| // cleanup... | |||||
| setPage(1); | |||||
| setShowMore(true); | |||||
| setList([]); | |||||
| } | |||||
| }, [astroType]); | |||||
| const onLoadData = ({astroType, page, list}) => { | |||||
| setLoading(true); | |||||
| _service({ | |||||
| url: "/astro/list", | |||||
| data: {astroType, page}, | |||||
| success: (response) => { | |||||
| if (response.json.length < 6) { | |||||
| setShowMore(false); | |||||
| } | |||||
| setList([...list, ...response.json]); | |||||
| setLoading(false); | |||||
| }, | |||||
| fail: (e) => { | |||||
| console.error("Service Error", e); | |||||
| notification.error({ | |||||
| message:"Erro", | |||||
| description:"Não foi possível encontrar o astro." | |||||
| }); | |||||
| setLoading(false); | |||||
| }, | |||||
| }); | |||||
| }; | |||||
| return ( | |||||
| <> | |||||
| <Row className="astro-list__result" | |||||
| gutter={[10,10]} | |||||
| > | |||||
| {list.map((item) => { | |||||
| return ( | |||||
| <Col | |||||
| xs={24} | |||||
| sm={12} | |||||
| md={8} | |||||
| lg={8} | |||||
| xl={8} | |||||
| > | |||||
| <Card | |||||
| hoverable | |||||
| style={{ | |||||
| }} | |||||
| cover={ | |||||
| <img | |||||
| src={`${servicePrefix}/astro/image?uid=${item.uid}`} | |||||
| alt="Imagem do Astro" | |||||
| /> | |||||
| } | |||||
| > | |||||
| <div className="shadow">Shadow</div> | |||||
| <p><Meta title={item.name}/></p> | |||||
| <Link to={`/pt/astro/${item.uid}`}>Mais Detalhes</Link> | |||||
| </Card> | |||||
| </Col> | |||||
| ); | |||||
| })} | |||||
| </Row> | |||||
| { showMore && <Button loading={loading} onClick={()=> setPage(page + 1) }>Mostrar mais</Button> } | |||||
| </> | |||||
| ); | |||||
| } | |||||
| export default Result; | |||||
| @ -0,0 +1,146 @@ | |||||
| @import "../../../../styles/variables.less"; | |||||
| .astro-list__result { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| margin-right: auto; | |||||
| margin-left: auto; | |||||
| // margin-top: 1rem; | |||||
| //width: @site-width; | |||||
| max-width: calc(@site-max-width + 16px); | |||||
| text-align: center; | |||||
| padding: 0 5px 0 5px; | |||||
| .ant-card { | |||||
| padding-top: 0; | |||||
| border: 2px solid @primary-color; | |||||
| border-radius: 0; | |||||
| background-color: @primary-color; | |||||
| margin-left: auto; | |||||
| margin-right: auto; | |||||
| margin-bottom: 1rem; | |||||
| color: white; | |||||
| @media only screen and (min-width: @header-mobile-width) { | |||||
| margin-left: 0; | |||||
| margin-right: 0; | |||||
| } | |||||
| .ant-card-meta-title { | |||||
| font-size: 1.5rem; | |||||
| color: white; | |||||
| font-family: Poppins; | |||||
| margin:0; | |||||
| } | |||||
| .ant-card-meta-description { | |||||
| color: white; | |||||
| } | |||||
| .shadow { | |||||
| position: relative; | |||||
| top: -25px; | |||||
| background-image: linear-gradient( | |||||
| to bottom, | |||||
| rgba(255, 0, 0, 0), | |||||
| @primary-color | |||||
| ); | |||||
| width: 100%; | |||||
| z-index: 200; | |||||
| color: transparent; | |||||
| } | |||||
| .ant-card-body { | |||||
| width: 100%; | |||||
| padding: 0; | |||||
| p { | |||||
| position: relative; | |||||
| display: flex; | |||||
| top: -10px; | |||||
| text-align: center; | |||||
| justify-content: center; | |||||
| } | |||||
| } | |||||
| img { | |||||
| clip-path: polygon(0 7%, 100% 1%, 100% 100%, 0% 100%); | |||||
| border: 2px solid @primary-color; | |||||
| border-radius: 0; | |||||
| height: 200px; | |||||
| } | |||||
| P { | |||||
| margin: 0; | |||||
| } | |||||
| .end { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| .anticon { | |||||
| color: white; | |||||
| font-size: 1.2rem; | |||||
| margin-top: 4%; | |||||
| } | |||||
| h5 { | |||||
| position: relative; | |||||
| top: 10px; | |||||
| color: white; | |||||
| margin: 0; | |||||
| } | |||||
| } | |||||
| .whats { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| .anticon { | |||||
| position: relative; | |||||
| color: rgb(52, 175, 35); | |||||
| font-size: 2rem; | |||||
| top: -5px; | |||||
| /*.span { | |||||
| }*/ | |||||
| } | |||||
| a { | |||||
| font-family: Poppins; | |||||
| color: white; | |||||
| margin-left: 5px; | |||||
| margin-right: 10px; | |||||
| margin-top: 0; | |||||
| text-decoration: none; | |||||
| } | |||||
| } | |||||
| .insta { | |||||
| display: flex; | |||||
| justify-content: center; | |||||
| .anticon { | |||||
| color: white; | |||||
| font-size: 2rem; | |||||
| background: #f09433; | |||||
| background: -moz-linear-gradient( | |||||
| 45deg, | |||||
| #f09433 0%, | |||||
| #e6683c 25%, | |||||
| #dc2743 50%, | |||||
| #cc2366 75%, | |||||
| #bc1888 100% | |||||
| ); | |||||
| background: -webkit-linear-gradient( | |||||
| 45deg, | |||||
| #f09433 0%, | |||||
| #e6683c 25%, | |||||
| #dc2743 50%, | |||||
| #cc2366 75%, | |||||
| #bc1888 100% | |||||
| ); | |||||
| // filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f09433', endColorstr='#bc1888',GradientType=1 ); | |||||
| border-radius: 10px; | |||||
| height: 2rem; | |||||
| } | |||||
| h4 { | |||||
| font-family: Poppins; | |||||
| color: white; | |||||
| margin-top: 3%; | |||||
| margin-left: 5px; | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,24 @@ | |||||
| import React, { useState } from "react"; | |||||
| import { Row, Col } from "antd"; | |||||
| import Filter from "./Filter"; | |||||
| import Result from "./Result"; | |||||
| import "./index.less"; | |||||
| function AstroList() { | |||||
| const [astroType, setAstroType] = useState("all"); | |||||
| return ( | |||||
| <section> | |||||
| <Row> | |||||
| <Col span className="astro-list"> | |||||
| <h1>Astros</h1> | |||||
| <Filter onAstroTypeChange={(astroType) => setAstroType(astroType)} /> | |||||
| <Result astroType={astroType} /> | |||||
| </Col> | |||||
| </Row> | |||||
| </section> | |||||
| ); | |||||
| } | |||||
| export default AstroList; | |||||
| @ -0,0 +1,8 @@ | |||||
| @import "../../../styles/variables.less"; | |||||
| .astro-list { | |||||
| display: flex; | |||||
| flex-direction: column; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| } | |||||
| @ -0,0 +1,20 @@ | |||||
| import React from 'react'; | |||||
| import { useParams } from 'react-router-dom'; | |||||
| //import Cluar from '../../common/Cluar'; | |||||
| import './index.less'; | |||||
| function AstroDetails() { | |||||
| return ( | |||||
| <main className="astro-details"> | |||||
| <h1>Sorry...</h1> | |||||
| <h2> | |||||
| {Cluar.currentLanguage().locale === 'pt' && <>Página em construção.</>} | |||||
| {Cluar.currentLanguage().locale === 'en' && <>Page under construction.</>} | |||||
| </h2> | |||||
| </main> | |||||
| ); | |||||
| }; | |||||
| export default AstroDetails; | |||||
| @ -0,0 +1,3 @@ | |||||
| .astro-details { | |||||
| text-align: center; | |||||
| } | |||||
| @ -0,0 +1,26 @@ | |||||
| import React from 'react'; | |||||
| import Cluar from '../../common/Cluar'; | |||||
| import './index.less'; | |||||
| function UnderConstruction() { | |||||
| return ( | |||||
| <main className="page--under-construction"> | |||||
| <>{Cluar.currentLanguage().locale === 'pt' && | |||||
| <> | |||||
| <h1>Brevemente...</h1> | |||||
| <h2>Página em construção.</h2> | |||||
| </> | |||||
| }</> | |||||
| <>{Cluar.currentLanguage().locale === 'en' && | |||||
| <> | |||||
| <h1>Soon...</h1> | |||||
| <h2>Page under construction.</h2> | |||||
| </> | |||||
| }</> | |||||
| </main> | |||||
| ); | |||||
| }; | |||||
| export default UnderConstruction; | |||||
| @ -0,0 +1,3 @@ | |||||
| .page--under-construction { | |||||
| text-align: center; | |||||
| } | |||||