| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- {% extends "layout.html" %}
- {% block head %}
- {{ super() }}
- <style type="text/css">
- [class^="content-box"] {
- border-radius: 0 !important;
- }
- </style>
- {% endblock head %}
- {% block content %}
- <script type="text/javascript">
- var resource_path = window.location.pathname;
- var cur_url = resource_path;
- $(document).ready(function() {
- $('body').addClass('add-transition');
- $('.add-page-transition').on('click', function(){
- var transAttr = $(this).attr('data-transition');
- $('.add-transition').attr('class', 'add-transition');
- $('.add-transition').addClass(transAttr);
- });
- });
- </script>
- <div class="panel">
- <div class="panel-body">
- <h3 class="title-hero">
- 资源概览
- </h3>
- <div class="example-box-wrapper">
- <div class="row">
- <div class="col-md-2">
- <a href="/hosts" title="计算节点 CPU 总计" class="tile-box tile-box-shortcut btn-info">
- <div class="tile-content-wrapper">
- <i class="webhh icon-cpu-processor"></i>
- <div style="font-size: 20px; margin-top: 18px; right: 10px; position: absolute;">
- {{ hosts_sum.cpu }} 核
- </div>
- <div class="tile-header" style="opacity: .70;">
- 计算节点 CPU 总计
- </div>
- </div>
- </a>
- </div>
- <div class="col-md-2">
- <a href="/hosts" title="计算节点内存总计" class="tile-box tile-box-shortcut btn-warning">
- <div class="tile-content-wrapper">
- <i class="webhh icon-ram"></i>
- <div style="font-size: 20px; margin-top: 18px; right: 10px; position: absolute;">
- {{ (hosts_sum.memory / 1024 / 1024 / 1024)|int }} GB
- </div>
- <div class="tile-header" style="opacity: .70;">
- 计算节点内存总计
- </div>
- </div>
- </a>
- </div>
- <div class="col-md-2">
- <a href="/guests" title="虚拟机 CPU 总计" class="tile-box tile-box-shortcut btn-blue-alt">
- <div class="tile-content-wrapper">
- <i class="webhh icon-stampalt"></i>
- <div style="font-size: 20px; margin-top: 18px; right: 10px; position: absolute;">
- {{ guests_distribute_count_ret.data.cpu }} 核
- </div>
- <div class="tile-header" style="opacity: .70;">
- 虚拟机 CPU 总计
- </div>
- </div>
- </a>
- </div>
- <div class="col-md-3">
- <a href="/guests" title="虚拟机内存总计" class="tile-box tile-box-shortcut btn-purple">
- <div class="tile-content-wrapper">
- <i class="webhh icon-ruler"></i>
- <div style="font-size: 20px; margin-top: 18px; right: 10px; position: absolute;">
- {{ guests_distribute_count_ret.data.memory }} GB
- </div>
- <div class="tile-header" style="opacity: .70;">
- 虚拟机内存总计
- </div>
- </div>
- </a>
- </div>
- <div class="col-md-3">
- <a href="/disks" title="虚拟机磁盘空间总计" class="tile-box tile-box-shortcut btn-black-opacity">
- <div class="tile-content-wrapper">
- <i class="webhh icon-diskspace"></i>
- <div style="font-size: 20px; margin-top: 18px; right: 10px; position: absolute;">
- {{ disks_distribute_count_ret.data.total_size }} GB
- </div>
- <div class="tile-header" style="opacity: .70;">
- 虚拟机磁盘空间总计
- </div>
- </div>
- </a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="panel">
- <div class="panel-body">
- <h3 class="title-hero">
- 虚拟机 TOP <span style="font-size: 17px;">10</span>
- </h3>
- <div class="row">
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header bg-blue-alt">
- CPU
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">负载</td>
- </tr>
- </thead>
- <tbody>
- {% for item in guests_current_top_10_ret.data.cpu_load %}
- {% if item.guest_uuid not in guests_mapping_by_uuid %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/guest/detail/{{ item.guest_uuid }}">
- {{ guests_mapping_by_uuid[item.guest_uuid].label }}/{{ guests_mapping_by_uuid[item.guest_uuid].remark }}
- </a>
- </td>
- <td>
- <div class="progressbar-small progressbar" data-value="{{ item.cpu_load }}">
- <div class="progressbar-value tooltip-button {% if item.cpu_load >= 85 %}bg-red{% elif item.cpu_load >= 65 %}bg-orange{% else %}bg-green{% endif %}" title="{{ item.cpu_load }}%">
- </div>
- </div>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header" style="background-color: #9e9e9e; opacity: 0.9; color: #fff;">
- 磁盘 IOPS
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">IOPS</td>
- </tr>
- </thead>
- <tbody>
- {% for item in guests_current_top_10_ret.data.rw_req %}
- {% if item.disk_uuid not in disks_mapping_by_uuid %}{% continue %}{% endif %}
- {% if disks_mapping_by_uuid[item.disk_uuid].guest_uuid not in guests_mapping_by_uuid %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/disk/detail/{{ item.disk_uuid }}">
- {{ guests_mapping_by_uuid[disks_mapping_by_uuid[item.disk_uuid].guest_uuid].label }}/{{ disks_mapping_by_uuid[item.disk_uuid].remark }}
- </a>
- </td>
- <td>
- {{ item.rw_req }}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header" style="background-color: #9e9e9e; opacity: 0.9; color: #fff;">
- 磁盘吞吐量
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">吞吐量</td>
- </tr>
- </thead>
- <tbody>
- {% for item in guests_current_top_10_ret.data.rw_bytes %}
- {% if item.disk_uuid not in disks_mapping_by_uuid %}{% continue %}{% endif %}
- {% if disks_mapping_by_uuid[item.disk_uuid].guest_uuid not in guests_mapping_by_uuid %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/disk/detail/{{ item.disk_uuid }}">
- {{ guests_mapping_by_uuid[disks_mapping_by_uuid[item.disk_uuid].guest_uuid].label }}/{{ disks_mapping_by_uuid[item.disk_uuid].remark }}
- </a>
- </td>
- <td>
- <!-- 速率参考链接:https://en.wikipedia.org/wiki/Data_rate_units#Examples_of_bit_rates -->
- {% if item.rw_bytes >= 1024**3 %}
- {{ '%0.1f'| format(item.rw_bytes / 1024**3) }} GBps
- {% elif item.rw_bytes >= 1024**2 %}
- {{ '%0.1f'| format(item.rw_bytes / 1024**2) }} MBps
- {% elif item.rw_bytes >= 1024 %}
- {{ '%0.1f'| format(item.rw_bytes / 1024) }} KBps
- {% else %}
- {{ item.rw_bytes }} Bps
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header bg-green" style="opacity: 0.72;">
- 网络流量
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">流量</td>
- </tr>
- </thead>
- <tbody>
- {% for item in guests_current_top_10_ret.data.rt_bytes %}
- {% if item.guest_uuid not in guests_mapping_by_uuid %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/guest/detail/{{ item.guest_uuid }}">
- {{ guests_mapping_by_uuid[item.guest_uuid].label }}/{{ guests_mapping_by_uuid[item.guest_uuid].remark }}
- </a>
- </td>
- <td>
- <!-- 速率参考链接:https://en.wikipedia.org/wiki/Data_rate_units#Examples_of_bit_rates -->
- {% if item.rt_bytes * 8 >= 1000**3 %}
- {{ '%0.1f'| format(item.rt_bytes * 8 / 1000**3) }} Gbps
- {% elif item.rt_bytes * 8 >= 1000**2 %}
- {{ '%0.1f'| format(item.rt_bytes * 8 / 1000**2) }} Mbps
- {% elif item.rt_bytes * 8 >= 1000 %}
- {{ '%0.1f'| format(item.rt_bytes * 8 / 1000) }} kbps
- {% else %}
- {{ item.rt_bytes * 8 }} bps
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- </div>
- <div class="col-md-4">
- </div>
- </div>
- </div>
- </div>
- <div class="panel">
- <div class="panel-body">
- <h3 class="title-hero">
- 计算节点 TOP <span style="font-size: 17px;">10</span>
- </h3>
- <div class="row">
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header btn-info">
- CPU
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">负载</td>
- </tr>
- </thead>
- <tbody>
- {% for item in hosts_current_top_10_ret.data.cpu_load %}
- {% if item.node_id not in hosts_mapping_by_node_id %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/host/detail/{{ item.node_id }}">
- {{ hosts_mapping_by_node_id[item.node_id].hostname }}
- </a>
- </td>
- <td>
- <div class="progressbar-small progressbar" data-value="{{ item.cpu_load }}">
- <div class="progressbar-value tooltip-button {% if item.cpu_load >= 85 %}bg-red{% elif item.cpu_load >= 65 %}bg-orange{% else %}bg-green{% endif %}" title="{{ item.cpu_load }}%">
- </div>
- </div>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header" style="background-color: #8e8e8e; color: #fff;">
- 磁盘 IOPS
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">IOPS</td>
- </tr>
- </thead>
- <tbody>
- {% for item in hosts_current_top_10_ret.data.rw_req %}
- {% if item.node_id not in hosts_mapping_by_node_id %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/host/detail/{{ item.node_id }}">
- {{ hosts_mapping_by_node_id[item.node_id].hostname }}({{ item.mountpoint }})
- </a>
- </td>
- <td>
- {{ item.rw_req }}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header" style="background-color: #8e8e8e; color: #fff;">
- 磁盘吞吐量
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">吞吐量</td>
- </tr>
- </thead>
- <tbody>
- {% for item in hosts_current_top_10_ret.data.rw_bytes %}
- {% if item.node_id not in hosts_mapping_by_node_id %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/host/detail/{{ item.node_id }}">
- {{ hosts_mapping_by_node_id[item.node_id].hostname }}({{ item.mountpoint }})
- </a>
- </td>
- <td>
- <!-- 速率参考链接:https://en.wikipedia.org/wiki/Data_rate_units#Examples_of_bit_rates -->
- {% if item.rw_bytes >= 1024**3 %}
- {{ '%0.1f'| format(item.rw_bytes / 1024**3) }} GBps
- {% elif item.rw_bytes >= 1024**2 %}
- {{ '%0.1f'| format(item.rw_bytes / 1024**2) }} MBps
- {% elif item.rw_bytes >= 1024 %}
- {{ '%0.1f'| format(item.rw_bytes / 1024) }} KBps
- {% else %}
- {{ item.rw_bytes }} Bps
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header bg-green">
- 网络流量
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">流量</td>
- </tr>
- </thead>
- <tbody>
- {% for item in hosts_current_top_10_ret.data.rt_bytes %}
- {% if item.node_id not in hosts_mapping_by_node_id %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/host/detail/{{ item.node_id }}">
- {{ hosts_mapping_by_node_id[item.node_id].hostname }}({{ item.name }})
- </a>
- </td>
- <td>
- <!-- 速率参考链接:https://en.wikipedia.org/wiki/Data_rate_units#Examples_of_bit_rates -->
- {% if item.rt_bytes * 8 >= 1000**3 %}
- {{ '%0.1f'| format(item.rt_bytes * 8 / 1000**3) }} Gbps
- {% elif item.rt_bytes * 8 >= 1000**2 %}
- {{ '%0.1f'| format(item.rt_bytes * 8 / 1000**2) }} Mbps
- {% elif item.rt_bytes * 8 >= 1000 %}
- {{ '%0.1f'| format(item.rt_bytes * 8 / 1000) }} kbps
- {% else %}
- {{ item.rt_bytes * 8 }} bps
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- <div class="content-box">
- <h3 class="content-box-header btn-warning">
- 内存使用率
- </h3>
- <div class="content-box-wrapper" style="padding-top: 0;">
- <table class="table mrg0B mrg10T" style="table-layout: fixed;">
- <thead>
- <tr>
- <td style="width: 65%;">实例</td>
- <td style="width: 35%;">使用率</td>
- </tr>
- </thead>
- <tbody>
- {% for item in hosts_current_top_10_ret.data.memory_rate %}
- {% if item.node_id not in hosts_mapping_by_node_id %}{% continue %}{% endif %}
- <tr>
- <td class="text-left" style="text-overflow: ellipsis; white-space: nowrap; overflow: hidden;">
- <a href="/host/detail/{{ item.node_id }}">
- {{ hosts_mapping_by_node_id[item.node_id].hostname }}
- </a>
- </td>
- <td>
- {{ item.memory_rate }}%
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="col-md-4">
- </div>
- </div>
- </div>
- </div>
- {% endblock content %}
|