Commit 0939fc27 authored by Mustafa Gezen's avatar Mustafa Gezen 🏗
Browse files

add direct links to koji and gitlab

parent 0418dbad
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="mustafa@bycrates.com"
CORRECT_NAME="Mustafa Gezen"
CORRECT_EMAIL="mustafa@rockylinux.org"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_AUTHOR_NAME="$CORRECT_NAME"
export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags
......@@ -12,7 +12,7 @@ from distrobuild import settings
from distrobuild.routes import register_routes
# init sessions
import distrobuild.session
from distrobuild import session
app = FastAPI()
app.mount("/static/files", StaticFiles(directory="ui/dist/files"), name="static")
......@@ -22,7 +22,11 @@ templates = Jinja2Templates(directory="ui/dist/templates")
@app.get("/{full_path:path}", response_class=HTMLResponse, include_in_schema=False)
async def serve_frontend(request: Request):
return templates.TemplateResponse("index.html", {"request": request})
return templates.TemplateResponse("index.html", {
"request": request,
"koji_weburl": session.koji_config.get("weburl"),
"gitlab_url": f"https://{settings.settings.gitlab_host}{settings.settings.repo_prefix}"
})
register_tortoise(
app,
......
......@@ -6,5 +6,9 @@
</head>
<body>
<div id="root"></div>
<script>
window.SETTINGS = {'kojiWeburl': '{{ koji_weburl}}', 'gitlabUrl': '{{ gitlab_url }}'};
</script>
</body>
</html>
\ No newline at end of file
......@@ -24,6 +24,7 @@ export interface IImport {
id: string;
created_at: string;
status: string;
commit: string;
_package: IPackage;
}
......
......@@ -78,7 +78,14 @@ export const Dashboard = () => {
{new Date(item.created_at).toLocaleString()}
</TableCell>
<TableCell>{item.package.name}</TableCell>
<TableCell>{item.koji_id}</TableCell>
<TableCell>
<Link
target="_blank"
href={`${window.SETTINGS.kojiWeburl}/taskinfo?taskID=${item.koji_id}`}
>
{item.koji_id}
</Link>
</TableCell>
<TableCell>{statusToTag(item.status)}</TableCell>
</TableRow>
))}
......@@ -113,9 +120,18 @@ export const Dashboard = () => {
<TableCell>{item._package.name}</TableCell>
<TableCell>{statusToTag(item.status)}</TableCell>
<TableCell>
<Link href={`/api/build/imports/${item.id}/logs`}>
<Link
style={{ marginRight: '10px' }}
href={`/api/build/imports/${item.id}/logs`}
>
Logs
</Link>
<Link
target="_blank"
href={`${window.SETTINGS.gitlabUrl}/rpms/${item._package.name}/-/commit/${item.commit}`}
>
GitLab commit
</Link>
</TableCell>
</TableRow>
))}
......
export {};
declare global {
interface Window {
SETTINGS: any;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment