Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/menu/main.tmpl

[% USE Whostmgr;
   USE JSON;
   USE EasyApache;
   USE VarCache;
   USE NVData;
   USE ServerRoles;
   USE Mysql;
   USE WhostmgrMain;
   USE CpanelOS ('can_be_elevated', 'can_elevate_to', 'major', 'pretty_distro');
%]
[%
    DEFAULT app_key = 'home';
    SET has_component_system = template_exists("/usr/local/cpanel/whostmgr/docroot/templates/master_templates/component.html.tt");
    IF has_component_system;
        USE Components;
    END;
    SET has_analytics = template_exists("/var/cpanel/customizations/whm/includes/cp_analytics_whm.html.tt");
    IF has_analytics;
        USE UIAnalytics;
    END;

    varcache.set('checkacl_all',Whostmgr.checkacl('all'));
    varcache.set('dnsonly',Whostmgr.dnsonly());

    varcache.set('server_analytics_setting',CPANEL.is_server_analytics_enabled());
    varcache.set('user_consent_analytics_setting',(NVData.get('analytics', undef, 0, 'whm') == "on"));

    SET checkacl_all = varcache.checkacl_all,
        dnsonly      = varcache.dnsonly,
        hide_important_next_steps = NVData.get("home:hide_important_next_steps"),
        hide_horde_deprecation_banner = NVData.get("home:hide_horde_deprecation_banner"),
        isa_email_error = data.item('isa:contact_email_save_error'),
        isa_nameserver_error = data.item('isa:nameservers_save_error'),
        nvDataNavigationState = NVData.get("whmcommand:navigation"), # Collapsed = 1, Expanded = 0
        expanded_groups = NVData.get("toggle-status", "home-tools-toggle-status"),
        hideAdditionalApps = nvDataNavigationState == "1" ? 0 : 1;

        # Notes:
        # 1) NVData.get() returns a string of length 0 when it cant find the property, not undef.
        # 2) NVData.get() returns /1 or /0 if the cache is missing, and a JSON::PP::Boolean otherwise.
        showFavoritesDescriptions = to_boolean(NVData.get('showFavoritesDescriptions'));

    IF !showFavoritesDescriptions.length();
        showFavoritesDescriptions = 1;
    ELSE;
        showFavoritesDescriptions = showFavoritesDescriptions ? 1 : 0;
    END;

    SET top_tools = data.top_tools;

    SET nameserver = Whostmgr.check_flag('CPCONF=local_nameserver_type').lower,
        nameserverConfigLink = cp_security_token _ '/scripts/nameserverconfig';

    SET whm_variables = Whostmgr.template_vars;

    SET license_type = CPANEL.get_producttype();
    IF Whostmgr.has_license_flag('dev');
        license_type = license_type _ ' DEVELOPER';
    ELSIF Whostmgr.has_license_flag('trial');
        license_type = license_type _ ' TRIAL';
    ELSIF Whostmgr.is_test_build();
        license_type = license_type _ ' TEST';
    END;
%]

[% WRAPPER 'master_templates/master.tmpl'
    theme="bootstrap"
    app_key="home"
    stylesheets = [
        Whostmgr.find_file_url('/templates/menu/main.min.css')
    ],
    scripts = [
        '/libraries/sortablejs/1.15.0/Sortable.js',
    ]
 -%]

<!-- Embed retently survey if user consent is given. -->
[% IF has_analytics && varcache.server_analytics_setting && varcache.user_consent_analytics_setting %]
[%
    SET analyticsData = UIAnalytics.get_whm_analytics_data();
    SET retently_email_id = UIAnalytics.get_email_id_for_retently_embed(analyticsData.UUID);
%]
<div
    id="retently-survey-embed"
    data-href="https://app.retently.com/api/remote/tracking/606c61a4c8c2d36d01246bc4"
    data-rel="dialog"
    data-campaignId="6602b1e4dfb203deb51b48f3"
    data-prop-analytics-id="[% analyticsData.UUID %]"
    data-email="[% retently_email_id %]"
    data-prop-account-age="[% analyticsData.ACCOUNT_AGE %]"
    data-prop-company-id="[% analyticsData.company_id %]"
    data-prop-product-version="[% analyticsData.product_version %]"
    data-prop-product-interface="[% analyticsData.product_interface %]"
    data-prop-product-feature="[% app_key %]"
    data-prop-product-locale="[% analyticsData.product_locale %]"
    data-prop-product-trial-status="[% analyticsData.product_trial_status %]"
    data-prop-server-main-ip="[% analyticsData.server_main_ip %]"
    data-prop-server-os="[% analyticsData.server_operating_system %]"
    data-prop-is-root="[% analyticsData.is_root %]"
    data-tags="whmadmin"
></div>

<script type="text/javascript">
(function (d, s, id) {
    var js, rjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s);
    js.id = id;
    js.src = "https://cdn.retently.com/public/components/embed/sdk.min.js";
    rjs.parentNode.insertBefore(js, rjs);
}(document, "script", "retently-jssdk"));
</script>
[% END %]

<div class="wrapper" role="main">
    <div class="container-lg">
        [% IF Whostmgr.hasroot() && Mysql.mysqlversion() == 5.5 %]
            [% PROCESS 'warnings/_end_of_life_callout/callout.tmpl'
                eol_callout_name = "mysql55"
                eol_software_name = "MySQL 5.5"
                eol_date = 1543795200 # December 3, 2018
                eol_read_more_link = "https://go.cpanel.net/mysql55replacement"
                eol_read_more_target = "cpblog-mysql55replacement"
                eol_upgrade_link = cp_security_token _ "/scripts/mysqlupgrade"
                eol_survey_link = "https://go.cpanel.net/mysql55survey"
            %]
        [% END %]

        [%# If the only message we could potentially display
            via an ajax callback which displays the versionExpiryMessage
            and topSection then we want to set the top section to be hidden
            so it does not push the page down and hide the "Explore WHM"
            section from the view port on small screens
        %]
        [%
            SET vars = Whostmgr.template_vars;
            SET display_mysql_warning = Whostmgr.hasroot() && Mysql.is_version_going_eol_soon;
            SET display_centos_6_warning = Whostmgr.hasroot() && vars.osname == 'CENTOS' && vars.osversion == '6';
            SET display_cl6_warning = Whostmgr.hasroot() && vars.osname == 'CLOUDLINUX' && vars.osversion == 6;
            SET display_c7_or_cl7_warning = Whostmgr.hasroot()
            && ( vars.osname == 'CENTOS' || vars.osname == 'CLOUDLINUX' )
            && vars.osversion == 7;
            SET display_centos_8_warning = Whostmgr.hasroot() && vars.osname == 'CENTOS' && vars.osversion == '8';
            SET display_amazon_linux_warning = (Whostmgr.hasroot() && vars.osname == "AMAZON");
            SET display_license_excess_warning = !varcache.dnsonly && Whostmgr.server_exceeds_max_users();
            SET display_nameserver_warning = Whostmgr.hasroot() && ( nameserver == 'mydns' || nameserver == 'nsd' );
        %]
        [%
            SET hide_top_section = !display_mysql_warning && !display_license_excess_warning
            && !display_nameserver_warning && ( data.disable_os_eol_banners
            || ( !display_centos_6_warning && !display_cl6_warning
            && !display_c7_or_cl7_warning && !display_centos_8_warning
            && !display_amazon_linux_warning ) );
            SET cloudlinux_url = cp_security_token _ "/scripts13/purchase_cloudlinux_init_WHM";
            SET os_names = {
                "CENTOS" => "CentOS",
                "REDHAT" => "Red Hat®",
                "CLOUDLINUX" => "CloudLinux™"
            };
        %]

        [% UNLESS hide_horde_deprecation_banner %]
            <div id="calloutHordeDeprecation" class="callout callout-warning" style="position: relative;">
                <p style ="width: 100%; align: right"><div id="dismissHordeIcon" title="Permanently remove this notice" style="cursor: pointer; width: 18px; display: inline-block;right:0; top:8px; position: absolute;"><i class="fas fa-times" aria-hidden="true"></i></div></p>
                <p>[% locale.maketext("The Horde webmail application has been removed in [asis,cPanel amp() WHM] version [asis,108].") %]
                [% locale.maketext("All Horde email, contacts, and calendars will be automatically migrated to Roundcube.")  %]
                [% locale.maketext("For more information, read our [output,url,_1,cPanel Deprecation Plan documentation,target,_blank].","https://go.cpanel.net/deprecation") %]
                </p>
            </div>
        [% END %]

        <section id="topSection" [% hide_top_section ? 'class="hide"' : '' %]>
            [% IF display_amazon_linux_warning && !data.disable_os_eol_banners %]
                    <div id="calloutAmazon" class="callout callout-warning">
                        <p>[% locale.maketext("On June 30, 2020, [asis,cPanel, L.L.C.] will stop supporting [output,strong,all] installations on [asis,Amazon Linux], which includes this server. At that time, we will no longer provide bug, security, or feature updates. We encourage you to [output,url,_1,migrate,_type,offsite] to a server using [asis,CentOS 7] or greater before June 30, 2020. For servers running on [asis,AWS], we recommend using our [output,url,_2,official listing,_type,offsite] in the [asis,AWS Marketplace]. Information about [asis,cPanel, L.L.C.‘s] deprecation plan is available in our documentation.", "https://go.cpanel.net/gomigrate", "https://go.cpanel.net/cpanelaws") %]</p>
                        <p>[% locale.maketext("Only system administrators (root and root-level resellers) see this message.") %]</p>
                    </div>
            [% ELSIF display_centos_6_warning && !data.disable_os_eol_banners  %]
                [% IF os_names.exists(vars.osname);
                        os_name = os_names.item(vars.osname); -%]
                        <div id="calloutCentos" class="callout callout-warning">
                            <p>[% locale.maketext("[asis,cPanel amp() WHM] version [asis,86] will continue to be supported through March 31, 2021. However, [_1] will stop providing support for [_1] [asis,6] on [output,strong,all] systems, including your server, on November 30, 2020. This means at that time they will no longer provide bug, security, or feature updates to [_1] [asis,6]. We encourage you to [output,url,_2,migrate,_type,offsite] to a server using [_1] [asis,7] or upgrade to a server running [asis,CloudLinux] [asis,6] before November 30, 2020. Information about [asis,cPanel, L.L.C.‘s] deprecation plan is available in our documentation.", os_name, "https://go.cpanel.net/gomigrate") %]</p>
                            <p>[% locale.maketext("Only system administrators (root and root-level resellers) see this message.") %]</p>

                            <a id="phpVersion_clButton" class="btn btn-warning" href="[% cloudlinux_url %]" target="_blank">
                            <i class="fas fa-lg fa-external-link-alt"></i>
                                Upgrade to CloudLinux
                            </a>
                        </div>
                [% END %]
            [% ELSIF display_cl6_warning && !data.disable_os_eol_banners %]
                [% IF os_names.exists(vars.osname);
                        os_name = os_names.item(vars.osname); -%]
                        <div id="calloutCentos" class="callout callout-warning">
                            [%
                                valid_migration_targets = [ 'AlmaLinux 8', 'Rocky Linux 8', 'CloudLinux™ 8' ];
                            %]
                            <p>[% locale.maketext("[asis,cPanel amp() WHM] version [numf,_1] will be the last version that supports [asis,_2][comment,operating system] [asis,_3][comment,os release].", 110, os_name, vars.osversion) %]
                            [% locale.maketext("Support for version [numf,_1] will end [datetime,_2]. We encourage you to [output,url,_3,migrate,_type,offsite] to a server running [list_or,_4] before [datetime,_2].",110,1722402000,"https://go.cpanel.net/gomigrate",valid_migration_targets) %]
                            [% locale.maketext("For more information, read our [output,url,_1,cPanel Deprecation Plan documentation,target,_blank].", "https://go.cpanel.net/deprecation") %]</p>
                            <p>[% locale.maketext("Only system administrators (root and root-level resellers) see this message.") %]</p>
                        </div>
                [% END %]
            [% ELSIF display_c7_or_cl7_warning && !data.disable_os_eol_banners %]
                [% IF os_names.exists(vars.osname);
                        os_name = os_names.item(vars.osname); -%]
                        <div id="calloutCentos" class="callout callout-warning">
                            [%
                                valid_migration_targets = [ 'AlmaLinux 8', 'Rocky Linux 8', 'CloudLinux™ 8' ];
                                can_be_elevated = CpanelOS.can_be_elevated();
                                IF can_be_elevated;
                                    default_elevate_target_os = CpanelOS.can_elevate_to().0;
                                    current_os = CpanelOS.pretty_distro() _ ' ' _ CpanelOS.major();
                                    target_os = CpanelOS.lookup_pretty_distro(default_elevate_target_os);
                                END;
                            %]
                            <p>[% locale.maketext("[asis,cPanel amp() WHM] version [numf,_1] will be the last version that supports [asis,_2][comment,operating system] [asis,_3][comment,os release].", 110, os_name, vars.osversion) %]
                            [% locale.maketext("The Extended Lifecycle Support program extends [asis,_1][comment,operating system] [asis,_2][comment,os release] support with [asis,cPanel amp() WHM] version [numf,_3] to [datetime,_4].", os_name, vars.osversion, 110, 1798783200) %]
                            [% locale.maketext("Read more about this program in the [output,url,_1,Extended Lifecycle Support OSes,_type,offsite] blog post.", "https://go.cpanel.net/ELS") %]
                            [% locale.maketext("We encourage you to migrate to a supported operating system as soon as possible.") %]</p>

                            [% IF can_be_elevated && !WhostmgrMain.has_elevate_noc_touchfile() %]
                            <p>[% locale.maketext("Click the “Elevate to [_2]” button below to read about a script you can use to upgrade [asis,cPanel amp() WHM] installations on [_1] to [_2].", current_os, target_os) %]</p>
                            [% END %]
                            <p>[% locale.maketext("Only system administrators (root and root-level resellers) see this message.") %]</p>

                            [% IF can_be_elevated && !WhostmgrMain.has_elevate_noc_touchfile() %]
                            <a id="phpVersion_clButton" class="btn btn-warning" href="https://go.cpanel.net/ELevate" target="_blank">
                            <i class="fas fa-lg fa-external-link-alt"></i>
                                Elevate to [% target_os %]
                            </a>
                            [% END %]
                        </div>
                [% END %]

            [% ELSIF display_centos_8_warning && !data.disable_os_eol_banners %]
                [% IF os_names.exists(vars.osname);
                        os_name = os_names.item(vars.osname); -%]
                        <div id="calloutCentos" class="callout callout-warning">
                            <p>[% locale.maketext("[_1] [asis,8] will reach End of Life (EOL) on [output,strong,all] systems on December 31, 2021. This means that after this date, [_1] will no longer provide bug, security, or feature updates to [_1] [asis,8]. We encourage you to convert to [asis,AlmaLinux] [asis,8] before December 31, 2021.", os_name) %]</p>
                            <p>[% locale.maketext("Only system administrators (root and root-level resellers) see this message.") %]</p>

                            <a id="phpVersion_almaButton" class="btn btn-warning" href="https://go.cpanel.net/convertalmalinux8" target="_blank">
                            <i class="fas fa-lg fa-external-link-alt"></i>
                                Convert to AlmaLinux
                            </a>
                        </div>
                [% END %]
            [% END %]

            [% IF Whostmgr.hasroot() -%]
                <div id="calloutVersionExpiry" class="callout callout-cpanel hide" id="versionExpiryMessage">
                    <h2><i class="glyphicon glyphicon-warning-sign text-danger"></i> [% locale.maketext("Your Version Is Expiring") -%]</h2>
                    <span id="expiryMessageContent">[% locale.maketext("Your server currently runs on [asis,cPanel amp() WHM] version [output,strong,_1,id,PLACEHOLDER_CURRENT_VERSION]. Your system’s version will reach [output,url,_2,End of Life,target,_blank] on [output,strong,_3,id,PLACEHOLDER_EXPIRY]. We [output,strong,strongly] recommend that you upgrade to the latest version to avoid any disruption in your service. For more information on how to update your version, read our [output,url,_4,Update Preferences] documentation.", "[PLACEHOLDER_CURRENT_VERSION]", "https://go.cpanel.net/longtermsupport", "[PLACEHOLDER_EXPIRY]", cp_security_token _ "/scripts2/updateconf") -%]</span>
                </div>
                [% PROCESS 'warnings/_mysql_version.tmpl' %]
            [% END -%]

            [% IF display_license_excess_warning -%]
                [% PROCESS 'menu/_license_excess.tmpl' -%]
            [% END -%]

            [% IF display_nameserver_warning %]
                <div id="calloutNameserverDeprecated" class="callout callout-warning">
                    <p>[% locale.maketext("This server uses [output,url,_1,deprecated nameserver software,_3]. We recommend that you [output,url,_2,migrate to PowerDNS].", 'https://go.cpanel.net/depplan', nameserverConfigLink, { 'target' => 'blank' }) %]</p>
                </div>
            [% END -%]
        </section>

        [% IF Whostmgr.hasroot() && !hide_important_next_steps && data.important_next_steps.size > 0 -%]
        [% IF isa_email_error == 1 || isa_nameserver_error == 1 %]
        <section id="isaAlertSection" class="isa-alert-section">
            <div class="alert-list">
                <div class="alert alert-danger" role="alert">
                    <button id="btnCloseAlert" type="button" class="close" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                    <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span>
                    <div class="alert-message">
                        <strong class="alert-title">[% locale.maketext("Error:") %]</strong>
                        <span class="alert-body">
                            <span id="alertMessage">
                                [% IF isa_email_error && isa_nameserver_error %]
                                    [% locale.maketext("The system could not save your contact email address and nameservers. [output,url,_1,Try Again,id,_2]", cp_security_token _ data.basic_setup.url _ '?find=EMAIL', 'lnkBasicSetup') %]
                                [% ELSIF isa_email_error %]
                                    [% locale.maketext("The system could not save your contact email address. [output,url,_1,Try Again,id,_2]", cp_security_token _ data.basic_setup.url _ '?find=EMAIL', 'lnkBasicSetup' ) %]
                                [% ELSIF isa_nameserver_error %]
                                    [% locale.maketext("The system could not save your nameservers. [output,url,_1,Try Again,id,_2]", cp_security_token _ data.basic_setup.url _ '?find=nameservers', 'lnkBasicSetup') %]
                                [% END %]
                            </span>
                        </span>
                    </div>
                </div>
            </div>
        </section>
        [% END %]
        <section role="region" aria-label=[% locale.maketext("Important next steps") %] id="nextStepsSection" class="cp-page-section">
            <div class="section-header section-flex">
                <h1 class="section-title">[% locale.maketext("Important next steps") %]</h1>
                <button id="lnkDismissNextSteps" class="btn btn-link flip pull-right dismiss" title="[% locale.maketext('Do not show this section in the future.') %]">
                    <i class="fas fa-times" aria-hidden="true"></i>
                    [% locale.maketext("Dismiss") %]
                </button>
            </div>

            <div class="tools-grid-container">
                [% FOREACH application IN data.important_next_steps %]
                    [%# Saving another iteration and making code ugly %]
                    [% IF application.file.split('\.').shift == "basic_webhost_manager_setup" %]
                    <div>
                        <a href="[% cp_security_token _ application.url _ '?find=EMAIL' %]">
                        <div class="cp-card cp-app">
                            <img class="cp-card__image-next-steps" src="[% Whostmgr.get_icon_url('icons/' _ application.file) %]" aria-hidden="true"/>
                            <div class="cp-app__details">
                                <span class="cp-app__details-title">[% locale.maketext('Provide Contact Information') %]</span>
                                <span class="cp-app__details-description">[% locale.maketext('Add your contact information. This lets [asis,cPanel amp() WHM] notify you about problems and status updates.') %]</span>
                            </div>
                        </div>
                        </a>
                    </div>
                    [% IF !varcache.dnsonly %]
                    <div>
                        <a href="[% cp_security_token _ application.url _ '?find=nameservers' %]">
                            <div class="cp-card cp-app">
                                <img class="cp-card__image-next-steps"  src="[% Whostmgr.get_icon_url('icons/' _ application.file) %]" aria-hidden="true">
                                <div class="cp-app__details">
                                    <span class="cp-app__details-title">[% locale.maketext('Customize Nameservers') %]</span>
                                    <span class="cp-app__details-description">
                                        [% locale.maketext("Optionally, update your nameserver configuration. The system selects default nameservers during installation, but you can customize them before you create domains.") %]
                                    </span>
                                </div>
                            </div>
                        </a>
                    </div>
                    [% END %]
                    <div>
                        <a href="[% cp_security_token _ application.url _ '?find=ethernet' %]">
                            <div class="cp-card cp-app">
                                <img class="cp-card__image-next-steps"  src="[% Whostmgr.get_icon_url('icons/' _ application.file) %]" aria-hidden="true">
                                <div class="cp-app__details">
                                    <span class="cp-app__details-title">[% locale.maketext('Customize Ethernet Device') %]</span>
                                    <span class="cp-app__details-description">
                                        [% locale.maketext("Select or enter the Ethernet device that the system will add new IP addresses to.") %]
                                    </span>
                                </div>
                            </div>
                        </a>
                    </div>
                    [% ELSE; %]
                    <div>
                        <a href="[% cp_security_token _ application.url %]">
                            <div class="cp-card cp-app">
                                <img class="cp-card__image-next-steps" src="[% Whostmgr.get_icon_url('icons/' _ application.file) %]" aria-hidden="true">
                                <div class="cp-app__details">
                                    <span class="cp-app__details-title">[% application.itemdesc %]</span>
                                    <span class="cp-app__details-description">[% application.description %]</span>
                                </div>
                            </div>
                        </a>
                    </div>
                    [% END %]
                [% END %]
                </div>
        </section>
        [% END %]

        <section class="tools-stats-grid-container cp-page-section">
            <section role="region" aria-label=[% locale.maketext("Favorites") %] id="top_tools">
                <div class="section-header section-flex">
                    <h1 class="section-title">[% locale.maketext("Favorites") %]</h1>
                    <button class="toggle-edit-favorites-button btn btn-default btn-sm">
                        [%
                            SET edit_label = locale.maketext("Edit Favorites");
                            SET done_edit_label = locale.maketext("Done Editing");
                        %]
                        <span class="toggle-edit-favorites-button__select">[% edit_label %]</span>
                        <span class="toggle-edit-favorites-button__done hidden">[% done_edit_label %]</span>
                    </button>
                </div>

                [% SET favorites = [];
                FOREACH application IN top_tools;
                    SET favorite = {
                        group  => application.group,
                        key    => application.key,
                        target => application.target || '_self',
                    };

                    IF application.type == 'plugin';
                        favorite.name = application.showname;
                        favorite.description = "";
                        favorite.url = cp_security_token _ '/cgi/' _ application.cgi;
                        IF application.icon;
                            favorite.iconUrl = Whostmgr.get_icon_url('addon_plugins/' _ application.icon);
                        ELSE;
                            favorite.iconUrl = Whostmgr.find_file_url("icons/${application.tagname}.png") || Whostmgr.find_file_url('icons/plugin_placeholder.png');
                        END;
                    ELSE;
                        favorite.name = application.itemdesc;
                        favorite.description = application.description;
                        favorite.url = cp_security_token _ application.url;
                        favorite.iconUrl = Whostmgr.get_icon_url('icons/' _ application.file);
                    END;

                    favorites.push(favorite);
                END;
                %]
                <div class="cp-favorite-instructions cp-card hidden">
                    <p>[% locale.maketext("Select your favorite tools from the [output,url,_1,Tools] sections below by clicking the star icons next to each tool.", "#tools-section") %]</p>
                    <ul>
                        <li>
                            <i class="cp-favorite-selector--selected">
                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
                                    <path fill="none" d="M0 0h24v24H0z" />
                                    <path d="M12 18.26l-7.053 3.948 1.575-7.928L.587 8.792l8.027-.952L12 .5l3.386 7.34 8.027.952-5.935 5.488 1.575 7.928z" />
                                </svg>
                            </i>
                            [% locale.maketext("Selected") %]
                        </li>
                        <li>
                            <i class="cp-favorite-selector--unselected">
                                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
                                    <path fill="none" d="M0 0h24v24H0z" />
                                    <path d="M12 18.26l-7.053 3.948 1.575-7.928L.587 8.792l8.027-.952L12 .5l3.386 7.34 8.027.952-5.935 5.488 1.575 7.928L12 18.26zm0-2.292l4.247 2.377-.949-4.773 3.573-3.305-4.833-.573L12 5.275l-2.038 4.42-4.833.572 3.573 3.305-.949 4.773L12 15.968z" />
                                </svg>
                            </i>
                            [% locale.maketext("Unselected") %]
                        </li>
                    </ul>
                    <p>[% locale.maketext("To reorder the favorites, click and drag the tool to the desired position.") %]</p>
                    <p>
                        [% locale.maketext("To stop editing your favorites, click the [_1] button above.", done_edit_label) %]
                    </p>
                    <hr>
                    <p>
                        [% locale.maketext("Use the following toggle to enable or disable descriptions:") %]
                        <cpw-toggle-switch
                            id="chkToggleCompact"
                            class="edit-favorites-options-compact"
                            label-position="left"
                            init-state="[% showFavoritesDescriptions ? "on" : "off" %]"
                            toggle-on-text="[% locale.maketext('Enabled') %]"
                            toggle-off-text="[% locale.maketext('Disabled') %]">
                        </cpw-toggle-switch>
                    </p>
                </div>
                <cp-favorite-list class="tools-grid-container favorites-container"
                    show-descriptions="[% showFavoritesDescriptions ? 'true' : 'false' %]">
                </cp-favorite-list>
                <div class="tools-grid-placeholder [% IF top_tools.size() != 0 %]hidden[% END %]">
                    <p>
                        [% locale.maketext("You can customize this section with the WHM features you use the most. Click [output,strong,_1] to change your favorites.", edit_label) %]
                    </p>
                </div>
            </section>
            <section role="region" aria-label=[% locale.maketext("Statistics") %] id="tools__stats">
                [%# Needed additional wrapper div so card does not overflow parent. %]
                <div class="stats-wrapper">
                    <div class="section-header">
                        <h1 class="section-title">[% locale.maketext("Statistics") %]</h1>
                    </div>
                    <div class="cp-card cp-stats" data-testid="statisticsSidebar">
                        [%# Hidden anchor used by the cp-360-stats-widget plugin to inject the Server Monitoring row before this element. %]
                        <div class="cp-stat__details" style="display:none" aria-hidden="true">
                            <span class="cp-stat__details-title" data-testid="loadAveragesStatisticsLabel"></span>
                        </div>
                        <div class="cp-stat__details hide" id="phpVersionsStatisticsRow" data-testid="phpVersionsStatisticsRow">
                            <span class="cp-stat__details-title" data-testid="phpVersionsStatisticsLabel">
                            [% locale.maketext("[asis,PHP] Status") %]
                            </span>
                            <span class="server-whm-version-value cp-stat__details-value" data-testid="phpVersionsStatisticsValue">
                                <span>
                                    <i class="fas fa-exclamation-circle text-danger" aria-hidden="true"></i>
                                    <span id="phpVersionsStatusText"></span>
                                </span>
                                <a id="phpElsSecureLink" class="cp-stat__details-action" href="[% cp_security_token _ '/scripts7/multiphp-manager' %]" target="_blank" rel="noopener noreferrer">
                                    [% locale.maketext("Secure sites with “[_1]”[comment,link label]", "PHP ELS") %]
                                </a>
                            </span>
                        </div>
                        <div class="cp-stat__details">
                            <span class="cp-stat__details-title">
                            [% locale.maketext("Hostname") %]
                            </span>
                            <span class="server-hostname-value cp-stat__details-value">
                            <cp-wrap-filter text="[% Whostmgr.hostname().html() %]"></cp-wrap-filter>
                            </span>
                        </div>
                        <div class="cp-stat__details">
                            <span class="cp-stat__details-title">
                                [% locale.maketext("Load Averages") %]
                                [%
                                    SET has_all = Whostmgr.checkacl('all');
                                    IF has_all;
                                %]
                                <a class="cp-stat__details-link"
                                    href="[% cp_security_token _ "/scripts2/top" %]"
                                    title="[% locale.maketext('Process Manager') %]"
                                    target="_self">
                                    <i class="ri-run-line"></i>
                                </a>
                                [% END %]
                            </span>
                            [% IF has_all %]
                            <a class="cp-stat__details-link__wrapper"
                                href="[% cp_security_token _ "/scripts2/top" %]"
                                target="_self">
                            [% END %]
                                <cp-load-averages id="stats" verbose="true" show-header="true" />
                            [% IF has_all %]
                            </a>
                            [% END %]
                        </div>
                        <div class="cp-stat__details hidden-xs">
                            <span class="cp-stat__details-title">
                            [% locale.maketext("Operating System") %]
                            </span>
                            <span class="server-operating-system-value cp-stat__details-value">
                            [% whm_variables.BASEOS.html() %]
                            </span>
                        </div>
                        <div class="cp-stat__details hidden-xs">
                            <span class="cp-stat__details-title">
                            [% locale.maketext("Product") %]
                            </span>
                            <span class="server-whm-version-value cp-stat__details-value">
                            cPanel &amp; WHM v[% Whostmgr.WHM_VERSION %] ([%license_type.html()%])
                            </span>
                        </div>
                    </div>
                </div>
            </section>
        </section>

        [%
        IF has_component_system && Components.has_components_for('whostmgr', app_key, 'menu-top');
            PROCESS "master_templates/component.html.tt",
                APP_KEY => app_key,
                TAG     => 'section',
                SLOT    => 'menu-top',
                CLASSES => 'cp-page-section';
        END;
        %]
        <section role="region" aria-label=[% locale.maketext("Tools") %] id="tools" class="cp-page-section">
            <div class="section-header">
                <h1 class="section-title"><a name="tools-section">[% locale.maketext("Tools") %]</a></h1>
            </div>
            [% FOREACH group IN data.tools.groups %]
                [% IF group.items.size > 0 %]
                <div data-group-key="[% group.key %]" class="cp-card cp-group mb-1 [% expanded_groups.item(group.key) == 1 ? 'expanded' : '' %]">
                    <div class="cp-group__header">
                        <img class="cp-group__header-icon" src="[% Whostmgr.get_icon_url('icons/' _ group.file) %]" alt="" />
                        <h2 class="cp-group__header-title">[% group.groupdesc %]</h2>
                        <a href="javascript:void(0)" class="cp-group__header-expand fas" aria-label="[% locale.maketext("Expand or collapse “[_1]” tools group.", group.groupdesc) %]">
                        </a>
                    </div>
                    <div class="cp-group__content">
                        <div class="row">
                            [% FOREACH application IN group.items;
                                application.iconUrl = Whostmgr.get_icon_url('icons/' _ application.file);
                                application.fullUrl = WhostmgrMain.final_menu_url(application.url);
                                application.type    = "builtin";
                            %]
                            <div class="col-md-4 cp-group__content-item">
                                <div>
                                    <cp-app
                                        class="cp-app-link"
                                        url="[% application.fullUrl %]"
                                        target=[% application.target || '_self' %]
                                        iconUrl="[% application.iconUrl %]"
                                        description="[% application.itemdesc %]"
                                        uniqueKey="[% application.group _ '_' _ application.key %]"
                                        name="[% application.key %]"
                                    >
                                    </cp-app>
                                    <cp-favorite-selector
                                        class="cp-select-for-my-tools"
                                        group="[% application.group %]"
                                        name="[% application.key %]"
                                    >
                                    </cp-favorite-selector>
                                </div>
                            </div>
                            [% END %]
                        </div>
                    </div>
                </div>
                [% END %]
                [% IF group.key == 'plugins' && Whostmgr.plugins_data.size > 0 %]
                <div data-group-key="[% group.key %]" class="cp-card cp-group mb-1 [% expanded_groups.item(group.key) == 1 ? 'expanded' : '' %]">
                    <div class="cp-group__header">
                        <img class="cp-group__header-icon" src="[% Whostmgr.get_icon_url('icons/' _ group.file) %]" alt="" />
                        <h2 class="cp-group__header-title">[% group.groupdesc %]</h2>
                        <a href="javascript:void(0)" class="cp-group__header-expand fas" aria-label="[% locale.maketext("Expand or collapse “[_1]” tools group.", group.groupdesc) %]">
                        </a>
                    </div>
                    <div class="cp-group__content">
                        <div class="row">
                            [%
                                SET plugins = Whostmgr.plugins_data;
                                FOREACH plugin IN plugins;
                                # Normalize the data model for plugins to match the data model for tools
                                plugin.key = plugin.uniquekey;
                                plugin.itemdesc = plugin.showname;
                                plugin.description = '';  # plugins don't have a description rigth now.
                                plugin.url = '/cgi/' _ plugin.cgi;
                                plugin.fullUrl = cp_security_token _ plugin.url;
                                IF plugin.icon;
                                    plugin.iconUrl = Whostmgr.get_icon_url('addon_plugins/' _ plugin.icon);
                                ELSE;
                                    plugin.iconUrl = Whostmgr.find_file_url("icons/${plugin.tagname}.png") || Whostmgr.find_file_url('icons/plugin_placeholder.png');
                                END;
                                plugin.type = "plugin";
                            %]
                            <div class="col-md-4 cp-group__content-item">
                                <div>
                                    <cp-app
                                        class="cp-app-link"
                                        url="[% plugin.fullUrl %]"
                                        target=[% plugin.target || '_self' %]
                                        iconUrl="[% plugin.iconUrl %]"
                                        description="[% plugin.showname.html() %]"
                                        uniqueKey="[% plugin.key %]"
                                        name="[% plugin.key %]"
                                    >
                                    </cp-app>
                                    <cp-favorite-selector
                                        class="cp-select-for-my-tools"
                                        group="[% group.key %]"
                                        name="[% plugin.key %]"
                                    >
                                    </cp-favorite-selector>
                                </div>
                            </div>
                            [% END %]
                        </div>
                    </div>
                </div>
                [% END %]
            [% END %]
        </section>
        [%
        IF has_component_system && Components.has_components_for('whostmgr', app_key, 'menu-bottom');
            PROCESS "master_templates/component.html.tt",
                APP_KEY => app_key,
                TAG     => 'section',
                SLOT    => 'menu-bottom',
                CLASSES => 'cp-page-section';
        END;
        %]
    </div>
</div>

<script type="text/javascript">
    var PAGE = PAGE || {};

    PAGE.token = "[% cp_security_token %]";
    PAGE.isRoot = [% Whostmgr.ENV.REMOTE_USER == "root" ? "true" : "false" %];

    PAGE.expanded_groups = [% expanded_groups.json() %];
    PAGE.hasBasicWHMFunctions = [% Whostmgr.checkacl('basic-whm-functions') %];
    PAGE.favorites = [% favorites.json() %];
    PAGE.tools = [% data.tools.json() %];
    PAGE.plugins = [% plugins.json() || '[]' %];

    [% INSERT "menu/main.js" %]
</script>
[% END -%]
Back to Directory File Manager