<dashboard version="1.1" theme="dark" stylesheet="manage_template_alerting_threshold_v2.css,,table_data_bar.css" script="manage_template_alerting_threshold_v2.js,manage_template_alerting_threshold_table_bar.js" hideEdit="true">
    <label>Configuration and management of template alerting threshold</label>
    <row>
        <panel>
            <html>
                <style>
                    .parent-top-single {
                        display: grid;
                        grid-template-columns: repeat(2, 1fr);
                        grid-template-rows: 1fr;
                        grid-column-gap: 0px;
                        grid-row-gap: 0px;
                    }
                </style>

                <!-- modal windows -->

                <!-- Help Modal -->
                <div class="modal custom-modal-60 fade" id="modal_help" tabindex="-1" role="dialog">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                    <span aria-hidden="true"></span>
                                </button>
                                <div style="text-align: left;">
                                    <h4 class="modal-title">Integrated Navigation:</h4>
                                </div>
                            </div>
                            <div class="modal-body">
                                <div style="text-align: center;">
                                    <h1>ALERTING THRESHOLD MANAGEMENT</h1>
                                </div>
                                <div>
                                    <h3>Use the alerting threshold management interfaces to configure Nmon alerting features:</h3>
                                    <div style="text-align: center;">
                                        <img src="../../static/app/metricator-for-nmon/diagrams/threshold_management.png" alt="threshold_management.png"></img>
                                    </div>
                                    <b>Thresholds are applied the following way:</b>
                                    <lu>
                                        <li>If a server has per server thresholds configured, these values have the highest priority</li>
                                        <li>If a template threshold matches a server (against its frameID), values are applied after per server thresholds</li>
                                        <li>If none of those have matches, default macro threshold values will be applied</li>
                                    </lu>
                                    <h3>Lookup access:</h3>
                                    <pre>| inputlookup nmon_alerting_threshold_template</pre>
                                </div>
                            </div>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                        </div>
                    </div>
                </div>

                <!-- Error or failure during the operation -->
                <div class="modal fade" id="modal_generic_error" role="dialog">
                    <div class="modal-dialog">

                        <!-- Modal content-->
                        <div class="modal-content">
                            <div class="modal-header modal-header-danger">
                                <button type="button" class="close" data-dismiss="modal"></button>
                                <h1 style="color: indianred;">
                                    <span class="glyphicon glyphicon-lock"></span>Oops!</h1>
                            </div>
                            <div class="modal-body">
                                <h1>Sorry but it looks like an error occurred while attempting to perform this operation.</h1>
                                <h2>You might not have the permission to do so, or an unexpected failure was encountered.</h2>
                                <b>The server returned the following error message:</b>
                                <div class="modal-error-message">
                                    <p>error return message</p>
                                </div>
                            </div>
                        </div>

                        <div class="modal-footer">
                            <button type="submit" class="btn btn-default pull-right" data-dismiss="modal">
                                <span class="glyphicon glyphicon-remove"></span> Close</button>
                        </div>
                    </div>
                </div>

                <!-- successful operation -->
                <div class="modal fade" id="modal_generic_success" role="dialog">
                    <div class="modal-dialog">

                        <!-- Modal content-->
                        <div class="modal-content">
                            <div class="modal-header modal-header-danger">
                                <button type="button" class="close" data-dismiss="modal"></button>
                                <h1 style="color: #77dd77;">
                                    <span class="glyphicon glyphicon-lock"></span>Success</h1>
                            </div>
                            <div class="modal-body">
                                <div class="modal-success-message">
                                    <h2>The operation was achieved successfully.</h2>
                                </div>
                            </div>

                            <div class="modal-footer">
                                <button type="submit" class="btn btn-primary pull-right" data-dismiss="modal">
                                    <span class="glyphicon glyphicon-remove"></span> Ok</button>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- add entity -->
                <div class="modal custom-modal-80 fade" id="modal_add_entity" role="dialog">
                    <div class="modal-dialog">

                        <!-- Modal content-->
                        <div class="modal-content">
                            <div class="modal-header modal-header-danger">
                                <button type="button" class="close" data-dismiss="modal"></button>
                                <h1 style="color: dodgerblue;">
                                    <span class="glyphicon glyphicon-lock"></span>Add entity:</h1>
                            </div>
                            <div class="modal-body">

                                <div>
                                    <h2>
                                        You can manually add a new entity to the frameID mapping collection, fill the required information and click on submit to add this new entity:
                                    </h2>
                                    <div class="fieldset">
                                        <div class="input input-text" id="input_add_frameid">
                                            <label>Enter the frameID:</label>
                                        </div>
                                        <div class="input input-text" id="input_add_alert_cpu_max_percent">
                                            <label>cpu max %:</label>
                                        </div>
                                        <div class="input input-text" id="input_add_alert_cpu_min_time_seconds">
                                            <label>cpu min time (sec):</label>
                                        </div>
                                        <div class="input input-text" id="input_add_alert_physical_memory_max_percent">
                                            <label>physical memory max %:</label>
                                        </div>
                                        <div class="input input-text" id="input_add_alert_physical_memory_min_time_seconds">
                                            <label>physical memory min time (sec):</label>
                                        </div>
                                        <div class="input input-text" id="input_add_alert_virtual_memory_max_percent">
                                            <label>virtual memory max %:</label>
                                        </div>
                                        <div class="input input-text" id="input_add_alert_virtual_memory_min_time_seconds">
                                            <label>virtual memory min time (sec):</label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button id="btn_submit_new_entity" style="margin-right: 10px;" class="btn btn-primary pull-right" data-dismiss="modal">
                                    <span class="glyphicon glyphicon-remove"></span> Submit</button>
                                <button id="btn_cancel_new_entity" style="margin-right: 10px;" class="btn btn-secondary pull-right" data-dismiss="modal">
                                    <span class="glyphicon glyphicon-remove"></span> Cancel</button>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- update entity -->
                <div class="modal custom-modal-80 fade" id="modal_update_entity" role="dialog">
                    <div class="modal-dialog">

                        <!-- Modal content-->
                        <div class="modal-content">
                            <div class="modal-header modal-header-danger">
                                <button type="button" class="close" data-dismiss="modal"></button>
                                <h1 style="color: dodgerblue;">
                                    <span class="glyphicon glyphicon-lock"></span>Update or delete entity:</h1>
                            </div>
                            <div class="modal-body">

                                <div>

                                    <h2>
                                        Update the entity information in the following inputs and click on the update button. If you wish to delete this entity from the collection, click on delete.
                                    </h2>

                                    <div class="fieldset">
                                        <div class="input input-text" id="input_update_frameid">
                                            <label>update frameID:</label>
                                        </div>
                                        <div class="input input-text" id="input_update_alert_cpu_max_percent">
                                            <label>cpu max %:</label>
                                        </div>
                                        <div class="input input-text" id="input_update_alert_cpu_min_time_seconds">
                                            <label>cpu min time (sec):</label>
                                        </div>
                                        <div class="input input-text" id="input_update_alert_physical_memory_max_percent">
                                            <label>physical memory max %:</label>
                                        </div>
                                        <div class="input input-text" id="input_update_alert_physical_memory_min_time_seconds">
                                            <label>physical memory min time (sec):</label>
                                        </div>
                                        <div class="input input-text" id="input_update_alert_virtual_memory_max_percent">
                                            <label>virtual memory max %:</label>
                                        </div>
                                        <div class="input input-text" id="input_update_alert_virtual_memory_min_time_seconds">
                                            <label>virtual memory min time (sec):</label>
                                        </div>
                                    </div>
                                </div>

                            </div>

                            <div class="modal-footer">
                                <button id="btn_submit_delete_entity" style="margin-right: 10px;" class="btn btn-danger pull-right" data-dismiss="modal">
                                    <span class="glyphicon glyphicon-remove"></span> Delete this entity</button>
                                <button id="btn_submit_update_entity" style="margin-right: 10px;" class="btn btn-primary pull-right" data-dismiss="modal">
                                    <span class="glyphicon glyphicon-remove"></span> Update this entity</button>
                                <button id="btn_cancel_update_entity" style="margin-right: 10px;" class="btn btn-secondary pull-right" data-dismiss="modal">
                                    <span class="glyphicon glyphicon-remove"></span> Cancel</button>
                            </div>

                        </div>
                    </div>
                </div>

                <!-- end modals -->

                <div class="parent-top-single">
                    <div id="element_unset_exclusions">
                    </div>
                    <div id="element_nb_hosts">
                    </div>
                </div>
            </html>
        </panel>
    </row>
    <row>
        <panel>
            <html>
                <div>
                    <button id="btn_help" style="margin-left: 20px; margin-right: 10px;" class="btn btn-primary pull-left" data-dismiss="modal">
                        <span class="glyphicon glyphicon-remove"></span> Help &amp; information</button>
                    <button id="btn_add_new_template" style="margin-left: 20px; margin-right: 10px;" class="btn btn-primary pull-left" data-dismiss="modal">
                        <span class="glyphicon glyphicon-remove"></span>Add a new template</button>
                </div>
            </html>
        </panel>
    </row>

    <row>
        <panel>
            <html>
                <div>
                    <div style="margin-left: 20px;">
                        <div class="input input-linklist" id="inputLink">
                            <label></label>
                        </div>
                    </div>

                    <div id="tableParent1" style="display: none;">

                        <h2>Use template alerting threshold management to apply threshold against frameID. Thresholds will be applied to all matching servers unless servers have per server thresholds configured. (see help link at the bottom of this page)
                        </h2>
                        <h3>
                        The threshold table shows template thresholds currently configured.To pref-fill for modification and deletion, click on any row of the table
                        </h3>

                        <div class="fieldset">
                            <div class="input input-text" id="input_search_frameid">
                                <label>Search frameID:</label>
                            </div>
                        </div>

                        <div id="element_table_show_lookup_content">
                        </div>
                    </div>

                    <div id="tableParent2" style="display: none;">

                        <h2>frameID KVstore collection current content:</h2>
                        <h3>The table shows frameID mapping entries currently configured. To search for an entry, fill the filters and press enter</h3>
                        <div>
                            <div class="fieldset">
                                <div class="input input-text" id="input_frameID_search_frameid">
                                    <label>Search frameID:</label>
                                </div>

                                <div class="input input-text" id="input_frameID_search_serialnum">
                                    <label>Search serialnum:</label>
                                </div>

                                <div class="input input-text" id="input_frameID_search_host">
                                    <label>Search host:</label>
                                </div>

                                <div class="input input-text" id="input_frameID_search_host_description">
                                    <label>Search host_description:</label>
                                </div>

                            </div>
                        </div>
                        <div id="element_table_show_frameID_lookup_content">
                        </div>
                    </div>

                </div>
            </html>
        </panel>
    </row>

</dashboard>