<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>M/Monit Admin | Settings</title>
    <meta name="theme-color" content="#3D3E40">
    <meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-title" content="M/Monit" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
    <meta name="view-transition" content="same-origin">
    <link rel="apple-touch-icon" href="../../img/apple-touch-icon.png"/>
    <link rel="manifest" href="../../img/manifest.webmanifest">
    <script src="../../lib/js/appearance.js"></script>
    <link rel="stylesheet" href="../../lib/css/styles.css?version=430">
    <link rel="stylesheet" href="../../assets/admin/admin_settings.css?version=430">
</head>
<body>
    <div id="wrap">
        <div id="fixed-header">
            <div id="fake-status-bar"></div>
            <div id="header">
                <div id="nav">
                    <a id="logo" target="webapp" href="../../"></a>
                    <a id="logout" title="Logout" target="webapp" href="../../login/logout.csp"></a>
                    <ul id="menu">
                        <li>
                            <a target="webapp" href="../../index.csp"><span>Dashboard</span></a>
                        </li>
                        <li>
                            <a target="webapp" href="../../status/hosts/"><span>Status</span></a>
                        </li>
                        <li>
                            <a target="webapp" href="../../reports/analytics/"><span>Reports</span></a>
                            <ul>
                                <li><a target="webapp" href="../../reports/analytics/">Analytics</a></li>
                                <li><a target="webapp" href="../../reports/uptime/">Uptime</a></li>
                                <li><a target="webapp" href="../../reports/events/">Events</a></li>
                            </ul>
                        </li>
                        <li class="active">
                            <?cs if:#Request.Param.IsAdmin ?>
                            <a target="webapp" href="../../admin/general/"><span>Admin</span></a>
                            <ul>
                                <li><a target="webapp" href="../../admin/general/">General</a></li>
                                <li><a target="webapp" href="../../admin/hosts/">Hosts</a></li>
                                <li><a target="webapp" href="../../admin/groups/">Groups</a></li>
                                <li><a target="webapp" href="../../admin/users/">Users</a></li>
                                <li><a target="webapp" href="../../admin/roles/">Roles</a></li>
                                <li><a target="webapp" href="../../admin/alerts/">Alerts</a></li>
                                <li><a class="active" target="webapp" href="../../admin/settings/">Settings</a></li>
                            </ul>
                            <?cs else ?>
                            <a target="webapp" href="../../admin/users/edit?id=<?cs var:Request.Param.RemoteUserId ?>"><span>Profile</span></a>
                            <?cs /if ?>
                        </li>
                        <li id="logout-phone"><a target="webapp" href="../../login/logout.csp">Logout</a></li>
                    </ul>
                </div> <!-- nav -->
            </div><!-- header -->
        </div><!-- fixed-header -->
        <div id="main">
<?cs if:#Request.Param.IsAdmin ?>
            <div id="title">
                <a href="#" id="help" class="help-button" title="Help" data-help="#helpbox"></a>
                <h1>
                    <span>Settings</span>
                </h1>
            </div>
            <div class="row-fluid">
                <h3>Password audit</h3>
                <ul class="tableView">
                  <li class="switch-button">
                      <input name="auditdefaultpassword" type="checkbox" data-bind="checked: systemmessages.auditDefaultPassword" />
                      <label data-bind="event: {vclick: systemmessages.toggleAuditDefaultPassword}" for="auditdefaultpassword">Default passwords</label>
                  </li>
                  <li class="switch-button">
                      <input name="auditmd5password" type="checkbox" data-bind="checked: systemmessages.auditMD5Password" />
                      <label data-bind="event: {vclick: systemmessages.toggleAuditMD5Password}" for="auditmd5password">Old encryption</label>
                  </li>
                </ul>

                <h3>
                    Check for updates
                    <img class="warning checkUpdatesWarning" src="../../img/leds/0.png" style="margin-top:6px; margin-left:10px" alt="warning" rel="tooltip" data-bind="visible: $root.showCheckUpdatesWarning, event: { mouseover: $root.displayCheckUpdatesWarning, mouseout: $root.hideCheckUpdatesWarning }, attr: { title: checkUpdatesStatus }">
                </h3>
                <ul class="tableView">
                  <li class="switch-button">
                      <input name="newmmonitnotification" type="checkbox" data-bind="checked: systemmessages.newMMonitNotification" />
                      <label data-bind="event: {vclick: systemmessages.toggleNewMMonitNotification}" for="newmmonitnotification">M/Monit</label>
                  </li>
                  <li class="switch-button">
                      <input name="newmonitnotification" type="checkbox" data-bind="checked: systemmessages.newMonitNotification" />
                      <label data-bind="event: {vclick: systemmessages.toggleNewMonitNotification}" for="newmonitnotification">Monit</label>
                  </li>
                </ul>

                <h3>Data retention</h3>
                <ul class="tableView">
                    <li class="tableViewDropDown">
                        <span>Delete events</span>
                        <span class="accessory">
                            <div class="btn-group">
                                <button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
                                    <span class="caret"></span>
                                    <div data-bind="html: deleteEventsLabel">Select interval</div>
                                </button>
                                <ul class="dropdown-menu pull-right" data-bind="foreach: deleteEventsMenu">
                                    <li data-bind="event: {vclick:$root.selectPurgeEvents}, css:{checked:selected}">
                                        <span data-bind="html: name"></span>
                                    </li>
                                </ul>
                            </div>
                        </span>
                    </li>
                    <li class="tableViewDropDown">
                        <span>Delete analytics</span>
                        <span class="accessory">
                            <div class="btn-group">
                                <button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
                                    <span class="caret"></span>
                                    <div data-bind="html: deleteAnalyticsLabel">Select interval</div>
                                </button>
                                <ul class="dropdown-menu pull-right" data-bind="foreach: deleteAnalyticsMenu">
                                    <li data-bind="event: {vclick:$root.selectPurgeAnalytics}, css:{checked:selected}">
                                        <span data-bind="html: name"></span>
                                    </li>
                                </ul>
                            </div>
                        </span>
                    </li>
                    
                </ul>

                <h3>Hosts</h3>
                <ul class="tableView">
                    <li class="tableViewDropDown">
                        <span>Acceptable report skew</span>
                        <span class="accessory" style="top:0px">
                            <input data-bind="value:defaultSkew, event:{change:setDefaultSkew}" name="defaultSkew" type="number" min="1" max="999999" style="width:70px;float:none;margin-top:-1px;" /> cycles
                        </span>
                    </li>
                </ul>
                
                <h3>Appearance</h3>
                <ul class="tableView">
                    <li class="tableViewDropDown">
                        <span>Theme</span>
                        <span class="accessory">
                            <div class="btn-group dropup">
                                <button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
                                    <span class="caret"></span>
                                    <div data-bind="html: appearanceLabel">Apperance</div>
                                </button>
                                <ul class="dropdown-menu pull-right" data-bind="foreach: appearanceMenu">
                                    <li data-bind="event: {vclick:$root.selectAppearance}, css:{checked:selected}">
                                        <span data-bind="html: name"></span>
                                    </li>
                                </ul>
                            </div>
                        </span>
                    </li>
                </ul>
                
            </div> <!-- row-fluid -->
<?cs /if ?>
        </div> <!-- main -->
    </div> <!-- wrap -->
    <div id="footer">
        <div class="toleft hidden-phone">Logged in as <?cs var:Request.RemoteUser ?></div>
        <div class="toright hidden-phone">
            <ul class="piped">
                <li>Copyright &copy; 2024 <a href="https://tildeslash.com/">Tildeslash</a>. All Rights Reserved.</li>
                <li><a href="https://mmonit.com/">M/Monit</a></li>
                <li><a href="https://mmonit.com/monit/">Monit</a></li>
                <li><a href="https://mmonit.com/wiki/">Wiki</a></li>
            </ul>
        </div>
        <div id="copy" class="visible-phone">Copyright &copy; 2024 <a href="https://tildeslash.com/">Tildeslash</a>. All Rights Reserved.</div>
    </div> <!-- footer -->
    <!-- Hidden -->
    <!-- Confirm Delete Events Dialog -->
    <div id="confirmDeleteEvents" class="modal hide">
        <div class="modal-body">
            <h2>
                Delete events older than <span data-bind="text:purgeEventsSelection().description"></span>?
            </h2>
            <p data-bind="visible:purgeEventsSelection().id < 9">
                The uptime report utilize events for reporting Hosts and Service uptime. If this setting is selected, the uptime
                report will be limited to <span data-bind="text:purgeEventsSelection().description"></span>.
            </p>
            <p>
                If you press [Confirm], events older than <span data-bind="text:purgeEventsSelection().description"></span> will be deleted from the database now and a job
                scheduler will be setup to automatically delete events older than <span data-bind="text:purgeEventsSelection().description"></span> once per week. Are you sure?
                There is no undo.
            </p>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal">Cancel</button>
            <button class="btn btn-danger" data-dismiss="modal" data-bind="click: $root.selectPurgeEventsConfirm">Confirm</button>
        </div>
    </div>
    <!-- Confirm Delete Analytics Dialog -->
    <div id="confirmDeleteAnalytics" class="modal hide">
        <div class="modal-body">
            <h2>
                Delete analytics data older than <span data-bind="text:purgeAnalyticsSelection().description"></span>?
            </h2>
            <p>
                If you press [Confirm], analytics data older than <span data-bind="text:purgeAnalyticsSelection().description"></span> will be deleted from the database now
                and analytics data older than <span data-bind="text:purgeAnalyticsSelection().description"></span> will automatically be deleted in the future. Are you sure?
                There is no undo.
            </p>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal">Cancel</button>
            <button class="btn btn-danger" data-dismiss="modal" data-bind="click: $root.selectPurgeAnalyticsConfirm">Confirm</button>
        </div>
    </div>
    <!-- Help -->
    <div id="helpbox">
        <div class="title">
            <h2>Settings Help</h2>
        </div>
        <div class="content paragraphify">
            <h3>Password audit</h3>
            <p>
                The password audit section can be used to turn on a subtle UI indication if an account is using one of the well-known default passwords
                ("swordfish" or “monit") or if an account has password stored as a MD5 hash, used in M/Monit 3
            </p>

            <h3>Check for updates</h3>
            <p>
                You can ask M/Monit to automatically check for updates. This will make M/Monit connect to mmonit.com once a day and check for new releases of
                M/Monit and Monit. If a new version is found, information will be posted in the dashboard.
            </p>

            <h3>Data retention</h3>
            <p>
                By default, <a href="../../reports/events/">events</a> are stored in the M/Monit database and never deleted.
                This means that the events log will grow over time. It can be useful to prune the events log to save space or
                if drill-down in the events log is starting to become slow due to an abundance of data. The <i>Delete
                events</i> option can be used to delete old events now and automatic remove events in the future.
            </p>
            <p>
                Analytics data (that is, data used to create charts in M/Monit) is stored and aggregated in the M/Monit
                database for 3 years, after which it is automatically deleted. If old analytics data is not useful nor
                relevant, you can use this option to store analytics data for a shorter time and thereby save space.
            </p>

            <h3>Acceptable report skew</h3>
            <p>
                A Monit agent has to send status update within a certain timeframe, otherwise M/Monit will generate a heartbeat failure event. The acceptable
                report skew is the number of Monit cycles M/Monit will wait before reporting the host as down. The default value is 3 cycles. The report skew set
                in this page applies to all new hosts registered in M/Monit. You can also fine-tune this value further in the <a
                href="../../admin/hosts/">Admin/Host</a> page for a specific host.
            </p>
            <h3>Appearance</h3>
            <p>
               Appearance allows you to choose the theme for the application. Choose "Auto" to follow the system's Dark or Light mode settings. Alternatively,
               you can manually set the theme to "Light" or "Dark" based on your preference.
            </p>
        </div>
    </div>
    <script src="../../lib/f/yui/2/utilities/utilities.js?version=430"></script>
    <script src="../../lib/f/jquery/jquery.js?version=430"></script>
    <script src="../../lib/f/jquery/jquery.mobile.vmouse.js?version=430"></script>
    <script src="../../lib/js/webapp.js?version=430"></script>
    <script src="../../lib/f/jquery/jquery.getUrlParam.js?version=430"></script>
    <script src="../../lib/f/twbootstrap/js/bootstrap.js?version=430"></script>
    <script src="../../lib/f/knockout/knockout.js?version=430"></script>
    <script src="../../lib/f/knockout/knockout.validation.js?version=430"></script>
    <script src="../../lib/js/error.js?version=430"></script>
    <script src="../../lib/js/math.js?version=430"></script>
    <script src="../../lib/js/ui.js?version=430"></script>
    <script src="../../lib/js/menu.js?version=430"></script>
    <script src="../../lib/js/tableview.js?version=430"></script>
    <script src="../../lib/js/help.js?version=430"></script>
    <script src="../../lib/js/csrf.js?version=430"></script>
    <script src="../../assets/admin/admin_settings.js?version=430"></script>
</body>
</html>
