Browse Source

Refactorização e gráfico.

master
eduveks 5 years ago
parent
commit
27154e2e55
12 changed files with 153711 additions and 141 deletions
  1. BIN
      dbs/social_ests.mv.db
  2. +531
    -0
      dbs/social_ests.trace.db
  3. +153052
    -76
      public/scripts/main.js
  4. +1
    -1
      public/scripts/main.js.map
  5. +0
    -1
      server/services/pessoas/publicacoes/post.js
  6. +14
    -0
      server/services/publicacoes/grafico.js
  7. +1
    -0
      ui/package.json
  8. +42
    -0
      ui/src/components/GraficoPublicacoes/index.jsx
  9. +10
    -31
      ui/src/components/TabelaPessoas/JanelaPublicacoes/index.jsx
  10. +11
    -29
      ui/src/components/TabelaPessoas/index.jsx
  11. +2
    -3
      ui/src/containers/DashboardContainer/index.jsx
  12. +47
    -0
      ui/src/utils/Service.js

BIN
dbs/social_ests.mv.db View File


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

@ -0,0 +1,531 @@
2021-03-25 09:43:45 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
SELECT
momento,
comunidade.nome
count([*]id)
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
"; SQL statement:
SELECT
momento,
comunidade.nome
count(id)
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
[42000-198]
2021-03-25 09:43:54 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Ambiguous column name "id"; SQL statement:
SELECT
momento,
comunidade.nome,
count(id)
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
[90059-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:573)
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.mapColumn(ExpressionColumn.java:142)
at org.h2.expression.ExpressionColumn.mapColumns(ExpressionColumn.java:116)
at org.h2.expression.aggregate.AbstractAggregate.mapColumnsAnalysis(AbstractAggregate.java:82)
at org.h2.expression.aggregate.Aggregate.mapColumnsAnalysis(Aggregate.java:627)
at org.h2.expression.analysis.DataAnalysisOperation.mapColumns(DataAnalysisOperation.java:133)
at org.h2.command.dml.Select.mapColumns(Select.java:1636)
at org.h2.command.dml.Select.init(Select.java:1175)
at org.h2.command.Parser.parseSelect(Parser.java:2449)
at org.h2.command.Parser.parsePrepared(Parser.java:815)
at org.h2.command.Parser.parse(Parser.java:789)
at org.h2.command.Parser.parse(Parser.java:761)
at org.h2.command.Parser.prepareCommand(Parser.java:684)
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.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:77)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:304)
at org.netuno.psamata.DB.executeQuery(SourceFile:456)
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.binary.DualNode.executeVoid(DualNode.java:148)
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:169)
at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:550)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:393)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:310)
at org.netuno.tritao.Service.execute(SourceFile:630)
at org.netuno.tritao.Service._main(SourceFile:571)
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)
2021-03-25 09:44:20 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column """momento""" must be in the GROUP BY list; SQL statement:
SELECT
momento,
comunidade.nome,
count(publicacao.id) total
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
[90016-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:573)
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.updateAggregate(ExpressionColumn.java:195)
at org.h2.command.dml.Select.updateAgg(Select.java:529)
at org.h2.command.dml.Select.gatherGroup(Select.java:508)
at org.h2.command.dml.Select.queryGroup(Select.java:468)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:890)
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.binary.DualNode.executeVoid(DualNode.java:148)
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:169)
at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:550)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:393)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:310)
at org.netuno.tritao.Service.execute(SourceFile:630)
at org.netuno.tritao.Service._main(SourceFile:571)
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)
2021-03-25 09:48:45 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Column """publicacao"".""momento""" must be in the GROUP BY list; SQL statement:
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome,
COUNT(publicacao.id) AS "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY month(publicacao.momento), comunidade.nome
[90016-198]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:573)
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.updateAggregate(ExpressionColumn.java:195)
at org.h2.expression.function.Function.updateAggregate(Function.java:2637)
at org.h2.expression.Alias.updateAggregate(Alias.java:74)
at org.h2.command.dml.Select.updateAgg(Select.java:529)
at org.h2.command.dml.Select.gatherGroup(Select.java:508)
at org.h2.command.dml.Select.queryGroup(Select.java:468)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:890)
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.binary.DualNode.executeVoid(DualNode.java:148)
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:169)
at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:550)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:393)
at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:310)
at org.netuno.tritao.Service.execute(SourceFile:630)
at org.netuno.tritao.Service._main(SourceFile:571)
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)
2021-03-25 10:04:46 jdbc[4]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS ""mes"",
comunidade.nome AS ""comunidade"",
COUNT(publicacao.id) ASx ""total""[*]
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
"; SQL statement:
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome AS "comunidade",
COUNT(publicacao.id) ASx "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
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-03-25 10:06:04 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS ""mes"",
comunidade.nome AS ""comunidade"",
COUNT(publicacao.id) ASx ""total""[*]
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
"; SQL statement:
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome AS "comunidade",
COUNT(publicacao.id) ASx "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
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-03-25 10:13:16 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS ""mes"",
comunidade.nome AS ""comunidade"",
COUNT(publicacao.id) ASx ""total""[*]
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
"; SQL statement:
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome AS "comunidade",
COUNT(publicacao.id) ASx "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
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-03-25 10:13:34 jdbc[3]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS ""mes"",
comunidade.nome AS ""comunidade"",
COUNT(publicacao.id) ASx ""total""[*]
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
"; SQL statement:
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome AS "comunidade",
COUNT(publicacao.id) ASx "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
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-03-25 10:14:01 jdbc[4]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS ""mes"",
comunidade.nome AS ""comunidade"",
COUNT(publicacao.id) ASx ""total""[*]
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
"; SQL statement:
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome AS "comunidade",
COUNT(publicacao.id) ASx "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
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-03-25 10:17:44 jdbc[4]: exception
org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS ""mes"",
comunidade.nome AS ""comunidade"",
COUNT(publicacao.id) ASx ""total""[*]
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
"; SQL statement:
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome AS "comunidade",
COUNT(publicacao.id) ASx "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
[42000-198]

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


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


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

@ -10,7 +10,6 @@ const dbPublicacoes = _db.query(`
where pessoa.uid = ?
`, _req.getString("uid"))
java.lang.Thread.sleep(4000)
_out.json(
dbPublicacoes
)

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

@ -0,0 +1,14 @@
const dbPublicacoes = _db.query(`
SELECT
SUBSTRING(publicacao.momento FROM 1 FOR 10) AS "mes",
comunidade.nome AS "comunidade",
COUNT(publicacao.id) AS "total"
FROM
publicacao INNER JOIN comunidade ON publicacao.comunidade_id = comunidade.id
GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome
`)
java.lang.Thread.sleep(4000)
_out.json(dbPublicacoes)

+ 1
- 0
ui/package.json View File

@ -30,6 +30,7 @@
},
"dependencies": {
"antd": "^4.1.0",
"bizcharts": "^4.1.9",
"chart.js": "^2.9.3",
"react-chartjs-2": "^2.9.0"
}


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

@ -0,0 +1,42 @@
import React, { useState, useEffect } from "react";
import PropTypes from "prop-types";
import Spin from 'antd/lib/spin';
import Typography from 'antd/lib/typography';
import { Chart, LineAdvance } from 'bizcharts';
import Service from "../../utils/Service";
const { Title } = Typography;
const GraficoPublicacoes = () => {
const [ loading, setLoading ] = useState(false);
const [ data, setData ] = useState([]);
useEffect(() => {
Service.call({
url: `publicacoes/grafico`,
method: "post",
setData,
setLoading,
errorTitle: 'Gráfico de Publicações',
errorMessage: 'Houve uma falha ao carregar o gráfico das publicações...'
})
}, []);
return <>
{ Service.spin(loading) }
<Chart padding={[10, 20, 50, 40]} autoFit height={300} data={data} >
<LineAdvance
shape="smooth"
point
area
position="mes*total"
color="comunidade"
/>
</Chart>
</>;
};
GraficoPublicacoes.propTypes = {
};
export default GraficoPublicacoes;

+ 10
- 31
ui/src/components/TabelaPessoas/JanelaPublicacoes/index.jsx View File

@ -3,6 +3,7 @@ import PropTypes from "prop-types";
import Modal from 'antd/lib/modal';
import Spin from 'antd/lib/spin';
import Typography from 'antd/lib/typography';
import Service from "../../../utils/Service";
const { Title } = Typography;
@ -11,46 +12,24 @@ const JanelaPublicacoes = ({ pessoa, onClose }) => {
const [ data, setData ] = useState([]);
useEffect(() => {
setLoading(true);
const fail = ()=> {
setLoading(false);
notification["error"]({
message: 'Lista de Publicações',
description: 'Houve uma falha ao carregar a lista das publicações...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/pessoas/publicacoes',
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
Service.call({
url: `pessoas/publicacoes`,
method: "post",
setData,
setLoading,
body: JSON.stringify({
uid: pessoa.uid
}),
success: (response)=> {
if (response.json) {
setData(response.json);
setLoading(false);
} else {
fail();
}
},
fail: ()=> {
fail();
}
});
errorTitle: 'Lista de Publicações',
errorMessage: 'Houve uma falha ao carregar a lista das publicações...'
})
}, []);
return <Modal
title="Publicações"
visible={true}
onOk={()=> { onClose() } }
onCancel={()=> { onClose() } }>
{ loading && <Spin /> }
{ Service.spin(loading) }
{ data.length > 0 ?
data.map(
(item)=> (


+ 11
- 29
ui/src/components/TabelaPessoas/index.jsx View File

@ -1,7 +1,12 @@
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 notification from 'antd/lib/notification';
import Service from "../../utils/Service";
import JanelaPublicacoes from "./JanelaPublicacoes/index.jsx";
const TabelaPessoas = () => {
@ -10,35 +15,12 @@ const TabelaPessoas = () => {
const [ loading, setLoading ] = useState(false);
useEffect(() => {
setLoading(true);
const fail = ()=> {
setLoading(false);
notification["error"]({
message: 'Tabela de Pessoas',
description: 'Houve uma falha ao carregar a tabela das pessoas...',
style: {
marginTop: 100,
}
});
};
netuno.service({
url: '/services/pessoas',
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
success: (response)=> {
if (response.json) {
setData(response.json);
setLoading(false);
} else {
fail();
}
},
fail: ()=> {
fail();
}
Service.call({
url: `pessoas`,
setData,
setLoading,
errorTitle: 'Tabela de Pessoas',
errorMessage: 'Houve uma falha ao carregar a tabela das pessoas...'
});
}, [ ]);


+ 2
- 3
ui/src/containers/DashboardContainer/index.jsx View File

@ -1,4 +1,5 @@
import React, { Component } from "react";
import GraficoPublicacoes from "../../components/GraficoPublicacoes/index.jsx";
import MyButton from "../../components/MyButton/index.jsx";
import TabelaPessoas from "../../components/TabelaPessoas/index.jsx";
@ -81,9 +82,7 @@ export default class DashboardContainer extends Component {
return (
<div className="my-dashboard">
<TabelaPessoas />
<div className="my-dashboard__button">
<MyButton mainRef={ this.button } text={ `ReactJS ⚡ Ant.Design 👉 Click me! ${ counter }` } click={ this.click } />
</div>
<GraficoPublicacoes />
</div>
);
}


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

@ -0,0 +1,47 @@
import React from "react";
import notification from 'antd/lib/notification';
import Spin from 'antd/lib/spin';
export default class Service {
static spin(loading) {
return loading && <Spin />;
}
static call(settings) {
if (!settings.url || !settings.setData || !settings.setLoading) {
console.error("Service.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 : settings.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();
}
});
}
}

Loading…
Cancel
Save