{* Server Actions dispatcher.
   Page controller resolves the server's type and assigns $server_type so we
   can include the right per-type template. Each type has its own UI:
     web  → server_actions_web.tpl
     mail → server_actions_mail.tpl
     dns  → server_actions_dns.tpl
   URL: &page=server_actions&server_id=X *}

{if $server_type == 'web'}
    {include file="$dir/templates/server_actions_web.tpl"}
{elseif $server_type == 'mail'}
    {include file="$dir/templates/server_actions_mail.tpl"}
{elseif $server_type == 'dns'}
    {* Driver-aware DNS server actions: HestiaCP DNS reuses the full
       Hestia panel surface; PowerDNS gets a slim HTTP-API-only view. *}
    {if $server_driver == 'powerdns'}
        {include file="$dir/templates/server_actions_dns_powerdns.tpl"}
    {else}
        {include file="$dir/templates/server_actions_dns.tpl"}
    {/if}
{else}
    <div class="alert alert-danger">
        <i class="fa fa-exclamation-triangle"></i>
        <strong>Server not found</strong> — the URL parameter <code>server_id</code> is missing or points to a non-existent server.
        <a href="{$meta.admin_module_url}&amp;page=web_servers" class="puq-nav-link">Back to web servers</a>
    </div>
{/if}
