added proxmox power button plugin 0.1

This commit is contained in:
2026-08-05 04:46:26 +02:00
parent 28fa9afa28
commit c8f5baedde
15 changed files with 817 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2026 Bryan Joshua Pedini
from netbox.plugins import PluginTemplateExtension
class VMPowerButtons(PluginTemplateExtension):
"""
Inject start/stop/reboot buttons into the VM detail page button bar.
Rendered via {% plugin_buttons %} in generic/object.html, which sits in the
`controls` block *before* `extra_controls` (where "Add Components" lives) —
so these land to the left of it, as required.
"""
models = ['virtualization.virtualmachine']
def buttons(self):
return self.render('proxmox_power_button/vm_power_buttons.html')
template_extensions = [VMPowerButtons]