mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 14:51:43 +00:00
fix interaction with web
This commit is contained in:
@ -58,6 +58,8 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<h1>ahriman {{ version|e }}</h1>
|
||||||
|
|
||||||
<table class="sortable" id="builds">
|
<table class="sortable" id="builds">
|
||||||
<tr>
|
<tr>
|
||||||
<th>package base</th>
|
<th>package base</th>
|
||||||
|
@ -79,10 +79,12 @@ class WebClient(Client):
|
|||||||
|
|
||||||
payload: Dict[str, Any] = {
|
payload: Dict[str, Any] = {
|
||||||
'status': status.value,
|
'status': status.value,
|
||||||
'base': package.base,
|
'package': {
|
||||||
'packages': [p for p in package.packages],
|
'base': package.base,
|
||||||
'version': package.version,
|
'packages': [p for p in package.packages],
|
||||||
'url': package.web_url
|
'version': package.version,
|
||||||
|
'aur_url': package.aur_url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
from aiohttp_jinja2 import template
|
from aiohttp_jinja2 import template
|
||||||
from typing import Any, Dict
|
from typing import Any, Dict
|
||||||
|
|
||||||
|
import ahriman.version as version
|
||||||
|
|
||||||
from ahriman.web.views.base import BaseView
|
from ahriman.web.views.base import BaseView
|
||||||
|
|
||||||
|
|
||||||
@ -43,4 +45,5 @@ class IndexView(BaseView):
|
|||||||
'architecture': self.service.architecture,
|
'architecture': self.service.architecture,
|
||||||
'packages': packages,
|
'packages': packages,
|
||||||
'repository': self.service.repository.name,
|
'repository': self.service.repository.name,
|
||||||
|
'version': version.__version__,
|
||||||
}
|
}
|
@ -37,7 +37,7 @@ class PackageView(BaseView):
|
|||||||
data = await self.request.json()
|
data = await self.request.json()
|
||||||
|
|
||||||
package = Package(**data['package']) if 'package' in data else None
|
package = Package(**data['package']) if 'package' in data else None
|
||||||
status = BuildStatusEnum(data.get('status', 'unknown'))
|
status = BuildStatusEnum(data['status'])
|
||||||
self.service.update(base, status, package)
|
self.service.update(base, status, package)
|
||||||
|
|
||||||
return HTTPOk()
|
return HTTPOk()
|
||||||
|
Reference in New Issue
Block a user