fix(security-center): add missing isMobile ref and fix Jenkins build failure handling

- Add isMobile reactive ref with resize listener in SecurityCenterView
  to fix TypeScript build error TS2339
- Fix Jenkinsfile: use '|| exit /b %ERRORLEVEL%' after docker build/push
  and ssh deploy commands so Windows bat steps actually fail the pipeline
  when a command returns non-zero exit code

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
这个提交包含在:
XuqmGroup 2026-05-22 19:33:38 +08:00
父节点 a8db0519ae
当前提交 ee20767d57
共有 2 个文件被更改,包括 14 次插入4 次删除

6
Jenkinsfile vendored
查看文件

@ -66,8 +66,8 @@ pipeline {
bat """ bat """
docker login ${env.ACR_REGISTRY} -u ${env.ACR_USERNAME} -p %ACR_PASS% docker login ${env.ACR_REGISTRY} -u ${env.ACR_USERNAME} -p %ACR_PASS%
docker pull --platform=linux/amd64 ${fullImage} || echo Pull failed, will build fresh docker pull --platform=linux/amd64 ${fullImage} || echo Pull failed, will build fresh
docker build --platform=linux/amd64 -f ${env.DOCKERFILE} ${env.BUILD_ARGS} --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ${fullImage} -t ${fullImage} . docker build --platform=linux/amd64 -f ${env.DOCKERFILE} ${env.BUILD_ARGS} --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ${fullImage} -t ${fullImage} . || exit /b %ERRORLEVEL%
docker push ${fullImage} docker push ${fullImage} || exit /b %ERRORLEVEL%
docker rmi ${fullImage} || exit 0 docker rmi ${fullImage} || exit 0
""" """
} }
@ -82,7 +82,7 @@ pipeline {
script { script {
def fullImage = "${env.ACR_REGISTRY}/${env.ACR_NAMESPACE}/${env.IMAGE_NAME}:${params.IMAGE_TAG}" def fullImage = "${env.ACR_REGISTRY}/${env.ACR_NAMESPACE}/${env.IMAGE_NAME}:${params.IMAGE_TAG}"
bat """ bat """
ssh -i "%SSH_KEY%" -o StrictHostKeyChecking=no ${env.PROD_USER}@${env.PROD_HOST} "docker rm -f xuqm-${env.DEPLOY_SERVICE} 2>/dev/null || true; docker pull ${fullImage} && docker compose -f ${env.COMPOSE_FILE} up -d --no-deps --force-recreate ${env.DEPLOY_SERVICE} && docker image prune -f" ssh -i "%SSH_KEY%" -o StrictHostKeyChecking=no ${env.PROD_USER}@${env.PROD_HOST} "docker rm -f xuqm-${env.DEPLOY_SERVICE} 2>/dev/null || true; docker pull ${fullImage} || exit 1; docker compose -f ${env.COMPOSE_FILE} up -d --no-deps --force-recreate ${env.DEPLOY_SERVICE} || exit 1; docker image prune -f"
""" """
} }
} }

查看文件

@ -252,7 +252,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { nextTick, onMounted, ref } from 'vue' import { nextTick, onMounted, onUnmounted, ref } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { Loading } from '@element-plus/icons-vue' import { Loading } from '@element-plus/icons-vue'
import { accountApi } from '@/api/account' import { accountApi } from '@/api/account'
@ -291,6 +291,10 @@ const licenseParseResult = ref<{
serverUrl: string serverUrl: string
} | null>(null) } | null>(null)
const licenseUploadRef = ref<any>(null) const licenseUploadRef = ref<any>(null)
const isMobile = ref(false)
function updateViewport() {
isMobile.value = window.innerWidth < 768
}
function handleLicenseFileChange(file: any) { function handleLicenseFileChange(file: any) {
const reader = new FileReader() const reader = new FileReader()
@ -517,6 +521,8 @@ async function pollForRecovery() {
const fmt = formatTime const fmt = formatTime
onMounted(async () => { onMounted(async () => {
updateViewport()
window.addEventListener('resize', updateViewport)
loadData() loadData()
try { try {
const status = await getDeploymentStatus() const status = await getDeploymentStatus()
@ -525,6 +531,10 @@ onMounted(async () => {
deploymentMode.value = 'PUBLIC' deploymentMode.value = 'PUBLIC'
} }
}) })
onUnmounted(() => {
window.removeEventListener('resize', updateViewport)
})
</script> </script>
<style scoped> <style scoped>