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,27 @@
<div>
<form method="post" action="tbl_tracking.php{{ url_query|raw }}">
{{ Url_getHiddenInputs(db, table) }}
<fieldset>
<legend>
{% if action == 'activate' %}
{% set legend = 'Activate tracking for %s'|trans %}
{% set value = 'activate_now' %}
{% set button = 'Activate now'|trans %}
{% elseif action == 'deactivate' %}
{% set legend = 'Deactivate tracking for %s'|trans %}
{% set value = 'deactivate_now' %}
{% set button = 'Deactivate now'|trans %}
{% else %}
{% set legend = '' %}
{% set value = '' %}
{% set button = '' %}
{% endif %}
{{ legend|format(db ~ '.' ~ table) }}
</legend>
<input type="hidden" name="version" value="{{ last_version }}" />
<input type="hidden" name="toggle_activation" value="{{ value }}" />
<input type="submit" value="{{ button }}" />
</fieldset>
</form>
</div>

View File

@@ -0,0 +1,79 @@
<div id="div_create_version">
<form method="post" action="{{ url_query|raw }}">
{{ Url_getHiddenInputs(db) }}
{% for selected_table in selected %}
<input type="hidden" name="selected[]" value="{{ selected_table }}">
{% endfor %}
<fieldset>
<legend>
{% if selected|length == 1 %}
{{ 'Create version %1$s of %2$s'|trans|format(
last_version + 1,
db ~ '.' ~ selected[0]
) }}
{% else %}
{{ 'Create version %1$s'|trans|format(last_version + 1) }}
{% endif %}
</legend>
<input type="hidden" name="version" value="{{ last_version + 1 }}">
<p>{% trans 'Track these data definition statements:' %}</p>
{% if type == 'both' or type == 'table' %}
<input type="checkbox" name="alter_table" value="true"
{{- 'ALTER TABLE' in default_statements ? ' checked="checked"' }}>
ALTER TABLE<br/>
<input type="checkbox" name="rename_table" value="true"
{{- 'RENAME TABLE' in default_statements ? ' checked="checked"' }}>
RENAME TABLE<br/>
<input type="checkbox" name="create_table" value="true"
{{- 'CREATE TABLE' in default_statements ? ' checked="checked"' }}>
CREATE TABLE<br/>
<input type="checkbox" name="drop_table" value="true"
{{- 'DROP TABLE' in default_statements ? ' checked="checked"' }}>
DROP TABLE<br/>
{% endif %}
{% if type == 'both' %}
<br/>
{% endif %}
{% if type == 'both' or type == 'view' %}
<input type="checkbox" name="alter_view" value="true"
{{- 'ALTER VIEW' in default_statements ? ' checked="checked"' }}>
ALTER VIEW<br/>
<input type="checkbox" name="create_view" value="true"
{{- 'CREATE VIEW' in default_statements ? ' checked="checked"' }}>
CREATE VIEW<br/>
<input type="checkbox" name="drop_view" value="true"
{{- 'DROP VIEW' in default_statements ? ' checked="checked"' }}>
DROP VIEW<br/>
{% endif %}
<br/>
<input type="checkbox" name="create_index" value="true"
{{- 'CREATE INDEX' in default_statements ? ' checked="checked"' }}>
CREATE INDEX<br/>
<input type="checkbox" name="drop_index" value="true"
{{- 'DROP INDEX' in default_statements ? ' checked="checked"' }}>
DROP INDEX<br/>
<p>{% trans 'Track these data manipulation statements:' %}</p>
<input type="checkbox" name="insert" value="true"
{{- 'INSERT' in default_statements ? ' checked="checked"' }}>
INSERT<br/>
<input type="checkbox" name="update" value="true"
{{- 'UPDATE' in default_statements ? ' checked="checked"' }}>
UPDATE<br/>
<input type="checkbox" name="delete" value="true"
{{- 'DELETE' in default_statements ? ' checked="checked"' }}>
DELETE<br/>
<input type="checkbox" name="truncate" value="true"
{{- 'TRUNCATE' in default_statements ? ' checked="checked"' }}>
TRUNCATE<br/>
</fieldset>
<fieldset class="tblFooters">
<input type="hidden" name="submit_create_version" value="1" />
<input type="submit" value="{% trans 'Create version' %}" />
</fieldset>
</form>
</div>

View File

@@ -0,0 +1,27 @@
<table id="{{ table_id }}" class="data">
<thead>
<tr>
<th>{% trans %}#{% context %}Number{% endtrans %}</th>
<th>{% trans 'Date' %}</th>
<th>{% trans 'Username' %}</th>
<th>{{ header_message }}</th>
<th>{% trans 'Action' %}</th>
</tr>
</thead>
<tbody>
{% for entry in entries %}
<tr class="noclick">
<td class="right"><small>{{ entry.line_number }}</small></td>
<td><small>{{ entry.date }}</small></td>
<td><small>{{ entry.username }}</small></td>
<td>{{ entry.formated_statement|raw }}</td>
<td class="nowrap">
<a class="delete_entry_anchor ajax" href="tbl_tracking.php" data-post="
{{- entry.url_params|raw }}">
{{ drop_image_or_text|raw }}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,17 @@
<form method="post" action="tbl_tracking.php{{ url_query|raw }}">
{{ Url_getHiddenInputs(db, table) }}
<select name="table" class="autosubmit">
{% for entry in entries %}
<option value="{{ entry.table_name }}"
{{- entry.table_name == selected_table ? ' selected' }}>
{{ entry.db_name }} . {{ entry.table_name }}
{% if entry.is_tracked %}
({% trans 'active' %})
{% else %}
({% trans 'not active' %})
{% endif %}
</option>
{% endfor %}
</select>
<input type="hidden" name="show_versions_submit" value="1">
</form>

View File

@@ -0,0 +1,56 @@
<h3>{% trans 'Structure' %}</h3>
<table id="tablestructure" class="data">
<thead>
<tr>
<th>{% trans %}#{% context %}Number{% endtrans %}</th>
<th>{% trans 'Column' %}</th>
<th>{% trans 'Type' %}</th>
<th>{% trans 'Collation' %}</th>
<th>{% trans 'Null' %}</th>
<th>{% trans 'Default' %}</th>
<th>{% trans 'Extra' %}</th>
<th>{% trans 'Comment' %}</th>
</tr>
</thead>
<tbody>
{% set index = 1 %}
{% for field in columns %}
<tr class="noclick">
<td>{{ index }}</td>
{% set index = index + 1 %}
<td>
<strong>
{{ field['Field'] }}
{% if field['Key'] == 'PRI' %}
{{ Util_getImage('b_primary', 'Primary'|trans) }}
{% elseif field['Key'] is not empty %}
{{ Util_getImage('bd_primary', 'Index'|trans) }}
{% endif %}
</strong>
</td>
<td>{{ field['Type'] }}</td>
<td>{{ field['Collation'] }}</td>
<td>{{ field['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }}</td>
<td>
{% if field['Default'] is defined %}
{% set extracted_columnspec = Util_extractColumnSpec(field['Type']) %}
{% if extracted_columnspec['type'] == 'bit' %}
{# here, $field['Default'] contains something like b'010' #}
{{ Util_convertBitDefaultValue(field['Default']) }}
{% else %}
{{ field['Default'] }}
{% endif %}
{% else %}
{% if field['Null'] == 'YES' %}
<em>NULL</em>
{% else %}
<em>{% trans %}None{% context %}None for default{% endtrans %}</em>
{% endif %}
{% endif %}
</td>
<td>{{ field['Extra'] }}</td>
<td>{{ field['Comment'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@@ -0,0 +1,33 @@
<h3>{% trans 'Indexes' %}</h3>
<table id="tablestructure_indexes" class="data">
<thead>
<tr>
<th>{% trans 'Keyname' %}</th>
<th>{% trans 'Type' %}</th>
<th>{% trans 'Unique' %}</th>
<th>{% trans 'Packed' %}</th>
<th>{% trans 'Column' %}</th>
<th>{% trans 'Cardinality' %}</th>
<th>{% trans 'Collation' %}</th>
<th>{% trans 'Null' %}</th>
<th>{% trans 'Comment' %}</th>
</tr>
</thead>
<tbody>
{% for index in indexes %}
<tr class="noclick">
<td>
<strong>{{ index['Key_name'] }}</strong>
</td>
<td>{{ index['Index_type'] }}</td>
<td>{{ index['Non_unique'] == 0 ? 'Yes'|trans : 'No'|trans }}</td>
<td>{{ index['Packed'] != '' ? 'Yes'|trans : 'No'|trans }}</td>
<td>{{ index['Column_name'] }}</td>
<td>{{ index['Cardinality'] }}</td>
<td>{{ index['Collation'] }}</td>
<td>{{ index['Null'] }}</td>
<td>{{ index['Comment'] }}</td>
</tr>
{% endfor %}
</tbody>
</table>