index.twig 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <div class="container-fluid">
  2. {{ message|raw }}
  3. {% if has_comment %}
  4. <form method="post" action="{{ url('/database/operations') }}" id="formDatabaseComment">
  5. {{ get_hidden_inputs(db) }}
  6. <div class="card mb-2">
  7. <div class="card-header">{{ get_icon('b_comment', 'Database comment'|trans, true) }}</div>
  8. <div class="card-body">
  9. <div class="form-row">
  10. <div class="col-auto">
  11. <label class="sr-only" for="databaseCommentInput">{% trans 'Database comment' %}</label>
  12. <input class="form-control textfield" id="databaseCommentInput" type="text" name="comment" value="{{ db_comment }}">
  13. </div>
  14. </div>
  15. </div>
  16. <div class="card-footer text-right">
  17. <input class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
  18. </div>
  19. </div>
  20. </form>
  21. {% endif %}
  22. <form id="create_table_form_minimal" method="post" action="{{ url('/table/create') }}" class="lock-page">
  23. {{ get_hidden_inputs(db) }}
  24. <div class="card mb-2">
  25. <div class="card-header">{{ get_icon('b_table_add', 'Create table'|trans, true) }}</div>
  26. <div class="card-body">
  27. <div class="form-row">
  28. <div class="col-auto">
  29. <label for="exampleInputEmail1">{% trans 'Name' %}</label>
  30. <input class="form-control" type="text" id="exampleInputEmail1" name="table" required>
  31. </div>
  32. <div class="col-auto">
  33. <label for="exampleInputEmail1">{% trans 'Number of columns' %}</label>
  34. <input class="form-control" type="number" id="exampleInputEmail1" name="num_fields" min="1" value="4" required>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="card-footer text-right">
  39. <input class="btn btn-primary" type="submit" value="{% trans "Go" %}">
  40. </div>
  41. </div>
  42. </form>
  43. {% if db != 'mysql' %}
  44. <form id="rename_db_form" class="ajax" method="post" action="{{ url('/database/operations') }}">
  45. {{ get_hidden_inputs(db) }}
  46. <input type="hidden" name="what" value="data">
  47. <input type="hidden" name="db_rename" value="true">
  48. {% if db_collation is not empty %}
  49. <input type="hidden" name="db_collation" value="{{ db_collation }}">
  50. {% endif %}
  51. <div class="card mb-2">
  52. <div class="card-header">{{ get_icon('b_edit', 'Rename database to'|trans, true) }}</div>
  53. <div class="card-body">
  54. <div class="form-group form-row">
  55. <div class="col-auto">
  56. <label class="sr-only" for="new_db_name">{% trans 'New database name' %}</label>
  57. <input class="form-control textfield" id="new_db_name" type="text" name="newname" maxlength="64" required>
  58. </div>
  59. </div>
  60. <div class="form-check">
  61. <input class="form-check-input" type="checkbox" name="adjust_privileges" value="1" id="checkbox_adjust_privileges"
  62. {%- if has_adjust_privileges %} checked{% else %} title="
  63. {%- trans 'You don\'t have sufficient privileges to perform this operation; Please refer to the documentation for more details.' %}" disabled{% endif %}>
  64. <label class="form-check-label" for="checkbox_adjust_privileges">
  65. {% trans 'Adjust privileges' %}
  66. {{ show_docu('faq', 'faq6-39') }}
  67. </label>
  68. </div>
  69. </div>
  70. <div class="card-footer text-right">
  71. <input class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
  72. </div>
  73. </div>
  74. </form>
  75. {% endif %}
  76. {% if is_drop_database_allowed %}
  77. <div class="card mb-2">
  78. <div class="card-header">{{ get_icon('b_deltbl', 'Remove database'|trans, true) }}</div>
  79. <div class="card-body">
  80. <div class="card-text">
  81. {{ link_or_button(
  82. url('/sql', {
  83. 'sql_query': 'DROP DATABASE ' ~ backquote(db),
  84. 'back': url('/database/operations'),
  85. 'goto': url('/'),
  86. 'reload': true,
  87. 'purge': true,
  88. 'message_to_show': 'Database %s has been dropped.'|trans|format(backquote(db))|e,
  89. 'db': null
  90. }),
  91. 'Drop the database (DROP)'|trans,
  92. {
  93. 'id': 'drop_db_anchor',
  94. 'class': 'ajax text-danger'
  95. }
  96. ) }}
  97. {{ show_mysql_docu('DROP_DATABASE') }}
  98. </div>
  99. </div>
  100. </div>
  101. {% endif %}
  102. <form id="copy_db_form" class="ajax" method="post" action="{{ url('/database/operations') }}">
  103. {{ get_hidden_inputs(db) }}
  104. <input type="hidden" name="db_copy" value="true">
  105. {% if db_collation is not empty %}
  106. <input type="hidden" name="db_collation" value="{{ db_collation }}">
  107. {% endif %}
  108. <div class="card mb-2">
  109. <div class="card-header">{{ get_icon('b_edit', 'Copy database to'|trans, true) }}</div>
  110. <div class="card-body">
  111. <div class="form-group form-row">
  112. <div class="col-auto">
  113. <label class="sr-only" for="renameDbNameInput">{% trans 'Database name' %}</label>
  114. <input class="form-control textfield" id="renameDbNameInput" type="text" maxlength="64" name="newname" required>
  115. </div>
  116. </div>
  117. <div class="form-group">
  118. <div class="form-check">
  119. <input class="form-check-input" type="radio" name="what" id="whatRadio1" value="structure">
  120. <label class="form-check-label" for="whatRadio1">
  121. {% trans 'Structure only' %}
  122. </label>
  123. </div>
  124. <div class="form-check">
  125. <input class="form-check-input" type="radio" name="what" id="whatRadio2" value="data" checked>
  126. <label class="form-check-label" for="whatRadio2">
  127. {% trans 'Structure and data' %}
  128. </label>
  129. </div>
  130. <div class="form-check">
  131. <input class="form-check-input" type="radio" name="what" id="whatRadio3" value="dataonly">
  132. <label class="form-check-label" for="whatRadio3">
  133. {% trans 'Data only' %}
  134. </label>
  135. </div>
  136. </div>
  137. <div class="form-check">
  138. <input class="form-check-input" type="checkbox" name="create_database_before_copying" value="1" id="checkbox_create_database_before_copying" checked>
  139. <label class="form-check-label" for="checkbox_create_database_before_copying">{% trans 'CREATE DATABASE before copying' %}</label>
  140. </div>
  141. <div class="form-check">
  142. <input class="form-check-input" type="checkbox" name="drop_if_exists" value="true" id="checkbox_drop">
  143. <label class="form-check-label" for="checkbox_drop">{{ 'Add %s'|trans|format('DROP TABLE / DROP VIEW') }}</label>
  144. </div>
  145. <div class="form-check">
  146. <input class="form-check-input" type="checkbox" name="sql_auto_increment" value="1" id="checkbox_auto_increment" checked>
  147. <label class="form-check-label" for="checkbox_auto_increment">{% trans 'Add AUTO_INCREMENT value' %}</label>
  148. </div>
  149. <div class="form-check">
  150. <input class="form-check-input" type="checkbox" name="add_constraints" value="1" id="checkbox_constraints" checked>
  151. <label class="form-check-label" for="checkbox_constraints">{% trans 'Add constraints' %}</label>
  152. </div>
  153. <div class="form-check">
  154. <input class="form-check-input" type="checkbox" name="adjust_privileges" value="1" id="checkbox_privileges"
  155. {%- if has_adjust_privileges %} checked{% else %} title="
  156. {%- trans 'You don\'t have sufficient privileges to perform this operation; Please refer to the documentation for more details.' %}" disabled{% endif %}>
  157. <label class="form-check-label" for="checkbox_privileges">
  158. {% trans 'Adjust privileges' %}
  159. {{ show_docu('faq', 'faq6-39') }}
  160. </label>
  161. </div>
  162. <div class="form-check">
  163. <input class="form-check-input" type="checkbox" name="switch_to_new" value="true" id="checkbox_switch"{{ switch_to_new ? ' checked' }}>
  164. <label class="form-check-label" for="checkbox_switch">{% trans 'Switch to copied database' %}</label>
  165. </div>
  166. </div>
  167. <div class="card-footer text-right">
  168. <input class="btn btn-primary" type="submit" name="submit_copy" value="{% trans 'Go' %}">
  169. </div>
  170. </div>
  171. </form>
  172. <form id="change_db_charset_form" class="ajax" method="post" action="{{ url('/database/operations/collation') }}">
  173. {{ get_hidden_inputs(db) }}
  174. <div class="card mb-2">
  175. <div class="card-header">{{ get_icon('s_asci', 'Collation'|trans, true) }}</div>
  176. <div class="card-body">
  177. <div class="form-group form-row">
  178. <div class="col-auto">
  179. <label class="sr-only" for="select_db_collation">{% trans 'Collation' %}</label>
  180. <select class="form-control" lang="en" dir="ltr" name="db_collation" id="select_db_collation">
  181. <option value=""></option>
  182. {% for charset in charsets %}
  183. <optgroup label="{{ charset.getName() }}" title="{{ charset.getDescription() }}">
  184. {% for collation in collations[charset.getName()] %}
  185. <option value="{{ collation.getName() }}" title="{{ collation.getDescription() }}"{{ db_collation == collation.getName() ? ' selected' }}>
  186. {{ collation.getName() }}
  187. </option>
  188. {% endfor %}
  189. </optgroup>
  190. {% endfor %}
  191. </select>
  192. </div>
  193. </div>
  194. <div class="form-check">
  195. <input class="form-check-input" type="checkbox" name="change_all_tables_collations" id="checkbox_change_all_tables_collations">
  196. <label class="form-check-label" for="checkbox_change_all_tables_collations">{% trans 'Change all tables collations' %}</label>
  197. </div>
  198. <div class="form-check" id="span_change_all_tables_columns_collations">
  199. <input class="form-check-input" type="checkbox" name="change_all_tables_columns_collations" id="checkbox_change_all_tables_columns_collations">
  200. <label class="form-check-label" for="checkbox_change_all_tables_columns_collations">{% trans 'Change all tables columns collations' %}</label>
  201. </div>
  202. </div>
  203. <div class="card-footer text-right">
  204. <input class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
  205. </div>
  206. </div>
  207. </form>
  208. </div>