|
@@ -484,7 +484,17 @@
|
|
|
|
|
|
|
|
document.getElementById('job-type').addEventListener('change', function() { showTypeConfig(); suggestName(); });
|
|
document.getElementById('job-type').addEventListener('change', function() { showTypeConfig(); suggestName(); });
|
|
|
const appSel = document.getElementById('app_id');
|
|
const appSel = document.getElementById('app_id');
|
|
|
- if (appSel) appSel.addEventListener('change', suggestName);
|
|
|
|
|
|
|
+ if (appSel) appSel.addEventListener('change', function() {
|
|
|
|
|
+ {% if not job %}
|
|
|
|
|
+ const opt = appSel.options[appSel.selectedIndex];
|
|
|
|
|
+ if (opt) {
|
|
|
|
|
+ const sep = opt.text.indexOf(' — ');
|
|
|
|
|
+ nameInput.value = sep !== -1 ? opt.text.slice(sep + 3) : opt.text;
|
|
|
|
|
+ }
|
|
|
|
|
+ {% else %}
|
|
|
|
|
+ suggestName();
|
|
|
|
|
+ {% endif %}
|
|
|
|
|
+ });
|
|
|
['db-select-mysql', 'db-select-postgresql'].forEach(id => {
|
|
['db-select-mysql', 'db-select-postgresql'].forEach(id => {
|
|
|
const el = document.getElementById(id);
|
|
const el = document.getElementById(id);
|
|
|
if (el) el.addEventListener('change', suggestName);
|
|
if (el) el.addEventListener('change', suggestName);
|