File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed
Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ func RecentCommits(ctx *context.Context) {
2222
2323 ctx .Data ["PageIsActivity" ] = true
2424 ctx .Data ["PageIsRecentCommits" ] = true
25- ctx .PageData ["repoLink" ] = ctx .Repo .RepoLink
2625
2726 ctx .HTML (http .StatusOK , tplRecentCommits )
2827}
Original file line number Diff line number Diff line change 44 data-locale-loading-title-failed="{{ctx.Locale.Tr "graphs.component_loading_failed" (ctx.Locale.Tr "graphs.recent_commits.what")}}"
55 data-locale-loading-info="{{ctx.Locale.Tr "graphs.component_loading_info"}}"
66 data-locale-component-failed-to-load="{{ctx.Locale.Tr "graphs.component_failed_to_load"}}"
7+ data-repo-link="{{ctx.Repo.RepoLink}}"
78 >
89 </div>
910{{end}}
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ import {chartJsColors} from '../utils/color.js';
1818import {sleep } from ' ../utils.js' ;
1919import ' chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm' ;
2020
21- const {pageData } = window .config ;
22-
2321Chart .defaults .color = chartJsColors .text ;
2422Chart .defaults .borderColor = chartJsColors .border ;
2523
@@ -37,11 +35,14 @@ export default {
3735 type: Object ,
3836 required: true
3937 },
38+ repoLink: {
39+ type: String ,
40+ required: true
41+ }
4042 },
4143 data : () => ({
4244 isLoading: false ,
4345 errorText: ' ' ,
44- repoLink: pageData .repoLink || [],
4546 data: [],
4647 }),
4748 mounted () {
@@ -53,7 +54,7 @@ export default {
5354 try {
5455 let response;
5556 do {
56- response = await GET (` ${ this . repoLink } /activity/recent-commits/data` );
57+ response = await GET (` ${ repoLink} /activity/recent-commits/data` );
5758 if (response .status === 202 ) {
5859 await sleep (1000 ); // wait for 1 second before retrying
5960 }
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ export async function initRepoRecentCommits() {
1111 loadingTitle : el . getAttribute ( 'data-locale-loading-title' ) ,
1212 loadingTitleFailed : el . getAttribute ( 'data-locale-loading-title-failed' ) ,
1313 loadingInfo : el . getAttribute ( 'data-locale-loading-info' ) ,
14- }
14+ } ,
15+ repoLink : el . getAttribute ( 'data-repo-link' )
1516 } ) ;
1617 View . mount ( el ) ;
1718 } catch ( err ) {
You can’t perform that action at this time.
0 commit comments