ui: grey out other upgrade arrows while host update runs (0.4.0)
Show inactive grey arrows on other hosts during a single remote agent update; bump SAC to 0.4.0. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"""Единый источник версии SAC (API, health, логи, OpenAPI)."""
|
||||
|
||||
APP_NAME = "Security Alert Center"
|
||||
APP_VERSION = "0.3.9"
|
||||
APP_VERSION = "0.4.0"
|
||||
APP_VERSION_LABEL = f"{APP_NAME} v.{APP_VERSION}"
|
||||
|
||||
@@ -7,8 +7,12 @@
|
||||
v-if="showUpgrade"
|
||||
type="button"
|
||||
class="agent-version-upgrade"
|
||||
:disabled="updating"
|
||||
:title="upgradeTitle"
|
||||
:class="{
|
||||
'agent-version-upgrade--inactive': upgradeBlocked,
|
||||
'agent-version-upgrade--updating': updating,
|
||||
}"
|
||||
:disabled="updating || upgradeBlocked"
|
||||
:title="buttonTitle"
|
||||
@click.stop="emit('upgrade')"
|
||||
>
|
||||
<span class="agent-version-upgrade__arrow" aria-hidden="true">↑</span>
|
||||
@@ -31,6 +35,8 @@ const props = defineProps<{
|
||||
host: HostSummary;
|
||||
git: AgentGitVersions | null | undefined;
|
||||
updating?: boolean;
|
||||
/** Другой хост сейчас обновляется — стрелка видна, но неактивна (серая). */
|
||||
upgradeBlocked?: boolean;
|
||||
outdatedHighlight?: boolean;
|
||||
}>();
|
||||
|
||||
@@ -40,9 +46,7 @@ const emit = defineEmits<{
|
||||
|
||||
const gitTargetVersion = computed(() => gitTargetVersionForHost(props.host, props.git));
|
||||
|
||||
const showUpgrade = computed(
|
||||
() => !props.updating && isGitAgentUpgradeAvailable(props.host, props.git),
|
||||
);
|
||||
const showUpgrade = computed(() => isGitAgentUpgradeAvailable(props.host, props.git));
|
||||
|
||||
const currentTitle = computed(() => {
|
||||
if (!props.host.product_version) return "";
|
||||
@@ -56,6 +60,16 @@ const upgradeTitle = computed(() => {
|
||||
if (!gitTargetVersion.value) return "";
|
||||
return `Обновить агент до ${gitTargetVersion.value}`;
|
||||
});
|
||||
|
||||
const buttonTitle = computed(() => {
|
||||
if (props.updating) {
|
||||
return "Обновление выполняется…";
|
||||
}
|
||||
if (props.upgradeBlocked) {
|
||||
return "Дождитесь завершения обновления на другом хосте";
|
||||
}
|
||||
return upgradeTitle.value;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -80,8 +94,7 @@ const upgradeTitle = computed(() => {
|
||||
}
|
||||
|
||||
.agent-version-upgrade:disabled {
|
||||
cursor: default;
|
||||
opacity: 0.65;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.agent-version-upgrade__arrow {
|
||||
@@ -114,6 +127,18 @@ const upgradeTitle = computed(() => {
|
||||
background: rgba(63, 185, 80, 0.28);
|
||||
}
|
||||
|
||||
.agent-version-upgrade--inactive .agent-version-upgrade__arrow,
|
||||
.agent-version-upgrade--updating .agent-version-upgrade__arrow {
|
||||
background: rgba(139, 148, 158, 0.2);
|
||||
color: #8b949e;
|
||||
}
|
||||
|
||||
.agent-version-upgrade--inactive .agent-version-upgrade__target,
|
||||
.agent-version-upgrade--updating .agent-version-upgrade__target {
|
||||
color: #8b949e;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.agent-version-upgrade__busy {
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/** Fallback до загрузки /health; при релизе держите в sync с backend/app/version.py */
|
||||
export const APP_NAME = "Security Alert Center";
|
||||
export const APP_VERSION = "0.3.8";
|
||||
export const APP_VERSION = "0.4.0";
|
||||
export const APP_VERSION_LABEL = `${APP_NAME} v.${APP_VERSION}`;
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
:host="h"
|
||||
:git="data"
|
||||
:updating="upgradingHostId === h.id"
|
||||
:upgrade-blocked="upgradingHostId != null && upgradingHostId !== h.id"
|
||||
:outdated-highlight="isVersionOutdated(h)"
|
||||
@upgrade="startAgentUpgrade(h)"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user