diff options
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | cgit.c | 6 | ||||
| -rw-r--r-- | cgit.css | 77 | ||||
| -rw-r--r-- | cgit.h | 3 | ||||
| -rw-r--r-- | cgitrc.5.txt | 8 | ||||
| -rw-r--r-- | cmd.c | 10 | ||||
| -rw-r--r-- | shared.c | 1 | ||||
| -rw-r--r-- | ui-shared.c | 3 | ||||
| -rw-r--r-- | ui-stats.c | 380 | ||||
| -rw-r--r-- | ui-stats.h | 8 |
10 files changed, 497 insertions, 0 deletions
| @@ -68,6 +68,7 @@ OBJECTS += ui-refs.o | |||
| 68 | OBJECTS += ui-repolist.o | 68 | OBJECTS += ui-repolist.o |
| 69 | OBJECTS += ui-shared.o | 69 | OBJECTS += ui-shared.o |
| 70 | OBJECTS += ui-snapshot.o | 70 | OBJECTS += ui-snapshot.o |
| 71 | OBJECTS += ui-stats.o | ||
| 71 | OBJECTS += ui-summary.o | 72 | OBJECTS += ui-summary.o |
| 72 | OBJECTS += ui-tag.o | 73 | OBJECTS += ui-tag.o |
| 73 | OBJECTS += ui-tree.o | 74 | OBJECTS += ui-tree.o |
| @@ -54,6 +54,8 @@ void config_cb(const char *name, const char *value) | |||
| 54 | ctx.cfg.enable_log_filecount = atoi(value); | 54 | ctx.cfg.enable_log_filecount = atoi(value); |
| 55 | else if (!strcmp(name, "enable-log-linecount")) | 55 | else if (!strcmp(name, "enable-log-linecount")) |
| 56 | ctx.cfg.enable_log_linecount = atoi(value); | 56 | ctx.cfg.enable_log_linecount = atoi(value); |
| 57 | else if (!strcmp(name, "enable-stats")) | ||
| 58 | ctx.cfg.enable_stats = atoi(value); | ||
| 57 | else if (!strcmp(name, "cache-size")) | 59 | else if (!strcmp(name, "cache-size")) |
| 58 | ctx.cfg.cache_size = atoi(value); | 60 | ctx.cfg.cache_size = atoi(value); |
| 59 | else if (!strcmp(name, "cache-root")) | 61 | else if (!strcmp(name, "cache-root")) |
| @@ -112,6 +114,8 @@ void config_cb(const char *name, const char *value) | |||
| 112 | ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); | 114 | ctx.repo->enable_log_filecount = ctx.cfg.enable_log_filecount * atoi(value); |
| 113 | else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount")) | 115 | else if (ctx.repo && !strcmp(name, "repo.enable-log-linecount")) |
| 114 | ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); | 116 | ctx.repo->enable_log_linecount = ctx.cfg.enable_log_linecount * atoi(value); |
| 117 | else if (ctx.repo && !strcmp(name, "repo.enable-stats")) | ||
| 118 | ctx.repo->enable_stats = ctx.cfg.enable_stats && atoi(value); | ||
| 115 | else if (ctx.repo && !strcmp(name, "repo.module-link")) | 119 | else if (ctx.repo && !strcmp(name, "repo.module-link")) |
| 116 | ctx.repo->module_link= xstrdup(value); | 120 | ctx.repo->module_link= xstrdup(value); |
| 117 | else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) { | 121 | else if (ctx.repo && !strcmp(name, "repo.readme") && value != NULL) { |
| @@ -154,6 +158,8 @@ static void querystring_cb(const char *name, const char *value) | |||
| 154 | ctx.qry.name = xstrdup(value); | 158 | ctx.qry.name = xstrdup(value); |
| 155 | } else if (!strcmp(name, "mimetype")) { | 159 | } else if (!strcmp(name, "mimetype")) { |
| 156 | ctx.qry.mimetype = xstrdup(value); | 160 | ctx.qry.mimetype = xstrdup(value); |
| 161 | } else if (!strcmp(name, "period")) { | ||
| 162 | ctx.qry.period = xstrdup(value); | ||
| 157 | } | 163 | } |
| 158 | } | 164 | } |
| 159 | 165 | ||
| @@ -456,3 +456,80 @@ div.footer { | |||
| 456 | font-size: 80%; | 456 | font-size: 80%; |
| 457 | color: #ccc; | 457 | color: #ccc; |
| 458 | } | 458 | } |
| 459 | table.stats { | ||
| 460 | border: solid 1px black; | ||
| 461 | border-collapse: collapse; | ||
| 462 | } | ||
| 463 | |||
| 464 | table.stats th { | ||
| 465 | text-align: left; | ||
| 466 | padding: 1px 0.5em; | ||
| 467 | background-color: #eee; | ||
| 468 | border: solid 1px black; | ||
| 469 | } | ||
| 470 | |||
| 471 | table.stats td { | ||
| 472 | text-align: right; | ||
| 473 | padding: 1px 0.5em; | ||
| 474 | border: solid 1px black; | ||
| 475 | } | ||
| 476 | |||
| 477 | table.stats td.total { | ||
| 478 | font-weight: bold; | ||
| 479 | text-align: left; | ||
| 480 | } | ||
| 481 | |||
| 482 | table.stats td.sum { | ||
| 483 | color: #c00; | ||
| 484 | font-weight: bold; | ||
| 485 | /* background-color: #eee; */ | ||
| 486 | } | ||
| 487 | |||
| 488 | table.stats td.left { | ||
| 489 | text-align: left; | ||
| 490 | } | ||
| 491 | |||
| 492 | table.vgraph { | ||
| 493 | border-collapse: separate; | ||
| 494 | border: solid 1px black; | ||
| 495 | height: 200px; | ||
| 496 | } | ||
| 497 | |||
| 498 | table.vgraph th { | ||
| 499 | background-color: #eee; | ||
| 500 | font-weight: bold; | ||
| 501 | border: solid 1px white; | ||
| 502 | padding: 1px 0.5em; | ||
| 503 | } | ||
| 504 | |||
| 505 | table.vgraph td { | ||
| 506 | vertical-align: bottom; | ||
| 507 | padding: 0px 10px; | ||
| 508 | } | ||
| 509 | |||
| 510 | table.vgraph div.bar { | ||
| 511 | background-color: #eee; | ||
| 512 | } | ||
| 513 | |||
| 514 | table.hgraph { | ||
| 515 | border: solid 1px black; | ||
| 516 | width: 800px; | ||
| 517 | } | ||
| 518 | |||
| 519 | table.hgraph th { | ||
| 520 | background-color: #eee; | ||
| 521 | font-weight: bold; | ||
| 522 | border: solid 1px black; | ||
| 523 | padding: 1px 0.5em; | ||
| 524 | } | ||
| 525 | |||
| 526 | table.hgraph td { | ||
| 527 | vertical-align: center; | ||
| 528 | padding: 2px 2px; | ||
| 529 | } | ||
| 530 | |||
| 531 | table.hgraph div.bar { | ||
| 532 | background-color: #eee; | ||
| 533 | height: 1em; | ||
| 534 | } | ||
| 535 | |||
| @@ -61,6 +61,7 @@ struct cgit_repo { | |||
| 61 | int snapshots; | 61 | int snapshots; |
| 62 | int enable_log_filecount; | 62 | int enable_log_filecount; |
| 63 | int enable_log_linecount; | 63 | int enable_log_linecount; |
| 64 | int enable_stats; | ||
| 64 | }; | 65 | }; |
| 65 | 66 | ||
| 66 | struct cgit_repolist { | 67 | struct cgit_repolist { |
| @@ -119,6 +120,7 @@ struct cgit_query { | |||
| 119 | char *name; | 120 | char *name; |
| 120 | char *mimetype; | 121 | char *mimetype; |
| 121 | char *url; | 122 | char *url; |
| 123 | char *period; | ||
| 122 | int ofs; | 124 | int ofs; |
| 123 | int nohead; | 125 | int nohead; |
| 124 | }; | 126 | }; |
| @@ -151,6 +153,7 @@ struct cgit_config { | |||
| 151 | int enable_index_links; | 153 | int enable_index_links; |
| 152 | int enable_log_filecount; | 154 | int enable_log_filecount; |
| 153 | int enable_log_linecount; | 155 | int enable_log_linecount; |
| 156 | int enable_stats; | ||
| 154 | int local_time; | 157 | int local_time; |
| 155 | int max_repo_count; | 158 | int max_repo_count; |
| 156 | int max_commit_count; | 159 | int max_commit_count; |
diff --git a/cgitrc.5.txt b/cgitrc.5.txt index 7887b02..60d3ea4 100644 --- a/cgitrc.5.txt +++ b/cgitrc.5.txt | |||
| @@ -74,6 +74,10 @@ enable-log-linecount | |||
| 74 | and removed lines for each commit on the repository log page. Default | 74 | and removed lines for each commit on the repository log page. Default |
| 75 | value: "0". | 75 | value: "0". |
| 76 | 76 | ||
| 77 | enable-stats | ||
