Skip to content

Commit

Permalink
Merge pull request #1218 from WeBankPartners/dev
Browse files Browse the repository at this point in the history
release v1.5.7
  • Loading branch information
gavin2lee authored Jan 29, 2021
2 parents 44d9354 + 086e4b7 commit 09db86e
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 27 deletions.
2 changes: 2 additions & 0 deletions cmdb-plugin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from platten/alpine-oracle-jre8-docker
LABEL maintainer = "Webank CTB Team"
ADD target/wecube-plugins-wecmdb-1.5.0.jar /application/wecube-plugins-wecmdb.jar
ADD scripts/start-tomcat-exporter.sh /scripts/start-tomcat-exporter.sh
ADD scripts/start.sh /scripts/start.sh
RUN chmod +x /scripts/start-tomcat-exporter.sh
RUN chmod +x /scripts/start.sh
ADD scripts/tomcat_exporter.tar /scripts/
CMD ["/bin/sh","-c","/scripts/start.sh $DB_HOST $DB_PORT $DB_SCHEMA $DB_USER $DB_PWD"]
6 changes: 6 additions & 0 deletions cmdb-plugin/scripts/start-tomcat-exporter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

sleep 3m
echo "About to start tomcat exporter..."
/bin/sh /scripts/tomcat_exporter/start.sh

8 changes: 5 additions & 3 deletions cmdb-plugin/scripts/start.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ JAVA_OPT="-Xmx3G -Xms512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:MaxTenuring
JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/data/wecmdb/log/wecmdb_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy"
JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m"

/bin/sh /scripts/tomcat_exporter/start.sh
nohup /scripts/start-tomcat-exporter.sh > /tmp/jmx.log 2>&1 &

echo "About to start wecmdb..."

mkdir -p /data/wecmdb/log

java ${JAVA_OPT} -Duser.timezone=Asia/Shanghai \
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.port=18082 \
Expand All @@ -19,7 +23,5 @@ java ${JAVA_OPT} -Duser.timezone=Asia/Shanghai \
-jar /application/wecube-plugins-wecmdb.jar \
--server.address=0.0.0.0 \
--server.port=8081 \
--spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver \
--spring.datasource.url="jdbc:mysql://${db_host}:${db_port}/${db_schema}?characterEncoding=utf8&serverTimezone=Asia/Shanghai" \
--spring.datasource.username=$4 \
--spring.datasource.password=$5 >>/data/wecmdb/log/wecmdb-core.log
6 changes: 3 additions & 3 deletions cmdb-plugin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ spring:
spec: expireAfterWrite=30s
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://db-server:3306/db_schema?characterEncoding=utf8&serverTimezone=UTC
username: db_user
password: db_password
url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_SCHEMA:wecmdb_embedded}?characterEncoding=utf8&serverTimezone=${TZ:Asia/Shanghai}
username: ${DB_USER:wecmdb_embedded}
password: ${DB_PWD:db_password}
hikari:
pool-name: WeCMDB_HikariCP
minimum-idle: 20
Expand Down
6 changes: 5 additions & 1 deletion cmdb-ui/src/locale/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,9 @@
"operating_area": "Operating Area",
"appArchFirstPart": "Whether based on ",
"appArchSecPart": " change",
"selectAll": "Select All"
"selectAll": "Select All",
"table_name_is_require": "Name Is Required",
"ci_type_id_is_require": "CI Type ID Is Required",
"zoom_level_is_require": "Layer Is Required",
"icon_is_require": "Icon Is Required"
}
6 changes: 5 additions & 1 deletion cmdb-ui/src/locale/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,9 @@
"operating_area": "操作区",
"appArchFirstPart": "是否基于",
"appArchSecPart": "版本做架构变更",
"selectAll": "全选"
"selectAll": "全选",
"table_name_is_require": "请输入名称",
"ci_type_id_is_require": "请输入CI类型ID",
"zoom_level_is_require": "请选择图层",
"icon_is_require": "请上传图标"
}
36 changes: 25 additions & 11 deletions cmdb-ui/src/pages/admin/cmdb-model-management.vue
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@
footer-hide
>
<Form
class="validation-form"
ref="addNewCITypeForm"
:rules="ruleValidate"
:model="addNewCITypeForm"
label-position="left"
:label-width="100"
Expand All @@ -244,9 +244,9 @@
</FormItem>
<FormItem :label="$t('zoom_level')" prop="zoomLevelId">
<Select :max-tag-count="3" v-model="addNewCITypeForm.zoomLevelId" filterable>
<Option v-for="item in zoomLevelIdList" :value="item.codeId" :key="item.codeId">
{{ item.value }}
</Option>
<Option v-for="item in zoomLevelIdList" :value="item.codeId" :key="item.codeId">{{
item.value
}}</Option>
</Select>
</FormItem>
<FormItem :label="$t('refrence_layer')">
Expand All @@ -257,7 +257,7 @@
<FormItem class="no-need-validation" :label="$t('description')" prop="description">
<Input v-model="addNewCITypeForm.description"></Input>
</FormItem>
<FormItem :label="$t('icon')">
<FormItem prop="imageFileId" :label="$t('icon')">
<img
v-if="addNewCITypeForm.imageFileId"
:src="`${baseURL}/files/${addNewCITypeForm.imageFileId}.png`"
Expand All @@ -276,6 +276,7 @@
</Button>
<Upload
ref="addUploadButton"
style="height: 1px"
show-upload-list
:action="`${baseURL}/files/upload`"
:headers="headers"
Expand Down Expand Up @@ -889,8 +890,21 @@ export default {
currentSelectLayerChildren: [],
currentSelectedCIChildren: [],
addNewCITypeForm: {
zoomLevelId: 1,
imageFileId: 0
name: '',
tableName: '',
zoomLevelId: null,
layerId: '',
description: '',
imageFileId: undefined
},
ruleValidate: {
name: [{ required: true, trigger: 'blur', message: `${this.$t('table_name_is_require')}` }],
tableName: [{ required: true, trigger: 'blur', message: `${this.$t('ci_type_id_is_require')}` }],
zoomLevelId: [
{ required: true, type: 'number', trigger: 'change', message: `${this.$t('zoom_level_is_require')}` }
],
layerId: [{ required: true, trigger: 'change', message: `${this.$t('refrence_layer')}` }],
imageFileId: [{ required: true, message: `${this.$t('icon_is_require')}` }]
},
addNewAttrForm: {
searchSeqNo: 0,
Expand Down Expand Up @@ -946,9 +960,9 @@ export default {
addCiTypeModalToggle (isShow) {
if (!isShow) {
this.addNewCITypeForm = {
zoomLevelId: 1,
zoomLevelId: null,
layerId: this.addNewCITypeForm.layerId,
imageFileId: 0
imageFileId: undefined
}
}
},
Expand Down Expand Up @@ -1595,10 +1609,10 @@ export default {
this.addNewCITypeForm = {
name: '',
tableName: '',
zoomLevelId: 1,
zoomLevelId: null,
layerId: '',
description: '',
imageFileId: 0
imageFileId: undefined
}
},
async submitCiType (id, form) {
Expand Down
8 changes: 1 addition & 7 deletions cmdb-ui/src/pages/components/ci-password.vue
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,7 @@ export default {

<style lang="scss" scoped>
.ci-password-span {
align-items: center;
display: flex;
height: 100%;
justify-content: center;
min-height: 50px;
padding: 20px;
width: 100%;
word-break: break-all;
}
.ci-password-cell-show {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion cmdb-ui/src/pages/components/cmdb-table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ export default {
></EditModal>
<div id={this.randomId} style="z-index: 100;">
{this.tipContent && (
<div style="word-break: break-word;background-color: rgba(70,76,91,.9);padding: 8px 12px;color: #fff;text-align: left;border-radius: 4px;border-radius: 4px;box-shadow: 0 1px 6px rgba(0,0,0,.2);width: 250px;">
<div style="word-break: break-word;background-color: rgba(70,76,91,.9);padding: 8px 12px;color: #fff;text-align: left;border-radius: 4px;border-radius: 4px;box-shadow: 0 1px 6px rgba(0,0,0,.2);width: 400px;">
<p style="white-space: pre-wrap;">{this.tipContent}</p>
</div>
)}
Expand Down
7 changes: 7 additions & 0 deletions cmdb-ui/src/pages/designing/planning-operation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,13 @@ export default {
}
}
}
const keys = Object.keys(tmpPanalData)
keys.forEach(item => {
if (item.endsWith('_tmp')) {
console.log(item)
delete tmpPanalData[item]
}
})
let params = {
id: this.selectedNodeType,
createData: [tmpPanalData]
Expand Down

0 comments on commit 09db86e

Please sign in to comment.