snapshots_show.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. {% extends theme("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. .table {
  14. font-size: 12px;
  15. border-width: 1px;
  16. line-height: 20px;
  17. }
  18. .table > thead > tr > th,
  19. .table > tfoot > tr > th {
  20. color: #999999;
  21. font-weight: normal;
  22. border-bottom: 0 solid #e1e6eb;
  23. background-color: #F5F6FA;
  24. }
  25. .table > tbody > tr > td {
  26. color: #424547;
  27. }
  28. .table-bordered > tbody > tr {
  29. padding-top: 10px;
  30. padding-bottom: 10px;
  31. }
  32. .table-bordered > thead > tr > th,
  33. .table-bordered > tbody > tr > th,
  34. .table-bordered > tfoot > tr > th,
  35. .table-bordered > thead > tr > td,
  36. .table-bordered > tbody > tr > td,
  37. .table-bordered > tfoot > tr > td {
  38. border-style: solid;
  39. border-width: 1px 0 0 0;
  40. }
  41. .btn,
  42. .form-control,
  43. .modal-content {
  44. border-radius: 0 !important;
  45. }
  46. .btn-shortcut {
  47. font-size: 12px !important;
  48. padding: 0 26px;
  49. }
  50. .show {
  51. display: inline-block !important;
  52. }
  53. .tr-selected td,
  54. .tr-selected {
  55. color: #000 !important;
  56. background: #fafaff !important;
  57. }
  58. </style>
  59. {% endblock head %}
  60. {% block content %}
  61. <script type="text/javascript">
  62. var page = 1;
  63. var page_size = 10;
  64. var keyword = '';
  65. var resource_path = window.location.pathname;
  66. var cur_url = resource_path;
  67. $(document).ready(function() {
  68. page_size = $('#page_size').val();
  69. cur_url = resource_path + '?page=' + page + '&page_size=' + page_size;
  70. var last_ready = null;
  71. $('#content_search').keydown(function() {
  72. if (last_ready !== null) {
  73. clearTimeout(last_ready);
  74. }
  75. last_ready = setTimeout(function () {
  76. keyword = $('#content_search').val();
  77. cur_url = resource_path + '?page=' + page + '&page_size=' + page_size;
  78. if (keyword.length > 0) {
  79. cur_url = resource_path + '?page=' + page + '&page_size=' + page_size + '&keyword=' + keyword;
  80. }
  81. window.location.href=cur_url;
  82. }, 1000);
  83. });
  84. $('#page_size').change(function () {
  85. keyword = $('#content_search').val();
  86. page_size = $('#page_size').val();
  87. cur_url = resource_path + '?page=' + page + '&page_size=' + page_size;
  88. if (keyword.length > 0) {
  89. cur_url = resource_path + '?page=' + page + '&page_size=' + page_size + '&keyword=' + keyword;
  90. }
  91. window.location.href=cur_url;
  92. });
  93. $("thead").on('click', ".all_selector", function() {
  94. if ($("thead .all_selector").is(':checked')) {
  95. $("tbody tr").find('td input[type="checkbox"]:eq(0)').prop('checked', true);
  96. $(".all_selector").prop('checked', true);
  97. } else {
  98. $("tbody tr").find('td input[type="checkbox"]:eq(0)').prop('checked', false);
  99. $(".all_selector").prop('checked', false);
  100. }
  101. select_item_action();
  102. });
  103. $("tfoot").on('click', ".all_selector", function() {
  104. if ($("tfoot .all_selector").is(':checked')) {
  105. $("tbody tr").find('td input[type="checkbox"]:eq(0)').prop('checked', true);
  106. $(".all_selector").prop('checked', true);
  107. } else {
  108. $("tbody tr").find('td input[type="checkbox"]:eq(0)').prop('checked', false);
  109. $(".all_selector").prop('checked', false);
  110. }
  111. select_item_action();
  112. });
  113. $("tbody tr").on('click', "input[type='checkbox']", function() {
  114. select_item_action();
  115. });
  116. $('#edit_label_modal').on('show.bs.modal', function (me) {
  117. $('#snapshot_id').val($(me.relatedTarget).parent().parent().prev().prev().text());
  118. $('#edit_label').val($(me.relatedTarget).prev().text());
  119. });
  120. });
  121. function refresh() {
  122. keyword = $('#content_search').val();
  123. page = $('#pagination li.active a').text();
  124. page_size = $('#page_size').val();
  125. cur_url = resource_path + '?page=' + page + '&page_size=' + page_size;
  126. if (keyword.length > 0) {
  127. cur_url = resource_path + '?page=' + page + '&page_size=' + page_size + '&keyword=' + keyword;
  128. }
  129. window.location.href=cur_url;
  130. }
  131. function row_onmouseover(me) {
  132. $(me).find(".edit_label_trigger").css('display','inline-flex');
  133. }
  134. function row_onmouseout(me) {
  135. $(me).find(".edit_label_trigger").css('display','none');
  136. }
  137. function label_update(me) {
  138. var snapshot_id = $('#snapshot_id').val();
  139. var label = $('#edit_label').val();
  140. $('#edit_label_modal').modal('hide');
  141. $.ajax({
  142. url : '/api/snapshot/' + snapshot_id,
  143. type : 'PATCH',
  144. contentType: "application/json; charset=utf-8",
  145. data : JSON.stringify({
  146. label: label
  147. }),
  148. error : function() {
  149. alter_danger('快照名称更新失败!');
  150. },
  151. success : function() {
  152. alter_success('快照名称更新成功!');
  153. setTimeout(function() {
  154. refresh();
  155. }, 1000);
  156. }
  157. });
  158. }
  159. function revert_snapshot(me) {
  160. var snapshot_id = $('#snapshot_id').val();
  161. $('#snapshot_revert_modal').modal('hide');
  162. $.ajax({
  163. url : '/api/snapshot/_revert/' + snapshot_id,
  164. type : 'PUT',
  165. error : function() {
  166. alter_danger('快照恢复失败!');
  167. },
  168. success : function() {
  169. alter_success('快照恢复成功!');
  170. setTimeout(function() {
  171. refresh();
  172. }, 1000);
  173. }
  174. });
  175. }
  176. function delete_snapshot(me) {
  177. var snapshot_id = $('#snapshot_id').val();
  178. $('#snapshot_delete_modal').modal('hide');
  179. $.ajax({
  180. url : '/api/snapshots/' + snapshot_id,
  181. type : 'DELETE',
  182. error : function() {
  183. alter_danger('快照删除失败!');
  184. },
  185. success : function() {
  186. alter_success('快照删除成功!');
  187. setTimeout(function() {
  188. refresh();
  189. }, 1000);
  190. }
  191. });
  192. }
  193. function get_selected_element(checked) {
  194. if (checked === null) {
  195. checked = true;
  196. }
  197. if (checked) {
  198. return $('tbody :checked');
  199. } else {
  200. return $('tbody input:not(:checked)');
  201. }
  202. }
  203. function highlight_selected_element() {
  204. var selected_element = get_selected_element(true);
  205. var no_selected_element = get_selected_element(false);
  206. selected_element.each(function(i, e) {
  207. $(e).parent().parent().toggleClass('tr-selected', true);
  208. });
  209. no_selected_element.each(function(i, e) {
  210. $(e).parent().parent().toggleClass('tr-selected', false);
  211. });
  212. }
  213. function shortcut_bar_enable() {
  214. var selected_element = get_selected_element(true);
  215. if (selected_element.length > 0) {
  216. $('.btn-shortcut').toggleClass('disabled', false);
  217. } else {
  218. $('.btn-shortcut').toggleClass('disabled', true);
  219. }
  220. }
  221. function select_item_action() {
  222. highlight_selected_element();
  223. shortcut_bar_enable();
  224. }
  225. function make_list_of_disks(me) {
  226. var snapshot_id = $('#snapshot_id').val();
  227. var disks_uuid = [];
  228. $.ajax({
  229. url : '/api/snapshot/_disks/' + snapshot_id,
  230. type : 'GET',
  231. contentType: "application/json; charset=utf-8",
  232. dataType: 'json',
  233. async: false,
  234. error : function() {
  235. alter_danger('获取实例磁盘列表失败!');
  236. },
  237. success : function(data, textStatus, xhr) {
  238. disks_uuid = data.data;
  239. }
  240. });
  241. $.ajax({
  242. url : '/api/disks?order_by=sequence&filter=uuid:in:' + disks_uuid.join(','),
  243. type : 'GET',
  244. contentType: "application/json; charset=utf-8",
  245. dataType: 'json',
  246. async: false,
  247. error : function() {
  248. alter_danger('获取实例磁盘列表失败!');
  249. },
  250. success : function(data, textStatus, xhr) {
  251. var disks_list_tbody = $("#disks_list").find("tbody");
  252. var disk_kind = '系统盘';
  253. disks_list_tbody.empty();
  254. $.each(data.data, function(k, v) {
  255. if (v['sequence'] === 0) {
  256. disk_kind = '系统盘';
  257. } else {
  258. disk_kind = '数据盘';
  259. }
  260. disks_list_tbody.append(
  261. '<tr role="row" class="odd" onmouseover="row_onmouseover(this);" onmouseout="row_onmouseout(this);">' +
  262. '<td>' +
  263. '<div>' + v['uuid'] + '</div>' +
  264. '<div>' + '<p style="display: inline-block;">' + v['remark'] + '</p></div>' +
  265. '</td>' +
  266. '<td>' + v['device'] + '</td>' +
  267. '<td>' + v['size'] + ' GB</td>' +
  268. '<td>' + disk_kind + '</td>' +
  269. '<td><a href="javascript:;" style="color: #0066cc" data-toggle="modal" data-target="#create_os_template_image_from_disk_snapshot_modal" ' +
  270. 'onclick="$(\'#os_template_image_label\').val($(this).parent().prev().prev().prev().prev().children()[1].textContent);$(\'#disk_uuid\').val(\'' + v['uuid'] + '\');' +
  271. '$(\'#create_os_template_image_from_disk_snapshot_desc\').text($(this).parent().prev().prev().prev().text());$(\'#snapshot_convert_to_os_template_image_modal\').modal(\'hide\');">创建</a></td>' +
  272. '</tr>'
  273. );
  274. });
  275. }
  276. });
  277. }
  278. function create_os_template_image_from_disk_snapshot() {
  279. var snapshot_id = $('#snapshot_id').val();
  280. var disk_uuid = $('#disk_uuid').val();
  281. var label = $('#os_template_image_label').val();
  282. $('#create_os_template_image_from_disk_snapshot_modal').modal('hide');
  283. $.ajax({
  284. url : '/api/snapshot/_convert_to_os_template_image/' + snapshot_id + '/' + disk_uuid,
  285. type : 'PUT',
  286. contentType: "application/json; charset=utf-8",
  287. data : JSON.stringify({
  288. label: label
  289. }),
  290. error : function() {
  291. alter_danger('从磁盘快照创建自定义镜像失败!');
  292. },
  293. success : function() {
  294. alter_success('从磁盘快照创建自定义镜像成功!');
  295. setTimeout(function() {
  296. window.location.href="/os_templates_image#custom";
  297. }, 1000);
  298. }
  299. });
  300. }
  301. </script>
  302. <div class="panel">
  303. <div class="panel-body">
  304. <h3 class="title-hero" style="font-size: 24px;">
  305. 虚拟机实例快照
  306. </h3>
  307. <div>
  308. <div id="datatable-row-highlight_wrapper" class="dataTables_wrapper form-inline">
  309. <div class="row" style="padding: 10px 10px 10px 0; width: 100%;">
  310. <div class="col-sm-12" style="padding-right: 0;">
  311. <div id="datatable-row-highlight_filter" class="dataTables_filter" style="display: inline-block;">
  312. <input id="content_search" type="search" class="form-control" placeholder="模糊搜索..." value="{%- if keyword -%} {{ keyword }} {%- endif -%}" style="margin-left: 0; border-radius: 0;">
  313. </div>
  314. <div class="pull-right">
  315. <button class="btn btn-default" onclick="refresh()" style="border-radius: 0;"><span class="glyph-icon icon-elusive-arrows-cw"></span></button>
  316. </div>
  317. </div>
  318. </div>
  319. <table id="snapshots_list" class="table table-bordered table-hover" cellspacing="0" width="100%" role="grid"
  320. style="width: 100%; margin-bottom: 0; border-bottom-width: 0;">
  321. <thead>
  322. <tr role="row">
  323. <th style="display: none;">ID</th>
  324. <th><input class="all_selector" title="选取所有" type="checkbox"></th>
  325. <th width="220px;">名称</th>
  326. <th>进度</th>
  327. <th>状态</th>
  328. <th>所属虚拟机</th>
  329. <th>创建时间</th>
  330. <th>操作</th>
  331. </tr>
  332. </thead>
  333. <tbody>
  334. {% for item in snapshots %}
  335. <tr role="row" class="odd" onmouseover="row_onmouseover(this);" onmouseout="row_onmouseout(this);">
  336. <td style="display: none;">{{ item.snapshot_id }}</td>
  337. <td><input title="选中" type="checkbox"></td>
  338. <td>
  339. <div>
  340. <a href="javascript:;">{{ item.snapshot_id }}</a>
  341. </div>
  342. <div>
  343. <p style="display: inline-block;">{{ item.label }}</p>
  344. <a href="javascript:;" class="edit_label_trigger" data-toggle="modal" data-target="#edit_label_modal" style="display: none; float: right;">
  345. <span class="glyph-icon icon-elusive-pencil" style="width: 20px; height: 20px; margin-left: 10px; border-radius: 0; border: 1px solid rgb(220, 233, 255); background-color: #ffffff;"></span>
  346. </a>
  347. </div>
  348. </td>
  349. <td>
  350. {% if item.progress == 255 %}
  351. <span style="color: #990000;">创建失败</span>
  352. {% elif item.progress == 254 %}
  353. <span style="color: #ff0000dd;">删除中...</span>
  354. {% elif item.progress == 253 %}
  355. <span style="color: #009cc5;">恢复中...</span>
  356. {% elif item.progress == 252 %}
  357. <span style="color: #009cc5;">创建镜像中...</span>
  358. {% elif item.progress == 100 %}
  359. <span style="color: #00BB00;">{{ item.progress }}%</span>
  360. {% else %}
  361. <span style="color: #e5b715;">{{ item.progress }}%</span>
  362. {% endif %}
  363. </td>
  364. <td>{{ format_guest_status(item.status, 100)|safe }}</td>
  365. <td><a href="/guest/detail/{{ item.guest_uuid }}" {% if 'guest' not in item %}style="display: none"{% endif %}>
  366. {% if 'guest' in item %}
  367. {{ item.guest.label }}/{{ item.guest.remark }}
  368. {% endif %}</a>
  369. </td>
  370. <td>{{ format_datetime_by_tus(item.create_time) }}</td>
  371. <td>
  372. <div class="dropdown inline-block">
  373. <a href="javascript:;" class="{% if item.progress not in [100] %} a-disabled {% endif %}" style="color: #0066cc" data-toggle="modal" data-target="#snapshot_revert_modal" onclick="$('#snapshot_id').val($(this).parent().parent().parent().children()[0].textContent);
  374. $('#revert_snapshot_instance_desc').text($($(this).parent().parent().parent().children()[2]).find('div a')[0].textContent + '/' + $($(this).parent().parent().parent().children()[2]).find('div p')[0].textContent)">恢复</a>
  375. <span> | </span>
  376. <a href="javascript:;" data-guest_uuid="{{ item.guest_uuid }}" class="{% if item.progress not in [100] %} a-disabled {% endif %}" style="color: #0066cc" data-toggle="modal" data-target="#snapshot_convert_to_os_template_image_modal" onclick="$('#snapshot_id').val($(this).parent().parent().parent().children()[0].textContent);
  377. make_list_of_disks(this);
  378. $('#convert_snapshot_instance_desc').text($($(this).parent().parent().parent().children()[2]).find('div a')[0].textContent + '/' + $($(this).parent().parent().parent().children()[2]).find('div p')[0].textContent)">创建镜像</a>
  379. <span> | </span>
  380. <a href="javascript:;" class="{% if item.progress not in [100, 255] %} a-disabled {% endif %}" style="color: #0066cc" data-toggle="modal" data-target="#snapshot_delete_modal" onclick="$('#snapshot_id').val($(this).parent().parent().parent().children()[0].textContent);
  381. $('#delete_snapshot_instance_desc').text($($(this).parent().parent().parent().children()[2]).find('div a')[0].textContent + '/' + $($(this).parent().parent().parent().children()[2]).find('div p')[0].textContent)">删除</a>
  382. </div>
  383. </td>
  384. </tr>
  385. {% endfor %}
  386. </tbody>
  387. </table>
  388. <table class="table table-bordered" style="border-top-width: 0; z-index: 99; position: sticky; bottom: 0;">
  389. <tfoot>
  390. <tr style="height: 70px;">
  391. <th><input type="checkbox" title="选取所有" class="all_selector"></th>
  392. <th>
  393. <div class="row">
  394. <div class="col-sm-6">
  395. </div>
  396. <div class="col-sm-3" style="font-size: 12px; padding-top: 5px; text-align: right;">
  397. 共有{{ paging.total }}条,每页显示:
  398. <select id="page_size" name="datatable-row-highlight_length" title="page_size" class="form-control" style="height: 22px; vertical-align: baseline;">
  399. <option value="10" {% if page_size == 10 %} selected {% endif %}>10</option>
  400. <option value="20" {% if page_size == 20 %} selected {% endif %}>20</option>
  401. <option value="50" {% if page_size == 50 %} selected {% endif %}>50</option>
  402. </select>&nbsp;&nbsp;条
  403. </div>
  404. <div class="col-sm-3" style="text-align: left;">
  405. <div class="dataTables_paginate paging_bootstrap" id="datatable-row-highlight_paginate">
  406. <ul id="pagination" class="pagination">
  407. <li class="{% if page == 1 %} disabled {% endif %}">
  408. <a href="{{ resource_path }}?page={{ page - 1 }}&page_size={{ page_size }}{% if keyword %}&keyword={{ keyword }}{% endif %}{% if order_by %}&order_by={{ order_by }}{% endif %}{% if order %}&order={{ order }}{% endif %}">«</a>
  409. </li>
  410. {% for item in pages %}
  411. <li class="{% if item == page %} active {% endif %}">
  412. <a href="{{ resource_path }}?page={{ item }}&page_size={{ page_size }}{% if keyword %}&keyword={{ keyword }}{% endif %}{% if order_by %}&order_by={{ order_by }}{% endif %}{% if order %}&order={{ order }}{% endif %}">{{ item }}</a>
  413. </li>
  414. {% endfor %}
  415. <li class="{% if page == last_page %} disabled {% endif %}">
  416. <a href="{{ resource_path }}?page={{ page + 1 }}&page_size={{ page_size }}{% if keyword %}&keyword={{ keyword }}{% endif %}{% if order_by %}&order_by={{ order_by }}{% endif %}{% if order %}&order={{ order }}{% endif %}">»</a>
  417. </li>
  418. </ul>
  419. </div>
  420. </div>
  421. </div>
  422. </th>
  423. </tr>
  424. </tfoot>
  425. </table>
  426. </div>
  427. </div>
  428. </div>
  429. </div>
  430. <input id="snapshot_id" title="快照 ID" class="form-control" name="snapshot_id" hidden>
  431. <input id="disk_uuid" title="磁盘 UUID" class="form-control" name="disk_uuid" hidden>
  432. <div class="modal" id="edit_label_modal" tabindex="-1" role="dialog" style="margin-top: 100px;">
  433. <div class="modal-dialog modal-sm">
  434. <div class="modal-content">
  435. <div class="modal-header">
  436. <h4 class="modal-title">编辑实例快照名称:</h4>
  437. </div>
  438. <div class="modal-body">
  439. <input id="edit_label" title="实例快照名称" class="form-control" name="snapshot_label">
  440. </div>
  441. <div class="modal-footer">
  442. <button type="button" class="btn btn-sm btn-primary" onclick="label_update();">确定</button>
  443. <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
  444. </div>
  445. </div>
  446. </div>
  447. </div>
  448. <div class="modal" id="snapshot_revert_modal" tabindex="-1" role="dialog" style="margin-top: 100px;">
  449. <div class="modal-dialog">
  450. <div class="modal-content">
  451. <div class="modal-header">
  452. <h4 class="modal-title">恢复实例快照:</h4>
  453. </div>
  454. <div class="modal-body">
  455. <p>您确定要使该虚拟机恢复至此快照吗?</p>
  456. <h3 style="color: orangered;" id="revert_snapshot_instance_desc"></h3>
  457. </div>
  458. <div class="modal-footer">
  459. <button type="button" class="btn btn-sm btn-primary" onclick="revert_snapshot();">确定</button>
  460. <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
  461. </div>
  462. </div>
  463. </div>
  464. </div>
  465. <div class="modal" id="snapshot_convert_to_os_template_image_modal" tabindex="-1" role="dialog" style="margin-top: 100px;">
  466. <div class="modal-dialog modal-lg">
  467. <div class="modal-content">
  468. <div class="modal-header">
  469. <h4 class="modal-title">请选择自定义镜像的磁盘:</h4>
  470. </div>
  471. <div class="modal-body">
  472. <h3 style="color: orangered;" id="convert_snapshot_instance_desc"></h3>
  473. <p></p>
  474. <table id="disks_list" class="table table-bordered table-hover" cellspacing="0" width="100%" role="grid"
  475. style="width: 100%; margin-bottom: 0; border-bottom-width: 0;">
  476. <thead>
  477. <tr role="row">
  478. <th width="280px;">UUID</th>
  479. <th>设备路径</th>
  480. <th>大小</th>
  481. <th>磁盘性别</th>
  482. <th>操作</th>
  483. </tr>
  484. </thead>
  485. <tbody>
  486. </tbody>
  487. </table>
  488. </div>
  489. <div class="modal-footer">
  490. <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
  491. </div>
  492. </div>
  493. </div>
  494. </div>
  495. <div class="modal" id="create_os_template_image_from_disk_snapshot_modal" tabindex="-1" role="dialog" style="margin-top: 100px;">
  496. <div class="modal-dialog modal-sm">
  497. <div class="modal-content">
  498. <div class="modal-header">
  499. <h4 class="modal-title">创建自定义镜像:</h4>
  500. </div>
  501. <div class="modal-body">
  502. <h3 style="color: orangered;" id="create_os_template_image_from_disk_snapshot_desc"></h3>
  503. <p></p>
  504. <input id="os_template_image_label" title="自定义镜像名称" class="form-control" name="os_template_image_label">
  505. </div>
  506. <div class="modal-footer">
  507. <button type="button" class="btn btn-sm btn-primary" onclick="create_os_template_image_from_disk_snapshot();">确定</button>
  508. <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
  509. </div>
  510. </div>
  511. </div>
  512. </div>
  513. <div class="modal" id="snapshot_delete_modal" tabindex="-1" role="dialog" style="margin-top: 100px;">
  514. <div class="modal-dialog">
  515. <div class="modal-content">
  516. <div class="modal-header">
  517. <h4 class="modal-title">删除实例快照:</h4>
  518. </div>
  519. <div class="modal-body">
  520. <p>您确定要删除此快照吗?</p>
  521. <h3 style="color: orangered;" id="delete_snapshot_instance_desc"></h3>
  522. </div>
  523. <div class="modal-footer">
  524. <button type="button" class="btn btn-sm btn-primary" onclick="delete_snapshot();">确定</button>
  525. <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">取消</button>
  526. </div>
  527. </div>
  528. </div>
  529. </div>
  530. {% endblock content %}