feat: manual host add from Hosts list via WinRM/SSH (0.4.5)
Add host button probes Windows by hostname or Linux by IP, registers host in SAC and deploys agent in background. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
</select>
|
||||
</label>
|
||||
<button type="button" class="secondary" @click="applyFilters">Найти</button>
|
||||
<button type="button" @click="manualAddOpen = true">Добавить вручную</button>
|
||||
</div>
|
||||
<p v-if="error" class="error">{{ error }}</p>
|
||||
<p v-else-if="loading">Загрузка…</p>
|
||||
@@ -108,6 +109,11 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
<HostManualAddModal
|
||||
:open="manualAddOpen"
|
||||
@close="manualAddOpen = false"
|
||||
@started="onManualAddStarted"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -133,10 +139,12 @@ import {
|
||||
} from "../utils/hostAgentUpgrade";
|
||||
import {
|
||||
isHostRemoteActionActive,
|
||||
pollHostRemoteAction,
|
||||
runHostRemoteAction,
|
||||
showHostRemoteActionLog,
|
||||
} from "../composables/useHostRemoteAction";
|
||||
import HostAgentVersionUpgrade from "../components/HostAgentVersionUpgrade.vue";
|
||||
import HostManualAddModal from "../components/HostManualAddModal.vue";
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
@@ -200,6 +208,7 @@ const initialSort = loadHostsSortPrefs();
|
||||
const sortBy = ref<SortKey>(initialSort.sortBy);
|
||||
const sortDir = ref<"asc" | "desc">(initialSort.sortDir);
|
||||
const deletingId = ref<number | null>(null);
|
||||
const manualAddOpen = ref(false);
|
||||
let patchingHostRow = false;
|
||||
let unsubscribeHostPatch: (() => void) | null = null;
|
||||
|
||||
@@ -404,6 +413,11 @@ interface HostDeleteResponse {
|
||||
deleted_problems: number;
|
||||
}
|
||||
|
||||
async function onManualAddStarted(payload: { hostId: number; title: string }) {
|
||||
await loadHosts();
|
||||
void pollHostRemoteAction(payload.hostId, payload.title);
|
||||
}
|
||||
|
||||
async function confirmDelete(h: HostSummary) {
|
||||
const label = h.display_name || h.hostname;
|
||||
const n = h.event_count ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user