Compare commits

...

8 Commits

Author SHA1 Message Date
chenjinsong
823c761adf fix: 修复npm折线图堆叠bug 2023-03-14 17:58:27 +08:00
chenjinsong
9e2f1a02d6 fix: 将entity-detail默认时间查询范围改为1小时 2023-03-11 20:40:35 +08:00
chenjinsong
44e7bbf87d fix: 将entity默认时间查询范围改为1小时 2023-03-11 15:10:27 +08:00
chenjinsong
c6e21a0967 fix: 将detection默认时间查询范围改为1小时 2023-03-11 11:15:41 +08:00
lijinyang
cc847102c4 Merge remote-tracking branch 'origin/dev-22.12' into dev-22.12 2023-02-14 16:35:14 +08:00
lijinyang
56f010e991 Update .gitlab-ci.yml 2023-02-14 16:35:05 +08:00
李金洋
4642003193 Update .gitlab-ci.yml file 2023-02-14 08:24:54 +00:00
lijinyang
89dcd7b253 Update .gitlab-ci.yml 2023-02-14 16:14:25 +08:00
8 changed files with 38 additions and 32 deletions

View File

@@ -10,7 +10,7 @@ cache:
- package.json
paths:
- node_modules
- dist/
# - dist/
before_script:
- export CNUI_TAG=$(date +%Y%m%d%H%M%S)
@@ -29,7 +29,7 @@ generate_git-log:
- public/index.html
- public/git-log.html
only:
- dev
- dev-22.12
tags:
- galaxy
@@ -41,29 +41,38 @@ build_project:
- cnpm install --save-dev --unsafe-perm
- echo "npm run build"
- cnpm run build
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
when: on_success
paths:
- dist/
only:
- dev
- dev-22.12
- tags
tags:
- galaxy
build_image:
dependencies:
- build_project
stage: build_image
script:
- echo "docker build"
- sudo docker build --no-cache -t cn-ui:$CNUI_TAG .
- sudo docker build --no-cache -t cn-ui-$CI_COMMIT_REF_NAME:$CNUI_TAG .
- echo "docker tag"
- sudo docker tag cn-ui:$CNUI_TAG 192.168.40.153:9080/cyber-narrator/cn-ui:$CNUI_TAG
- sudo docker tag cn-ui-$CI_COMMIT_REF_NAME:$CNUI_TAG 192.168.40.153:9080/cyber-narrator/cn-ui-$CI_COMMIT_REF_NAME:$CNUI_TAG
- echo "docker push"
- sudo docker push 192.168.40.153:9080/cyber-narrator/cn-ui:$CNUI_TAG
- sudo docker push 192.168.40.153:9080/cyber-narrator/cn-ui-$CI_COMMIT_REF_NAME:$CNUI_TAG
when: on_success
only:
- dev
- dev-22.12
tags:
- galaxy
build_release_image:
dependencies:
- build_project
stage: build_image
script:
- echo 'tag名称是'
@@ -71,11 +80,11 @@ build_release_image:
- echo '提交的版本是'
- echo $CI_COMMIT_REF_NAME
- echo "docker build"
- sudo docker build --no-cache -t cn-ui:$CI_COMMIT_TAG .
- sudo docker build --no-cache -t cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG .
- echo "docker tag"
- sudo docker tag cn-ui:$CI_COMMIT_TAG 192.168.40.153:9080/cyber-narrator/cn-ui:$CI_COMMIT_TAG
- sudo docker tag cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG 192.168.40.153:9080/cyber-narrator/cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG
- echo "docker push"
- sudo docker push 192.168.40.153:9080/cyber-narrator/cn-ui:$CI_COMMIT_TAG
- sudo docker push 192.168.40.153:9080/cyber-narrator/cn-ui-$CI_COMMIT_REF_NAME:$CI_COMMIT_TAG
only:
- tags
tags:

View File

@@ -247,9 +247,8 @@ import {
chartActiveIpTableOrderOptions,
chartPieTableTopOptions,
eventSeverity,
chartTableColumnMapping, panelTypeAndRouteMapping
chartTableColumnMapping
} from '@/utils/constants'
import { useRouter } from 'vue-router'
export default {
name: 'ChartHeader',
@@ -370,17 +369,12 @@ export default {
}
},
setup (props) {
const { currentRoute } = useRouter()
function isEntityDetail (r) {
return r.indexOf('entityDetail') > -1
}
const dateRangeValue = isEntityDetail(currentRoute.value.path) ? 60 * 24 : 60
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
// entity详情内的chart时间工具不是公共的需要单独定义
const chartTimeFilter = ref({ startTime, endTime, dateRangeValue })
// 复制一份prop中需要被组件v-model的内容避免报错
const copyOrderPieTable = props.orderPieTable
const copyOrderPieTable = ref(props.orderPieTable)
return {
chartTimeFilter,
chartTableTopOptions,

View File

@@ -107,11 +107,8 @@ export default {
const { params } = useRoute()
panelType = props.entity ? props.entity.type : panelTypeAndRouteMapping[params.typeName]
function isEntityDetail (t) {
return [4, 5, 6].indexOf(t) > -1
}
// date
const dateRangeValue = isEntityDetail(panelType) ? 60 * 24 : 60
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
const timeFilter = ref({ startTime, endTime, dateRangeValue })

View File

@@ -238,20 +238,16 @@ export default {
} else {
panelType = props.entity ? props.entity.type : panelTypeAndRouteMapping[params.typeName]
}
function isEntityDetail (t) {
return [4, 5, 6].indexOf(t) > -1
}
// 获取url携带的range、startTime、endTime
const rangeParam = query.range
const startTimeParam = query.startTime
const endTimeParam = query.endTime
// 若url携带了使用携带的值否则使用默认值。
const dateRangeValue = rangeParam ? parseInt(query.range) : (isEntityDetail(panelType) ? 60 * 24 : 60)
const dateRangeValue = rangeParam ? parseInt(query.range) : 60
const timeFilter = ref({ dateRangeValue })
if (!startTimeParam || !endTimeParam) {
const { startTime, endTime } = getNowTime(isEntityDetail(panelType) ? 60 * 24 : 60)
const { startTime, endTime } = getNowTime(60)
timeFilter.value.startTime = startTime
timeFilter.value.endTime = endTime
} else {

View File

@@ -533,7 +533,7 @@ export default {
color: chartColor3[t.positioning],
width: 1
},
stack: t.name !== 'network.total' ? 'network.total' : '',
stack: t.name !== this.$t('network.total') ? this.$t('network.total') : '',
areaStyle: {
opacity: 0.1,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [

View File

@@ -842,7 +842,7 @@ export default {
setup () {
const { params } = useRoute()
const pageType = params.typeName
const dateRangeValue = 60 * 24
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
const timeFilter = ref({ startTime, endTime, dateRangeValue })

View File

@@ -129,6 +129,16 @@ export default {
beforeUnmount () {
window.removeEventListener('resize', this.debounceFunc)
},
watch: {
top (n) {
const findIndex = this.anchorPoints.findLastIndex(a => a.top < n + 100)
if (findIndex > -1) {
this.anchorPoints.forEach((a, i) => {
a.isActive = i === findIndex
})
}
}
},
computed: {
iconClass () {
let className

View File

@@ -717,7 +717,7 @@ export default {
}
},
setup () {
const dateRangeValue = 60 * 24
const dateRangeValue = 60
const { startTime, endTime } = getNowTime(dateRangeValue)
const timeFilter = ref({ startTime, endTime, dateRangeValue })
return {