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>
这个提交包含在:
父节点
a8db0519ae
当前提交
ee20767d57
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -66,8 +66,8 @@ pipeline {
|
||||
bat """
|
||||
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 build --platform=linux/amd64 -f ${env.DOCKERFILE} ${env.BUILD_ARGS} --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ${fullImage} -t ${fullImage} .
|
||||
docker push ${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} || exit /b %ERRORLEVEL%
|
||||
docker rmi ${fullImage} || exit 0
|
||||
"""
|
||||
}
|
||||
@ -82,7 +82,7 @@ pipeline {
|
||||
script {
|
||||
def fullImage = "${env.ACR_REGISTRY}/${env.ACR_NAMESPACE}/${env.IMAGE_NAME}:${params.IMAGE_TAG}"
|
||||
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>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onMounted, ref } from 'vue'
|
||||
import { nextTick, onMounted, onUnmounted, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Loading } from '@element-plus/icons-vue'
|
||||
import { accountApi } from '@/api/account'
|
||||
@ -291,6 +291,10 @@ const licenseParseResult = ref<{
|
||||
serverUrl: string
|
||||
} | null>(null)
|
||||
const licenseUploadRef = ref<any>(null)
|
||||
const isMobile = ref(false)
|
||||
function updateViewport() {
|
||||
isMobile.value = window.innerWidth < 768
|
||||
}
|
||||
|
||||
function handleLicenseFileChange(file: any) {
|
||||
const reader = new FileReader()
|
||||
@ -517,6 +521,8 @@ async function pollForRecovery() {
|
||||
const fmt = formatTime
|
||||
|
||||
onMounted(async () => {
|
||||
updateViewport()
|
||||
window.addEventListener('resize', updateViewport)
|
||||
loadData()
|
||||
try {
|
||||
const status = await getDeploymentStatus()
|
||||
@ -525,6 +531,10 @@ onMounted(async () => {
|
||||
deploymentMode.value = 'PUBLIC'
|
||||
}
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('resize', updateViewport)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户