column_definitions_form.twig 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <form method="post" action="{{ action }}" class="
  2. {{- action == url('/table/create') ? 'create_table' : 'append_fields' -}}
  3. _form ajax lock-page">
  4. {{ get_hidden_inputs(form_params) }}
  5. {# happens when an index has been set on a column #}
  6. {# and a column is added to the table creation dialog #}
  7. {# This contains a JSON-encoded string #}
  8. <input type="hidden" name="primary_indexes" value="
  9. {{- primary_indexes is not empty ? primary_indexes : '[]' }}">
  10. <input type="hidden" name="unique_indexes" value="
  11. {{- unique_indexes is not empty ? unique_indexes : '[]' }}">
  12. <input type="hidden" name="indexes" value="
  13. {{- indexes is not empty ? indexes : '[]' }}">
  14. <input type="hidden" name="fulltext_indexes" value="
  15. {{- fulltext_indexes is not empty ? fulltext_indexes : '[]' }}">
  16. <input type="hidden" name="spatial_indexes" value="
  17. {{- spatial_indexes is not empty ? spatial_indexes : '[]' }}">
  18. {% if action == url('/table/create') %}
  19. <div id="table_name_col_no_outer">
  20. <table id="table_name_col_no" class="pma-table tdblock">
  21. <tr class="vmiddle floatleft">
  22. <td>{% trans 'Table name' %}:
  23. <input type="text"
  24. name="table"
  25. size="40"
  26. maxlength="64"
  27. value="{{ table is defined ? table }}"
  28. class="textfield" autofocus required>
  29. </td>
  30. <td>
  31. {% trans 'Add' %}
  32. <input type="number"
  33. id="added_fields"
  34. name="added_fields"
  35. size="2"
  36. value="1"
  37. min="1"
  38. onfocus="this.select()">
  39. {% trans 'column(s)' %}
  40. <input class="btn btn-secondary" type="button"
  41. name="submit_num_fields"
  42. value="{% trans 'Go' %}">
  43. </td>
  44. </tr>
  45. </table>
  46. </div>
  47. {% endif %}
  48. {% if content_cells is iterable %}
  49. {% include 'columns_definitions/table_fields_definitions.twig' with {
  50. 'is_backup': is_backup,
  51. 'fields_meta': fields_meta,
  52. 'mimework': mimework,
  53. 'content_cells': content_cells,
  54. 'change_column': change_column,
  55. 'is_virtual_columns_supported': is_virtual_columns_supported,
  56. 'server_version' : server_version,
  57. 'browse_mime': browse_mime,
  58. 'server_type': server_type,
  59. 'max_rows': max_rows,
  60. 'char_editing': char_editing,
  61. 'attribute_types': attribute_types,
  62. 'privs_available': privs_available,
  63. 'max_length': max_length,
  64. 'charsets': charsets
  65. } only %}
  66. {% endif %}
  67. {% if action == url('/table/create') %}
  68. <div class="responsivetable">
  69. <table class="pma-table">
  70. <tr class="vtop">
  71. <th>{% trans 'Table comments:' %}</th>
  72. <td width="25">&nbsp;</td>
  73. <th>{% trans 'Collation:' %}</th>
  74. <td width="25">&nbsp;</td>
  75. <th>
  76. {% trans 'Storage Engine:' %}
  77. {{ show_mysql_docu('Storage_engines') }}
  78. </th>
  79. <td width="25">&nbsp;</td>
  80. <th id="storage-engine-connection">
  81. {% trans 'Connection:' %}
  82. {{ show_mysql_docu('federated-create-connection') }}
  83. </th>
  84. </tr>
  85. <tr>
  86. <td>
  87. <input type="text"
  88. name="comment"
  89. size="40"
  90. maxlength="60"
  91. value="{{ comment is defined ? comment }}"
  92. class="textfield">
  93. </td>
  94. <td width="25">&nbsp;</td>
  95. <td>
  96. <select lang="en" dir="ltr" name="tbl_collation">
  97. <option value=""></option>
  98. {% for charset in charsets %}
  99. <optgroup label="{{ charset.name }}" title="{{ charset.description }}">
  100. {% for collation in charset.collations %}
  101. <option value="{{ collation.name }}" title="{{ collation.description }}"
  102. {{- collation.name == tbl_collation ? ' selected' }}>
  103. {{- collation.name -}}
  104. </option>
  105. {% endfor %}
  106. </optgroup>
  107. {% endfor %}
  108. </select>
  109. </td>
  110. <td width="25">&nbsp;</td>
  111. <td>
  112. <select class="form-control" name="tbl_storage_engine" aria-label="{% trans 'Storage engine' %}">
  113. {% for engine in storage_engines %}
  114. <option value="{{ engine.name }}"{% if engine.comment is not empty %} title="{{ engine.comment }}"{% endif %}
  115. {{- engine.name|lower == tbl_storage_engine|lower or (tbl_storage_engine is empty and engine.is_default) ? ' selected' }}>
  116. {{- engine.name -}}
  117. </option>
  118. {% endfor %}
  119. </select>
  120. </td>
  121. <td width="25">&nbsp;</td>
  122. <td>
  123. <input type="text"
  124. name="connection"
  125. size="40"
  126. value="{{ connection is defined ? connection }}"
  127. placeholder="scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name"
  128. class="textfield"
  129. required="required">
  130. </td>
  131. </tr>
  132. {% if have_partitioning %}
  133. <tr class="vtop">
  134. <th colspan="5">
  135. {% trans 'PARTITION definition:' %}
  136. {{ show_mysql_docu('Partitioning') }}
  137. </th>
  138. </tr>
  139. <tr>
  140. <td colspan="5">
  141. {% include 'columns_definitions/partitions.twig' with {
  142. 'partition_details': partition_details,
  143. 'storage_engines': storage_engines
  144. } only %}
  145. </td>
  146. </tr>
  147. {% endif %}
  148. </table>
  149. </div>
  150. {% endif %}
  151. <fieldset class="tblFooters">
  152. {% if action == url('/table/add-field') or action == url('/table/structure/save') %}
  153. <input type="checkbox" name="online_transaction" value="ONLINE_TRANSACTION_ENABLED" />{% trans %}Online transaction{% context %}Online transaction part of the SQL DDL for InnoDB{% endtrans %}{{ show_mysql_docu('innodb-online-ddl') }}
  154. {% endif %}
  155. <input class="btn btn-secondary preview_sql" type="button"
  156. value="{% trans 'Preview SQL' %}">
  157. <input class="btn btn-primary" type="submit"
  158. name="do_save_data"
  159. value="{% trans 'Save' %}">
  160. </fieldset>
  161. <div id="properties_message"></div>
  162. </form>