init web ems all

This commit is contained in:
agtuser
2024-09-27 17:13:36 +08:00
parent 81c97acbe9
commit 5cc56f8078
4263 changed files with 798779 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
{% if privs_available %}
<input name="field_adjust_privileges[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
checked="checked"
type="checkbox"
value="NULL"
class="allow_null"/>
{% else %}
<input name="field_adjust_privileges[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
disabled
type="checkbox"
value="NULL"
class="allow_null"
title="{% trans "You don't have sufficient privileges to perform this operation; Please refer to the documentation for more details" %}"/>
{% endif %}

View File

@@ -0,0 +1,21 @@
{% if submit_attribute is defined and submit_attribute != false %}
{% set attribute = submit_attribute %}
{% elseif column_meta['Extra'] is defined
and column_meta['Extra'] == 'on update CURRENT_TIMESTAMP' %}
{% 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>

View File

@@ -0,0 +1,240 @@
{# 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="center">
{# column name #}
{% include 'columns_definitions/column_name.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'cfg_relation': cfg_relation,
'max_rows': max_rows
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# column type #}
{% include 'columns_definitions/column_type.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'type_upper': type_upper
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# column length #}
{% include 'columns_definitions/column_length.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'length_values_input_size': length_values_input_size,
'length_to_display': length
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# column default #}
{% include 'columns_definitions/column_default.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'type_upper': type_upper,
'char_editing': char_editing
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# column collation #}
{{ Charsets_getCollationDropdownBox(
dbi,
disable_is,
'field_collation[' ~ column_number ~ ']',
'field_' ~ column_number ~ '_' ~ (ci - ci_offset),
column_meta['Collation'] is not empty ? column_meta['Collation'] : null,
false
) }}
{% set ci = ci + 1 %}
</td>
<td class="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="center">
{# column NULL #}
{% include 'columns_definitions/column_null.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta
} only %}
{% 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="center">
{% include 'columns_definitions/column_adjust_privileges.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'privs_available': privs_available
} only %}
{% set ci = ci + 1 %}
</td>
{% endif %}
{% if not is_backup %}
{# column indexes, See my other comment about this 'if'. #}
<td class="center">
{% include 'columns_definitions/column_indexes.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta
} only %}
{% set ci = ci + 1 %}
</td>
{% endif %}
<td class="center">
{# column auto_increment #}
{% include 'columns_definitions/column_auto_increment.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# column comments #}
{% include 'columns_definitions/column_comment.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'max_length': max_length,
'value': column_meta['Field'] is defined
and comments_map is iterable
and comments_map[column_meta['Field']] is defined
? comments_map[column_meta['Field']]|e
} only %}
{% set ci = ci + 1 %}
</td>
{# column virtuality #}
{% if is_virtual_columns_supported %}
<td class="center">
{% include 'columns_definitions/column_virtuality.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'char_editing': char_editing,
'expression': column_meta['Expression'] is defined ? column_meta['Expression'],
'options': options
} only %}
{% 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="center">
{% include 'columns_definitions/move_column.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'move_columns': move_columns,
'current_index': current_index
} only %}
{% set ci = ci + 1 %}
</td>
{% endif %}
{% if cfg_relation['mimework'] and browse_mime and cfg_relation['commwork'] %}
<td class="center">
{# Column Mime-type #}
{% include 'columns_definitions/mime_type.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'available_mime': available_mime,
'mime_map': mime_map
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# Column Browser transformation #}
{% include 'columns_definitions/transformation.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'available_mime': available_mime,
'mime_map': mime_map,
'type': 'transformation'
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# column Transformation options #}
{% include 'columns_definitions/transformation_option.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'mime_map': mime_map,
'type_prefix': ''
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# Column Input transformation #}
{% include 'columns_definitions/transformation.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'available_mime': available_mime,
'mime_map': mime_map,
'type': 'input_transformation'
} only %}
{% set ci = ci + 1 %}
</td>
<td class="center">
{# column Input transformation options #}
{% include 'columns_definitions/transformation_option.twig' with {
'column_number': column_number,
'ci': ci,
'ci_offset': ci_offset,
'column_meta': column_meta,
'mime_map': mime_map,
'type_prefix': 'input_'
} only %}
{% set ci = ci + 1 %}
</td>
{% endif %}

View File

@@ -0,0 +1,7 @@
<input name="field_extra[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
{% if column_meta['Extra'] is defined and column_meta['Extra']|lower == 'auto_increment' -%}
checked="checked"
{%- endif %}
type="checkbox"
value="AUTO_INCREMENT" />

View File

@@ -0,0 +1,7 @@
<input id="field_{{ column_number }}_{{ ci - ci_offset }}"
type="text"
name="field_comments[{{ column_number }}]"
size="12"
maxlength="{{ max_length }}"
value="{{ value|raw }}"
class="textfield" />

View File

@@ -0,0 +1,46 @@
{# here we put 'NONE' as the default value of drop-down; otherwise users would
have problems if they forget to enter the default value (example, for an INT) #}
{% set translation %}{% trans %}None{% context %}for default{% endtrans %}{% endset %}
{% set default_options = {
'NONE': translation,
'USER_DEFINED': 'As defined:'|trans,
'NULL': 'NULL',
'CURRENT_TIMESTAMP': 'CURRENT_TIMESTAMP'
} %}
{# For a TIMESTAMP, do not show the string "CURRENT_TIMESTAMP" as a default value #}
{% set default_value = '' %}
{% if column_meta['DefaultValue'] is defined %}
{% set default_value = column_meta['DefaultValue'] %}
{% endif %}
{% if type_upper == 'BIT' %}
{% set default_value = Util_convertBitDefaultValue(column_meta['DefaultValue']) %}
{% elseif type_upper == 'BINARY' or type_upper == 'VARBINARY' %}
{% set default_value = bin2hex(column_meta['DefaultValue']) %}
{% endif %}
<select name="field_default_type[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
class="default_type">
{% for key, value in default_options %}
<option value="{{ key }}"
{%- if column_meta['DefaultType'] is defined
and column_meta['DefaultType'] == key %}
selected="selected"
{%- endif %}>
{{ value }}
</option>
{% endfor %}
</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 %}

View File

@@ -0,0 +1,152 @@
<form method="post" action="{{ action }}" class="
{{- action == 'tbl_create.php' ? 'create_table' : 'append_fields' -}}
_form ajax lock-page">
{{ Url_getHiddenInputs(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 == 'tbl_create.php' %}
<div id="table_name_col_no_outer">
<table id="table_name_col_no" class="tdblock">
<tr class="vmiddle floatleft">
<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 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,
'mimework': mimework,
'content_cells': content_cells,
'change_column': change_column,
'is_virtual_columns_supported': is_virtual_columns_supported,
'browse_mime': browse_mime,
'server_type': server_type,
'max_rows': max_rows,
'char_editing': char_editing,
'attribute_types': attribute_types,
'privs_available': privs_available,
'max_length': max_length,
'dbi': dbi,
'disable_is': disable_is
} only %}
{% endif %}
{% if action == 'tbl_create.php' %}
<div class="responsivetable">
<table>
<tr class="vtop">
<th>{% trans 'Table comments:' %}</th>
<td width="25">&nbsp;</td>
<th>{% trans 'Collation:' %}</th>
<td width="25">&nbsp;</td>
<th>
{% trans 'Storage Engine:' %}
{{ Util_showMySQLDocu('Storage_engines') }}
</th>
<td width="25">&nbsp;</td>
<th>
{% trans 'Connection:' %}
{{ Util_showMySQLDocu('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">&nbsp;</td>
<td>
{{ Charsets_getCollationDropdownBox(
dbi,
disable_is,
'tbl_collation',
null,
tbl_collation,
false
) }}
</td>
<td width="25">&nbsp;</td>
<td>
{{ StorageEngine_getHtmlSelect(
'tbl_storage_engine',
null,
tbl_storage_engine
) }}
</td>
<td width="25">&nbsp;</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="vtop">
<th colspan="5">
{% trans 'PARTITION definition:' %}
{{ Util_showMySQLDocu('Partitioning') }}
</th>
</tr>
<tr>
<td colspan="5">
{% include 'columns_definitions/partitions.twig' with {
'partition_details': partition_details
} only %}
</td>
</tr>
{% endif %}
</table>
</div>
{% endif %}
<fieldset class="tblFooters">
<input type="button"
class="preview_sql"
value="{% trans 'Preview SQL' %}" />
<input type="submit"
name="do_save_data"
value="{% trans 'Save' %}" />
</fieldset>
<div id="properties_message"></div>
</form>

View File

@@ -0,0 +1,7 @@
<input name="col_extra[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
{% if column_meta['Extra'] is not empty and column_meta['Extra'] == 'auto_increment' -%}
checked="checked"
{%- endif %}
type="checkbox"
value="auto_increment" />

View File

@@ -0,0 +1,24 @@
<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="selected"' }}>
PRIMARY
</option>
<option value="unique_{{ column_number }}" title="{% trans "Unique" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'UNI' ? ' selected="selected"' }}>
UNIQUE
</option>
<option value="index_{{ column_number }}" title="{% trans "Index" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'MUL' ? ' selected="selected"' }}>
INDEX
</option>
<option value="fulltext_{{ column_number }}" title="{% trans "Fulltext" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'FULLTEXT' ? ' selected="selected"' }}>
FULLTEXT
</option>
<option value="spatial_{{ column_number }}" title="{% trans "Spatial" %}"
{{- column_meta['Key'] is defined and column_meta['Key'] == 'SPATIAL' ? ' selected="selected"' }}>
SPATIAL
</option>
</select>

View File

@@ -0,0 +1,11 @@
<input id="field_{{ column_number }}_{{ ci - ci_offset }}"
type="text"
name="field_length[{{ column_number }}]"
size="{{ length_values_input_size }}"
value="{{ length_to_display }}"
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>

View File

@@ -0,0 +1,43 @@
{% 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 cfg_relation['centralcolumnswork']
and not (column_meta['column_status'] is defined
and not column_meta['column_status']['isEditable']) %}
<p style="font-size:80%;margin:5px 2px"
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 %}

View File

@@ -0,0 +1,8 @@
<input name="field_null[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
{% if column_meta['Null'] is not empty and column_meta['Null'] != 'NO' and column_meta['Null'] != 'NOT NULL' -%}
checked="checked"
{%- endif %}
type="checkbox"
value="YES"
class="allow_null" />

View File

@@ -0,0 +1,8 @@
<select class="column_type"
name="field_type[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
{%- if column_meta['column_status'] is defined and not column_meta['column_status']['isEditable'] -%}
disabled="disabled"
{%- endif %}>
{{ Util_getSupportedDatatypes(true, type_upper) }}
</select>

View File

@@ -0,0 +1,31 @@
<select name="field_virtuality[{{ column_number }}]"
id="field_{{ column_number }}_{{ ci - ci_offset }}"
class="virtuality">
{% for key, value in options %}
<option value="{{ key }}"
{%- if column_meta['Extra'] is defined
and key != ''
and strpos(column_meta['Extra'], key) is same as(0) %}
selected="selected"
{%- endif %}>
{{ value }}
</option>
{% endfor %}
</select>
{% if char_editing == 'textarea' %}
{% apply spaceless %}
<textarea name="field_expression[{{ column_number }}]"
cols="15"
class="textfield expression">
{{ expression }}
</textarea>
{% endapply %}
{% else %}
<input type="text"
name="field_expression[{{ column_number }}]"
size="12"
value="{{ expression }}"
placeholder="{% trans 'Expression' %}"
class="textfield expression" />
{% endif %}

View File

@@ -0,0 +1,17 @@
<select id="field_{{ column_number }}_{{ ci - ci_offset }}"
size="1"
name="field_mimetype[{{ column_number }}]">
<option value="">&nbsp;</option>
{% if available_mime['mimetype'] is defined
and available_mime['mimetype'] is iterable %}
{% for mimetype in available_mime['mimetype'] %}
{% set checked = column_meta['Field'] is defined
and mime_map[column_meta['Field']]['mimetype'] is defined
and mime_map[column_meta['Field']]['mimetype'] == mimetype|replace({'/': '_'})
? ' selected' %}
<option value="{{ mimetype|replace({'/': '_'}) }}"{{ checked }}>
{{ mimetype|lower }}
</option>
{% endfor %}
{% endif %}
</select>

View File

@@ -0,0 +1,15 @@
<select id="field_{{ column_number }}_{{ ci - ci_offset }}"
name="field_move_to[{{ column_number }}]"
size="1"
width="5em">
<option value="" selected="selected">&nbsp;</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="disabled"' }}>
{{ 'after %s'|trans|format(Util_backquote(move_columns[mi].name|e)) }}
</option>
{% endfor %}
</select>

View 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 id="partition_table">
<tr class="vmiddle">
<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="vmiddle">
<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="vmiddle">
<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="vmiddle">
<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 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="vmiddle">
<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>
{{ StorageEngine_getHtmlSelect(
subpartition['prefix'] ~ '[engine]',
null,
subpartition['engine'],
false,
true
) }}
</td>
<td>
{% apply spaceless %}
<textarea name="{{ subpartition['prefix'] }}[comment]">
{{ subpartition['comment'] }}
</textarea>
{% endapply %}
</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 %}

View File

@@ -0,0 +1,123 @@
<div class="responsivetable">
<table id="table_columns" class="noclick">
<caption class="tblHeaders">
{% trans 'Structure' %}
{{ Util_showMySQLDocu('CREATE_TABLE') }}
</caption>
<tr>
<th>
{% trans 'Name' %}
</th>
<th>
{% trans 'Type' %}
{{ Util_showMySQLDocu('data-types') }}
</th>
<th>
{% trans 'Length/Values' %}
{{ Util_showHint('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' %}
{{ Util_showHint('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' %}
{{ Util_showDocu('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 mimework and browse_mime %}
<th>
{% trans 'MIME type' %}
</th>
<th>
<a href="transformation_overview.php
{{- Url_getCommon() }}#transformation" title="
{%- trans 'List of available transformations and their options' -%}
" target="_blank">
{% trans 'Browser display transformation' %}
</a>
</th>
<th>
{% trans 'Browser display transformation options' %}
{{ Util_showHint('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="transformation_overview.php{{ Url_getCommon() }}#input_transformation"
title="{% trans 'List of available transformations and their options' %}"
target="_blank">
{% trans 'Input transformation' %}
</a>
</th>
<th>
{% trans 'Input transformation options' %}
{{ Util_showHint('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 server_type == 'MariaDB' %}
{% set options = options|merge({'PERSISTENT': 'PERSISTENT'}) %}
{% set options = options|merge({'STORED': 'STORED'}) %}
{% else %}
{% set options = options|merge({'STORED': 'STORED'}) %}
{% 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,
'dbi': dbi,
'disable_is': disable_is
}) only %}
</tr>
{% endfor %}
</table>
</div>

View File

@@ -0,0 +1,26 @@
<select id="field_{{ column_number }}_{{ ci - ci_offset }}"
size="1"
name="field_{{ type }}[{{ column_number }}]">
<option value="" title="{% trans 'None' %}"></option>
{% if available_mime[type] is defined and available_mime[type] is iterable %}
{% for mimekey, transform in available_mime[type] %}
{% set checked = column_meta['Field'] is defined
and mime_map[column_meta['Field']][type] is defined
and mime_map[column_meta['Field']][type] matches
'@' ~ preg_quote(available_mime[type ~ '_file'][mimekey], '@') ~ '3?@i'
? 'selected ' %}
{% set tooltip = Transformations_getDescription(
available_mime[type ~ '_file'][mimekey]
) %}
{% set parts = transform|split(':') %}
{% set name = Transformations_getName(
available_mime[type ~ '_file'][mimekey]
) ~ ' (' ~ parts[0]|lower ~ ':' ~ parts[1] ~ ')' %}
<option value="{{ available_mime[type ~ '_file'][mimekey] }}"
{{ checked }}
title="{{ tooltip }}">
{{ name }}
</option>
{% endfor %}
{% endif %}
</select>

View File

@@ -0,0 +1,9 @@
{% set options_key = type_prefix ~ 'transformation_options' %}
<input id="field_{{ column_number }}_{{ ci - ci_offset }}"
type="text"
name="field_{{ options_key }}[{{ column_number }}]"
size="16"
class="textfield"
value="{% if column_meta['Field'] is defined and mime_map[column_meta['Field']][options_key] is defined -%}
{{- mime_map[column_meta['Field']][options_key] -}}
{%- endif %}" />