|
|
@@ -72,7 +72,7 @@
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{{ testingWinRm ? "Проверка…" : "Проверить WinRM (admin)" }}
|
|
|
|
{{ testingWinRm ? "Проверка…" : "Проверить WinRM (admin)" }}
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<p v-if="winRmTestMessage" :class="winRmTestOk ? 'success' : 'error'">{{ winRmTestMessage }}</p>
|
|
|
|
<p v-if="showWinRmTestFeedback && winRmTestMessage" :class="winRmTestOk ? 'success' : 'error'">{{ winRmTestMessage }}</p>
|
|
|
|
<div class="host-actions-row">
|
|
|
|
<div class="host-actions-row">
|
|
|
|
<button
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
type="button"
|
|
|
@@ -297,7 +297,7 @@ import {
|
|
|
|
} from "../api";
|
|
|
|
} from "../api";
|
|
|
|
import { emitHostPatch } from "../utils/hostPatchBus";
|
|
|
|
import { emitHostPatch } from "../utils/hostPatchBus";
|
|
|
|
|
|
|
|
|
|
|
|
const SSH_TEST_FEEDBACK_MS = 60_000;
|
|
|
|
const HOST_ACTION_FEEDBACK_MS = 30_000;
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{ id: string }>();
|
|
|
|
const props = defineProps<{ id: string }>();
|
|
|
|
const route = useRoute();
|
|
|
|
const route = useRoute();
|
|
|
@@ -313,6 +313,7 @@ const eventsPageSize = 50;
|
|
|
|
const testingWinRm = ref(false);
|
|
|
|
const testingWinRm = ref(false);
|
|
|
|
const winRmTestMessage = ref("");
|
|
|
|
const winRmTestMessage = ref("");
|
|
|
|
const winRmTestOk = ref(false);
|
|
|
|
const winRmTestOk = ref(false);
|
|
|
|
|
|
|
|
const showWinRmTestFeedback = ref(false);
|
|
|
|
const testingSsh = ref(false);
|
|
|
|
const testingSsh = ref(false);
|
|
|
|
const updatingAgent = ref(false);
|
|
|
|
const updatingAgent = ref(false);
|
|
|
|
const showSshTestFeedback = ref(false);
|
|
|
|
const showSshTestFeedback = ref(false);
|
|
|
@@ -334,6 +335,7 @@ const configForm = reactive({
|
|
|
|
getInventory: true,
|
|
|
|
getInventory: true,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
let sshTestHideTimer: ReturnType<typeof setTimeout> | null = null;
|
|
|
|
let sshTestHideTimer: ReturnType<typeof setTimeout> | null = null;
|
|
|
|
|
|
|
|
let winRmTestHideTimer: ReturnType<typeof setTimeout> | null = null;
|
|
|
|
let sshProbeSeq = 0;
|
|
|
|
let sshProbeSeq = 0;
|
|
|
|
let refreshingLive = false;
|
|
|
|
let refreshingLive = false;
|
|
|
|
|
|
|
|
|
|
|
@@ -480,6 +482,13 @@ function applySshAdminStatus(result: { ok: boolean; ssh_admin_ok?: boolean | nul
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function clearWinRmTestFeedbackTimer() {
|
|
|
|
|
|
|
|
if (winRmTestHideTimer != null) {
|
|
|
|
|
|
|
|
clearTimeout(winRmTestHideTimer);
|
|
|
|
|
|
|
|
winRmTestHideTimer = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function scheduleSshTestFeedbackHide() {
|
|
|
|
function scheduleSshTestFeedbackHide() {
|
|
|
|
clearSshTestFeedbackTimer();
|
|
|
|
clearSshTestFeedbackTimer();
|
|
|
|
sshTestHideTimer = setTimeout(() => {
|
|
|
|
sshTestHideTimer = setTimeout(() => {
|
|
|
@@ -487,7 +496,16 @@ function scheduleSshTestFeedbackHide() {
|
|
|
|
sshTestOutput.value = "";
|
|
|
|
sshTestOutput.value = "";
|
|
|
|
showSshTestFeedback.value = false;
|
|
|
|
showSshTestFeedback.value = false;
|
|
|
|
sshTestHideTimer = null;
|
|
|
|
sshTestHideTimer = null;
|
|
|
|
}, SSH_TEST_FEEDBACK_MS);
|
|
|
|
}, HOST_ACTION_FEEDBACK_MS);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function scheduleWinRmTestFeedbackHide() {
|
|
|
|
|
|
|
|
clearWinRmTestFeedbackTimer();
|
|
|
|
|
|
|
|
winRmTestHideTimer = setTimeout(() => {
|
|
|
|
|
|
|
|
winRmTestMessage.value = "";
|
|
|
|
|
|
|
|
showWinRmTestFeedback.value = false;
|
|
|
|
|
|
|
|
winRmTestHideTimer = null;
|
|
|
|
|
|
|
|
}, HOST_ACTION_FEEDBACK_MS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function runSshTest(options: { silent?: boolean } = {}) {
|
|
|
|
async function runSshTest(options: { silent?: boolean } = {}) {
|
|
|
@@ -544,14 +562,21 @@ async function probeSshOnOpen() {
|
|
|
|
|
|
|
|
|
|
|
|
async function runWinRmTest() {
|
|
|
|
async function runWinRmTest() {
|
|
|
|
testingWinRm.value = true;
|
|
|
|
testingWinRm.value = true;
|
|
|
|
|
|
|
|
clearWinRmTestFeedbackTimer();
|
|
|
|
winRmTestMessage.value = "";
|
|
|
|
winRmTestMessage.value = "";
|
|
|
|
|
|
|
|
showWinRmTestFeedback.value = false;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const result = await testHostWinRm(hostId.value);
|
|
|
|
const result = await testHostWinRm(hostId.value);
|
|
|
|
winRmTestOk.value = result.ok;
|
|
|
|
winRmTestOk.value = result.ok;
|
|
|
|
winRmTestMessage.value = result.message;
|
|
|
|
winRmTestMessage.value = result.message;
|
|
|
|
|
|
|
|
showWinRmTestFeedback.value = true;
|
|
|
|
|
|
|
|
if (result.ok) {
|
|
|
|
|
|
|
|
scheduleWinRmTestFeedbackHide();
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
winRmTestOk.value = false;
|
|
|
|
winRmTestOk.value = false;
|
|
|
|
winRmTestMessage.value = e instanceof Error ? e.message : "Ошибка проверки WinRM";
|
|
|
|
winRmTestMessage.value = e instanceof Error ? e.message : "Ошибка проверки WinRM";
|
|
|
|
|
|
|
|
showWinRmTestFeedback.value = true;
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
testingWinRm.value = false;
|
|
|
|
testingWinRm.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -646,6 +671,8 @@ async function loadHost() {
|
|
|
|
loading.value = true;
|
|
|
|
loading.value = true;
|
|
|
|
error.value = "";
|
|
|
|
error.value = "";
|
|
|
|
winRmTestMessage.value = "";
|
|
|
|
winRmTestMessage.value = "";
|
|
|
|
|
|
|
|
clearWinRmTestFeedbackTimer();
|
|
|
|
|
|
|
|
showWinRmTestFeedback.value = false;
|
|
|
|
sshProbeSeq += 1;
|
|
|
|
sshProbeSeq += 1;
|
|
|
|
clearSshTestFeedbackTimer();
|
|
|
|
clearSshTestFeedbackTimer();
|
|
|
|
showSshTestFeedback.value = false;
|
|
|
|
showSshTestFeedback.value = false;
|
|
|
@@ -738,6 +765,7 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
onUnmounted(() => {
|
|
|
|
clearSshTestFeedbackTimer();
|
|
|
|
clearSshTestFeedbackTimer();
|
|
|
|
|
|
|
|
clearWinRmTestFeedbackTimer();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
|