Update website
This commit is contained in:
parent
41ce1aa076
commit
ea0eb1c6e0
4222 changed files with 721797 additions and 14 deletions
|
@ -0,0 +1,22 @@
|
|||
{% if submit_attribute is defined and submit_attribute != false %}
|
||||
{% set attribute = submit_attribute %}
|
||||
{# MariaDB has additional parentheses #}
|
||||
{% elseif column_meta['Extra'] is defined
|
||||
and ('on update current_timestamp' in column_meta['Extra'] or 'on update current_timestamp()' in column_meta['Extra']|lower) %}
|
||||
{% set attribute = 'on update CURRENT_TIMESTAMP' %}
|
||||
{% elseif extracted_columnspec['attribute'] is defined %}
|
||||
{% set attribute = extracted_columnspec['attribute'] %}
|
||||
{% else %}
|
||||
{% set attribute = '' %}
|
||||
{% endif %}
|
||||
{% set attribute = attribute|upper %}
|
||||
<select name="field_attribute[{{ column_number }}]"
|
||||
id="field_{{ column_number }}_{{ ci - ci_offset }}">
|
||||
{% set cnt_attribute_types = attribute_types|length - 1 %}
|
||||
{% for i in 0..cnt_attribute_types %}
|
||||
<option value="{{ attribute_types[i] }}"
|
||||
{{- attribute == attribute_types[i]|upper ? ' selected="selected"' }}>
|
||||
{{ attribute_types[i] }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
|
@ -0,0 +1,259 @@
|
|||
{# Cell index: If certain fields get left out, the counter shouldn't change. #}
|
||||
{% set ci = 0 %}
|
||||
|
||||
{# Every time a cell shall be left out the STRG-jumping feature, $ci_offset has
|
||||
to be incremented ($ci_offset++) #}
|
||||
{% set ci_offset = -1 %}
|
||||
|
||||
<td class="text-center">
|
||||
{# column name #}
|
||||
{% include 'columns_definitions/column_name.twig' with {
|
||||
'column_number': column_number,
|
||||
'ci': ci,
|
||||
'ci_offset': ci_offset,
|
||||
'column_meta': column_meta,
|
||||
'has_central_columns_feature': relation_parameters.centralColumnsFeature is not null,
|
||||
'max_rows': max_rows
|
||||
} only %}
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<select class="column_type" name="field_type[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}"
|
||||
{{- column_meta['column_status'] is defined and not column_meta['column_status']['isEditable'] ? ' disabled' }}>
|
||||
{{ get_supported_datatypes(true, type_upper) }}
|
||||
</select>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input id="field_{{ column_number }}_{{ ci - ci_offset }}" type="text" name="field_length[{{ column_number }}]" size="
|
||||
{{- length_values_input_size }}" value="{{ length }}" class="textfield">
|
||||
<p class="enum_notice" id="enum_notice_{{ column_number }}_{{ ci - ci_offset }}">
|
||||
<a href="#" class="open_enum_editor">{% trans 'Edit ENUM/SET values' %}</a>
|
||||
</p>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<select name="field_default_type[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" class="default_type">
|
||||
<option value="NONE"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'NONE' ? ' selected' }}>
|
||||
{% trans %}None{% context %}for default{% endtrans %}
|
||||
</option>
|
||||
<option value="USER_DEFINED"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'USER_DEFINED' ? ' selected' }}>
|
||||
{% trans 'As defined:' %}
|
||||
</option>
|
||||
<option value="NULL"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'NULL' ? ' selected' }}>
|
||||
NULL
|
||||
</option>
|
||||
<option value="CURRENT_TIMESTAMP"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'CURRENT_TIMESTAMP' ? ' selected' }}>
|
||||
CURRENT_TIMESTAMP
|
||||
</option>
|
||||
{% if is_uuid_supported() %}
|
||||
<option value="UUID"{{ column_meta['DefaultType'] is defined and column_meta['DefaultType'] == 'UUID' ? ' selected' }}>
|
||||
UUID
|
||||
</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
{% if char_editing == 'textarea' %}
|
||||
<textarea name="field_default_value[{{ column_number }}]" cols="15" class="textfield default_value">{{ default_value }}</textarea>
|
||||
{% else %}
|
||||
<input type="text" name="field_default_value[{{ column_number }}]" size="12" value="{{ default_value }}" class="textfield default_value">
|
||||
{% endif %}
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{# column collation #}
|
||||
<select lang="en" dir="ltr" name="field_collation[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}">
|
||||
<option value=""></option>
|
||||
{% for charset in charsets %}
|
||||
<optgroup label="{{ charset.name }}" title="{{ charset.description }}">
|
||||
{% for collation in charset.collations %}
|
||||
<option value="{{ collation.name }}" title="{{ collation.description }}"
|
||||
{{- collation.name == column_meta['Collation'] ? ' selected' }}>
|
||||
{{- collation.name -}}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{# column attribute #}
|
||||
{% include 'columns_definitions/column_attribute.twig' with {
|
||||
'column_number': column_number,
|
||||
'ci': ci,
|
||||
'ci_offset': ci_offset,
|
||||
'column_meta': column_meta,
|
||||
'extracted_columnspec': extracted_columnspec,
|
||||
'submit_attribute': submit_attribute,
|
||||
'attribute_types': attribute_types
|
||||
} only %}
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input name="field_null[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" type="checkbox" value="YES" class="allow_null"
|
||||
{{- column_meta['Null'] is not empty and column_meta['Null'] != 'NO' and column_meta['Null'] != 'NOT NULL' ? ' checked' }}>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
{% if change_column is defined and change_column is not empty %}
|
||||
{# column Adjust privileges, Only for 'Edit' Column(s) #}
|
||||
<td class="text-center">
|
||||
<input name="field_adjust_privileges[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" type="checkbox" value="NULL" class="allow_null"
|
||||
{%- if privs_available %} checked>
|
||||
{%- else %} title="{% trans "You don't have sufficient privileges to perform this operation; Please refer to the documentation for more details" %}" disabled>
|
||||
{%- endif %}
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if not is_backup %}
|
||||
{# column indexes, See my other comment about this 'if'. #}
|
||||
<td class="text-center">
|
||||
<select name="field_key[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" data-index="">
|
||||
<option value="none_{{ column_number }}">---</option>
|
||||
<option value="primary_{{ column_number }}" title="{% trans "Primary" %}"
|
||||
{{- column_meta['Key'] is defined and column_meta['Key'] == 'PRI' ? ' selected' }}>
|
||||
PRIMARY
|
||||
</option>
|
||||
<option value="unique_{{ column_number }}" title="{% trans "Unique" %}"
|
||||
{{- column_meta['Key'] is defined and column_meta['Key'] == 'UNI' ? ' selected' }}>
|
||||
UNIQUE
|
||||
</option>
|
||||
<option value="index_{{ column_number }}" title="{% trans "Index" %}"
|
||||
{{- column_meta['Key'] is defined and column_meta['Key'] == 'MUL' ? ' selected' }}>
|
||||
INDEX
|
||||
</option>
|
||||
<option value="fulltext_{{ column_number }}" title="{% trans "Fulltext" %}"
|
||||
{{- column_meta['Key'] is defined and column_meta['Key'] == 'FULLTEXT' ? ' selected' }}>
|
||||
FULLTEXT
|
||||
</option>
|
||||
<option value="spatial_{{ column_number }}" title="{% trans "Spatial" %}"
|
||||
{{- column_meta['Key'] is defined and column_meta['Key'] == 'SPATIAL' ? ' selected' }}>
|
||||
SPATIAL
|
||||
</option>
|
||||
</select>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
{% endif %}
|
||||
<td class="text-center">
|
||||
<input name="field_extra[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" type="checkbox" value="AUTO_INCREMENT"
|
||||
{{- column_meta['Extra'] is defined and column_meta['Extra']|lower == 'auto_increment' ? ' checked' }}>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<textarea id="field_{{ column_number }}_{{ ci - ci_offset }}" rows="1" name="field_comments[{{ column_number }}]" maxlength="{{ max_length }}">
|
||||
{{- column_meta['Field'] is defined and comments_map is iterable and comments_map[column_meta['Field']] is defined ? comments_map[column_meta['Field']] -}}
|
||||
</textarea>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
{# column virtuality #}
|
||||
{% if is_virtual_columns_supported %}
|
||||
<td class="text-center">
|
||||
<select name="field_virtuality[{{ column_number }}]" id="field_{{ column_number }}_{{ ci - ci_offset }}" class="virtuality">
|
||||
{% for key, value in options %}
|
||||
{% set virtuality = column_meta['Extra'] is defined ? column_meta['Extra'] : null %}
|
||||
{# Creating a new row on create table sends a Virtuality field #}
|
||||
{% set virtuality = column_meta['Virtuality'] is defined ? column_meta['Virtuality'] : virtuality %}
|
||||
|
||||
<option value="{{ key }}"{{ virtuality is not null and key != '' and virtuality|slice(0, key|length) is same as (key) ? ' selected' }}>
|
||||
{{ value }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
{% if char_editing == 'textarea' %}
|
||||
<textarea name="field_expression[{{ column_number }}]" cols="15" class="textfield expression">{{ column_meta['Expression'] is defined ? column_meta['Expression'] }}</textarea>
|
||||
{% else %}
|
||||
<input type="text" name="field_expression[{{ column_number }}]" size="12" value="{{ column_meta['Expression'] is defined ? column_meta['Expression'] }}" placeholder="{% trans 'Expression' %}" class="textfield expression">
|
||||
{% endif %}
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
{% endif %}
|
||||
{# move column #}
|
||||
{% if fields_meta is defined %}
|
||||
{% set current_index = 0 %}
|
||||
{% set cols = move_columns|length - 1 %}
|
||||
{% set break = false %}
|
||||
{% for mi in 0..cols %}
|
||||
{% if move_columns[mi].name == column_meta['Field'] and not break %}
|
||||
{% set current_index = mi %}
|
||||
{% set break = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<td class="text-center">
|
||||
<select id="field_{{ column_number }}_{{ ci - ci_offset }}" name="field_move_to[{{ column_number }}]" size="1" width="5em">
|
||||
<option value="" selected="selected"> </option>
|
||||
<option value="-first"{{ current_index == 0 ? ' disabled="disabled"' }}>
|
||||
{% trans 'first' %}
|
||||
</option>
|
||||
{% for mi in 0..move_columns|length - 1 %}
|
||||
<option value="{{ move_columns[mi].name }}"
|
||||
{{- current_index == mi or current_index == mi + 1 ? ' disabled' }}>
|
||||
{{ 'after %s'|trans|format(backquote(move_columns[mi].name|e)) }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
{% if relation_parameters.browserTransformationFeature is not null and relation_parameters.columnCommentsFeature is not null and browse_mime %}
|
||||
<td class="text-center">
|
||||
<select id="field_{{ column_number }}_{{ ci - ci_offset }}" size="1" name="field_mimetype[{{ column_number }}]">
|
||||
<option value=""> </option>
|
||||
{% if available_mime['mimetype'] is defined and available_mime['mimetype'] is iterable %}
|
||||
{% for media_type in available_mime['mimetype'] %}
|
||||
<option value="{{ media_type|replace({'/': '_'}) }}"
|
||||
{{- column_meta['Field'] is defined and mime_map[column_meta['Field']]['mimetype'] is defined
|
||||
and mime_map[column_meta['Field']]['mimetype'] == media_type|replace({'/': '_'}) ? ' selected' }}>
|
||||
{{ media_type|lower }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<select id="field_{{ column_number }}_{{ ci - ci_offset }}" size="1" name="field_transformation[{{ column_number }}]">
|
||||
<option value="" title="{% trans 'None' %}"></option>
|
||||
{% if available_mime['transformation'] is defined and available_mime['transformation'] is iterable %}
|
||||
{% for mimekey, transform in available_mime['transformation'] %}
|
||||
{% set parts = transform|split(':') %}
|
||||
<option value="{{ available_mime['transformation_file'][mimekey] }}" title="{{ get_description(available_mime['transformation_file'][mimekey]) }}"
|
||||
{{- column_meta['Field'] is defined
|
||||
and mime_map[column_meta['Field']]['transformation'] is defined
|
||||
and mime_map[column_meta['Field']]['transformation'] is not null
|
||||
and mime_map[column_meta['Field']]['transformation'] matches '@' ~ available_mime['transformation_file_quoted'][mimekey] ~ '3?@i' ? ' selected'}}>
|
||||
{{ get_name(available_mime['transformation_file'][mimekey]) ~ ' (' ~ parts[0]|lower ~ ':' ~ parts[1] ~ ')' }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input id="field_{{ column_number }}_{{ ci - ci_offset }}" type="text" name="field_transformation_options[{{ column_number }}]" size="16" class="textfield" value="
|
||||
{{- column_meta['Field'] is defined and mime_map[column_meta['Field']]['transformation_options'] is defined ? mime_map[column_meta['Field']]['transformation_options'] }}">
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<select id="field_{{ column_number }}_{{ ci - ci_offset }}" size="1" name="field_input_transformation[{{ column_number }}]">
|
||||
<option value="" title="{% trans 'None' %}"></option>
|
||||
{% if available_mime['input_transformation'] is defined and available_mime['input_transformation'] is iterable %}
|
||||
{% for mimekey, transform in available_mime['input_transformation'] %}
|
||||
{% set parts = transform|split(':') %}
|
||||
<option value="{{ available_mime['input_transformation_file'][mimekey] }}" title="{{ get_description(available_mime['input_transformation_file'][mimekey]) }}"
|
||||
{{- column_meta['Field'] is defined and mime_map[column_meta['Field']]['input_transformation'] is defined
|
||||
and mime_map[column_meta['Field']]['input_transformation'] matches '@' ~ available_mime['input_transformation_file_quoted'][mimekey] ~ '3?@i' ? ' selected' }}>
|
||||
{{ get_name(available_mime['input_transformation_file'][mimekey]) ~ ' (' ~ parts[0]|lower ~ ':' ~ parts[1] ~ ')' }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<input id="field_{{ column_number }}_{{ ci - ci_offset }}" type="text" name="field_input_transformation_options[{{ column_number }}]" size="16" class="textfield" value="
|
||||
{{- column_meta['Field'] is defined and mime_map[column_meta['Field']]['input_transformation_options'] is defined ? mime_map[column_meta['Field']]['input_transformation_options'] }}">
|
||||
{% set ci = ci + 1 %}
|
||||
</td>
|
||||
{% endif %}
|
|
@ -0,0 +1,188 @@
|
|||
<form method="post" action="{{ action }}" class="
|
||||
{{- action == url('/table/create') ? 'create_table' : 'append_fields' -}}
|
||||
_form ajax lock-page">
|
||||
{{ get_hidden_inputs(form_params) }}
|
||||
{# happens when an index has been set on a column #}
|
||||
{# and a column is added to the table creation dialog #}
|
||||
{# This contains a JSON-encoded string #}
|
||||
<input type="hidden" name="primary_indexes" value="
|
||||
{{- primary_indexes is not empty ? primary_indexes : '[]' }}">
|
||||
<input type="hidden" name="unique_indexes" value="
|
||||
{{- unique_indexes is not empty ? unique_indexes : '[]' }}">
|
||||
<input type="hidden" name="indexes" value="
|
||||
{{- indexes is not empty ? indexes : '[]' }}">
|
||||
<input type="hidden" name="fulltext_indexes" value="
|
||||
{{- fulltext_indexes is not empty ? fulltext_indexes : '[]' }}">
|
||||
<input type="hidden" name="spatial_indexes" value="
|
||||
{{- spatial_indexes is not empty ? spatial_indexes : '[]' }}">
|
||||
|
||||
{% if action == url('/table/create') %}
|
||||
<div id="table_name_col_no_outer">
|
||||
<table id="table_name_col_no" class="table table-borderless tdblock">
|
||||
<tr class="align-middle float-start">
|
||||
<td>{% trans 'Table name' %}:
|
||||
<input type="text"
|
||||
name="table"
|
||||
size="40"
|
||||
maxlength="64"
|
||||
value="{{ table is defined ? table }}"
|
||||
class="textfield" autofocus required>
|
||||
</td>
|
||||
<td>
|
||||
{% trans 'Add' %}
|
||||
<input type="number"
|
||||
id="added_fields"
|
||||
name="added_fields"
|
||||
size="2"
|
||||
value="1"
|
||||
min="1"
|
||||
onfocus="this.select()">
|
||||
{% trans 'column(s)' %}
|
||||
<input class="btn btn-secondary" type="button"
|
||||
name="submit_num_fields"
|
||||
value="{% trans 'Go' %}">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if content_cells is iterable %}
|
||||
{% include 'columns_definitions/table_fields_definitions.twig' with {
|
||||
'is_backup': is_backup,
|
||||
'fields_meta': fields_meta,
|
||||
'relation_parameters': relation_parameters,
|
||||
'content_cells': content_cells,
|
||||
'change_column': change_column,
|
||||
'is_virtual_columns_supported': is_virtual_columns_supported,
|
||||
'server_version' : server_version,
|
||||
'browse_mime': browse_mime,
|
||||
'supports_stored_keyword': supports_stored_keyword,
|
||||
'max_rows': max_rows,
|
||||
'char_editing': char_editing,
|
||||
'attribute_types': attribute_types,
|
||||
'privs_available': privs_available,
|
||||
'max_length': max_length,
|
||||
'charsets': charsets
|
||||
} only %}
|
||||
{% endif %}
|
||||
{% if action == url('/table/create') %}
|
||||
<div class="responsivetable">
|
||||
<table class="table table-borderless w-auto align-middle mb-0">
|
||||
<tr class="align-top">
|
||||
<th>{% trans 'Table comments:' %}</th>
|
||||
<td width="25"> </td>
|
||||
<th>{% trans 'Collation:' %}</th>
|
||||
<td width="25"> </td>
|
||||
<th>
|
||||
{% trans 'Storage Engine:' %}
|
||||
{{ show_mysql_docu('Storage_engines') }}
|
||||
</th>
|
||||
<td width="25"> </td>
|
||||
<th id="storage-engine-connection">
|
||||
{% trans 'Connection:' %}
|
||||
{{ show_mysql_docu('federated-create-connection') }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text"
|
||||
name="comment"
|
||||
size="40"
|
||||
maxlength="60"
|
||||
value="{{ comment is defined ? comment }}"
|
||||
class="textfield">
|
||||
</td>
|
||||
<td width="25"> </td>
|
||||
<td>
|
||||
<select lang="en" dir="ltr" name="tbl_collation">
|
||||
<option value=""></option>
|
||||
{% for charset in charsets %}
|
||||
<optgroup label="{{ charset.name }}" title="{{ charset.description }}">
|
||||
{% for collation in charset.collations %}
|
||||
<option value="{{ collation.name }}" title="{{ collation.description }}"
|
||||
{{- collation.name == tbl_collation ? ' selected' }}>
|
||||
{{- collation.name -}}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td width="25"> </td>
|
||||
<td>
|
||||
<select class="form-select" name="tbl_storage_engine" aria-label="{% trans 'Storage engine' %}">
|
||||
{% for engine in storage_engines %}
|
||||
<option value="{{ engine.name }}"{% if engine.comment is not empty %} title="{{ engine.comment }}"{% endif %}
|
||||
{{- engine.name|lower == tbl_storage_engine|lower or (tbl_storage_engine is empty and engine.is_default) ? ' selected' }}>
|
||||
{{- engine.name -}}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td width="25"> </td>
|
||||
<td>
|
||||
<input type="text"
|
||||
name="connection"
|
||||
size="40"
|
||||
value="{{ connection is defined ? connection }}"
|
||||
placeholder="scheme://user_name[:password]@host_name[:port_num]/db_name/tbl_name"
|
||||
class="textfield"
|
||||
required="required">
|
||||
</td>
|
||||
</tr>
|
||||
{% if have_partitioning %}
|
||||
<tr class="align-top">
|
||||
<th colspan="5">
|
||||
{% trans 'PARTITION definition:' %}
|
||||
{{ show_mysql_docu('Partitioning') }}
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
{% include 'columns_definitions/partitions.twig' with {
|
||||
'partition_details': partition_details,
|
||||
'storage_engines': storage_engines
|
||||
} only %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
<fieldset class="pma-fieldset tblFooters">
|
||||
{% if action == url('/table/add-field') or action == url('/table/structure/save') %}
|
||||
<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') }}
|
||||
{% endif %}
|
||||
<input class="btn btn-secondary preview_sql" type="button"
|
||||
value="{% trans 'Preview SQL' %}">
|
||||
<input class="btn btn-primary" type="submit"
|
||||
name="do_save_data"
|
||||
value="{% trans 'Save' %}">
|
||||
</fieldset>
|
||||
<div id="properties_message"></div>
|
||||
{% if is_integers_length_restricted %}
|
||||
<div class="alert alert-primary" id="length_not_allowed" role="alert">
|
||||
{{ get_image('s_notice') }}
|
||||
{% trans %}The column width of integer types is ignored in your MySQL version unless defining a TINYINT(1) column{% endtrans %}
|
||||
{{ show_mysql_docu('', false, 'https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</form>
|
||||
<div class="modal fade" id="previewSqlModal" tabindex="-1" aria-labelledby="previewSqlModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="previewSqlModalLabel">{% trans 'Loading' %}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{% trans 'Close' %}"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" id="previewSQLCloseButton" data-bs-dismiss="modal">{% trans 'Close' %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Used by add new column of type ENUM/SET #}
|
||||
{{ include('modals/enum_set_editor.twig') }}
|
|
@ -0,0 +1,42 @@
|
|||
{% set title = '' %}
|
||||
{% if column_meta['column_status'] is defined %}
|
||||
{% if column_meta['column_status']['isReferenced'] %}
|
||||
{% set title = title ~ 'Referenced by %s.'|trans|format(
|
||||
column_meta['column_status']['references']|join(',')
|
||||
) %}
|
||||
{% endif %}
|
||||
{% if column_meta['column_status']['isForeignKey'] %}
|
||||
{% if title is not empty %}
|
||||
{% set title = title ~ '\n'|raw %}
|
||||
{% endif %}
|
||||
{% set title = title ~ 'Is a foreign key.'|trans %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if title is empty %}
|
||||
{% set title = 'Column'|trans %}
|
||||
{% endif %}
|
||||
|
||||
<input id="field_{{ column_number }}_{{ ci - ci_offset }}"
|
||||
{% if column_meta['column_status'] is defined
|
||||
and not column_meta['column_status']['isEditable'] %}
|
||||
disabled="disabled"
|
||||
{% endif %}
|
||||
type="text"
|
||||
name="field_name[{{ column_number }}]"
|
||||
maxlength="64"
|
||||
class="textfield"
|
||||
title="{{ title }}"
|
||||
size="10"
|
||||
value="{{ column_meta['Field'] is defined ? column_meta['Field'] }}">
|
||||
|
||||
{% if has_central_columns_feature
|
||||
and not (column_meta['column_status'] is defined
|
||||
and not column_meta['column_status']['isEditable']) %}
|
||||
<p class="column_name" id="central_columns_{{ column_number }}_{{ ci - ci_offset }}">
|
||||
<a data-maxrows="{{ max_rows }}"
|
||||
href="#"
|
||||
class="central_columns_dialog">
|
||||
{% trans 'Pick from Central Columns' %}
|
||||
</a>
|
||||
</p>
|
||||
{% endif %}
|
180
admin/phpMyAdmin/templates/columns_definitions/partitions.twig
Normal file
180
admin/phpMyAdmin/templates/columns_definitions/partitions.twig
Normal file
|
@ -0,0 +1,180 @@
|
|||
{% set partition_options = [
|
||||
'',
|
||||
'HASH',
|
||||
'LINEAR HASH',
|
||||
'KEY',
|
||||
'LINEAR KEY',
|
||||
'RANGE',
|
||||
'RANGE COLUMNS',
|
||||
'LIST',
|
||||
'LIST COLUMNS'
|
||||
] %}
|
||||
{% set sub_partition_options = ['', 'HASH', 'LINEAR HASH', 'KEY', 'LINEAR KEY'] %}
|
||||
{% set value_type_options = ['', 'LESS THAN', 'LESS THAN MAXVALUE', 'IN'] %}
|
||||
|
||||
<table class="table table-borderless w-auto align-middle mb-0" id="partition_table">
|
||||
<tr class="align-middle">
|
||||
<td><label for="partition_by">{% trans 'Partition by:' %}</label></td>
|
||||
<td>
|
||||
<select name="partition_by" id="partition_by">
|
||||
{% for option in partition_options %}
|
||||
<option value="{{ option }}"
|
||||
{%- if partition_details['partition_by'] == option %}
|
||||
selected="selected"
|
||||
{%- endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
(<input name="partition_expr" type="text"
|
||||
placeholder="{% trans 'Expression or column list' %}"
|
||||
value="{{ partition_details['partition_expr'] }}">)
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="align-middle">
|
||||
<td><label for="partition_count">{% trans 'Partitions:' %}</label></td>
|
||||
<td colspan="2">
|
||||
<input name="partition_count" type="number" min="2"
|
||||
value="{{ partition_details['partition_count'] ?: '' }}">
|
||||
</td>
|
||||
</tr>
|
||||
{% if partition_details['can_have_subpartitions'] %}
|
||||
<tr class="align-middle">
|
||||
<td><label for="subpartition_by">{% trans 'Subpartition by:' %}</label></td>
|
||||
<td>
|
||||
<select name="subpartition_by" id="subpartition_by">
|
||||
{% for option in sub_partition_options %}
|
||||
<option value="{{ option }}"
|
||||
{%- if partition_details['subpartition_by'] == option %}
|
||||
selected="selected"
|
||||
{%- endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
(<input name="subpartition_expr" type="text"
|
||||
placeholder="{% trans 'Expression or column list' %}"
|
||||
value="{{ partition_details['subpartition_expr'] }}">)
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="align-middle">
|
||||
<td><label for="subpartition_count">{% trans 'Subpartitions:' %}</label></td>
|
||||
<td colspan="2">
|
||||
<input name="subpartition_count" type="number" min="2"
|
||||
value="{{ partition_details['subpartition_count'] ?: '' }}">
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% if partition_details['partition_count'] > 1 %}
|
||||
<table class="table align-middle" id="partition_definition_table">
|
||||
<thead><tr>
|
||||
<th>{% trans 'Partition' %}</th>
|
||||
{% if partition_details['value_enabled'] %}
|
||||
<th>{% trans 'Values' %}</th>
|
||||
{% endif %}
|
||||
{% if partition_details['can_have_subpartitions']
|
||||
and partition_details['subpartition_count'] > 1 %}
|
||||
<th>{% trans 'Subpartition' %}</th>
|
||||
{% endif %}
|
||||
<th>{% trans 'Engine' %}</th>
|
||||
<th>{% trans 'Comment' %}</th>
|
||||
<th>{% trans 'Data directory' %}</th>
|
||||
<th>{% trans 'Index directory' %}</th>
|
||||
<th>{% trans 'Max rows' %}</th>
|
||||
<th>{% trans 'Min rows' %}</th>
|
||||
<th>{% trans 'Table space' %}</th>
|
||||
<th>{% trans 'Node group' %}</th>
|
||||
</tr></thead>
|
||||
{% for partition in partition_details['partitions'] %}
|
||||
{% set rowspan = partition['subpartition_count'] is not empty
|
||||
? partition['subpartition_count'] + 1 : 2 %}
|
||||
<tr>
|
||||
<td rowspan="{{ rowspan }}">
|
||||
<input type="text" name="{{ partition['prefix'] }}[name]"
|
||||
value="{{ partition['name'] }}">
|
||||
</td>
|
||||
{% if partition_details['value_enabled'] %}
|
||||
<td rowspan="{{ rowspan }}" class="align-middle">
|
||||
<select class="partition_value"
|
||||
name="{{ partition['prefix'] }}[value_type]">
|
||||
{% for option in value_type_options %}
|
||||
<option value="{{ option }}"
|
||||
{%- if partition['value_type'] == option %}
|
||||
selected="selected"
|
||||
{%- endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="text" class="partition_value"
|
||||
name="{{ partition['prefix'] }}[value]"
|
||||
value="{{ partition['value'] }}">
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
||||
{% if partition['subpartitions'] is defined %}
|
||||
{% set subpartitions = partition['subpartitions'] %}
|
||||
{% else %}
|
||||
{% set subpartitions = [partition] %}
|
||||
{% endif %}
|
||||
|
||||
{% for subpartition in subpartitions %}
|
||||
<tr>
|
||||
{% if partition_details['can_have_subpartitions']
|
||||
and partition_details['subpartition_count'] > 1 %}
|
||||
<td>
|
||||
<input type="text" name="{{ subpartition['prefix'] }}[name]"
|
||||
value="{{ subpartition['name'] }}">
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<select name="{{ subpartition['prefix'] }}[engine]" aria-label="{% trans 'Storage engine' %}">
|
||||
<option value=""></option>
|
||||
{% for engine in storage_engines %}
|
||||
<option value="{{ engine.name }}"{% if engine.comment is not empty %} title="{{ engine.comment }}"{% endif %}
|
||||
{{- engine.name|lower == subpartition['engine']|lower ? ' selected' }}>
|
||||
{{- engine.name -}}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<textarea name="{{ subpartition['prefix'] }}[comment]">
|
||||
{{- subpartition['comment'] -}}
|
||||
</textarea>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="{{ subpartition['prefix'] }}[data_directory]"
|
||||
value="{{ subpartition['data_directory'] }}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="{{ subpartition['prefix'] }}[index_directory]"
|
||||
value="{{ subpartition['index_directory'] }}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" name="{{ subpartition['prefix'] }}[max_rows]"
|
||||
value="{{ subpartition['max_rows'] }}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="number" min="0" name="{{ subpartition['prefix'] }}[min_rows]"
|
||||
value="{{ subpartition['min_rows'] }}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" min="0" name="{{ subpartition['prefix'] }}[tablespace]"
|
||||
value="{{ subpartition['tablespace'] }}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="{{ subpartition['prefix'] }}[node_group]"
|
||||
value="{{ subpartition['node_group'] }}">
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
|
@ -0,0 +1,121 @@
|
|||
<div class="responsivetable">
|
||||
<table id="table_columns" class="table table-striped caption-top align-middle mb-0 noclick">
|
||||
<caption class="tblHeaders">
|
||||
{% trans 'Structure' %}
|
||||
{{ show_mysql_docu('CREATE_TABLE') }}
|
||||
</caption>
|
||||
<tr>
|
||||
<th>
|
||||
{% trans 'Name' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Type' %}
|
||||
{{ show_mysql_docu('data-types') }}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Length/Values' %}
|
||||
{{ show_hint('If column type is "enum" or "set", please enter the values using this format: \'a\',\'b\',\'c\'…<br>If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Default' %}
|
||||
{{ show_hint('For default values, please enter just a single value, without backslash escaping or quotes, using this format: a'|trans) }}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Collation' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Attributes' %}
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Null' %}
|
||||
</th>
|
||||
|
||||
{# Only for 'Edit' Column(s) #}
|
||||
{% if change_column is defined and change_column is not empty %}
|
||||
<th>
|
||||
{% trans 'Adjust privileges' %}
|
||||
{{ show_docu('faq', 'faq6-39') }}
|
||||
</th>
|
||||
{% endif %}
|
||||
|
||||
{# We could remove this 'if' and let the key information be shown and
|
||||
editable. However, for this to work, structure.lib.php must be
|
||||
modified to use the key fields, as tbl_addfield does. #}
|
||||
{% if not is_backup %}
|
||||
<th>
|
||||
{% trans 'Index' %}
|
||||
</th>
|
||||
{% endif %}
|
||||
|
||||
<th>
|
||||
<abbr title="AUTO_INCREMENT">A_I</abbr>
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Comments' %}
|
||||
</th>
|
||||
|
||||
{% if is_virtual_columns_supported %}
|
||||
<th>
|
||||
{% trans 'Virtuality' %}
|
||||
</th>
|
||||
{% endif %}
|
||||
|
||||
{% if fields_meta is defined %}
|
||||
<th>
|
||||
{% trans 'Move column' %}
|
||||
</th>
|
||||
{% endif %}
|
||||
|
||||
{% if relation_parameters.browserTransformationFeature is not null and browse_mime %}
|
||||
<th>
|
||||
{% trans 'Media type' %}
|
||||
</th>
|
||||
<th>
|
||||
<a href="{{ url('/transformation/overview') }}#transformation" title="
|
||||
{%- trans 'List of available transformations and their options' -%}
|
||||
" target="_blank">
|
||||
{% trans 'Browser display transformation' %}
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Browser display transformation options' %}
|
||||
{{ show_hint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…<br>If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
|
||||
</th>
|
||||
<th>
|
||||
<a href="{{ url('/transformation/overview') }}#input_transformation"
|
||||
title="{% trans 'List of available transformations and their options' %}"
|
||||
target="_blank">
|
||||
{% trans 'Input transformation' %}
|
||||
</a>
|
||||
</th>
|
||||
<th>
|
||||
{% trans 'Input transformation options' %}
|
||||
{{ show_hint('Please enter the values for transformation options using this format: \'a\', 100, b,\'c\'…<br>If you ever need to put a backslash ("\\") or a single quote ("\'") amongst those values, precede it with a backslash (for example \'\\\\xyz\' or \'a\\\'b\').'|trans) }}
|
||||
</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% set options = {'': '', 'VIRTUAL': 'VIRTUAL'} %}
|
||||
{% if supports_stored_keyword %}
|
||||
{% set options = options|merge({'STORED': 'STORED'}) %}
|
||||
{% else %}
|
||||
{% set options = options|merge({'PERSISTENT': 'PERSISTENT'}) %}
|
||||
{% endif %}
|
||||
{% for content_row in content_cells %}
|
||||
<tr>
|
||||
{% include 'columns_definitions/column_attributes.twig' with content_row|merge({
|
||||
'options': options,
|
||||
'change_column': change_column,
|
||||
'is_virtual_columns_supported': is_virtual_columns_supported,
|
||||
'browse_mime': browse_mime,
|
||||
'max_rows': max_rows,
|
||||
'char_editing': char_editing,
|
||||
'attribute_types': attribute_types,
|
||||
'privs_available': privs_available,
|
||||
'max_length': max_length,
|
||||
'charsets': charsets,
|
||||
'relation_parameters': relation_parameters
|
||||
}) only %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue