# 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]