Version 0.5.5.94: field type conversion, exclusion filters and value lists
- Change the data type of custom fields with stored values via a preview: values that cannot be converted need an explicit decision, the conversion runs in one transaction with row locks and a stale-preview check, old values are saved to data/backups and recorded in history. - Table filters: "!value" excludes rows, "=value" compares exactly; Excel-like value list (▾) per column in all tables. The software job list computes its value list on the server over the full job history. - Bulk edit offers custom fields with type-specific input and validation. - MeshCentral mappings: optional "value if empty" with a guard path; fallbacks are skipped when only basic data was delivered. - Deleting a field removes its translations (same name can be reused); one confirmation with the value count replaces the checkbox. - Job list filters recognize the "reinstall" action and the "software deployment" job type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
261b4f2029
commit
40cd88871f
20 files changed
+1400
-187
No files matched your search
@@ -9,7 +9,7 @@
|
||||
<label>{{ t('common.field') }}
|
||||
<select name="field_name" id="bulk-field" required>
|
||||
<option value="">{{ t('common.please_select') }}</option>
|
||||
{% for field in fields %}<option value="{{ field.field_name }}">{{ field.label }}</option>{% endfor %}
|
||||
{% for field in fields %}<option value="{{ field.field_name }}" data-type="{{ field.data_type or '' }}" data-custom="{{ '1' if field.custom else '0' }}">{{ field.label }}</option>{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label>{{ t('history.new_value') }}
|
||||
@@ -22,6 +22,11 @@
|
||||
<option value="">{{ t('assets.bulk_edit.no_parent') }}</option>
|
||||
{% for parent in parent_candidates %}<option value="{{ parent.id }}">{{ parent.name }}{% if parent.asset_tag %} – {{ parent.asset_tag }}{% endif %} ({{ parent.category.name }})</option>{% endfor %}
|
||||
</select>
|
||||
<select id="bulk-boolean-value" class="hidden-control">
|
||||
<option value="">{{ t('assets.bulk_edit.empty_value') }}</option>
|
||||
<option value="true">{{ t('common.yes') }}</option>
|
||||
<option value="false">{{ t('common.no') }}</option>
|
||||
</select>
|
||||
<select id="bulk-category-value" class="hidden-control">
|
||||
<option value="">{{ t('assets.bulk_edit.select_category') }}</option>
|
||||
{% for category in categories %}<option value="{{ category.id }}">{{ category.name }}</option>{% endfor %}
|
||||
@@ -40,16 +45,27 @@
|
||||
const status = document.getElementById('bulk-status-value');
|
||||
const parent = document.getElementById('bulk-parent-value');
|
||||
const category = document.getElementById('bulk-category-value');
|
||||
const controls = [input, status, parent, category];
|
||||
const bool = document.getElementById('bulk-boolean-value');
|
||||
const controls = [input, status, parent, category, bool];
|
||||
field.addEventListener('change', () => {
|
||||
const selected = field.value;
|
||||
const active = selected === 'status' ? status : selected === 'parent_asset_id' ? parent : selected === 'category_id' ? category : input;
|
||||
const option = field.selectedOptions[0];
|
||||
const isCustom = option && option.dataset.custom === '1';
|
||||
const dataType = option ? option.dataset.type : '';
|
||||
const active = selected === 'status' ? status : selected === 'parent_asset_id' ? parent : selected === 'category_id' ? category : (isCustom && dataType === 'boolean') ? bool : input;
|
||||
controls.forEach(control => {
|
||||
control.classList.toggle('hidden-control', control !== active);
|
||||
if (control === active) control.name = 'new_value'; else control.removeAttribute('name');
|
||||
});
|
||||
const dateFields = ['assigned_on','purchase_date','warranty_until'];
|
||||
input.type = dateFields.includes(selected) ? 'date' : 'text';
|
||||
input.removeAttribute('step');
|
||||
if (dateFields.includes(selected) || (isCustom && dataType === 'date')) input.type = 'date';
|
||||
else if (isCustom && dataType === 'datetime') input.type = 'datetime-local';
|
||||
else if (isCustom && dataType === 'integer') { input.type = 'number'; input.step = '1'; }
|
||||
else if (isCustom && dataType === 'decimal') { input.type = 'number'; input.step = 'any'; }
|
||||
else if (isCustom && dataType === 'email') input.type = 'email';
|
||||
else if (isCustom && dataType === 'url') input.type = 'url';
|
||||
else input.type = 'text';
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user