diff --git a/src/views/connections/ConnectionInfo.vue b/src/views/connections/ConnectionInfo.vue index 7949a634d..d79a3cb7b 100644 --- a/src/views/connections/ConnectionInfo.vue +++ b/src/views/connections/ConnectionInfo.vue @@ -180,7 +180,7 @@ export default class ConnectionInfo extends Vue { private async validateName(rule: FormRule, name: string, callBack: NameCallBack) { for (const oneConnection of this.allConnections) { if (name !== this.oldName && oneConnection.name === name) { - callBack(`${this.$t('connections.duplicateName')}`) + callBack(this.$tc('connections.duplicateName')) } } } diff --git a/web/src/assets/scss/element/element-reset.scss b/web/src/assets/scss/element/element-reset.scss index 92633bb3b..028032605 100644 --- a/web/src/assets/scss/element/element-reset.scss +++ b/web/src/assets/scss/element/element-reset.scss @@ -71,15 +71,24 @@ } /* Button */ +.el-button--mini { + border-radius: 4px; +} .el-button--outline { background: var(--color-bg-normal); - border: 2px solid var(--color-main-green); + border: 1px solid var(--color-main-green); color: var(--color-main-green); } .el-button.is-plain:hover, .el-button.is-plain:focus { background: var(--color-bg-normal); } +.el-input-number--mini { + width: 100%; + .el-input__inner { + text-align: left; + } +} /* Cascader */ .el-cascader { diff --git a/web/src/views/connections/ConnectionInfo.vue b/web/src/views/connections/ConnectionInfo.vue index 5637e342c..5a0656146 100644 --- a/web/src/views/connections/ConnectionInfo.vue +++ b/web/src/views/connections/ConnectionInfo.vue @@ -4,33 +4,56 @@ - + - - + + + - + - + - + - - Clean Session + + + {{ + connection.clean ? 'true' : 'false' + }} + @Prop({ required: true }) public titleName!: string @Getter('allConnections') private allConnections!: ConnectionModel[] | [] @@ -98,6 +121,11 @@ export default class ConnectionInfo extends Vue { this.oldName = titleName } + // Return the status of client connection + get isClientConnected() { + return this.client.connected + } + get rules() { return { name: [ @@ -115,7 +143,7 @@ export default class ConnectionInfo extends Vue { private async validateName(rule: FormRule, name: string, callBack: NameCallBack['callBack']) { for (const oneConnection of this.allConnections) { if (name !== this.oldName && oneConnection.name === name) { - callBack(`${this.$t('connections.duplicateName')}`) + callBack(this.$tc('connections.duplicateName')) } } } @@ -146,6 +174,10 @@ export default class ConnectionInfo extends Vue { } private refreshClientId() { + // when the client connected, we should disable this icon event + if (this.isClientConnected) { + return + } this.connection.clientId = getClientId() } } @@ -168,12 +200,43 @@ export default class ConnectionInfo extends Vue { line-height: 35px; height: 35px; } + // normal icon + .icon-oper { + color: var(--color-text-tips); + line-height: 43px; + transition: 0.2s color ease; + } + // icon active + .icon-oper-active { + color: var(--color-main-green); + } + // icon disable + .icon-oper-disable { + color: var(--color-text-default); + } + // input disable + .is-disabled > input { + background: transparent; + } + } + // adjust the position of the clientID timestamp element + .icon-client-time { + position: absolute; + top: -2.65em; + left: 5em; } + .el-checkbox { - margin-top: 42px; + border: 1px solid var(--color-border-default); + padding: 4px 10px; + height: 28px; + width: 100%; + .el-checkbox__label { + font-size: 12px; + } } .el-button.btn { - margin-top: 13px; + margin-top: 10px; float: right; } .el-button.cancel { @@ -183,6 +246,12 @@ export default class ConnectionInfo extends Vue { color: var(--color-minor-red); border-color: var(--color-minor-red); } + .el-form-item.is-success .el-input__inner, + .el-form-item.is-success .el-input__inner:focus, + .el-form-item.is-success .el-textarea__inner, + .el-form-item.is-success .el-textarea__inner:focus { + border: 1px solid var(--color-border-default); + } } }