Viewing File: /usr/local/cpanel/base/frontend/jupiter/site-monitor/directives/monitorsDirective.js

/*
# site-monitor/directives/monitorsDirective.js                    Copyright(c) 2021 cPanel, L.L.C.
#                                                                            All rights reserved.
# copyright@cpanel.net                                                          http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
*/

/* global define: false */

/** @namespace cpanel.siteMonitor.directive.monitors */

define(
    [
        "angular",
        "lodash",
        "cjt/core",
        "cjt/util/locale",
        "app/directives/monitorDirective",
    ],
    function(angular, _, CJT, LOCALE) {

        "use strict";

        var module = angular.module("cpanel.siteMonitor.monitorsDirective", [
            "cpanel.siteMonitor.monitorDirective",
        ]);


        module.directive("monitors", function factory() {

            /**
             * Generates a list of monitors from a site.monitors array.
             *
             * @module monitors
             * @restrict E
             *
             * @param  {string} id an id attribute for the element.
             * @param  {Site} data reference to the site to render. Each site should have a monitors collection that
             * indicates information about the monitors for this site.
             *
             * @example
             * <monitors id="monitors" data="site" />
             *
             */

            var TEMPLATE_PATH = "directives/monitorsDirective.phtml";
            var RELATIVE_PATH = "site-monitor/" + TEMPLATE_PATH;

            return {
                templateUrl: CJT.config.debug ? CJT.buildFullPath(RELATIVE_PATH) : TEMPLATE_PATH,
                restrict: "E",
                scope: {
                    parentID: "@id",
                    site: "=data"
                },
                controller: ["$scope", function($scope) {
                    $scope.LOCALE = LOCALE;
                }]
            };
        });
    }
);
Back to Directory File Manager