Skip to content

Commit ac9aa05

Browse files
authored
386 feature request configurable page size rows per page in UI tables (#397)
* update paginator and config * update paginator and config * fix toml config * update readme * add test
1 parent 28df400 commit ac9aa05

File tree

31 files changed

+389
-171
lines changed

31 files changed

+389
-171
lines changed

README.md

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ projects, potentially resulting in undetected failed pipelines.
2525
- You won't get rate limited by the Gitlab API, due to server-side caching
2626
- Communication to the Gitlab API happens only server side
2727
- Only 1 `read only` token is needed to serve a whole team
28-
- Optionally use a `read/write` token to perform actions like restarting failed pipelines, create new pipelines or
29-
cancel pipelines.
28+
- Optionally use a `read/write` token to perform actions like restarting failed pipelines, create new pipelines or
29+
cancel pipelines.
3030

31-
## ✅ Features (DONE)
31+
## ✅ Features
3232

3333
- [x] Overview of all latest pipeline statuses within a group
3434
- [x] Overview of all pipeline statuses within a group
@@ -120,6 +120,7 @@ docker run \
120120
```
121121

122122
## 📜 Custom CA certificate
123+
123124
If you are running a gitlab instance that is using a TLS certificate signed with a private CA you are able to provide that CA as mount (PEM encoded)
124125

125126
This is needed when the dashboard backend is unable to make a connection to the gitlab API over HTTPS.
@@ -136,32 +137,49 @@ docker run \
136137
```
137138

138139
### Troubleshooting
140+
139141
If you are still unable to connect with a custom CA cert, be sure that the gitlab server certificate contains a valid SAN (Subject Alternative Name)
140142

141143
If there is a mismatch the HTTP client is still unable to make a proper connection.
142144

145+
## 🔀 Reverse proxy
146+
147+
Below is a working config for a `Caddy` reverse proxy server to serve the dashboard on a different path.
148+
149+
```bash
150+
:80 {
151+
handle_path /my-custom-path* {
152+
reverse_proxy gitlab-ci-dashboard:8080
153+
}
154+
}
155+
```
156+
157+
The dashboard should now be available at: https://example.com/my-custom-path
158+
143159
## 🌍 Environment variables
144160

145-
| Variable | Type | Description | Required | Default |
146-
|-----------------------------------|--------|------------------------------------------------------------------------------------------------------------------------------------|----------|--------------|
147-
| GITLAB_BASE_URL | string | The base url to the Gitlab server (e.g: https://gitlab.com) | yes | |
148-
| GITLAB_API_TOKEN | string | A readonly or read/write access token generated in Gitlab (see: https://gitlab.com/-/profile/personal_access_tokens) | yes | |
149-
| GITLAB_GROUP_ONLY_IDS | string | Provide a comma seperated string of group ids which will only be displayed (e.g: 123,789,888) | no | |
150-
| GITLAB_GROUP_SKIP_IDS | string | Provide a comma seperated string of group ids which will be ignored (e.g: 123,789,888) | no | |
151-
| GITLAB_GROUP_ONLY_TOP_LEVEL | bool | Show only top level groups, projects in sub groups will be shown inside the top level groups (see: GITLAB_GROUP_INCLUDE_SUBGROUPS) | no | true |
152-
| GITLAB_GROUP_INCLUDE_SUBGROUPS | bool | Whether to include subgroup projects whenever projects are fetched for a specific group | no | true |
153-
| GITLAB_GROUP_CACHE_TTL_SECONDS | int | Expire after write time in seconds for groups (cache) | no | 300 |
154-
| GITLAB_PROJECT_SKIP_IDS | string | Provide a comma seperated string of project ids which will be ignored (e.g: 123,789,888) | no | |
155-
| GITLAB_PROJECT_CACHE_TTL_SECONDS | int | Expire after write time in seconds for projects (cache) | no | 300 |
156-
| GITLAB_PIPELINE_CACHE_TTL_SECONDS | int | Expire after write time in seconds for pipelines (cache) | no | 5 |
157-
| GITLAB_PIPELINE_HISTORY_DAYS | int | How far back in time (days), it should fetch pipelines from gitlab (pipelines tab only) | no | 5 |
158-
| GITLAB_BRANCH_CACHE_TTL_SECONDS | int | Expire after write time in seconds for branches (cache) | no | 60 |
159-
| GITLAB_SCHEDULE_CACHE_TTL_SECONDS | int | Expire after write time in seconds for schedules (cache) | no | 300 |
160-
| GITLAB_JOB_CACHE_TTL_SECONDS | int | Expire after write time in seconds for jobs (cache) | no | 5 |
161-
| GITLAB_ARTIFACT_CACHE_TTL_SECONDS | int | Expire after write time in seconds for artifacts (cache) | no | 1800 |
162-
| API_READ_ONLY | bool | If true, you are not able to perform 'write' operations like retrying a pipeline | no | true |
163-
| UI_HIDE_WRITE_ACTIONS | bool | If true, the ellipsis action button (...) is hidden, handy if you want to use this application in read-only mode | no | false |
164-
| SERVER_LISTEN_IP | string | The IP address where the web server should listen on | no | 0.0.0.0 |
165-
| SERVER_LISTEN_PORT | int | The port where the web server should listen on | no | 8080 |
166-
| SERVER_WORKER_COUNT | int | The amount of worker threads the web server should have | no | CPU specific |
167-
| RUST_LOG | string | The log level of the application, set to "debug" to enable debug logging | no | info |
161+
| Variable | Type | Description | Required | Default |
162+
| --------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------- |
163+
| GITLAB_BASE_URL | string | The base url to the Gitlab server (e.g: https://gitlab.com) | yes | |
164+
| GITLAB_API_TOKEN | string | A readonly or read/write access token generated in Gitlab (see: https://gitlab.com/-/profile/personal_access_tokens) | yes | |
165+
| GITLAB_GROUP_ONLY_IDS | string | Provide a comma seperated string of group ids which will only be displayed (e.g: 123,789,888) | no | |
166+
| GITLAB_GROUP_SKIP_IDS | string | Provide a comma seperated string of group ids which will be ignored (e.g: 123,789,888) | no | |
167+
| GITLAB_GROUP_ONLY_TOP_LEVEL | bool | Show only top level groups, projects in sub groups will be shown inside the top level groups (see: GITLAB_GROUP_INCLUDE_SUBGROUPS) | no | true |
168+
| GITLAB_GROUP_INCLUDE_SUBGROUPS | bool | Whether to include subgroup projects whenever projects are fetched for a specific group | no | true |
169+
| GITLAB_GROUP_CACHE_TTL_SECONDS | int | Expire after write time in seconds for groups (cache) | no | 300 |
170+
| GITLAB_PROJECT_SKIP_IDS | string | Provide a comma seperated string of project ids which will be ignored (e.g: 123,789,888) | no | |
171+
| GITLAB_PROJECT_CACHE_TTL_SECONDS | int | Expire after write time in seconds for projects (cache) | no | 300 |
172+
| GITLAB_PIPELINE_CACHE_TTL_SECONDS | int | Expire after write time in seconds for pipelines (cache) | no | 5 |
173+
| GITLAB_PIPELINE_HISTORY_DAYS | int | How far back in time (days), it should fetch pipelines from gitlab (pipelines tab only) | no | 5 |
174+
| GITLAB_BRANCH_CACHE_TTL_SECONDS | int | Expire after write time in seconds for branches (cache) | no | 60 |
175+
| GITLAB_SCHEDULE_CACHE_TTL_SECONDS | int | Expire after write time in seconds for schedules (cache) | no | 300 |
176+
| GITLAB_JOB_CACHE_TTL_SECONDS | int | Expire after write time in seconds for jobs (cache) | no | 5 |
177+
| GITLAB_ARTIFACT_CACHE_TTL_SECONDS | int | Expire after write time in seconds for artifacts (cache) | no | 1800 |
178+
| API_READ_ONLY | bool | If true, you are not able to perform 'write' operations like retrying a pipeline | no | true |
179+
| UI_HIDE_WRITE_ACTIONS | bool | If true, the ellipsis action button (...) is hidden, handy if you want to use this application in read-only mode | no | false |
180+
| UI_PAGE_SIZE_OPTIONS | string | Provide a comma seperated string of page sizes. This is the dropdown of available page sizes inside the paginator of the tables | no | 10,20,30,40,50 |
181+
| UI_DEFAULT_PAGE_SIZE | int | The default page size which should be selected for the paginator | no | 10 |
182+
| SERVER_LISTEN_IP | string | The IP address where the web server should listen on | no | 0.0.0.0 |
183+
| SERVER_LISTEN_PORT | int | The port where the web server should listen on | no | 8080 |
184+
| SERVER_WORKER_COUNT | int | The amount of worker threads the web server should have | no | CPU specific |
185+
| RUST_LOG | string | The log level of the application, set to "debug" to enable debug logging | no | info |

api/Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ reqwest = { version = "0.12.26", features = ["json", "rustls-tls"] }
2121
tokio = { version = "1.48.0", features = ["sync"] }
2222
async-trait = "0.1.89"
2323
futures = "0.3.31"
24-
toml = "0.9.8"
24+
toml = "0.9.9"
2525

2626
[dev-dependencies]
2727
serial_test = "3.2.0"

api/config.example.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
# only gitlab section is mandatory
12
[gitlab]
23
url = "https://gitlab.com"
34
token = "your-token-here"
45

6+
# optional
57
[server]
68
ip = "0.0.0.0"
79
port = 8080
810
workers = 4
911

12+
# optional
1013
[cache]
1114
ttl_group_seconds = 300
1215
ttl_project_seconds = 300
@@ -16,18 +19,24 @@ ttl_pipeline_seconds = 5
1619
ttl_schedule_seconds = 300
1720
ttl_artifact_seconds = 1800
1821

22+
# optional
1923
[pipeline]
2024
history_days = 5
2125

26+
# optional
2227
[project]
2328
skip_ids = []
2429

30+
# optional
2531
[group]
2632
only_ids = []
2733
skip_ids = []
2834
only_top_level = true
2935
include_subgroups = true
3036

37+
# optional
3138
[ui]
3239
read_only = true
33-
hide_write_actions = false
40+
hide_write_actions = false
41+
page_size_options = [10, 20, 30, 40, 50]
42+
default_page_size = 10

0 commit comments

Comments
 (0)