You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/09/28 17:08:07 UTC
[GitHub] [apisix-dashboard] codewangg opened a new pull request #2152: feat: added dashboard backend api for apisix status summary
codewangg opened a new pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152
**Why submit this pull request?**
- [ ] Bugfix
- [x] New feature provided
- [ ] Improve performance
- [ ] Backport patches
**What changes will this PR take into?**
added dashboard backend API for apisix status summary
**Related issues**
https://summer.iscas.ac.cn/#/org/prodetail/210050270
**Checklist:**
- [x] Did you explain what problem does this PR solve? Or what new features have been added?
- [x] Have you added corresponding test cases?
- [x] Have you modified the corresponding document?
- [x] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist edited a comment on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist edited a comment on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1066465446
@starsz @bzp2010 Please take a look, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codewangg commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codewangg commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1008590201
>
Hi Bozhong, thank you for reminding me, I have added you to the collaborators :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] github-actions[bot] commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-987766216
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time ordiscuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codewangg commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codewangg commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1004549644
>
Hi @zaunist , thanks for reaching out, there are still e2e tests needed to be done, please let me know if there's anything I can help with.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz commented on a change in pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#discussion_r718112966
##########
File path: api/internal/handler/dashboard/dashboard.go
##########
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package Dashboard
+
+import (
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+ "reflect"
+ "sort"
Review comment:
Need to group the import.
https://github.com/uber-go/guide/blob/master/style.md#import-group-ordering
##########
File path: api/internal/core/entity/entity.go
##########
@@ -290,3 +290,14 @@ type PluginConfig struct {
Plugins map[string]interface{} `json:"plugins"`
Labels map[string]string `json:"labels,omitempty"`
}
+
+type DashboardInfo struct {
+ RouteCnt int64 `json:"router_cnt,omitempty"`
+ OnlineRouterCnt int64 `json:"online_router_cnt,omitempty"`
+ UpstreamCnt int64 `json:"upstream_cnt,omitempty"`
+ ServiceCnt int64 `json:"service_cnt,omitempty"`
+ CertificateCnt int64 `json:"certificate_cnt,omitempty"`
+ Plugins []string `json:"plugins,omitempty"`
+ ApisixVersion string `json:"apisix_version,omitempty"`
+ ServerSummary []*ServerInfo `json:"ServerSummary,omitempty"`
Review comment:
Missing Dashboard version.
##########
File path: api/internal/handler/dashboard/dashboard.go
##########
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package Dashboard
+
+import (
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+ "reflect"
+ "sort"
+)
+
+type Handler struct {
+ routeStore store.Interface
+ upstreamStore store.Interface
+ serverInfoStore store.Interface
+ serviceStore store.Interface
+ sslStore store.Interface
+}
+
+func NewHandler() (handler.RouteRegister, error) {
+ return &Handler{
+ routeStore: store.GetStore(store.HubKeyRoute),
+ upstreamStore: store.GetStore(store.HubKeyUpstream),
+ serverInfoStore: store.GetStore(store.HubKeyServerInfo),
+ serviceStore: store.GetStore(store.HubKeyService),
+ sslStore: store.GetStore(store.HubKeySsl),
+ }, nil
+}
+
+func (h *Handler) ApplyRoute(r *gin.Engine) {
+ r.GET("/apisix/admin/dashboard", wgin.Wraps(h.List,
Review comment:
Maybe `/apisix/admin/overview` is better ?
You can refer other systems.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5599a9d) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/fd5afe419fb24d5045e6e65c3f07f9e5d9278272?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fd5afe4) will **decrease** coverage by `2.17%`.
> The diff coverage is `86.04%`.
> :exclamation: Current head 5599a9d differs from pull request most recent head 49847ae. Consider uploading reports for the commit 49847ae to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
- Coverage 67.75% 65.57% -2.18%
==========================================
Files 126 61 -65
Lines 3300 3919 +619
Branches 803 0 -803
==========================================
+ Hits 2236 2570 +334
+ Misses 1064 1053 -11
- Partials 0 296 +296
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `45.95% <9.30%> (?)` | |
| backend-unit-test | `53.73% <77.34%> (?)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `68.18% <ø> (ø)` | |
| [api/internal/handler/dashboard/dashboard.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGFzaGJvYXJkL2Rhc2hib2FyZC5nbw==) | `85.93% <85.93%> (ø)` | |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `86.84% <100.00%> (ø)` | |
| [...pages/Route/components/Step1/RequestConfigView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1JlcXVlc3RDb25maWdWaWV3LnRzeA==) | | |
| [web/src/constants.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb25zdGFudHMudHM=) | | |
| [web/src/components/RawDataEditor/RawDataEditor.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Jhd0RhdGFFZGl0b3IvUmF3RGF0YUVkaXRvci50c3g=) | | |
| [web/src/pages/SSL/components/Step2/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9TU0wvY29tcG9uZW50cy9TdGVwMi9pbmRleC50c3g=) | | |
| [...ages/Route/components/Step2/RequestRewriteView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAyL1JlcXVlc3RSZXdyaXRlVmlldy50c3g=) | | |
| [web/src/components/Plugin/UI/basic-auth.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9iYXNpYy1hdXRoLnRzeA==) | | |
| [web/src/components/Upstream/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL3NlcnZpY2UudHM=) | | |
| ... and [179 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [fd5afe4...49847ae](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1008596541
> >
>
> Hi Bozhong, thank you for reminding me, I have added you to the collaborators :)
Thanks, @codewangg
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1004478262
Hi, @codewangg . I see that it has not been updated for a long time, and I will assist you in complete this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1004555253
> >
>
> Hi @zaunist , thanks for reaching out, there are still e2e tests needed to be done, please let me know if there's anything I can help with.
Can you add me to the collaborators of the warehouse so that I can submit the code on your PR.
![AkIDsM52YR](https://user-images.githubusercontent.com/38528079/148017497-7c7bae82-e818-4bfb-a4d1-767a15745cbb.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1066465446
cc @starsz
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (00dd81d) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/edca223f0169cbba24d62a56f2d39b01c97756b9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (edca223) will **decrease** coverage by `1.23%`.
> The diff coverage is `86.66%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
- Coverage 70.04% 68.80% -1.24%
==========================================
Files 188 58 -130
Lines 7347 4046 -3301
Branches 828 0 -828
==========================================
- Hits 5146 2784 -2362
+ Misses 1904 956 -948
- Partials 297 306 +9
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `59.98% <84.16%> (+0.56%)` | :arrow_up: |
| backend-unit-test | `50.06% <75.63%> (+0.95%)` | :arrow_up: |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `90.90% <ø> (ø)` | |
| [api/internal/handler/overview/overview.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvb3ZlcnZpZXcvb3ZlcnZpZXcuZ28=) | `86.55% <86.55%> (ø)` | |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `87.50% <100.00%> (+0.32%)` | :arrow_up: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `32.11% <0.00%> (-35.41%)` | :arrow_down: |
| [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `62.00% <0.00%> (-11.00%)` | :arrow_down: |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `47.24% <0.00%> (-6.30%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `89.58% <0.00%> (-2.09%)` | :arrow_down: |
| [web/src/pages/Route/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9zZXJ2aWNlLnRz) | | |
| [web/src/pages/Route/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS90cmFuc2Zvcm0udHM=) | | |
| [web/src/pages/Route/List.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9MaXN0LnRzeA==) | | |
| ... and [128 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [edca223...00dd81d](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1002518833
Do we still need to implement this feature ? @starsz
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (671ac52) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/edca223f0169cbba24d62a56f2d39b01c97756b9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (edca223) will **decrease** coverage by `5.73%`.
> The diff coverage is `84.16%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
- Coverage 70.04% 64.31% -5.74%
==========================================
Files 188 58 -130
Lines 7347 4046 -3301
Branches 828 0 -828
==========================================
- Hits 5146 2602 -2544
+ Misses 1904 1073 -831
- Partials 297 371 +74
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `36.01% <10.00%> (-1.39%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `59.68% <84.16%> (+0.26%)` | :arrow_up: |
| backend-unit-test | `?` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `90.90% <ø> (ø)` | |
| [api/internal/handler/overview/overview.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvb3ZlcnZpZXcvb3ZlcnZpZXcuZ28=) | `84.03% <84.03%> (ø)` | |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `87.50% <100.00%> (+0.32%)` | :arrow_up: |
| [api/internal/utils/runtime/runtime.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3J1bnRpbWUvcnVudGltZS5nbw==) | `5.55% <0.00%> (-61.12%)` | :arrow_down: |
| [api/internal/core/store/validate\_mock.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGVfbW9jay5nbw==) | `0.00% <0.00%> (-60.00%)` | :arrow_down: |
| [api/internal/utils/closer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL2Nsb3Nlci5nbw==) | `33.33% <0.00%> (-33.34%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `65.62% <0.00%> (-26.05%)` | :arrow_down: |
| [api/internal/handler/service/service.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2VydmljZS9zZXJ2aWNlLmdv) | `69.35% <0.00%> (-24.20%)` | :arrow_down: |
| [api/internal/filter/authentication.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2ZpbHRlci9hdXRoZW50aWNhdGlvbi5nbw==) | `55.55% <0.00%> (-22.23%)` | :arrow_down: |
| [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `68.11% <0.00%> (-17.40%)` | :arrow_down: |
| ... and [149 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [edca223...671ac52](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1068035223
> > Hi Bozhong, `ready to review` has been set, I am actively monitoring this stream, so please let me know if there is any other blockage by making new comments.
Thanks a lot @codewangg.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (671ac52) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/edca223f0169cbba24d62a56f2d39b01c97756b9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (edca223) will **decrease** coverage by `34.03%`.
> The diff coverage is `10.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
===========================================
- Coverage 70.04% 36.01% -34.04%
===========================================
Files 188 58 -130
Lines 7347 4046 -3301
Branches 828 0 -828
===========================================
- Hits 5146 1457 -3689
- Misses 1904 2314 +410
+ Partials 297 275 -22
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `36.01% <10.00%> (-1.39%)` | :arrow_down: |
| backend-e2e-test-ginkgo | `?` | |
| backend-unit-test | `?` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `68.18% <ø> (-22.73%)` | :arrow_down: |
| [api/internal/handler/overview/overview.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvb3ZlcnZpZXcvb3ZlcnZpZXcuZ28=) | `9.24% <9.24%> (ø)` | |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `80.00% <100.00%> (-7.18%)` | :arrow_down: |
| [api/internal/core/migrate/conflict.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9jb25mbGljdC5nbw==) | `0.00% <0.00%> (-80.00%)` | :arrow_down: |
| [api/internal/handler/schema/plugin.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3BsdWdpbi5nbw==) | `20.00% <0.00%> (-80.00%)` | :arrow_down: |
| [api/internal/core/migrate/migrate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvbWlncmF0ZS9taWdyYXRlLmdv) | `0.00% <0.00%> (-76.20%)` | :arrow_down: |
| [api/internal/handler/label/label.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbGFiZWwvbGFiZWwuZ28=) | `10.34% <0.00%> (-75.87%)` | :arrow_down: |
| [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `28.00% <0.00%> (-72.00%)` | :arrow_down: |
| [api/internal/handler/consumer/consumer.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvY29uc3VtZXIvY29uc3VtZXIuZ28=) | `23.80% <0.00%> (-68.26%)` | :arrow_down: |
| [api/internal/utils/runtime/runtime.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3J1bnRpbWUvcnVudGltZS5nbw==) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
| ... and [165 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [edca223...671ac52](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5599a9d) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/fd5afe419fb24d5045e6e65c3f07f9e5d9278272?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fd5afe4) will **decrease** coverage by `14.01%`.
> The diff coverage is `77.34%`.
> :exclamation: Current head 5599a9d differs from pull request most recent head 49847ae. Consider uploading reports for the commit 49847ae to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
===========================================
- Coverage 67.75% 53.73% -14.02%
===========================================
Files 126 39 -87
Lines 3300 3063 -237
Branches 803 0 -803
===========================================
- Hits 2236 1646 -590
- Misses 1064 1214 +150
- Partials 0 203 +203
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-unit-test | `53.73% <77.34%> (?)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
| [api/internal/handler/dashboard/dashboard.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGFzaGJvYXJkL2Rhc2hib2FyZC5nbw==) | `77.34% <77.34%> (ø)` | |
| [web/src/components/PluginFlow/constants.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbkZsb3cvY29uc3RhbnRzLnRz) | | |
| [web/src/components/RightContent/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1JpZ2h0Q29udGVudC9pbmRleC50c3g=) | | |
| [web/src/components/Plugin/UI/proxy-mirror.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1BsdWdpbi9VSS9wcm94eS1taXJyb3IudHN4) | | |
| [...ream/components/active-check/Healthy/Successes.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0hlYWx0aHkvU3VjY2Vzc2VzLnRzeA==) | | |
| [web/src/components/Upstream/components/Scheme.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvU2NoZW1lLnRzeA==) | | |
| [...pages/Route/components/Step1/RequestConfigView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1JlcXVlc3RDb25maWdWaWV3LnRzeA==) | | |
| [web/src/components/HeaderDropdown/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL0hlYWRlckRyb3Bkb3duL2luZGV4LnRzeA==) | | |
| [web/src/constants.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb25zdGFudHMudHM=) | | |
| ... and [156 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [fd5afe4...49847ae](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter edited a comment on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (00dd81d) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/edca223f0169cbba24d62a56f2d39b01c97756b9?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (edca223) will **decrease** coverage by `1.33%`.
> The diff coverage is `86.66%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
==========================================
- Coverage 70.04% 68.70% -1.34%
==========================================
Files 188 189 +1
Lines 7347 7467 +120
Branches 828 828
==========================================
- Hits 5146 5130 -16
- Misses 1904 2031 +127
- Partials 297 306 +9
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-e2e-test | `?` | |
| backend-e2e-test-ginkgo | `59.98% <84.16%> (+0.56%)` | :arrow_up: |
| backend-unit-test | `50.06% <75.63%> (+0.95%)` | :arrow_up: |
| frontend-e2e-test | `68.57% <ø> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `90.90% <ø> (ø)` | |
| [api/internal/handler/overview/overview.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvb3ZlcnZpZXcvb3ZlcnZpZXcuZ28=) | `86.55% <86.55%> (ø)` | |
| [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `87.50% <100.00%> (+0.32%)` | :arrow_up: |
| [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `32.11% <0.00%> (-35.41%)` | :arrow_down: |
| [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `62.00% <0.00%> (-11.00%)` | :arrow_down: |
| [api/internal/core/storage/etcd.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmFnZS9ldGNkLmdv) | `47.24% <0.00%> (-6.30%)` | :arrow_down: |
| [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `89.58% <0.00%> (-2.09%)` | :arrow_down: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [edca223...00dd81d](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz commented on a change in pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#discussion_r827016768
##########
File path: api/internal/handler/overview/overview.go
##########
@@ -0,0 +1,250 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package overview
+
+import (
+ "reflect"
+ "sort"
+
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+type Handler struct {
+ routeStore store.Interface
+ upstreamStore store.Interface
+ serverInfoStore store.Interface
+ serviceStore store.Interface
+ sslStore store.Interface
+}
+
+func NewHandler() (handler.RouteRegister, error) {
+ return &Handler{
+ routeStore: store.GetStore(store.HubKeyRoute),
+ upstreamStore: store.GetStore(store.HubKeyUpstream),
+ serverInfoStore: store.GetStore(store.HubKeyServerInfo),
+ serviceStore: store.GetStore(store.HubKeyService),
+ sslStore: store.GetStore(store.HubKeySsl),
+ }, nil
+}
+
+func (h *Handler) ApplyRoute(r *gin.Engine) {
+ r.GET("/apisix/admin/overview", wgin.Wraps(h.List,
+ wrapper.InputType(reflect.TypeOf(ListInput{}))))
+}
+
+type ListInput struct {
+}
+
+func (h *Handler) List(c droplet.Context) (interface{}, error) {
+ routerCnt, onlineRouterCnt, err := h.GetRouteCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ upstreamCnt, err := h.GetUpstreamCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ serviceCnt, err := h.GetServiceCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ certificateCnt, err := h.GetCertificateCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ plugins, err := h.GetPlugins(c)
+ if err != nil {
+ return nil, err
+ }
+
+ dashboardVersion, err := h.GetApisixVersion()
+ if err != nil {
+ return nil, err
+ }
+
+ serverInfo, err := h.GetServerInfo(c)
+ if err != nil {
+ return nil, err
+ }
+
+ res := &entity.Overview{
+ RouteCnt: routerCnt,
+ OnlineRouterCnt: onlineRouterCnt,
+ UpstreamCnt: upstreamCnt,
+ ServiceCnt: serviceCnt,
+ CertificateCnt: certificateCnt,
+ DashboardVersion: dashboardVersion,
+ GatewayInfo: serverInfo,
+ Plugins: plugins,
+ }
+
+ return res, nil
+}
+
+func (h *Handler) GetCertificateCnt(c droplet.Context) (int64, error) {
+ var certificateCnt int64 = 0
+
+ certificateRet, err := h.sslStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ certificateCnt = int64(certificateRet.TotalSize)
+ }
+
+ return certificateCnt, err
+}
+
+func (h *Handler) GetPlugins(_ droplet.Context) ([]string, error) {
+
+ plugins := conf.Schema.Get("plugins")
+
+ var res []string
+ list := plugins.Value().(map[string]interface{})
+ for name := range list {
+ res = append(res, name)
+ }
+ sort.Strings(res)
+
+ return res, nil
+}
+
+func (h *Handler) GetServerInfo(c droplet.Context) ([]*entity.ServerInfo, error) {
+ ret, err := h.serverInfoStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err != nil {
+ return nil, err
+ }
+ var res [](*entity.ServerInfo)
+
+ for _, item := range ret.Rows {
+ res = append(res, item.(*entity.ServerInfo))
+ }
+
+ return res, nil
+}
+
+func (h *Handler) GetApisixVersion() (string, error) {
+ _, version := utils.GetHashAndVersion()
+ return version, nil
+}
+
+func (h *Handler) GetRouteCnt(c droplet.Context) (int64, int64, error) {
+ var routesCnt, onlineRoutesCnt int64 = 0, 0
+
+ routesRet, err := h.routeStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ // get all routes
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ routesCnt = int64(routesRet.TotalSize)
+ }
+
+ onlineRoutesRet, err := h.routeStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ // get all the online routes
+ if int(obj.(*entity.Route).Status) == 1 {
+ return true
+ } else {
+ return false
+ }
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ onlineRoutesCnt = int64(onlineRoutesRet.TotalSize)
+ }
+
+ return routesCnt, onlineRoutesCnt, err
+}
+
+func (h *Handler) GetUpstreamCnt(c droplet.Context) (int64, error) {
+ var upstreamCnt int64 = 0
+ upstreamRet, err := h.upstreamStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ Format: func(obj interface{}) interface{} {
+ upstream := obj.(*entity.Upstream)
+ upstream.Nodes = entity.NodesFormat(upstream.Nodes)
+ return upstream
Review comment:
Do we need this?
##########
File path: api/internal/handler/overview/overview.go
##########
@@ -0,0 +1,250 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package overview
+
+import (
+ "reflect"
+ "sort"
+
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+type Handler struct {
+ routeStore store.Interface
+ upstreamStore store.Interface
+ serverInfoStore store.Interface
+ serviceStore store.Interface
+ sslStore store.Interface
+}
+
+func NewHandler() (handler.RouteRegister, error) {
+ return &Handler{
+ routeStore: store.GetStore(store.HubKeyRoute),
+ upstreamStore: store.GetStore(store.HubKeyUpstream),
+ serverInfoStore: store.GetStore(store.HubKeyServerInfo),
+ serviceStore: store.GetStore(store.HubKeyService),
+ sslStore: store.GetStore(store.HubKeySsl),
+ }, nil
+}
+
+func (h *Handler) ApplyRoute(r *gin.Engine) {
+ r.GET("/apisix/admin/overview", wgin.Wraps(h.List,
+ wrapper.InputType(reflect.TypeOf(ListInput{}))))
+}
+
+type ListInput struct {
+}
+
+func (h *Handler) List(c droplet.Context) (interface{}, error) {
+ routerCnt, onlineRouterCnt, err := h.GetRouteCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ upstreamCnt, err := h.GetUpstreamCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ serviceCnt, err := h.GetServiceCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ certificateCnt, err := h.GetCertificateCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ plugins, err := h.GetPlugins(c)
+ if err != nil {
+ return nil, err
+ }
+
+ dashboardVersion, err := h.GetApisixVersion()
+ if err != nil {
+ return nil, err
+ }
+
+ serverInfo, err := h.GetServerInfo(c)
+ if err != nil {
+ return nil, err
+ }
+
+ res := &entity.Overview{
+ RouteCnt: routerCnt,
+ OnlineRouterCnt: onlineRouterCnt,
+ UpstreamCnt: upstreamCnt,
+ ServiceCnt: serviceCnt,
+ CertificateCnt: certificateCnt,
+ DashboardVersion: dashboardVersion,
+ GatewayInfo: serverInfo,
+ Plugins: plugins,
+ }
+
+ return res, nil
+}
+
+func (h *Handler) GetCertificateCnt(c droplet.Context) (int64, error) {
+ var certificateCnt int64 = 0
+
+ certificateRet, err := h.sslStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ certificateCnt = int64(certificateRet.TotalSize)
+ }
+
+ return certificateCnt, err
+}
+
+func (h *Handler) GetPlugins(_ droplet.Context) ([]string, error) {
+
+ plugins := conf.Schema.Get("plugins")
+
+ var res []string
+ list := plugins.Value().(map[string]interface{})
+ for name := range list {
+ res = append(res, name)
+ }
+ sort.Strings(res)
+
+ return res, nil
+}
+
+func (h *Handler) GetServerInfo(c droplet.Context) ([]*entity.ServerInfo, error) {
+ ret, err := h.serverInfoStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err != nil {
+ return nil, err
+ }
+ var res [](*entity.ServerInfo)
+
+ for _, item := range ret.Rows {
+ res = append(res, item.(*entity.ServerInfo))
+ }
+
+ return res, nil
+}
+
+func (h *Handler) GetApisixVersion() (string, error) {
+ _, version := utils.GetHashAndVersion()
Review comment:
Is's a version of APISIX-Dashboard.
##########
File path: api/internal/handler/overview/overview.go
##########
@@ -0,0 +1,250 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package overview
+
+import (
+ "reflect"
+ "sort"
+
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+)
+
+type Handler struct {
+ routeStore store.Interface
+ upstreamStore store.Interface
+ serverInfoStore store.Interface
+ serviceStore store.Interface
+ sslStore store.Interface
+}
+
+func NewHandler() (handler.RouteRegister, error) {
+ return &Handler{
+ routeStore: store.GetStore(store.HubKeyRoute),
+ upstreamStore: store.GetStore(store.HubKeyUpstream),
+ serverInfoStore: store.GetStore(store.HubKeyServerInfo),
+ serviceStore: store.GetStore(store.HubKeyService),
+ sslStore: store.GetStore(store.HubKeySsl),
+ }, nil
+}
+
+func (h *Handler) ApplyRoute(r *gin.Engine) {
+ r.GET("/apisix/admin/overview", wgin.Wraps(h.List,
+ wrapper.InputType(reflect.TypeOf(ListInput{}))))
+}
+
+type ListInput struct {
+}
+
+func (h *Handler) List(c droplet.Context) (interface{}, error) {
+ routerCnt, onlineRouterCnt, err := h.GetRouteCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ upstreamCnt, err := h.GetUpstreamCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ serviceCnt, err := h.GetServiceCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ certificateCnt, err := h.GetCertificateCnt(c)
+ if err != nil {
+ return nil, err
+ }
+
+ plugins, err := h.GetPlugins(c)
+ if err != nil {
+ return nil, err
+ }
+
+ dashboardVersion, err := h.GetApisixVersion()
+ if err != nil {
+ return nil, err
+ }
+
+ serverInfo, err := h.GetServerInfo(c)
+ if err != nil {
+ return nil, err
+ }
+
+ res := &entity.Overview{
+ RouteCnt: routerCnt,
+ OnlineRouterCnt: onlineRouterCnt,
+ UpstreamCnt: upstreamCnt,
+ ServiceCnt: serviceCnt,
+ CertificateCnt: certificateCnt,
+ DashboardVersion: dashboardVersion,
+ GatewayInfo: serverInfo,
+ Plugins: plugins,
+ }
+
+ return res, nil
+}
+
+func (h *Handler) GetCertificateCnt(c droplet.Context) (int64, error) {
+ var certificateCnt int64 = 0
+
+ certificateRet, err := h.sslStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ certificateCnt = int64(certificateRet.TotalSize)
+ }
+
+ return certificateCnt, err
+}
+
+func (h *Handler) GetPlugins(_ droplet.Context) ([]string, error) {
+
+ plugins := conf.Schema.Get("plugins")
+
+ var res []string
+ list := plugins.Value().(map[string]interface{})
+ for name := range list {
+ res = append(res, name)
+ }
+ sort.Strings(res)
+
+ return res, nil
+}
+
+func (h *Handler) GetServerInfo(c droplet.Context) ([]*entity.ServerInfo, error) {
+ ret, err := h.serverInfoStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err != nil {
+ return nil, err
+ }
+ var res [](*entity.ServerInfo)
+
+ for _, item := range ret.Rows {
+ res = append(res, item.(*entity.ServerInfo))
+ }
+
+ return res, nil
+}
+
+func (h *Handler) GetApisixVersion() (string, error) {
+ _, version := utils.GetHashAndVersion()
+ return version, nil
+}
+
+func (h *Handler) GetRouteCnt(c droplet.Context) (int64, int64, error) {
+ var routesCnt, onlineRoutesCnt int64 = 0, 0
+
+ routesRet, err := h.routeStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ // get all routes
+ return true
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ routesCnt = int64(routesRet.TotalSize)
+ }
+
+ onlineRoutesRet, err := h.routeStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ // get all the online routes
+ if int(obj.(*entity.Route).Status) == 1 {
+ return true
+ } else {
+ return false
+ }
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ onlineRoutesCnt = int64(onlineRoutesRet.TotalSize)
+ }
+
+ return routesCnt, onlineRoutesCnt, err
+}
+
+func (h *Handler) GetUpstreamCnt(c droplet.Context) (int64, error) {
+ var upstreamCnt int64 = 0
+ upstreamRet, err := h.upstreamStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ Format: func(obj interface{}) interface{} {
+ upstream := obj.(*entity.Upstream)
+ upstream.Nodes = entity.NodesFormat(upstream.Nodes)
+ return upstream
+ },
+ PageSize: 0,
+ PageNumber: 0,
+ })
+
+ if err == nil {
+ upstreamCnt = int64(upstreamRet.TotalSize)
+ }
+
+ return upstreamCnt, err
+}
+
+func (h *Handler) GetServiceCnt(c droplet.Context) (int64, error) {
+ var serviceCnt int64 = 0
+
+ servicesRet, err := h.serviceStore.List(c.Context(), store.ListInput{
+ Predicate: func(obj interface{}) bool {
+ return true
+ },
+ Format: func(obj interface{}) interface{} {
+ service := obj.(*entity.Service)
+ if service.Upstream != nil && service.Upstream.Nodes != nil {
+ service.Upstream.Nodes = entity.NodesFormat(service.Upstream.Nodes)
+ }
Review comment:
Ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2a2f89c) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/fd5afe419fb24d5045e6e65c3f07f9e5d9278272?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fd5afe4) will **decrease** coverage by `13.98%`.
> The diff coverage is `77.34%`.
> :exclamation: Current head 2a2f89c differs from pull request most recent head 92414a8. Consider uploading reports for the commit 92414a8 to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
===========================================
- Coverage 67.75% 53.77% -13.99%
===========================================
Files 126 39 -87
Lines 3300 3063 -237
Branches 803 0 -803
===========================================
- Hits 2236 1647 -589
- Misses 1064 1213 +149
- Partials 0 203 +203
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-unit-test | `53.77% <77.34%> (?)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
| [api/internal/handler/dashboard/dashboard.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGFzaGJvYXJkL2Rhc2hib2FyZC5nbw==) | `77.34% <77.34%> (ø)` | |
| [web/src/pages/PluginTemplate/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9DcmVhdGUudHN4) | | |
| [...s/Upstream/components/active-check/Concurrency.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0NvbmN1cnJlbmN5LnRzeA==) | | |
| [web/src/components/Upstream/components/Retries.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvUmV0cmllcy50c3g=) | | |
| [...components/active-check/Unhealthy/HttpFailures.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL1VuaGVhbHRoeS9IdHRwRmFpbHVyZXMudHN4) | | |
| [...eb/src/components/Upstream/components/TimeUnit.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvVGltZVVuaXQudHN4) | | |
| [web/src/components/HeaderDropdown/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL0hlYWRlckRyb3Bkb3duL2luZGV4LnRzeA==) | | |
| [...ream/components/active-check/Healthy/Successes.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0hlYWx0aHkvU3VjY2Vzc2VzLnRzeA==) | | |
| [...omponents/passive-check/Unhealthy/HttpStatuses.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvcGFzc2l2ZS1jaGVjay9VbmhlYWx0aHkvSHR0cFN0YXR1c2VzLnRzeA==) | | |
| ... and [156 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [fd5afe4...92414a8](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] zaunist commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
zaunist commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1067006744
@starsz :joy: I can't contact @codewangg. And I don't have the permission to set to review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codecov-commenter commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-929735483
# [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#2152](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2a2f89c) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/fd5afe419fb24d5045e6e65c3f07f9e5d9278272?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fd5afe4) will **decrease** coverage by `13.98%`.
> The diff coverage is `77.34%`.
> :exclamation: Current head 2a2f89c differs from pull request most recent head 92414a8. Consider uploading reports for the commit 92414a8 to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #2152 +/- ##
===========================================
- Coverage 67.75% 53.77% -13.99%
===========================================
Files 126 39 -87
Lines 3300 3063 -237
Branches 803 0 -803
===========================================
- Hits 2236 1647 -589
- Misses 1064 1213 +149
- Partials 0 203 +203
```
| Flag | Coverage Δ | |
|---|---|---|
| backend-unit-test | `53.77% <77.34%> (?)` | |
| frontend-e2e-test | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <ø> (ø)` | |
| [api/internal/handler/dashboard/dashboard.go](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGFzaGJvYXJkL2Rhc2hib2FyZC5nbw==) | `77.34% <77.34%> (ø)` | |
| [web/src/pages/PluginTemplate/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9wYWdlcy9QbHVnaW5UZW1wbGF0ZS9DcmVhdGUudHN4) | | |
| [...s/Upstream/components/active-check/Concurrency.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0NvbmN1cnJlbmN5LnRzeA==) | | |
| [web/src/components/Upstream/components/Retries.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvUmV0cmllcy50c3g=) | | |
| [...components/active-check/Unhealthy/HttpFailures.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL1VuaGVhbHRoeS9IdHRwRmFpbHVyZXMudHN4) | | |
| [...eb/src/components/Upstream/components/TimeUnit.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvVGltZVVuaXQudHN4) | | |
| [web/src/components/HeaderDropdown/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL0hlYWRlckRyb3Bkb3duL2luZGV4LnRzeA==) | | |
| [...ream/components/active-check/Healthy/Successes.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvYWN0aXZlLWNoZWNrL0hlYWx0aHkvU3VjY2Vzc2VzLnRzeA==) | | |
| [...omponents/passive-check/Unhealthy/HttpStatuses.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-d2ViL3NyYy9jb21wb25lbnRzL1Vwc3RyZWFtL2NvbXBvbmVudHMvcGFzc2l2ZS1jaGVjay9VbmhlYWx0aHkvSHR0cFN0YXR1c2VzLnRzeA==) | | |
| ... and [156 more](https://codecov.io/gh/apache/apisix-dashboard/pull/2152/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [fd5afe4...92414a8](https://codecov.io/gh/apache/apisix-dashboard/pull/2152?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz commented on a change in pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
starsz commented on a change in pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#discussion_r718112966
##########
File path: api/internal/handler/dashboard/dashboard.go
##########
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package Dashboard
+
+import (
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+ "reflect"
+ "sort"
Review comment:
Need to group the import.
https://github.com/uber-go/guide/blob/master/style.md#import-group-ordering
##########
File path: api/internal/core/entity/entity.go
##########
@@ -290,3 +290,14 @@ type PluginConfig struct {
Plugins map[string]interface{} `json:"plugins"`
Labels map[string]string `json:"labels,omitempty"`
}
+
+type DashboardInfo struct {
+ RouteCnt int64 `json:"router_cnt,omitempty"`
+ OnlineRouterCnt int64 `json:"online_router_cnt,omitempty"`
+ UpstreamCnt int64 `json:"upstream_cnt,omitempty"`
+ ServiceCnt int64 `json:"service_cnt,omitempty"`
+ CertificateCnt int64 `json:"certificate_cnt,omitempty"`
+ Plugins []string `json:"plugins,omitempty"`
+ ApisixVersion string `json:"apisix_version,omitempty"`
+ ServerSummary []*ServerInfo `json:"ServerSummary,omitempty"`
Review comment:
Missing Dashboard version.
##########
File path: api/internal/handler/dashboard/dashboard.go
##########
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package Dashboard
+
+import (
+ "github.com/apisix/manager-api/internal/conf"
+ "github.com/apisix/manager-api/internal/core/entity"
+ "github.com/apisix/manager-api/internal/core/store"
+ "github.com/apisix/manager-api/internal/handler"
+ "github.com/apisix/manager-api/internal/utils"
+ "github.com/gin-gonic/gin"
+ "github.com/shiningrush/droplet"
+ "github.com/shiningrush/droplet/wrapper"
+ wgin "github.com/shiningrush/droplet/wrapper/gin"
+ "reflect"
+ "sort"
+)
+
+type Handler struct {
+ routeStore store.Interface
+ upstreamStore store.Interface
+ serverInfoStore store.Interface
+ serviceStore store.Interface
+ sslStore store.Interface
+}
+
+func NewHandler() (handler.RouteRegister, error) {
+ return &Handler{
+ routeStore: store.GetStore(store.HubKeyRoute),
+ upstreamStore: store.GetStore(store.HubKeyUpstream),
+ serverInfoStore: store.GetStore(store.HubKeyServerInfo),
+ serviceStore: store.GetStore(store.HubKeyService),
+ sslStore: store.GetStore(store.HubKeySsl),
+ }, nil
+}
+
+func (h *Handler) ApplyRoute(r *gin.Engine) {
+ r.GET("/apisix/admin/dashboard", wgin.Wraps(h.List,
Review comment:
Maybe `/apisix/admin/overview` is better ?
You can refer other systems.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] codewangg commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
codewangg commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1067060845
> Hi Bozhong, `ready to review` has been set, I am actively monitoring this stream, so please let me know if there is any other blockage by making new comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix-dashboard] starsz commented on pull request #2152: feat: added dashboard backend api for apisix status summary
Posted by GitBox <gi...@apache.org>.
starsz commented on pull request #2152:
URL: https://github.com/apache/apisix-dashboard/pull/2152#issuecomment-1066895384
> @starsz @bzp2010 Please take a look, thanks.
Need to set `ready for review`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org