Improve artifact availability UX
This commit is contained in:
@@ -83,12 +83,16 @@ class PluginDetailView(StorePermissionMixin, View):
|
||||
except StoreClientError as exc:
|
||||
raise Http404(redact_text(exc)) from exc
|
||||
state = _plugin_state(plugin, set(django_settings.PLUGINS))
|
||||
installable_releases = plugin.installable_releases(
|
||||
runtime.netbox_version,
|
||||
require_approval_marker=runtime.execution_mode == "agent",
|
||||
)
|
||||
actions: list[str] = []
|
||||
if not state["installed"]:
|
||||
if plugin.approved:
|
||||
if plugin.approved and installable_releases:
|
||||
actions.append("install")
|
||||
else:
|
||||
if plugin.approved:
|
||||
if plugin.approved and installable_releases:
|
||||
actions.append("update")
|
||||
if state["enabled"]:
|
||||
actions.append("disable")
|
||||
@@ -107,7 +111,9 @@ class PluginDetailView(StorePermissionMixin, View):
|
||||
"state": state,
|
||||
"actions": actions,
|
||||
"releases": releases,
|
||||
"has_installable_release": bool(installable_releases),
|
||||
"local_status": local_status,
|
||||
"runtime": runtime,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user