feat: add Semaphore Sync job
Fetches Semaphore project inventory via Bearer auth, parses the Ansible INI format to extract hostnames, and sets semaphore=1/0 on matching instances. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
11
js/ui.js
11
js/ui.js
@@ -483,17 +483,20 @@ function _renderJobConfigFields(key, cfg) {
|
||||
<input class="form-input" id="job-cfg-api-key" type="password"
|
||||
placeholder="tskey-api-…" value="${esc(cfg.api_key ?? '')}">
|
||||
</div>`;
|
||||
if (key === 'patchmon_sync') return `
|
||||
if (key === 'patchmon_sync' || key === 'semaphore_sync') {
|
||||
const label = key === 'semaphore_sync' ? 'API Token (Bearer)' : 'API Token (Basic)';
|
||||
return `
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="job-cfg-api-url">API URL</label>
|
||||
<input class="form-input" id="job-cfg-api-url" type="text"
|
||||
placeholder="http://patchmon:3000/api/v1/api/hosts" value="${esc(cfg.api_url ?? '')}">
|
||||
value="${esc(cfg.api_url ?? '')}">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="job-cfg-api-token">API Token (Basic)</label>
|
||||
<label class="form-label" for="job-cfg-api-token">${label}</label>
|
||||
<input class="form-input" id="job-cfg-api-token" type="password"
|
||||
placeholder="Basic token…" value="${esc(cfg.api_token ?? '')}">
|
||||
value="${esc(cfg.api_token ?? '')}">
|
||||
</div>`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user