show tasks/schedules for blueprints and ssf provider
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
@ -136,14 +136,3 @@ class Task(SerializerModel, TaskBase):
|
||||
|
||||
def error(self, message: str | Exception, save: bool = False, **attributes):
|
||||
self.log(self.uid, TaskStatus.ERROR, message, save=save, **attributes)
|
||||
|
||||
|
||||
class TasksModel(models.Model):
|
||||
tasks = GenericRelation(
|
||||
Task,
|
||||
content_type_field="rel_obj_content_type",
|
||||
object_id_field="rel_obj_id",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
|
@ -6,7 +6,6 @@ from django.utils.translation import gettext_lazy as _
|
||||
from django_dramatiq_postgres.models import ScheduleBase
|
||||
|
||||
from authentik.lib.models import SerializerModel
|
||||
from authentik.tasks.models import TasksModel
|
||||
from authentik.tasks.schedules.lib import ScheduleSpec
|
||||
|
||||
|
||||
@ -37,7 +36,7 @@ class Schedule(SerializerModel, ScheduleBase):
|
||||
return ScheduleSerializer
|
||||
|
||||
|
||||
class ScheduledModel(TasksModel, models.Model):
|
||||
class ScheduledModel(models.Model):
|
||||
schedules = GenericRelation(
|
||||
Schedule, content_type_field="rel_obj_content_type", object_id_field="rel_obj_id"
|
||||
)
|
||||
|
@ -1,5 +1,6 @@
|
||||
import "@goauthentik/admin/blueprints/BlueprintForm";
|
||||
import "@goauthentik/admin/rbac/ObjectPermissionModal";
|
||||
import "@goauthentik/admin/system-tasks/TaskList";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { EVENT_REFRESH } from "@goauthentik/common/constants";
|
||||
import { formatElapsedTime } from "@goauthentik/common/temporal";
|
||||
@ -23,6 +24,7 @@ import {
|
||||
BlueprintInstance,
|
||||
BlueprintInstanceStatusEnum,
|
||||
ManagedApi,
|
||||
ModelEnum,
|
||||
RbacPermissionsAssignedByUsersListModelEnum,
|
||||
} from "@goauthentik/api";
|
||||
|
||||
@ -109,7 +111,8 @@ export class BlueprintListPage extends TablePage<BlueprintInstance> {
|
||||
}
|
||||
|
||||
renderExpanded(item: BlueprintInstance): TemplateResult {
|
||||
return html`<td role="cell" colspan="4">
|
||||
const [appLabel, modelName] = ModelEnum.AuthentikBlueprintsBlueprintinstance.split(".");
|
||||
return html`<td role="cell" colspan="5">
|
||||
<div class="pf-c-table__expandable-row-content">
|
||||
<dl class="pf-c-description-list pf-m-horizontal">
|
||||
<div class="pf-c-description-list__group">
|
||||
@ -123,6 +126,22 @@ export class BlueprintListPage extends TablePage<BlueprintInstance> {
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<dl class="pf-c-description-list pf-m-horizontal">
|
||||
<div class="pf-c-description-list__group">
|
||||
<dt class="pf-c-description-list__term">
|
||||
<span class="pf-c-description-list__text">${msg("Tasks")}</span>
|
||||
</dt>
|
||||
<dd class="pf-c-description-list__description">
|
||||
<div class="pf-c-description-list__text">
|
||||
<ak-task-list
|
||||
.relObjAppLabel=${appLabel}
|
||||
.relObjModel=${modelName}
|
||||
.relObjId="${item.pk}"
|
||||
></ak-task-list>
|
||||
</div>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</td>`;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import "@goauthentik/admin/providers/RelatedApplicationButton";
|
||||
import "@goauthentik/admin/providers/ssf/SSFProviderFormPage";
|
||||
import "@goauthentik/admin/providers/ssf/StreamTable";
|
||||
import "@goauthentik/admin/system-tasks/TaskList";
|
||||
import { DEFAULT_CONFIG } from "@goauthentik/common/api/config";
|
||||
import { EVENT_REFRESH } from "@goauthentik/common/constants";
|
||||
import "@goauthentik/components/events/ObjectChangelog";
|
||||
@ -28,6 +29,7 @@ import PFGrid from "@patternfly/patternfly/layouts/Grid/grid.css";
|
||||
import PFBase from "@patternfly/patternfly/patternfly-base.css";
|
||||
|
||||
import {
|
||||
ModelEnum,
|
||||
ProvidersApi,
|
||||
RbacPermissionsAssignedByUsersListModelEnum,
|
||||
SSFProvider,
|
||||
@ -109,6 +111,7 @@ export class SSFProviderViewPage extends AKElement {
|
||||
if (!this.provider) {
|
||||
return html``;
|
||||
}
|
||||
const [appLabel, modelName] = ModelEnum.AuthentikProvidersSsfSsfprovider.split(".");
|
||||
return html`<div slot="header" class="pf-c-banner pf-m-info">
|
||||
${msg("SSF Provider is in preview.")}
|
||||
<a href="mailto:hello+feature/ssf@goauthentik.io">${msg("Send us feedback!")}</a>
|
||||
@ -166,6 +169,14 @@ export class SSFProviderViewPage extends AKElement {
|
||||
<ak-provider-ssf-stream-list .providerId=${this.providerID}>
|
||||
</ak-provider-ssf-stream-list>
|
||||
</div>
|
||||
<div class="pf-c-card pf-l-grid__item pf-m-12-col-on-2xl">
|
||||
<div class="pf-c-card__title">${msg("Tasks")}</div>
|
||||
<ak-task-list
|
||||
.relObjAppLabel=${appLabel}
|
||||
.relObjModel=${modelName}
|
||||
.relObjId="${this.provider.pk}"
|
||||
></ak-task-list>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user