Browse Source

Area reservada, lista de comunidades e apresentação das imagens.

master
eduveks 5 years ago
parent
commit
213f18b810
26 changed files with 685 additions and 20 deletions
  1. BIN
      dbs/social_ests.mv.db
  2. +439
    -0
      dbs/social_ests.trace.db
  3. +9
    -0
      server/core/social/userPessoa.js
  4. +31
    -0
      server/services/api/communities/get.js
  5. +19
    -0
      server/services/api/communities/image.get.js
  6. +1
    -0
      server/services/api/communities/options.js
  7. +14
    -0
      server/services/api/info.get.js
  8. +1
    -0
      server/services/api/info.options.js
  9. +30
    -0
      server/setup/_schema-form-2-comunidade.js
  10. BIN
      storage/database/comunidade/imagem/Download.netuno-s3zKBo98.jpg
  11. BIN
      storage/database/comunidade/imagem/Download.netuno-s3zKBo98___form.jpg
  12. BIN
      storage/database/comunidade/imagem/Download.netuno-s3zKBo98___search.jpg
  13. BIN
      storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG.jpg
  14. BIN
      storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___form.jpg
  15. BIN
      storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___search.jpg
  16. BIN
      storage/database/comunidade/imagem/Download.netuno3-ButCwJhz.jpg
  17. BIN
      storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___form.jpg
  18. BIN
      storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___search.jpg
  19. +1
    -0
      website/package.json
  20. +20
    -17
      website/src/App.js
  21. +23
    -0
      website/src/pages/Communities/Item/index.js
  22. +0
    -0
      website/src/pages/Communities/Item/index.less
  23. +58
    -0
      website/src/pages/Communities/index.js
  24. +19
    -0
      website/src/pages/Communities/index.less
  25. +2
    -1
      website/src/pages/Login/index.js
  26. +18
    -2
      website/src/pages/Main/index.js

BIN
dbs/social_ests.mv.db View File


+ 439
- 0
dbs/social_ests.trace.db View File

@ -529,3 +529,442 @@ org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
[42000-198]
2021-04-23 14:45:32 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Parameter "#1" is not set; SQL statement:
SELECT
comunidade.uid,
comunidade.nome,
comunidade.descricao,
comunidade.imagem,
(
SELECT comunidade_id
FROM pessoa_comunidade
WHERE pessoa_id = ?
AND comunidade_id = comunidade.id
)
FROM comunidade
WHERE comunidade.active = true
ORDER BY comunidade.nome
[90012-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:587)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.Parameter.checkSet(Parameter.java:94)
at org.h2.command.Prepared.checkParameters(Prepared.java:180)
at org.h2.command.CommandContainer.query(CommandContainer.java:144)
at org.h2.command.Command.executeQuery(Command.java:202)
at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:115)
at org.netuno.psamata.DB.executeQuery(SourceFile:460)
at org.netuno.psamata.DB.executeQuery(SourceFile:411)
at org.netuno.psamata.DB.query(SourceFile:381)
at org.netuno.tritao.resource.DB.query(SourceFile:761)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:292)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestCodeCache$1.executeImpl(HostToGuestCodeCache.java:86)
at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.execute(GuestToHostRootNode.java:82)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:485)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.GraalRuntimeSupport.callInlined(GraalRuntimeSupport.java:120)
at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:108)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:319)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doInvoke(HostExecuteNode.java:809)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doOverloadedCached(HostExecuteNode.java:241)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.executeAndSpecialize(HostExecuteNodeGen.java:241)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:94)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObject.invokeMember(HostObject.java:412)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMemberNode_AndSpecialize(HostObjectGen.java:1393)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:1365)
at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:6078)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1482)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:294)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:240)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:711)
at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeAndSpecialize(WritePropertyNode.java:263)
at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeVoid(WritePropertyNode.java:235)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeVoid(OptimizedBlockNode.java:120)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:70)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeGeneric(OptimizedBlockNode.java:79)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:75)
at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:73)
at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:147)
at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:93)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:459)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71)
at com.oracle.truffle.js.lang.JavaScriptLanguage$1.execute(JavaScriptLanguage.java:214)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:446)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:434)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:941)
at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:347)
at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:373)
at org.netuno.psamata.script.GraalRunner.eval(SourceFile:179)
at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:561)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:401)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:317)
at org.netuno.tritao.Service.execute(SourceFile:631)
at org.netuno.tritao.Service._main(SourceFile:572)
at jdk.internal.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-04-23 14:46:53 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Invalid value "1" for parameter "parameterIndex" [90008-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:587)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.getInvalidValueException(DbException.java:280)
at org.h2.jdbc.JdbcPreparedStatement.setParameter(JdbcPreparedStatement.java:1573)
at org.h2.jdbc.JdbcPreparedStatement.setInt(JdbcPreparedStatement.java:407)
at org.netuno.psamata.DB.b(SourceFile:695)
at org.netuno.psamata.DB.executeQuery(SourceFile:458)
at org.netuno.psamata.DB.query(SourceFile:421)
at org.netuno.tritao.resource.DB.query(SourceFile:822)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:292)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestCodeCache$1.executeImpl(HostToGuestCodeCache.java:86)
at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.execute(GuestToHostRootNode.java:82)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:485)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.GraalRuntimeSupport.callInlined(GraalRuntimeSupport.java:120)
at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:108)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:319)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doInvoke(HostExecuteNode.java:809)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doOverloadedCached(HostExecuteNode.java:241)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.executeAndSpecialize(HostExecuteNodeGen.java:241)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:94)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObject.invokeMember(HostObject.java:412)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMemberNode_AndSpecialize(HostObjectGen.java:1393)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:1365)
at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:6078)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1482)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:294)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:240)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:711)
at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeAndSpecialize(WritePropertyNode.java:263)
at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeVoid(WritePropertyNode.java:235)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeVoid(OptimizedBlockNode.java:120)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:70)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeGeneric(OptimizedBlockNode.java:79)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:75)
at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:73)
at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:147)
at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:93)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:459)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71)
at com.oracle.truffle.js.lang.JavaScriptLanguage$1.execute(JavaScriptLanguage.java:214)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:446)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:434)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:941)
at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:347)
at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:373)
at org.netuno.psamata.script.GraalRunner.eval(SourceFile:179)
at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:561)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:401)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:317)
at org.netuno.tritao.Service.execute(SourceFile:631)
at org.netuno.tritao.Service._main(SourceFile:572)
at jdk.internal.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-04-23 14:47:12 jdbc[3]: exception
org.h2.jdbc.JdbcSQLDataException: Scalar subquery contains more than one row; SQL statement:
SELECT
comunidade.uid,
comunidade.nome,
comunidade.descricao,
comunidade.imagem,
(
SELECT comunidade_id
FROM pessoa_comunidade
--WHERE pessoa_id = ?
--AND comunidade_id = comunidade.id
) AS seguindo
FROM comunidade
WHERE comunidade.active = true
ORDER BY comunidade.nome
[90053-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:587)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.message.DbException.get(DbException.java:170)
at org.h2.expression.Subquery.getValue(Subquery.java:49)
at org.h2.expression.Alias.getValue(Alias.java:37)
at org.h2.command.dml.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1886)
at org.h2.result.LazyResult.hasNext(LazyResult.java:80)
at org.h2.result.LazyResult.next(LazyResult.java:60)
at org.h2.command.dml.Select.queryFlat(Select.java:719)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:895)
at org.h2.command.dml.Query.queryWithoutCacheLazyCheck(Query.java:151)
at org.h2.command.dml.Query.query(Query.java:435)
at org.h2.command.dml.Query.query(Query.java:397)
at org.h2.command.CommandContainer.query(CommandContainer.java:145)
at org.h2.command.Command.executeQuery(Command.java:202)
at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:115)
at org.netuno.psamata.DB.executeQuery(SourceFile:460)
at org.netuno.psamata.DB.executeQuery(SourceFile:411)
at org.netuno.psamata.DB.query(SourceFile:381)
at org.netuno.tritao.resource.DB.query(SourceFile:761)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:292)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestCodeCache$1.executeImpl(HostToGuestCodeCache.java:86)
at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.execute(GuestToHostRootNode.java:82)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:485)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.GraalRuntimeSupport.callInlined(GraalRuntimeSupport.java:120)
at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:108)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:319)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doInvoke(HostExecuteNode.java:809)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doOverloadedCached(HostExecuteNode.java:241)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.executeAndSpecialize(HostExecuteNodeGen.java:241)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:94)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObject.invokeMember(HostObject.java:412)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMemberNode_AndSpecialize(HostObjectGen.java:1393)
at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:1365)
at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:6078)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1482)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:294)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:240)
at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:711)
at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeAndSpecialize(WritePropertyNode.java:263)
at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeVoid(WritePropertyNode.java:235)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeVoid(OptimizedBlockNode.java:120)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:70)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeGeneric(OptimizedBlockNode.java:79)
at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:75)
at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:73)
at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:147)
at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:93)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:459)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71)
at com.oracle.truffle.js.lang.JavaScriptLanguage$1.execute(JavaScriptLanguage.java:214)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:446)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:434)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:941)
at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:347)
at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:373)
at org.netuno.psamata.script.GraalRunner.eval(SourceFile:179)
at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:561)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:401)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:317)
at org.netuno.tritao.Service.execute(SourceFile:631)
at org.netuno.tritao.Service._main(SourceFile:572)
at jdk.internal.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-04-23 14:57:14 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "comunidade.id" not found; SQL statement:
SELECT count(comunidade_id)
FROM pessoa_comunidade
WHERE pessoa_id = 2
AND comunidade_id = comunidade.id
[42122-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:451)
at org.h2.message.DbException.getJdbcSQLException(DbException.java:427)
at org.h2.message.DbException.get(DbException.java:205)
at org.h2.message.DbException.get(DbException.java:181)
at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158)
at org.h2.expression.condition.Comparison.optimize(Comparison.java:207)
at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:134)
at org.h2.command.dml.Select.prepare(Select.java:1259)
at org.h2.command.Parser.prepareCommand(Parser.java:690)
at org.h2.engine.Session.prepareLocal(Session.java:629)
at org.h2.engine.Session.prepareCommand(Session.java:567)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78)
at org.netuno.tritao.dev.Query._main(SourceFile:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.netuno.proteu.Run.run(SourceFile:103)
at org.netuno.proteu.Run.<init>(SourceFile:33)
at org.netuno.proteu.DynamicURL.build(SourceFile:153)
at org.netuno.proteu.Enterprise.processRequest(SourceFile:452)
at org.netuno.proteu.Enterprise.service(SourceFile:525)
at javax.servlet.http.HttpServlet.service(SourceFile:791)
at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402)
at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188)
at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141)
at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127)
at org.eclipse.jetty.server.Server.handle(SourceFile:501)
at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383)
at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556)
at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375)
at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311)
at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103)
at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938)
at java.base/java.lang.Thread.run(Thread.java:834)

+ 9
- 0
server/core/social/userPessoa.js View File

@ -0,0 +1,9 @@
const userPessoa = ()=> {
const dbPessoa = _db.queryFirst(`
SELECT pessoa.*
FROM pessoa
WHERE utilizador_id = ?
`, _user.id())
return dbPessoa
}

+ 31
- 0
server/services/api/communities/get.js View File

@ -0,0 +1,31 @@
// _core : social/userPessoa
const dbComunidades = _db.query(`
SELECT
comunidade.uid,
comunidade.nome,
comunidade.descricao,
(
SELECT count(comunidade_id)
FROM pessoa_comunidade
WHERE pessoa_id = ?
AND comunidade_id = comunidade.id
) AS seguindo
FROM comunidade
WHERE comunidade.active = true
ORDER BY comunidade.nome
`, userPessoa().getInt("id"))
const data = _val.list()
for (const dbComunidade of dbComunidades) {
data.add(
_val.map()
.set("uid", dbComunidade.getString("uid"))
.set("name", dbComunidade.getString("nome"))
.set("description", dbComunidade.getString("descricao"))
.set("following", dbComunidade.getInt("seguindo") > 0)
)
}
_out.json(data)

+ 19
- 0
server/services/api/communities/image.get.js View File

@ -0,0 +1,19 @@
const dbComunidade = _db.queryFirst(`
SELECT imagem
FROM comunidade
WHERE uid = ?
`, _req.getString("uid"))
_header
.contentTypeJPG()
.noCache()
if (dbComunidade && dbComunidade.getString("imagem") != '') {
const storageImage = _storage.database(
"comunidade",
"imagem",
dbComunidade.getString("imagem")
)
_out.copy(storageImage.inputStream())
}

+ 1
- 0
server/services/api/communities/options.js View File

@ -0,0 +1 @@
_out.json(_val.map().set("result", true))

+ 14
- 0
server/services/api/info.get.js View File

@ -0,0 +1,14 @@
const dbPessoa = _db.queryFirst(`
SELECT pessoa.*, cidade.nome cidade
FROM pessoa INNER JOIN cidade ON pessoa.cidade_id = cidade.id
WHERE utilizador_id = ?
`, _user.id())
const data = _val.map()
.set("name", dbPessoa.getString("nome"))
.set("surname", dbPessoa.getString("apelido"))
.set("email", dbPessoa.getString("email"))
.set("city", dbPessoa.getString("cidade"))
_out.json(data)

+ 1
- 0
server/services/api/info.options.js View File

@ -0,0 +1 @@
_out.json(_val.map().set("result", true))

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

@ -85,6 +85,36 @@ _form.createComponentIfNotExists(
.set("x", 1)
.set("y", 2)
)
_form.createComponentIfNotExists(
"e96b426b-6f34-4dcc-8ac7-a8d22dd78b5e",
_val.init()
.set("colspan", 0)
.set("displayname", "Imagem")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "imagem")
.set("notnull", false)
.set("primarykey", false)
.set("properties", "{}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "image")
.set("uid", "374c3765-da8a-49be-bd9c-bcef985c9600")
.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(
"e96b426b-6f34-4dcc-8ac7-a8d22dd78b5e",
_val.init()


BIN
storage/database/comunidade/imagem/Download.netuno-s3zKBo98.jpg View File

Before After
Width: 1200  |  Height: 630  |  Size: 80 KiB

BIN
storage/database/comunidade/imagem/Download.netuno-s3zKBo98___form.jpg View File

Before After
Width: 400  |  Height: 210  |  Size: 10 KiB

BIN
storage/database/comunidade/imagem/Download.netuno-s3zKBo98___search.jpg View File

Before After
Width: 200  |  Height: 105  |  Size: 4.0 KiB

BIN
storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG.jpg View File

Before After
Width: 400  |  Height: 222  |  Size: 21 KiB

BIN
storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___form.jpg View File

Before After
Width: 400  |  Height: 222  |  Size: 20 KiB

BIN
storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___search.jpg View File

Before After
Width: 200  |  Height: 111  |  Size: 6.2 KiB

BIN
storage/database/comunidade/imagem/Download.netuno3-ButCwJhz.jpg View File

Before After
Width: 626  |  Height: 380  |  Size: 248 KiB

BIN
storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___form.jpg View File

Before After
Width: 400  |  Height: 242  |  Size: 19 KiB

BIN
storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___search.jpg View File

Before After
Width: 200  |  Height: 121  |  Size: 5.6 KiB

+ 1
- 0
website/package.json View File

@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.6.2",
"@netuno/auth-client": "^1.0.3",
"@netuno/service-client": "^1.0.7",
"@testing-library/jest-dom": "^5.11.10",


+ 20
- 17
website/src/App.js View File

@ -1,5 +1,6 @@
import React, { useState, useEffect } from "react";
import _service from '@netuno/service-client';
import _auth from '@netuno/auth-client';
import { Layout, Menu } from 'antd';
@ -14,6 +15,7 @@ import Home from './pages/Home';
import Login from './pages/Login';
import Register from './pages/Register';
import Main from './pages/Main';
import Communities from './pages/Communities';
import logo from './logo.svg';
import './App.less';
@ -21,27 +23,25 @@ import './App.less';
const { Header, Footer, Content } = Layout;
export default () => {
const [ data, setData ] = useState([]);
useEffect(()=> {
_service({
url: "pessoas",
success: (response) => {
setData(response.json);
},
fail: (e) => {
console.log("Service Error", e);
}
});
}, []);
let menuItems = null;
if (_auth.isLogged()) {
menuItems = <>
<Menu.Item><Link to="/main">Principal</Link></Menu.Item>
<Menu.Item><Link to="/communities">Comunidades</Link></Menu.Item>
</>;
} else {
menuItems = <>
<Menu.Item><Link to="/">Home</Link></Menu.Item>
<Menu.Item><Link to="/login">Login</Link></Menu.Item>
<Menu.Item><Link to="/register">Register</Link></Menu.Item>
</>;
}
return (
<Router>
<Layout>
<Header>
<Menu mode="horizontal" theme="dark">
<Menu.Item><Link to="/">Home</Link></Menu.Item>
<Menu.Item><Link to="/login">Login</Link></Menu.Item>
<Menu.Item><Link to="/register">Register</Link></Menu.Item>
{menuItems}
</Menu>
</Header>
<Content>
@ -55,6 +55,9 @@ export default () => {
<Route path="/main">
<Main/>
</Route>
<Route path="/communities">
<Communities/>
</Route>
<Route path="/">
<Home/>
</Route>


+ 23
- 0
website/src/pages/Communities/Item/index.js View File

@ -0,0 +1,23 @@
import React, { useState, useEffect } from "react";
import { Redirect } from "react-router-dom";
import { Button, Spin } from 'antd';
import { CheckCircleOutlined } from '@ant-design/icons';
import _auth from '@netuno/auth-client';
import _service from '@netuno/service-client';
export default ({ data }) => {
const servicesPrefix = _service.config().prefix;
return (
<li style={{backgroundImage: `url(${servicesPrefix}api/communities/image?uid=${data.uid})`}}>
<h1>
{ data.name }
&nbsp;
{ data.following ? <CheckCircleOutlined /> : null }
</h1>
</li>
);
};

+ 0
- 0
website/src/pages/Communities/Item/index.less View File


+ 58
- 0
website/src/pages/Communities/index.js View File

@ -0,0 +1,58 @@
import React, { useState, useEffect } from "react";
import { Redirect } from "react-router-dom";
import { Button, Spin } from 'antd';
import { CheckCircleOutlined } from '@ant-design/icons';
import _auth from '@netuno/auth-client';
import _service from '@netuno/service-client';
import Item from './Item';
import './index.less';
export default () => {
if (!_auth.isLogged()) {
return <Redirect to="/login"/>;
}
const [ loading, setLoading ] = useState(true);
const [ communities, setCommunities ] = useState([]);
useEffect(()=> {
_service({
method: 'GET',
url: "api/communities",
success: (response) => {
setLoading(false);
setCommunities(response.json);
},
fail: (e) => {
setLoading(false);
console.log("Service User Info Error", e);
}
});
}, []);
const onLogout = ()=> {
_auth.logout();
setLoading(true);
}
if (loading) {
return <Spin />;
}
return (
<div className="communities">
<ul className="communities__list">
{
communities.map(
(community) => {
return (
<Item data={community} />
);
}
)
}
</ul>
</div>
);
};

+ 19
- 0
website/src/pages/Communities/index.less View File

@ -0,0 +1,19 @@
.communities {
&__list {
list-style: none;
padding: 0;
margin: 0;
> li {
height: 200px;
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 50%;
> h1 {
background-color: rgba(0, 0, 0, 0.75);
color: #ffffff;
padding: 10px;
}
}
}
}

+ 2
- 1
website/src/pages/Login/index.js View File

@ -37,7 +37,8 @@ export default () => {
};
if (_auth.isLogged()) {
return <Redirect to="/main"/>;
window.location = '/main';
//return <Redirect to="/main"/>;
}
return (
<div>


+ 18
- 2
website/src/pages/Main/index.js View File

@ -6,18 +6,34 @@ import { Button } from 'antd';
import _auth from '@netuno/auth-client';
import _service from '@netuno/service-client';
export default () => {
const [ loading, setLoading ] = useState(false);
if (!_auth.isLogged()) {
return <Redirect to="/login"/>;
}
const [ loading, setLoading ] = useState(false);
const [ userInfo, setUserInfo ] = useState(null);
useEffect(()=> {
_service({
method: 'GET',
url: "api/info",
success: (response) => {
setUserInfo(response.json);
},
fail: (e) => {
console.log("Service User Info Error", e);
}
});
}, []);
const onLogout = ()=> {
_auth.logout();
setLoading(true);
window.location = '/';
}
return (
<div>
<h1>Olá...</h1>
<h1>Olá { userInfo && userInfo.name }...</h1>
<Button onClick={onLogout} loading={loading}>Sair</Button>
</div>
);


Loading…
Cancel
Save