fix: WinRM update panel no longer blocks SAC navigation (0.20.21)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""Единый источник версии SAC (API, health, логи, OpenAPI)."""
|
||||
|
||||
APP_NAME = "Security Alert Center"
|
||||
APP_VERSION = "0.20.20"
|
||||
APP_VERSION = "0.20.21"
|
||||
APP_VERSION_LABEL = f"{APP_NAME} v.{APP_VERSION}"
|
||||
|
||||
@@ -4,6 +4,6 @@ from app.version import APP_NAME, APP_VERSION, APP_VERSION_LABEL
|
||||
|
||||
|
||||
def test_version_constants():
|
||||
assert APP_VERSION == "0.20.20"
|
||||
assert APP_VERSION == "0.20.21"
|
||||
assert APP_NAME == "Security Alert Center"
|
||||
assert APP_VERSION_LABEL == "Security Alert Center v.0.20.20"
|
||||
assert APP_VERSION_LABEL == "Security Alert Center v.0.20.21"
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<nav class="sac-sidebar-nav" aria-label="Основная навигация">
|
||||
<button
|
||||
v-if="remoteJobRunning && !remoteJobPanelOpen"
|
||||
type="button"
|
||||
class="sac-nav-item sac-remote-job-badge"
|
||||
title="Обновление агента выполняется на сервере SAC"
|
||||
@click="showHostRemoteActionLog"
|
||||
>
|
||||
<span class="sac-nav-icon sac-remote-job-spinner" aria-hidden="true" />
|
||||
<span class="sac-nav-label">Обновление…</span>
|
||||
</button>
|
||||
<RouterLink
|
||||
v-for="item in navItems"
|
||||
:key="item.to"
|
||||
@@ -35,10 +45,17 @@ import { useRoute, useRouter } from "vue-router";
|
||||
import { clearToken, isAdmin } from "../api";
|
||||
import SidebarSystemStats from "./SidebarSystemStats.vue";
|
||||
import { useSacVersion } from "../composables/useSacVersion";
|
||||
import {
|
||||
hasActiveHostRemoteAction,
|
||||
hostRemoteActionLog,
|
||||
showHostRemoteActionLog,
|
||||
} from "../composables/useHostRemoteAction";
|
||||
|
||||
const { appName, appVersion } = useSacVersion();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const remoteJobRunning = computed(() => hasActiveHostRemoteAction());
|
||||
const remoteJobPanelOpen = computed(() => hostRemoteActionLog.open);
|
||||
|
||||
const navItems = computed(() => {
|
||||
const items = [
|
||||
@@ -161,6 +178,28 @@ function logout() {
|
||||
transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
|
||||
}
|
||||
|
||||
.sac-remote-job-badge {
|
||||
color: #58a6ff;
|
||||
border-left-color: #58a6ff;
|
||||
background: rgba(88, 166, 255, 0.08);
|
||||
}
|
||||
|
||||
.sac-remote-job-spinner {
|
||||
display: inline-block;
|
||||
width: 0.85rem;
|
||||
height: 0.85rem;
|
||||
border: 2px solid #3a4556;
|
||||
border-top-color: #58a6ff;
|
||||
border-radius: 50%;
|
||||
animation: sac-remote-job-spin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes sac-remote-job-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.sac-nav-item:hover {
|
||||
background: #1e2d3d;
|
||||
color: #fff;
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
<template>
|
||||
<div v-if="open" class="modal-backdrop" @click.self="onBackdropClick">
|
||||
<div class="modal-card host-action-log-modal" role="dialog" aria-modal="true">
|
||||
<h3>{{ title }}</h3>
|
||||
<div v-if="open" class="host-action-log-dock" aria-live="polite">
|
||||
<div class="host-action-log-panel" role="dialog" :aria-label="title">
|
||||
<div class="host-action-log-header">
|
||||
<h3>{{ title }}</h3>
|
||||
<button
|
||||
type="button"
|
||||
class="host-action-log-icon-btn"
|
||||
:title="loading ? 'Свернуть — обновление продолжится на сервере' : 'Закрыть'"
|
||||
:aria-label="loading ? 'Свернуть' : 'Закрыть'"
|
||||
@click="emit('close')"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</div>
|
||||
<p v-if="loading" class="host-action-log-status">
|
||||
<span class="host-action-log-spinner" aria-hidden="true" />
|
||||
Выполняется на удалённом хосте… Это может занять несколько минут.
|
||||
Выполняется на удалённом хосте… Можно перейти в другой раздел SAC.
|
||||
</p>
|
||||
<p v-if="message" :class="messageClass">{{ message }}</p>
|
||||
<p v-if="message && !loading" :class="messageClass">{{ message }}</p>
|
||||
<p v-else-if="message && loading" class="muted host-action-log-sub">{{ message }}</p>
|
||||
<pre v-if="output" class="host-action-log-output">{{ output }}</pre>
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="secondary" :disabled="loading" @click="emit('close')">
|
||||
{{ loading ? "Выполняется…" : "Закрыть" }}
|
||||
<div class="host-action-log-actions">
|
||||
<button v-if="loading" type="button" class="secondary" @click="emit('close')">
|
||||
Свернуть
|
||||
</button>
|
||||
<button v-else type="button" class="secondary" @click="emit('close')">
|
||||
Закрыть
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -37,46 +52,79 @@ const messageClass = computed(() => {
|
||||
if (props.loading || props.ok == null) return "muted";
|
||||
return props.ok ? "success" : "error";
|
||||
});
|
||||
|
||||
function onBackdropClick() {
|
||||
if (!props.loading) emit("close");
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.modal-backdrop {
|
||||
.host-action-log-dock {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
right: 1rem;
|
||||
bottom: 1rem;
|
||||
z-index: 1000;
|
||||
padding: 1rem;
|
||||
max-width: min(28rem, calc(100vw - 2rem));
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.modal-card {
|
||||
.host-action-log-panel {
|
||||
pointer-events: auto;
|
||||
background: var(--card-bg, #1e2430);
|
||||
border: 1px solid var(--border, #3a4556);
|
||||
border-radius: 8px;
|
||||
max-width: 820px;
|
||||
width: 100%;
|
||||
max-height: 85vh;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
|
||||
max-height: min(70vh, 28rem);
|
||||
overflow: auto;
|
||||
padding: 1rem 1.25rem;
|
||||
padding: 0.85rem 1rem 1rem;
|
||||
}
|
||||
|
||||
.host-action-log-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.host-action-log-header h3 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.host-action-log-icon-btn {
|
||||
flex-shrink: 0;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
padding: 0;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: #9aa4b2;
|
||||
font-size: 1.25rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.host-action-log-icon-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: #e6edf3;
|
||||
}
|
||||
|
||||
.host-action-log-status {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
gap: 0.65rem;
|
||||
margin: 0.75rem 0;
|
||||
margin: 0.65rem 0 0;
|
||||
color: #9aa4b2;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.host-action-log-sub {
|
||||
margin: 0.35rem 0 0;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.host-action-log-spinner {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
margin-top: 0.15rem;
|
||||
border: 2px solid #3a4556;
|
||||
border-top-color: #58a6ff;
|
||||
border-radius: 50%;
|
||||
@@ -91,18 +139,18 @@ function onBackdropClick() {
|
||||
}
|
||||
|
||||
.host-action-log-output {
|
||||
margin-top: 0.75rem;
|
||||
max-height: 24rem;
|
||||
margin-top: 0.65rem;
|
||||
max-height: 12rem;
|
||||
overflow: auto;
|
||||
padding: 0.75rem;
|
||||
padding: 0.65rem;
|
||||
background: #0d1117;
|
||||
border-radius: 6px;
|
||||
font-size: 0.85rem;
|
||||
font-size: 0.8rem;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.modal-actions {
|
||||
margin-top: 1rem;
|
||||
.host-action-log-actions {
|
||||
margin-top: 0.75rem;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.5rem;
|
||||
|
||||
@@ -38,6 +38,7 @@ function finishModal(job: HostRemoteActionJobStatus) {
|
||||
hostRemoteActionLog.loading = false;
|
||||
hostRemoteActionLog.ok = job.ok ?? job.status === "success";
|
||||
applyJobToModal(job);
|
||||
hostRemoteActionLog.open = true;
|
||||
}
|
||||
|
||||
async function pollRemoteJob(hostId: number): Promise<HostRemoteActionJobStatus> {
|
||||
@@ -115,6 +116,15 @@ export async function runHostRemoteAction(
|
||||
}
|
||||
|
||||
export function closeHostRemoteActionLog() {
|
||||
if (hostRemoteActionLog.loading) return;
|
||||
hostRemoteActionLog.open = false;
|
||||
}
|
||||
|
||||
export function showHostRemoteActionLog() {
|
||||
if (hostRemoteActionLog.loading || hostRemoteActionLog.ok != null) {
|
||||
hostRemoteActionLog.open = true;
|
||||
}
|
||||
}
|
||||
|
||||
export function hasActiveHostRemoteAction(): boolean {
|
||||
return hostRemoteActionLog.loading;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Fallback до загрузки /health; при релизе держите в sync с backend/app/version.py */
|
||||
export const APP_NAME = "Security Alert Center";
|
||||
export const APP_VERSION = "0.20.20";
|
||||
export const APP_VERSION = "0.20.21";
|
||||
export const APP_VERSION_LABEL = `${APP_NAME} v.${APP_VERSION}`;
|
||||
|
||||
Reference in New Issue
Block a user