mirror of
https://github.com/Unkn0wnCat/matrix-veles.git
synced 2025-04-28 17:56:49 +02:00
webui: Add RoomDetail and corresponding query
This commit is contained in:
parent
42a5e527eb
commit
0e70a15fdc
14 changed files with 4367 additions and 1431 deletions
6
go.mod
6
go.mod
|
@ -4,7 +4,7 @@ go 1.16
|
|||
|
||||
require (
|
||||
github.com/766b/chi-prometheus v0.0.0-20211217152057-87afa9aa2ca8
|
||||
github.com/99designs/gqlgen v0.17.1
|
||||
github.com/99designs/gqlgen v0.17.13
|
||||
github.com/go-chi/chi v1.5.4 // indirect
|
||||
github.com/go-chi/chi/v5 v5.0.7
|
||||
github.com/go-chi/cors v1.2.0
|
||||
|
@ -12,13 +12,13 @@ require (
|
|||
github.com/prometheus/client_golang v1.12.1
|
||||
github.com/spf13/cobra v1.3.0
|
||||
github.com/spf13/viper v1.10.1
|
||||
github.com/vektah/gqlparser/v2 v2.4.0
|
||||
github.com/vektah/gqlparser/v2 v2.4.6
|
||||
go.mongodb.org/mongo-driver v1.8.3
|
||||
go.opentelemetry.io/otel v1.4.1
|
||||
go.opentelemetry.io/otel/exporters/jaeger v1.4.1
|
||||
go.opentelemetry.io/otel/sdk v1.4.1
|
||||
go.opentelemetry.io/otel/trace v1.4.1
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
|
||||
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
|
||||
maunium.net/go/mautrix v0.9.14
|
||||
)
|
||||
|
|
46
go.sum
46
go.sum
|
@ -48,16 +48,17 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
|
|||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/766b/chi-prometheus v0.0.0-20211217152057-87afa9aa2ca8 h1:hK1G69lDhhrGqJbRA5i1rmT2KI/W77MSdr7hEGHqWdQ=
|
||||
github.com/766b/chi-prometheus v0.0.0-20211217152057-87afa9aa2ca8/go.mod h1:X/LhbmoBoRu8TxoGIOIraVNhfz3hhikJoaelrOuhdPY=
|
||||
github.com/99designs/gqlgen v0.17.1 h1:i2qQMPKHQjHgBWYIpO4TsaQpPqMHCPK1+h95ipvH8VU=
|
||||
github.com/99designs/gqlgen v0.17.1/go.mod h1:K5fzLKwtph+FFgh9j7nFbRUdBKvTcGnsta51fsMTn3o=
|
||||
github.com/99designs/gqlgen v0.17.13 h1:ETUEqvRg5Zvr1lXtpoRdj026fzVay0ZlJPwI33qXLIw=
|
||||
github.com/99designs/gqlgen v0.17.13/go.mod h1:w1brbeOdqVyNJI553BGwtwdVcYu1LKeYE1opLWN9RgQ=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII=
|
||||
github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM=
|
||||
github.com/agnivade/levenshtein v1.1.0 h1:n6qGwyHG61v3ABce1rPVZklEYRT8NFpCMrpZdBUbYGM=
|
||||
github.com/agnivade/levenshtein v1.1.0/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
|
||||
github.com/agnivade/levenshtein v1.1.1 h1:QY8M92nrzkmr798gCo3kmMyqXFzdQVpxLlGPRBij0P8=
|
||||
github.com/agnivade/levenshtein v1.1.1/go.mod h1:veldBMzWxcCG2ZvUTKD2kJNRdCk5hVbJomOvKkmgYbo=
|
||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
|
@ -113,7 +114,6 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH
|
|||
github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
@ -243,8 +243,9 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m
|
|||
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
|
||||
github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
|
||||
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M=
|
||||
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
|
||||
|
@ -318,8 +319,7 @@ github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxA
|
|||
github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w=
|
||||
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
|
||||
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
github.com/matryer/moq v0.2.3 h1:Q06vEqnBYjjfx5KKgHfYRKE/lvlRu+Nj+xodG4YdHnU=
|
||||
github.com/matryer/moq v0.2.3/go.mod h1:9RtPYjTnH1bSBIkpvtHkFN7nbWAnO7oRpdJkEIn6UtE=
|
||||
github.com/matryer/moq v0.2.7/go.mod h1:kITsx543GOENm48TUAQyJ9+SAvFSr7iGQXPoth/VUBk=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
|
@ -342,7 +342,7 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk
|
|||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.2.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs=
|
||||
github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
|
@ -396,7 +396,6 @@ github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0
|
|||
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
|
@ -405,7 +404,6 @@ github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDN
|
|||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||
github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
|
@ -432,8 +430,9 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
|||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tidwall/gjson v1.6.8/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI=
|
||||
|
@ -443,16 +442,18 @@ github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
|
|||
github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||
github.com/tidwall/sjson v1.1.5/go.mod h1:VuJzsZnTowhSxWdOgsAnb886i4AjEyTkk7tNtsL7EYE=
|
||||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
|
||||
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
|
||||
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
|
||||
github.com/vektah/gqlparser/v2 v2.4.0 h1:EmA4dw9mqHm0j6Xzb9T21hOrp3oXmxnS40vwki70DZU=
|
||||
github.com/vektah/gqlparser/v2 v2.4.0/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
|
||||
github.com/urfave/cli/v2 v2.8.1 h1:CGuYNZF9IKZY/rfBe3lJpccSoIY1ytfvmgQT90cNOl4=
|
||||
github.com/urfave/cli/v2 v2.8.1/go.mod h1:Z41J9TPoffeoqP0Iza0YbAhGvymRdZAd2uPmZ5JxRdY=
|
||||
github.com/vektah/gqlparser/v2 v2.4.6 h1:Yjzp66g6oVq93Jihbi0qhGnf/6zIWjcm8H6gA27zstE=
|
||||
github.com/vektah/gqlparser/v2 v2.4.6/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
|
||||
github.com/xdg-go/scram v1.0.2 h1:akYIkZ28e6A96dkWNJQu3nmCzH3YfwMPQExUYDaRv7w=
|
||||
github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs=
|
||||
github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyhBc=
|
||||
github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA=
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
|
@ -498,8 +499,9 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh
|
|||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201216223049-8b5274cf687f/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
|
@ -536,8 +538,9 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
|||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
|
||||
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
|
@ -747,7 +750,6 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY
|
|||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200815165600-90abf76919f3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
||||
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
|
@ -761,8 +763,9 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
|||
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8=
|
||||
golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU=
|
||||
golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20=
|
||||
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
@ -912,8 +915,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
|
|||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -244,6 +244,7 @@ type Query {
|
|||
rooms(first: Int, after: String, filter: RoomFilter): RoomConnection @loggedIn
|
||||
|
||||
|
||||
room(id: ID): Room @loggedIn
|
||||
user(id: ID, username: String): User @loggedIn
|
||||
entry(id: ID, hashValue: String): Entry @loggedIn
|
||||
list(id: ID, name: String): List @loggedIn
|
||||
|
|
|
@ -7,6 +7,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
"math/big"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -23,6 +24,7 @@ import (
|
|||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
)
|
||||
|
||||
// Author is the resolver for the author field.
|
||||
func (r *commentResolver) Author(ctx context.Context, obj *model.Comment) (*model.User, error) {
|
||||
user, err := db.GetUserByID(*obj.AuthorID)
|
||||
if err != nil {
|
||||
|
@ -36,6 +38,7 @@ func (r *commentResolver) Author(ctx context.Context, obj *model.Comment) (*mode
|
|||
return model.MakeUser(user), nil
|
||||
}
|
||||
|
||||
// PartOf is the resolver for the partOf field.
|
||||
func (r *entryResolver) PartOf(ctx context.Context, obj *model.Entry, first *int, after *string) (*model.ListConnection, error) {
|
||||
ids := obj.PartOfIDs
|
||||
|
||||
|
@ -112,6 +115,7 @@ func (r *entryResolver) PartOf(ctx context.Context, obj *model.Entry, first *int
|
|||
}, nil
|
||||
}
|
||||
|
||||
// AddedBy is the resolver for the addedBy field.
|
||||
func (r *entryResolver) AddedBy(ctx context.Context, obj *model.Entry) (*model.User, error) {
|
||||
user, err := db.GetUserByID(obj.AddedByID)
|
||||
if err != nil {
|
||||
|
@ -125,12 +129,14 @@ func (r *entryResolver) AddedBy(ctx context.Context, obj *model.Entry) (*model.U
|
|||
return model.MakeUser(user), nil
|
||||
}
|
||||
|
||||
// Comments is the resolver for the comments field.
|
||||
func (r *entryResolver) Comments(ctx context.Context, obj *model.Entry, first *int, after *string) (*model.CommentConnection, error) {
|
||||
comments := obj.RawComments
|
||||
|
||||
return ResolveComments(comments, first, after)
|
||||
}
|
||||
|
||||
// Creator is the resolver for the creator field.
|
||||
func (r *listResolver) Creator(ctx context.Context, obj *model.List) (*model.User, error) {
|
||||
user, err := db.GetUserByID(obj.CreatorID)
|
||||
if err != nil {
|
||||
|
@ -140,12 +146,14 @@ func (r *listResolver) Creator(ctx context.Context, obj *model.List) (*model.Use
|
|||
return model.MakeUser(user), nil
|
||||
}
|
||||
|
||||
// Comments is the resolver for the comments field.
|
||||
func (r *listResolver) Comments(ctx context.Context, obj *model.List, first *int, after *string) (*model.CommentConnection, error) {
|
||||
comments := obj.RawComments
|
||||
|
||||
return ResolveComments(comments, first, after)
|
||||
}
|
||||
|
||||
// Maintainers is the resolver for the maintainers field.
|
||||
func (r *listResolver) Maintainers(ctx context.Context, obj *model.List, first *int, after *string) (*model.UserConnection, error) {
|
||||
ids := obj.MaintainerIDs
|
||||
|
||||
|
@ -222,6 +230,7 @@ func (r *listResolver) Maintainers(ctx context.Context, obj *model.List, first *
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Entries is the resolver for the entries field.
|
||||
func (r *listResolver) Entries(ctx context.Context, obj *model.List, first *int, after *string) (*model.EntryConnection, error) {
|
||||
coll := db.Db.Collection(viper.GetString("bot.mongo.collection.entries"))
|
||||
|
||||
|
@ -299,6 +308,7 @@ func (r *listResolver) Entries(ctx context.Context, obj *model.List, first *int,
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Login is the resolver for the login field.
|
||||
func (r *mutationResolver) Login(ctx context.Context, input model.Login) (string, error) {
|
||||
user, err := db.GetUserByUsername(input.Username)
|
||||
if err != nil {
|
||||
|
@ -336,6 +346,7 @@ func (r *mutationResolver) Login(ctx context.Context, input model.Login) (string
|
|||
return ss, nil
|
||||
}
|
||||
|
||||
// Register is the resolver for the register field.
|
||||
func (r *mutationResolver) Register(ctx context.Context, input model.Register) (string, error) {
|
||||
_, err := db.GetUserByUsername(input.Username)
|
||||
if !errors.Is(err, mongo.ErrNoDocuments) {
|
||||
|
@ -381,6 +392,7 @@ func (r *mutationResolver) Register(ctx context.Context, input model.Register) (
|
|||
return ss, nil
|
||||
}
|
||||
|
||||
// AddMxid is the resolver for the addMXID field.
|
||||
func (r *mutationResolver) AddMxid(ctx context.Context, input model.AddMxid) (*model.User, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -403,6 +415,7 @@ func (r *mutationResolver) AddMxid(ctx context.Context, input model.AddMxid) (*m
|
|||
return model.MakeUser(user), nil
|
||||
}
|
||||
|
||||
// RemoveMxid is the resolver for the removeMXID field.
|
||||
func (r *mutationResolver) RemoveMxid(ctx context.Context, input model.RemoveMxid) (*model.User, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -429,6 +442,7 @@ func (r *mutationResolver) RemoveMxid(ctx context.Context, input model.RemoveMxi
|
|||
return model.MakeUser(user), nil
|
||||
}
|
||||
|
||||
// ReconfigureRoom is the resolver for the reconfigureRoom field.
|
||||
func (r *mutationResolver) ReconfigureRoom(ctx context.Context, input model.RoomConfigUpdate) (*model.Room, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -499,6 +513,7 @@ func (r *mutationResolver) ReconfigureRoom(ctx context.Context, input model.Room
|
|||
return model.MakeRoom(rConfig), nil
|
||||
}
|
||||
|
||||
// SubscribeToList is the resolver for the subscribeToList field.
|
||||
func (r *mutationResolver) SubscribeToList(ctx context.Context, input model.ListSubscriptionUpdate) (*model.Room, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -558,6 +573,7 @@ func (r *mutationResolver) SubscribeToList(ctx context.Context, input model.List
|
|||
return model.MakeRoom(rConfig), nil
|
||||
}
|
||||
|
||||
// UnsubscribeFromList is the resolver for the unsubscribeFromList field.
|
||||
func (r *mutationResolver) UnsubscribeFromList(ctx context.Context, input model.ListSubscriptionUpdate) (*model.Room, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -616,6 +632,7 @@ func (r *mutationResolver) UnsubscribeFromList(ctx context.Context, input model.
|
|||
return model.MakeRoom(rConfig), nil
|
||||
}
|
||||
|
||||
// CreateEntry is the resolver for the createEntry field.
|
||||
func (r *mutationResolver) CreateEntry(ctx context.Context, input model.CreateEntry) (*model.Entry, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -666,6 +683,7 @@ func (r *mutationResolver) CreateEntry(ctx context.Context, input model.CreateEn
|
|||
return model.MakeEntry(entry), nil
|
||||
}
|
||||
|
||||
// CommentEntry is the resolver for the commentEntry field.
|
||||
func (r *mutationResolver) CommentEntry(ctx context.Context, input model.CommentEntry) (*model.Entry, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -699,6 +717,7 @@ func (r *mutationResolver) CommentEntry(ctx context.Context, input model.Comment
|
|||
return model.MakeEntry(entry), nil
|
||||
}
|
||||
|
||||
// AddToLists is the resolver for the addToLists field.
|
||||
func (r *mutationResolver) AddToLists(ctx context.Context, input model.AddToLists) (*model.Entry, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -738,6 +757,7 @@ func (r *mutationResolver) AddToLists(ctx context.Context, input model.AddToList
|
|||
return model.MakeEntry(entry), nil
|
||||
}
|
||||
|
||||
// RemoveFromLists is the resolver for the removeFromLists field.
|
||||
func (r *mutationResolver) RemoveFromLists(ctx context.Context, input model.RemoveFromLists) (*model.Entry, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -777,6 +797,7 @@ func (r *mutationResolver) RemoveFromLists(ctx context.Context, input model.Remo
|
|||
return model.MakeEntry(entry), nil
|
||||
}
|
||||
|
||||
// CreateList is the resolver for the createList field.
|
||||
func (r *mutationResolver) CreateList(ctx context.Context, input model.CreateList) (*model.List, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -829,6 +850,7 @@ func (r *mutationResolver) CreateList(ctx context.Context, input model.CreateLis
|
|||
return model.MakeList(&list), nil
|
||||
}
|
||||
|
||||
// CommentList is the resolver for the commentList field.
|
||||
func (r *mutationResolver) CommentList(ctx context.Context, input model.CommentList) (*model.List, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
@ -862,10 +884,12 @@ func (r *mutationResolver) CommentList(ctx context.Context, input model.CommentL
|
|||
return model.MakeList(list), nil
|
||||
}
|
||||
|
||||
// DeleteList is the resolver for the deleteList field.
|
||||
func (r *mutationResolver) DeleteList(ctx context.Context, input string) (bool, error) {
|
||||
panic(fmt.Errorf("not implemented"))
|
||||
}
|
||||
|
||||
// Users is the resolver for the users field.
|
||||
func (r *queryResolver) Users(ctx context.Context, first *int, after *string, filter *model.UserFilter, sort *model.UserSort) (*model.UserConnection, error) {
|
||||
dbFilter, dbSort, dbLimit, err := buildDBUserFilter(first, after, filter, sort)
|
||||
if err != nil {
|
||||
|
@ -940,6 +964,7 @@ func (r *queryResolver) Users(ctx context.Context, first *int, after *string, fi
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Lists is the resolver for the lists field.
|
||||
func (r *queryResolver) Lists(ctx context.Context, first *int, after *string, filter *model.ListFilter, sort *model.ListSort) (*model.ListConnection, error) {
|
||||
dbFilter, dbSort, dbLimit, err := buildDBListFilter(first, after, filter, sort)
|
||||
if err != nil {
|
||||
|
@ -1014,6 +1039,7 @@ func (r *queryResolver) Lists(ctx context.Context, first *int, after *string, fi
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Entries is the resolver for the entries field.
|
||||
func (r *queryResolver) Entries(ctx context.Context, first *int, after *string, filter *model.EntryFilter, sort *model.EntrySort) (*model.EntryConnection, error) {
|
||||
dbFilter, dbSort, dbLimit, err := buildDBEntryFilter(first, after, filter, sort)
|
||||
if err != nil {
|
||||
|
@ -1088,6 +1114,7 @@ func (r *queryResolver) Entries(ctx context.Context, first *int, after *string,
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Rooms is the resolver for the rooms field.
|
||||
func (r *queryResolver) Rooms(ctx context.Context, first *int, after *string, filter *model.RoomFilter) (*model.RoomConnection, error) {
|
||||
user, _ := GetUserFromContext(ctx)
|
||||
|
||||
|
@ -1172,6 +1199,39 @@ func (r *queryResolver) Rooms(ctx context.Context, first *int, after *string, fi
|
|||
}, nil
|
||||
}
|
||||
|
||||
// Room is the resolver for the room field.
|
||||
func (r *queryResolver) Room(ctx context.Context, id *string) (*model.Room, error) {
|
||||
if id != nil {
|
||||
dbId, err := primitive.ObjectIDFromHex(*id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
coll := db.Db.Collection(viper.GetString("bot.mongo.collection.rooms"))
|
||||
|
||||
res := coll.FindOne(ctx, bson.M{"_id": dbId})
|
||||
if res.Err() != nil {
|
||||
if errors.Is(res.Err(), mongo.ErrNoDocuments) {
|
||||
return nil, errors.New("not found")
|
||||
}
|
||||
|
||||
return nil, errors.New("database error")
|
||||
}
|
||||
|
||||
var room config.RoomConfig
|
||||
|
||||
err = res.Decode(&room)
|
||||
if err != nil {
|
||||
return nil, errors.New("database error")
|
||||
}
|
||||
|
||||
return model.MakeRoom(&room), nil
|
||||
}
|
||||
|
||||
return nil, errors.New("not found")
|
||||
}
|
||||
|
||||
// User is the resolver for the user field.
|
||||
func (r *queryResolver) User(ctx context.Context, id *string, username *string) (*model.User, error) {
|
||||
if id != nil {
|
||||
dbId, err := primitive.ObjectIDFromHex(*id)
|
||||
|
@ -1207,6 +1267,7 @@ func (r *queryResolver) User(ctx context.Context, id *string, username *string)
|
|||
return nil, errors.New("not found")
|
||||
}
|
||||
|
||||
// Entry is the resolver for the entry field.
|
||||
func (r *queryResolver) Entry(ctx context.Context, id *string, hashValue *string) (*model.Entry, error) {
|
||||
if id != nil {
|
||||
dbId, err := primitive.ObjectIDFromHex(*id)
|
||||
|
@ -1242,6 +1303,7 @@ func (r *queryResolver) Entry(ctx context.Context, id *string, hashValue *string
|
|||
return nil, errors.New("not found")
|
||||
}
|
||||
|
||||
// List is the resolver for the list field.
|
||||
func (r *queryResolver) List(ctx context.Context, id *string, name *string) (*model.List, error) {
|
||||
if id != nil {
|
||||
dbId, err := primitive.ObjectIDFromHex(*id)
|
||||
|
@ -1277,6 +1339,7 @@ func (r *queryResolver) List(ctx context.Context, id *string, name *string) (*mo
|
|||
return nil, errors.New("not found")
|
||||
}
|
||||
|
||||
// Self is the resolver for the self field.
|
||||
func (r *queryResolver) Self(ctx context.Context) (*model.User, error) {
|
||||
user, err := GetUserFromContext(ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -244,6 +244,7 @@ type Query {
|
|||
rooms(first: Int, after: String, filter: RoomFilter): RoomConnection @loggedIn
|
||||
|
||||
|
||||
room(id: ID): Room @loggedIn
|
||||
user(id: ID, username: String): User @loggedIn
|
||||
entry(id: ID, hashValue: String): Entry @loggedIn
|
||||
list(id: ID, name: String): List @loggedIn
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"jump_to_content": "Zum Inhalt springen",
|
||||
"jump_to_navigation": "Zur Navigation springen",
|
||||
"documentation": "Dokumentation",
|
||||
"logout": "Ausloggen",
|
||||
"navigation": {
|
||||
"dashboard": "Dashboard",
|
||||
"rooms": "Meine Räume",
|
||||
|
|
|
@ -13,5 +13,14 @@
|
|||
"my_rooms": {
|
||||
"title": "Meine Räume"
|
||||
}
|
||||
},
|
||||
"rooms": {
|
||||
"debug": "Debug",
|
||||
"inactive": "Inaktiv",
|
||||
"active": "Aktiv",
|
||||
"title": "Meine Räume",
|
||||
"details": "Details",
|
||||
"name": "Name",
|
||||
"id": "ID"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"jump_to_content": "Jump to Content",
|
||||
"jump_to_navigation": "Jump to Navigation",
|
||||
"documentation": "Documentation",
|
||||
"logout": "Logout",
|
||||
"navigation": {
|
||||
"dashboard": "Dashboard",
|
||||
"rooms": "My Rooms",
|
||||
|
|
|
@ -13,5 +13,14 @@
|
|||
"my_rooms": {
|
||||
"title": "My Rooms"
|
||||
}
|
||||
},
|
||||
"rooms": {
|
||||
"debug": "Debug",
|
||||
"inactive": "Inactive",
|
||||
"active": "Active",
|
||||
"title": "My Rooms",
|
||||
"details": "Details",
|
||||
"name": "Name",
|
||||
"id": "Room ID"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@ import Dashboard from "./components/panel/dashboard/Dashboard";
|
|||
import DashboardQueryGraphql, {DashboardQuery} from "./components/panel/dashboard/__generated__/DashboardQuery.graphql";
|
||||
import Rooms from "./components/panel/rooms/Rooms";
|
||||
import RoomsQueryGraphql, {RoomsQuery} from "./components/panel/rooms/__generated__/RoomsQuery.graphql";
|
||||
import RoomDetailQueryGraphql, {RoomDetailQuery} from "./components/panel/rooms/__generated__/RoomDetailQuery.graphql";
|
||||
import RoomDetail from "./components/panel/rooms/RoomDetail";
|
||||
|
||||
function App() {
|
||||
const dispatch = useAppDispatch()
|
||||
|
@ -31,6 +33,10 @@ function App() {
|
|||
RoomsQueryGraphql
|
||||
)
|
||||
|
||||
const [roomDetailInitialState, loadRoomDetailQuery, disposeRoomDetailQuery] = useQueryLoader<RoomDetailQuery>(
|
||||
RoomDetailQueryGraphql
|
||||
)
|
||||
|
||||
// This needs to be here to prevent a weird bug
|
||||
useTranslation()
|
||||
|
||||
|
@ -62,7 +68,7 @@ function App() {
|
|||
<Route path={"/"} element={<PanelLayout/>}>
|
||||
<Route path={""} element={<RequireAuth>{dashboardInitialState && <Dashboard initialQueryRef={dashboardInitialState}/>}</RequireAuth>} />
|
||||
<Route path={"rooms"} element={<RequireAuth>{roomsInitialState && <Rooms initialQueryRef={roomsInitialState}/>}</RequireAuth>}>
|
||||
<Route path={":id"} element={<h1>room detail</h1>} />
|
||||
<Route path={":id"} element={<RequireAuth><RoomDetail initialQueryRef={roomDetailInitialState} fetch={loadRoomDetailQuery} dispose={disposeRoomDetailQuery}/></RequireAuth>} />
|
||||
</Route>
|
||||
<Route path={"hashing/lists"} element={<RequireAuth><h1>lists</h1></RequireAuth>}>
|
||||
<Route path={":id"} element={<h1>list detail</h1>} />
|
||||
|
|
61
webui/src/components/panel/rooms/RoomDetail.tsx
Normal file
61
webui/src/components/panel/rooms/RoomDetail.tsx
Normal file
|
@ -0,0 +1,61 @@
|
|||
import React, {useEffect} from "react";
|
||||
import {PreloadedQuery, usePreloadedQuery} from "react-relay/hooks";
|
||||
import {graphql} from "babel-plugin-relay/macro";
|
||||
import {RoomDetailQuery, RoomDetailQuery$variables} from "./__generated__/RoomDetailQuery.graphql";
|
||||
import {DisposeFn} from "relay-runtime";
|
||||
import {useParams} from "react-router-dom";
|
||||
|
||||
type Props = {
|
||||
initialQueryRef: PreloadedQuery<RoomDetailQuery> | null | undefined,
|
||||
fetch: (variables: RoomDetailQuery$variables) => void
|
||||
dispose: DisposeFn
|
||||
}
|
||||
|
||||
type PropsFinal = {
|
||||
initialQueryRef: PreloadedQuery<RoomDetailQuery>,
|
||||
}
|
||||
|
||||
const RoomDetailInner = ({initialQueryRef}: PropsFinal) => {
|
||||
const data = usePreloadedQuery(
|
||||
graphql`
|
||||
query RoomDetailQuery($id: ID) {
|
||||
room(id:$id) {
|
||||
id
|
||||
active
|
||||
adminPowerLevel
|
||||
debug
|
||||
name
|
||||
roomId
|
||||
hashCheckerConfig {
|
||||
chatNotice
|
||||
hashCheckMode
|
||||
subscribedLists
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
initialQueryRef
|
||||
)
|
||||
|
||||
return <>
|
||||
<h1>Room Detail: {data.room?.name}</h1>
|
||||
|
||||
<pre>{JSON.stringify(data, null, 2)}</pre>
|
||||
</>
|
||||
}
|
||||
|
||||
const RoomDetail = ({initialQueryRef, fetch, dispose}: Props) => {
|
||||
const {id} = useParams()
|
||||
|
||||
useEffect(() => {
|
||||
fetch({id})
|
||||
|
||||
return () => {
|
||||
dispose();
|
||||
}
|
||||
}, [id, dispose, fetch])
|
||||
|
||||
return initialQueryRef ? <RoomDetailInner initialQueryRef={initialQueryRef} /> : <>loading...</>
|
||||
}
|
||||
|
||||
export default RoomDetail;
|
|
@ -4,7 +4,7 @@ import {useNavigate, useOutlet} from "react-router-dom";
|
|||
import styles from "./Rooms.module.scss";
|
||||
import {Trans} from "react-i18next";
|
||||
import RoomsTable from "./RoomsTable";
|
||||
import {PreloadedQuery, usePreloadedQuery} from "react-relay/hooks";
|
||||
import {PreloadedQuery, usePreloadedQuery, useQueryLoader} from "react-relay/hooks";
|
||||
import {graphql} from "babel-plugin-relay/macro";
|
||||
import {RoomsQuery} from "./__generated__/RoomsQuery.graphql";
|
||||
import {X} from "lucide-react";
|
||||
|
|
167
webui/src/components/panel/rooms/__generated__/RoomDetailQuery.graphql.ts
generated
Normal file
167
webui/src/components/panel/rooms/__generated__/RoomDetailQuery.graphql.ts
generated
Normal file
|
@ -0,0 +1,167 @@
|
|||
/**
|
||||
* @generated SignedSource<<9574fe27c6b52038cbfdd4009ccdf08c>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest, Query } from 'relay-runtime';
|
||||
export type HashCheckerMode = "NOTICE" | "DELETE" | "MUTE" | "BAN" | "%future added value";
|
||||
export type RoomDetailQuery$variables = {
|
||||
id?: string | null;
|
||||
};
|
||||
export type RoomDetailQuery$data = {
|
||||
readonly room: {
|
||||
readonly id: string;
|
||||
readonly active: boolean;
|
||||
readonly adminPowerLevel: number;
|
||||
readonly debug: boolean;
|
||||
readonly name: string;
|
||||
readonly roomId: string;
|
||||
readonly hashCheckerConfig: {
|
||||
readonly chatNotice: boolean;
|
||||
readonly hashCheckMode: HashCheckerMode;
|
||||
readonly subscribedLists: ReadonlyArray<string> | null;
|
||||
};
|
||||
} | null;
|
||||
};
|
||||
export type RoomDetailQuery = {
|
||||
variables: RoomDetailQuery$variables;
|
||||
response: RoomDetailQuery$data;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"defaultValue": null,
|
||||
"kind": "LocalArgument",
|
||||
"name": "id"
|
||||
}
|
||||
],
|
||||
v1 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": [
|
||||
{
|
||||
"kind": "Variable",
|
||||
"name": "id",
|
||||
"variableName": "id"
|
||||
}
|
||||
],
|
||||
"concreteType": "Room",
|
||||
"kind": "LinkedField",
|
||||
"name": "room",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "active",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "adminPowerLevel",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "debug",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "roomId",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "HashCheckerConfig",
|
||||
"kind": "LinkedField",
|
||||
"name": "hashCheckerConfig",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "chatNotice",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "hashCheckMode",
|
||||
"storageKey": null
|
||||
},
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "subscribedLists",
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "RoomDetailQuery",
|
||||
"selections": (v1/*: any*/),
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": (v0/*: any*/),
|
||||
"kind": "Operation",
|
||||
"name": "RoomDetailQuery",
|
||||
"selections": (v1/*: any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "91fa63463870ca57128248af37619c8f",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "RoomDetailQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query RoomDetailQuery(\n $id: ID\n) {\n room(id: $id) {\n id\n active\n adminPowerLevel\n debug\n name\n roomId\n hashCheckerConfig {\n chatNotice\n hashCheckMode\n subscribedLists\n }\n }\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
(node as any).hash = "a825cd16719edd1498f1b34bef67b414";
|
||||
|
||||
export default node;
|
Loading…
Add table
Reference in a new issue