disk_detail.html 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. {% extends "layout.html" %}
  2. {% block head %}
  3. {{ super() }}
  4. <style type="text/css">
  5. @media (min-width: 768px) {
  6. .form-horizontal .control-label {
  7. text-align: left;
  8. }
  9. }
  10. label>span {
  11. color: deepskyblue;
  12. }
  13. #change_disk_quota_form label {
  14. padding-left: 0;
  15. padding-right: 0;
  16. }
  17. .btn,
  18. .form-group>div>div,
  19. .form-control {
  20. border-radius: 0;
  21. }
  22. .table {
  23. font-size: 12px;
  24. border-width: 1px;
  25. line-height: 22px;
  26. }
  27. .table > tbody > tr > td {
  28. color: #424547;
  29. }
  30. .table-bordered > tbody > tr {
  31. padding-top: 10px;
  32. padding-bottom: 10px;
  33. }
  34. .table-bordered > thead > tr > th,
  35. .table-bordered > tbody > tr > th,
  36. .table-bordered > tfoot > tr > th,
  37. .table-bordered > thead > tr > td,
  38. .table-bordered > tbody > tr > td,
  39. .table-bordered > tfoot > tr > td {
  40. border-style: solid;
  41. border-width: 1px 0 0 0;
  42. }
  43. .guest-label {
  44. color: #999999;
  45. }
  46. .guest-desc {
  47. color: #333333;
  48. }
  49. </style>
  50. {% endblock head %}
  51. {% block body %}
  52. <script>
  53. var resource_path = window.location.pathname;
  54. var resource_path_array = resource_path.split('/');
  55. var uuid = resource_path_array[resource_path_array.length - 1];
  56. var datetime_format_type = 'time';
  57. function format_time(timestamp, i) {
  58. if (datetime_format_type === 'time') {
  59. return new Date(timestamp).format('HH:MM');
  60. } else {
  61. return new Date(timestamp).format('mm-dd');
  62. }
  63. }
  64. function render_disk_throughput_chart(disk_uuid, granularity, dev_id, dev_name) {
  65. var url = '/api/performance/disk_io/last_hour/' + disk_uuid;
  66. if (granularity === 'hour') {
  67. url = '/api/performance/disk_io/last_hour/' + disk_uuid
  68. } else if (granularity === 'six_hours') {
  69. url = '/api/performance/disk_io/last_six_hours/' + disk_uuid
  70. } else if (granularity === 'day') {
  71. url = '/api/performance/disk_io/last_day/' + disk_uuid
  72. } else {
  73. url = '/api/performance/disk_io/last_seven_days/' + disk_uuid
  74. }
  75. $.ajax({
  76. url : url,
  77. type : 'GET',
  78. contentType: "application/json; charset=utf-8",
  79. dataType: 'json',
  80. error : function() {
  81. alter_danger('获取图表数据失败失败!');
  82. },
  83. success : function(data, textStatus, xhr) {
  84. if (data.data.length > 1) {
  85. if ((data.data[data.data.length - 1]['timestamp'] - data.data[0]['timestamp']) >= 86400) {
  86. datetime_format_type = 'date';
  87. }
  88. }
  89. var option = {
  90. color: ['#3BC0FF', '#FAB406'],
  91. title: {
  92. text: '磁盘吞吐量 - ' + dev_name
  93. },
  94. legend: {
  95. data:['读(MBps)', '写(MBps)'],
  96. bottom: 5
  97. },
  98. toolbox: {
  99. feature: {
  100. dataZoom: {
  101. yAxisIndex: 'none'
  102. },
  103. magicType: {type: ['line', 'bar']},
  104. saveAsImage: {
  105. show: true,
  106. pixelRatio: 4
  107. }
  108. }
  109. },
  110. tooltip: {
  111. show: true,
  112. trigger: 'axis',
  113. formatter: (function (params, ticket, callback) {
  114. var readSeriesName = params[0].seriesName;
  115. var writeSeriesName = params[1].seriesName;
  116. var read = params[0].data[1];
  117. var write = params[1].data[1];
  118. var readMarker = params[0].marker;
  119. var writeMarker = params[1].marker;
  120. var datetime = new Date(params[0].data[0]).format('yyyy-mm-dd HH:MM:ss');
  121. if (read === null) {
  122. read = '无数据';
  123. }
  124. if (write === null) {
  125. write = '无数据';
  126. }
  127. return datetime + '<br />' + [readMarker, readSeriesName, read].join(' ') +
  128. '<br />' + [writeMarker, writeSeriesName, write].join(' ')
  129. })
  130. },
  131. xAxis: {
  132. type: 'time',
  133. axisTick: {
  134. show: false
  135. },
  136. axisLine: {
  137. lineStyle: {
  138. opacity: 0.1,
  139. color: '#3d4245'
  140. }
  141. },
  142. splitLine: {
  143. show: false
  144. },
  145. axisLabel: {
  146. formatter: format_time
  147. }
  148. },
  149. yAxis: {
  150. min: 0,
  151. max: 'dataMax',
  152. minInterval: 2,
  153. axisTick: {
  154. show: false
  155. },
  156. axisLine: {
  157. lineStyle: {
  158. opacity: 0,
  159. color: '#8c8f91'
  160. }
  161. },
  162. splitLine: {
  163. show: true,
  164. lineStyle: {
  165. width: 1,
  166. opacity: 0.5
  167. }
  168. }
  169. },
  170. series: [{
  171. name: '读(MBps)',
  172. type: 'line',
  173. showSymbol: false,
  174. smooth: true,
  175. lineStyle: {
  176. normal: {
  177. width: 1
  178. }
  179. },
  180. data: (function () {
  181. var d = [];
  182. $.each(data.data, function(i, ele) {
  183. d.push([
  184. ele['timestamp'] * 1000,
  185. ele['rd_bytes'] !== null ? Math.floor(ele['rd_bytes'] / 1024 / 1024 * 1000) / 1000 : null
  186. ])
  187. });
  188. return d;
  189. })()
  190. },{
  191. name: '写(MBps)',
  192. type: 'line',
  193. showSymbol: false,
  194. smooth: true,
  195. lineStyle: {
  196. normal: {
  197. width: 1
  198. }
  199. },
  200. data: (function () {
  201. var d = [];
  202. $.each(data.data, function(i, ele) {
  203. d.push([
  204. ele['timestamp'] * 1000,
  205. ele['wr_bytes'] !== null ? Math.floor(ele['wr_bytes'] / 1024 / 1024 * 1000) / 1000 : null
  206. ])
  207. });
  208. return d;
  209. })()
  210. }]
  211. };
  212. var disk_chart = echarts.init(document.getElementById(dev_id));
  213. disk_chart.setOption(option);
  214. }
  215. });
  216. }
  217. function render_disk_iops_chart(disk_uuid, granularity, dev_id, dev_name) {
  218. var url = '/api/performance/disk_io/last_hour/' + disk_uuid;
  219. if (granularity === 'hour') {
  220. url = '/api/performance/disk_io/last_hour/' + disk_uuid
  221. } else if (granularity === 'six_hours') {
  222. url = '/api/performance/disk_io/last_six_hours/' + disk_uuid
  223. } else if (granularity === 'day') {
  224. url = '/api/performance/disk_io/last_day/' + disk_uuid
  225. } else {
  226. url = '/api/performance/disk_io/last_seven_days/' + disk_uuid
  227. }
  228. $.ajax({
  229. url : url,
  230. type : 'GET',
  231. contentType: "application/json; charset=utf-8",
  232. dataType: 'json',
  233. error : function() {
  234. alter_danger('获取图表数据失败失败!');
  235. },
  236. success : function(data, textStatus, xhr) {
  237. if (data.data.length > 1) {
  238. if ((data.data[data.data.length - 1]['timestamp'] - data.data[0]['timestamp']) >= 86400) {
  239. datetime_format_type = 'date';
  240. }
  241. }
  242. var option = {
  243. color: ['#3BC0FF', '#FAB406'],
  244. title: {
  245. text: '磁盘IOPS - ' + dev_name
  246. },
  247. legend: {
  248. data:['读(IOPS)', '写(IOPS)'],
  249. bottom: 5
  250. },
  251. toolbox: {
  252. feature: {
  253. dataZoom: {
  254. yAxisIndex: 'none'
  255. },
  256. magicType: {type: ['line', 'bar']},
  257. saveAsImage: {
  258. show: true,
  259. pixelRatio: 4
  260. }
  261. }
  262. },
  263. tooltip: {
  264. show: true,
  265. trigger: 'axis',
  266. formatter: (function (params, ticket, callback) {
  267. var readSeriesName = params[0].seriesName;
  268. var writeSeriesName = params[1].seriesName;
  269. var read = params[0].data[1];
  270. var write = params[1].data[1];
  271. var readMarker = params[0].marker;
  272. var writeMarker = params[1].marker;
  273. var datetime = new Date(params[0].data[0]).format('yyyy-mm-dd HH:MM:ss');
  274. if (read === null) {
  275. read = '无数据';
  276. }
  277. if (write === null) {
  278. write = '无数据';
  279. }
  280. return datetime + '<br />' + [readMarker, readSeriesName, read].join(' ') +
  281. '<br />' + [writeMarker, writeSeriesName, write].join(' ')
  282. })
  283. },
  284. xAxis: {
  285. type: 'time',
  286. axisTick: {
  287. show: false
  288. },
  289. axisLine: {
  290. lineStyle: {
  291. opacity: 0.1,
  292. color: '#3d4245'
  293. }
  294. },
  295. splitLine: {
  296. show: false
  297. },
  298. axisLabel: {
  299. formatter: format_time
  300. }
  301. },
  302. yAxis: {
  303. min: 0,
  304. max: 'dataMax',
  305. minInterval: 2,
  306. axisTick: {
  307. show: false
  308. },
  309. axisLine: {
  310. lineStyle: {
  311. opacity: 0,
  312. color: '#8c8f91'
  313. }
  314. },
  315. splitLine: {
  316. show: true,
  317. lineStyle: {
  318. width: 1,
  319. opacity: 0.5
  320. }
  321. }
  322. },
  323. series: [{
  324. name: '读(IOPS)',
  325. type: 'line',
  326. showSymbol: false,
  327. smooth: true,
  328. lineStyle: {
  329. normal: {
  330. width: 1
  331. }
  332. },
  333. data: (function () {
  334. var d = [];
  335. $.each(data.data, function(i, ele) {
  336. d.push([
  337. ele['timestamp'] * 1000,
  338. ele['rd_req'] !== null ? ele['rd_req'] : null
  339. ])
  340. });
  341. return d;
  342. })()
  343. },{
  344. name: '写(IOPS)',
  345. type: 'line',
  346. showSymbol: false,
  347. smooth: true,
  348. lineStyle: {
  349. normal: {
  350. width: 1
  351. }
  352. },
  353. data: (function () {
  354. var d = [];
  355. $.each(data.data, function(i, ele) {
  356. d.push([
  357. ele['timestamp'] * 1000,
  358. ele['wr_req'] !== null ? ele['wr_req'] : null
  359. ])
  360. });
  361. return d;
  362. })()
  363. }]
  364. };
  365. var disk_chart = echarts.init(document.getElementById(dev_id));
  366. disk_chart.setOption(option);
  367. }
  368. });
  369. }
  370. function render_disks_chart(uuid, granularity) {
  371. var dev_table = [];
  372. for (var i = 1; i <= 26; i++) {
  373. dev_table.push('vd' + String.fromCharCode(0x60+i));
  374. }
  375. var dev_name = dev_table[{{ disk_ret.data.sequence }}];
  376. var dev_id_throughput = 'disk_throughput_chart';
  377. var dev_id_iops = 'disk_iops_chart';
  378. render_disk_throughput_chart(uuid, granularity, dev_id_throughput, dev_name);
  379. render_disk_iops_chart(uuid, granularity, dev_id_iops, dev_name);
  380. }
  381. $(document).ready(function() {
  382. $('body').addClass('add-transition');
  383. $('.add-page-transition').on('click', function(){
  384. var transAttr = $(this).attr('data-transition');
  385. $('.add-transition').attr('class', 'add-transition');
  386. $('.add-transition').addClass(transAttr);
  387. });
  388. render_disks_chart(uuid, 'hour');
  389. register_iops_bps_event();
  390. });
  391. function refresh_render_with_specify_granularity(granularity) {
  392. render_disks_chart(uuid, granularity)
  393. }
  394. function refresh() {
  395. window.location.href=window.location.pathname;
  396. }
  397. function update_disk_quota(uuids) {
  398. $.ajax({
  399. url : '/api/disks/' + uuids.join(','),
  400. type : 'PATCH',
  401. contentType: "application/json; charset=utf-8",
  402. data : JSON.stringify({
  403. iops: parseInt($('#iops').val()),
  404. iops_rd: parseInt($('#iops_rd').val()),
  405. iops_wr: parseInt($('#iops_wr').val()),
  406. iops_max: parseInt($('#iops_max').val()),
  407. iops_max_length: parseInt($('#iops_max_length').val()),
  408. bps: parseInt($('#bps').val()) * 1024 * 1024,
  409. bps_rd: parseInt($('#bps_rd').val()) * 1024 * 1024,
  410. bps_wr: parseInt($('#bps_wr').val()) * 1024 * 1024,
  411. bps_max: parseInt($('#bps_max').val()) * 1024 * 1024,
  412. bps_max_length: parseInt($('#bps_max_length').val())
  413. }),
  414. error : function() {
  415. alter_danger('变更磁盘性能配额指令发送失败!');
  416. },
  417. success : function() {
  418. alter_success('变更磁盘性能配额指令发送成功!');
  419. refresh();
  420. }
  421. });
  422. }
  423. function change_disk_quota() {
  424. var uuids = [uuid];
  425. if (uuids) {
  426. update_disk_quota(uuids);
  427. }
  428. $('#change_disk_quota_modal').modal('hide');
  429. }
  430. $(function() { "use strict";
  431. $("#iops").TouchSpin({
  432. max: {{ config_ret.data.iops_cap }},
  433. min: 0,
  434. verticalbuttons: true,
  435. verticalupclass: 'glyph-icon icon-plus',
  436. verticaldownclass: 'glyph-icon icon-minus'
  437. });
  438. });
  439. $(function() { "use strict";
  440. $("#iops_rd").TouchSpin({
  441. max: {{ config_ret.data.iops_cap - disk_ret.data.iops_wr }},
  442. min: 0,
  443. verticalbuttons: true,
  444. verticalupclass: 'glyph-icon icon-plus',
  445. verticaldownclass: 'glyph-icon icon-minus'
  446. });
  447. });
  448. $(function() { "use strict";
  449. $("#iops_wr").TouchSpin({
  450. max: {{ config_ret.data.iops_cap - disk_ret.data.iops_rd }},
  451. min: 0,
  452. verticalbuttons: true,
  453. verticalupclass: 'glyph-icon icon-plus',
  454. verticaldownclass: 'glyph-icon icon-minus'
  455. });
  456. });
  457. $(function() { "use strict";
  458. $("#iops_max").TouchSpin({
  459. max: {{ config_ret.data.iops_max }},
  460. min: 0,
  461. verticalbuttons: true,
  462. verticalupclass: 'glyph-icon icon-plus',
  463. verticaldownclass: 'glyph-icon icon-minus'
  464. });
  465. });
  466. $(function() { "use strict";
  467. $("#iops_max_length").TouchSpin({
  468. max: {{ config_ret.data.iops_max_length }},
  469. min: 0,
  470. verticalbuttons: true,
  471. verticalupclass: 'glyph-icon icon-plus',
  472. verticaldownclass: 'glyph-icon icon-minus'
  473. });
  474. });
  475. $(function() { "use strict";
  476. $("#bps").TouchSpin({
  477. max: {{ (config_ret.data.bps_cap / 1024 / 1024) | int }},
  478. min: 0,
  479. verticalbuttons: true,
  480. verticalupclass: 'glyph-icon icon-plus',
  481. verticaldownclass: 'glyph-icon icon-minus'
  482. });
  483. });
  484. $(function() { "use strict";
  485. $("#bps_rd").TouchSpin({
  486. max: {{ ((config_ret.data.bps_cap - disk_ret.data.bps_wr) / 1024 / 1024) | int }},
  487. min: 0,
  488. verticalbuttons: true,
  489. verticalupclass: 'glyph-icon icon-plus',
  490. verticaldownclass: 'glyph-icon icon-minus'
  491. });
  492. });
  493. $(function() { "use strict";
  494. $("#bps_wr").TouchSpin({
  495. max: {{ ((config_ret.data.bps_cap - disk_ret.data.bps_rd) / 1024 / 1024) | int }},
  496. min: 0,
  497. verticalbuttons: true,
  498. verticalupclass: 'glyph-icon icon-plus',
  499. verticaldownclass: 'glyph-icon icon-minus'
  500. });
  501. });
  502. $(function() { "use strict";
  503. $("#bps_max").TouchSpin({
  504. max: {{ (config_ret.data.bps_max / 1024 / 1024) | int }},
  505. min: 0,
  506. verticalbuttons: true,
  507. verticalupclass: 'glyph-icon icon-plus',
  508. verticaldownclass: 'glyph-icon icon-minus'
  509. });
  510. });
  511. $(function() { "use strict";
  512. $("#bps_max_length").TouchSpin({
  513. max: {{ config_ret.data.bps_max_length }},
  514. min: 0,
  515. verticalbuttons: true,
  516. verticalupclass: 'glyph-icon icon-plus',
  517. verticaldownclass: 'glyph-icon icon-minus'
  518. });
  519. });
  520. function register_iops_bps_event() {
  521. $('#iops').on('change', function(){
  522. $("#iops_rd").trigger("touchspin.updatesettings", {max: $('#iops').val() - $('#iops_wr').val()});
  523. $("#iops_wr").trigger("touchspin.updatesettings", {max: $('#iops').val() - $('#iops_rd').val()});
  524. });
  525. $('#iops_rd').on('change', function(){
  526. $("#iops_wr").trigger("touchspin.updatesettings", {max: $('#iops').val() - $('#iops_rd').val()});
  527. });
  528. $('#iops_wr').on('change', function(){
  529. $("#iops_rd").trigger("touchspin.updatesettings", {max: $('#iops').val() - $('#iops_wr').val()});
  530. });
  531. $('#bps').on('change', function(){
  532. $("#bps_rd").trigger("touchspin.updatesettings", {max: $('#bps').val() - $('#bps_wr').val()});
  533. $("#bps_wr").trigger("touchspin.updatesettings", {max: $('#bps').val() - $('#bps_rd').val()});
  534. });
  535. $('#bps_rd').on('change', function(){
  536. $("#bps_wr").trigger("touchspin.updatesettings", {max: $('#bps').val() - $('#bps_rd').val()});
  537. });
  538. $('#bps_wr').on('change', function(){
  539. $("#bps_rd").trigger("touchspin.updatesettings", {max: $('#bps').val() - $('#bps_wr').val()});
  540. });
  541. }
  542. </script>
  543. <div class="container" style="padding-top: 100px; width: 90%; max-width: 100%;">
  544. <div class="panel">
  545. <div class="panel-body">
  546. <a href="javascript:history.go(-1)" class="btn btn-xs btn-default add-page-transition" data-transition="pt-page-moveFromLeft-init" style="margin-bottom: 4px; margin-left: 10px;">
  547. <span class="glyph-icon icon-separator" style="transform: rotateY(-180deg);">
  548. <i class="glyph-icon icon-level-up"></i>
  549. </span>
  550. <span class="button-content">
  551. 返回
  552. </span>
  553. </a>
  554. <div class="row" style="margin-top: 10px;">
  555. <div class="col-xs-4">
  556. <div style="background: #F5f6FA; border: 1px solid #e1e6eb; padding: 10px; font-size: 14px; width: 100%;">
  557. <span>
  558. 磁盘信息
  559. </span>
  560. </div>
  561. <table class="table table-bordered">
  562. <tbody>
  563. <tr>
  564. <td>
  565. <span class="guest-label">UUID:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  566. <span class="guest-desc">
  567. {{ disk_ret.data.uuid }}
  568. </span>
  569. </td>
  570. </tr>
  571. <tr>
  572. <td>
  573. <span class="guest-label">名称:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  574. <span class="guest-desc">
  575. {{ disk_ret.data.remark }}
  576. </span>
  577. </td>
  578. </tr>
  579. <tr>
  580. <td>
  581. <span class="guest-label">状态:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  582. <span class="guest-desc">
  583. {{ format_disk_state(disk_ret.data.state)|safe }}
  584. </span>
  585. </td>
  586. </tr>
  587. <tr>
  588. <td>
  589. <span class="guest-label">磁盘性别:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  590. <span class="guest-desc">
  591. {% if disk_ret.data.sequence == 0 %}
  592. 系统盘
  593. {% else %}
  594. 数据盘
  595. {% endif %}
  596. </span>
  597. </td>
  598. </tr>
  599. <tr>
  600. <td>
  601. <span class="guest-label">磁盘容量:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  602. <span class="guest-desc">
  603. {{ disk_ret.data.size }} GB
  604. </span>
  605. </td>
  606. </tr>
  607. <tr>
  608. <td>
  609. <span class="guest-label">所属 Guest:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  610. <span class="guest-desc">
  611. {% if disk_ret.data.sequence != -1 %}
  612. <a href="/guest/detail/{{ disk_ret.data.guest_uuid }}">{{ guest_ret.data.label }}/{{ guest_ret.data.remark }}</a>
  613. {% else %}
  614. {% endif %}
  615. </span>
  616. </td>
  617. </tr>
  618. <tr>
  619. <td>
  620. <span class="guest-label">设备号:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  621. <span class="guest-desc">
  622. {{ format_sequence_to_device_name(disk_ret.data.sequence) }}
  623. </span>
  624. </td>
  625. </tr>
  626. <tr>
  627. <td style="padding: 0;">
  628. <table style="width: 100%;">
  629. <thead>
  630. <tr class="guest-label">
  631. <th width="100%" colspan="5" style="padding: 0 9px;">
  632. <span style="position: absolute; left: 41.2%;">
  633. 磁盘性能配额
  634. </span>
  635. <button class="btn btn-xs btn-default btn-shortcut" style="float: right;" data-toggle="modal" data-target="#change_disk_quota_modal">变更配额</button>
  636. </th>
  637. </tr>
  638. <tr class="guest-label">
  639. <th width="20%" style="padding: 0 9px; text-align: center;">IOPS</th>
  640. <th width="20%" style="padding: 0 9px; text-align: center;">IOPS 读</th>
  641. <th width="20%" style="padding: 0 9px; text-align: center;">IOPS 写</th>
  642. <th width="20%" style="padding: 0 9px; text-align: center;">IOPS 桶宽</th>
  643. <th width="20%" style="padding: 0 9px; text-align: center;">IOPS 桶高</th>
  644. </tr>
  645. </thead>
  646. <tbody>
  647. <tr class="guest-desc">
  648. <th style="text-align: center;">{{ disk_ret.data.iops }}</th>
  649. <th style="text-align: center;">{{ disk_ret.data.iops_rd }}</th>
  650. <th style="text-align: center;">{{ disk_ret.data.iops_wr }}</th>
  651. <th style="text-align: center;">{{ disk_ret.data.iops_max }}</th>
  652. <th style="text-align: center;">{{ disk_ret.data.iops_max_length }} 秒</th>
  653. </tr>
  654. </tbody>
  655. <thead>
  656. <tr class="guest-label">
  657. <th width="20%" style="padding: 0 9px; text-align: center;">BPS</th>
  658. <th width="20%" style="padding: 0 9px; text-align: center;">BPS 读</th>
  659. <th width="20%" style="padding: 0 9px; text-align: center;">BPS 写</th>
  660. <th width="20%" style="padding: 0 9px; text-align: center;">BPS 桶宽</th>
  661. <th width="20%" style="padding: 0 9px; text-align: center;">BPS 桶高</th>
  662. </tr>
  663. </thead>
  664. <tbody>
  665. <tr class="guest-desc">
  666. <th style="text-align: center;">{{ (disk_ret.data.bps / 1024 / 1024) | int }} MiB</th>
  667. <th style="text-align: center;">{{ (disk_ret.data.bps_rd / 1024 / 1024) | int }} MiB</th>
  668. <th style="text-align: center;">{{ (disk_ret.data.bps_wr / 1024 / 1024) | int }} MiB</th>
  669. <th style="text-align: center;">{{ (disk_ret.data.bps_max / 1024 / 1024) | int }} MiB</th>
  670. <th style="text-align: center;">{{ disk_ret.data.bps_max_length }} 秒</th>
  671. </tr>
  672. </tbody>
  673. </table>
  674. </td>
  675. </tr>
  676. <tr>
  677. <td>
  678. <span class="guest-label">创建时间:&nbsp;&nbsp;&nbsp;&nbsp;</span>
  679. <span class="guest-desc">
  680. {{ format_datetime_by_tus(disk_ret.data.create_time) }}
  681. </span>
  682. </td>
  683. </tr>
  684. </tbody>
  685. </table>
  686. </div>
  687. <div class="col-xs-8">
  688. <div class="row" style="margin-bottom: 20px;">
  689. <div class="col-xs-8"></div>
  690. <div class="col-xs-4">
  691. <div class="btn-group btn-group-justified btn-group-xs">
  692. <a class="btn btn-default" role="button" onclick="refresh_render_with_specify_granularity('hour');">1小时</a>
  693. <a class="btn btn-default" role="button" onclick="refresh_render_with_specify_granularity('six_hours');">6小时</a>
  694. <a class="btn btn-default" role="button" onclick="refresh_render_with_specify_granularity('day');">1天</a>
  695. <a class="btn btn-default" role="button" onclick="refresh_render_with_specify_granularity('seven_days');">7天</a>
  696. </div>
  697. </div>
  698. </div>
  699. <div>
  700. <div id="disk_throughput_chart" style="width: 800px;height:280px;"></div>
  701. <div id="disk_iops_chart" style="width: 800px;height:280px;"></div>
  702. </div>
  703. <div id="disks_chart"></div>
  704. </div>
  705. </div>
  706. </div>
  707. </div>
  708. </div>
  709. <div class="modal" id="change_disk_quota_modal" tabindex="-1" role="dialog" style="margin-top: 100px;">
  710. <div class="modal-dialog modal-lg">
  711. <div class="modal-content">
  712. <div class="modal-header">
  713. <h4 class="modal-title">变更磁盘配额:</h4>
  714. </div>
  715. <div class="modal-body" style="padding-left: 8%;">
  716. <form id="change_disk_quota_form" class="form-horizontal bordered-row">
  717. <div class="form-group" style="margin-bottom: 0;">
  718. <label class="col-sm-2 control-label">
  719. <span class="glyph-icon icon-exchange" style="transform: rotate(90deg); display: inline-flex;"></span>
  720. &nbsp;&nbsp;IOPS
  721. </label>
  722. <div class="col-sm-3">
  723. <input id="iops" title="IOPS" class="form-control" type="text" value="{{ disk_ret.data.iops }}" name="iops">
  724. </div>
  725. <span class="col-sm-1"></span>
  726. <label class="col-sm-2 control-label"><span class="glyph-icon icon-openid"></span>&nbsp;&nbsp;BPS(MiB)</label>
  727. <div class="col-sm-3">
  728. <input id="bps" title="BPS" class="form-control" type="text" value="{{ (disk_ret.data.bps / 1024 / 1024) | int }}" name="bps">
  729. </div>
  730. <span class="col-sm-1"></span>
  731. </div>
  732. <div class="form-group" style="margin-bottom: 0;">
  733. <label class="col-sm-2 control-label">
  734. <span class="glyph-icon icon-exchange" style="transform: rotate(90deg); display: inline-flex;"></span>
  735. &nbsp;&nbsp;IOPS 读
  736. </label>
  737. <div class="col-sm-3">
  738. <input id="iops_rd" title="IOPS_RD" class="form-control" type="text" value="{{ disk_ret.data.iops_rd }}" name="iops_rd">
  739. </div>
  740. <span class="col-sm-1"></span>
  741. <label class="col-sm-2 control-label"><span class="glyph-icon icon-openid"></span>&nbsp;&nbsp;BPS 读 (MiB)</label>
  742. <div class="col-sm-3">
  743. <input id="bps_rd" title="BPS_RD" class="form-control" type="text" value="{{ (disk_ret.data.bps_rd / 1024 / 1024) | int }}" name="bps_rd">
  744. </div>
  745. <span class="col-sm-1"></span>
  746. </div>
  747. <div class="form-group" style="margin-bottom: 0;">
  748. <label class="col-sm-2 control-label">
  749. <span class="glyph-icon icon-exchange" style="transform: rotate(90deg); display: inline-flex;"></span>
  750. &nbsp;&nbsp;IOPS 写
  751. </label>
  752. <div class="col-sm-3">
  753. <input id="iops_wr" title="IOPS_WR" class="form-control" type="text" value="{{ disk_ret.data.iops_wr }}" name="iops_wr">
  754. </div>
  755. <span class="col-sm-1"></span>
  756. <label class="col-sm-2 control-label"><span class="glyph-icon icon-openid"></span>&nbsp;&nbsp;BPS 写 (MiB)</label>
  757. <div class="col-sm-3">
  758. <input id="bps_wr" title="BPS_WR" class="form-control" type="text" value="{{ (disk_ret.data.bps_wr / 1024 / 1024) | int }}" name="bps_wr">
  759. </div>
  760. <span class="col-sm-1"></span>
  761. </div>
  762. <div class="form-group" style="margin-bottom: 0;">
  763. <label class="col-sm-2 control-label">
  764. <span class="glyph-icon icon-exchange" style="transform: rotate(90deg); display: inline-flex;"></span>
  765. <span class="glyph-icon icon-bitbucket" style="margin-left: -4px;"></span>
  766. &nbsp;&nbsp;IOPS 桶宽
  767. </label>
  768. <div class="col-sm-3">
  769. <input id="iops_max" title="IOPS_MAX" class="form-control" type="text" value="{{ disk_ret.data.iops_max }}" name="iops_max">
  770. </div>
  771. <span class="col-sm-1"></span>
  772. <label class="col-sm-2 control-label"><span class="glyph-icon icon-openid"></span><span class="glyph-icon icon-bitbucket"></span>&nbsp;&nbsp;BPS 桶宽 (MiB)</label>
  773. <div class="col-sm-3">
  774. <input id="bps_max" title="BPS_MAX" class="form-control" type="text" value="{{ (disk_ret.data.bps_max / 1024 / 1024) | int }}" name="bps_max">
  775. </div>
  776. <span class="col-sm-1"></span>
  777. </div>
  778. <div class="form-group" style="margin-bottom: 0;">
  779. <label class="col-sm-2 control-label">
  780. <span class="glyph-icon icon-exchange" style="transform: rotate(90deg); display: inline-flex;"></span>
  781. <span class="glyph-icon icon-bitbucket" style="margin-left: -4px;"></span>
  782. &nbsp;&nbsp;IOPS 桶高 (秒)
  783. </label>
  784. <div class="col-sm-3">
  785. <input id="iops_max_length" title="IOPS_MAX_LENGTH" class="form-control" type="text" value="{{ disk_ret.data.iops_max_length }}" name="iops_max_length">
  786. </div>
  787. <span class="col-sm-1"></span>
  788. <label class="col-sm-2 control-label"><span class="glyph-icon icon-openid"></span><span class="glyph-icon icon-bitbucket"></span>&nbsp;&nbsp;BPS 桶高 (秒)</label>
  789. <div class="col-sm-3">
  790. <input id="bps_max_length" title="BPS_MAX_LENGTH" class="form-control" type="text" value="{{ disk_ret.data.bps_max_length }}" name="bps_max_length">
  791. </div>
  792. <span class="col-sm-1"></span>
  793. </div>
  794. </form>
  795. </div>
  796. <div class="modal-footer">
  797. <button type="button" class="btn btn-sm btn-primary" onclick="change_disk_quota();">确定</button>
  798. <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
  799. </div>
  800. </div>
  801. </div>
  802. </div>
  803. {% endblock body %}