42 lines
2.0 KiB
JavaScript
42 lines
2.0 KiB
JavaScript
import $ from 'jquery';
|
||
|
||
function getBaseUrl() {
|
||
return window.location.origin;
|
||
}
|
||
|
||
export const SRMPage = {
|
||
render: () => {
|
||
const baseUrl = getBaseUrl();
|
||
const updateUrl = `${baseUrl}/webhook/SRM/update`;
|
||
const subnetsUrl = `${baseUrl}/webhook/SRM/subnets`;
|
||
|
||
return `
|
||
<h1 class="page-title">SRM Webhooks</h1>
|
||
<div class="component-config-form">
|
||
<p class="hint-text" style="margin-bottom: 20px;">
|
||
SRM предоставляет HTTP webhook'ы для получения информации о текущем состоянии подсетей.
|
||
Настройка не требуется — компонент отслеживает изменения автоматически.
|
||
</p>
|
||
|
||
<div class="form-group">
|
||
<label for="srm-update-url">Последнее обновление</label>
|
||
<textarea id="srm-update-url" class="form-control" readonly rows="1"
|
||
style="font-family: monospace; resize: vertical; cursor: text;"
|
||
onclick="this.select();">${updateUrl}</textarea>
|
||
<small class="hint-text">Возвращает временную метку (unix timestamp) последнего обновления списка подсетей.</small>
|
||
</div>
|
||
|
||
<div class="form-group" style="margin-top: 20px;">
|
||
<label for="srm-subnets-url">Список подсетей</label>
|
||
<textarea id="srm-subnets-url" class="form-control" readonly rows="1"
|
||
style="font-family: monospace; resize: vertical; cursor: text;"
|
||
onclick="this.select();">${subnetsUrl}</textarea>
|
||
<small class="hint-text">Возвращает текущий список подсетей в формате JSON array.</small>
|
||
</div>
|
||
</div>
|
||
`;
|
||
},
|
||
mount: async () => {},
|
||
unmount: () => {}
|
||
};
|