Compare commits

..

8 Commits
v2.27 ... v2.26

Author SHA1 Message Date
“huailei000”
02d1ab25a0 fix: jQuery undefined 2022-10-13 17:41:29 +08:00
“huailei000”
5408057c05 perf: update jquery 2022-10-13 11:20:02 +08:00
feng626
bb640f63a3 Merge pull request #2096 from jumpserver/pr@v2.26@task_log
fix: 修复任务列表无法查看日志信息bug
2022-10-13 10:55:09 +08:00
feng626
7f0df48bb0 fix: 修复任务列表无法查看日志信息bug 2022-10-13 10:52:48 +08:00
“huailei000”
0225ea95fb pref: 作业中心任务详情添加查看输出快捷键 2022-10-12 19:13:28 +08:00
“huailei000”
c599a6aa21 fix: 修复全局组织下更新、删除:用户、端点、端点规则、组织权限 2022-09-26 14:51:57 +08:00
“huailei000”
7f34195ae4 fix: 实例同步列表不显示多选框;设置云同步详情页面的菜单高亮显示;云同步进入详情不主动激活detail页卡 2022-09-26 14:50:47 +08:00
“huailei000”
b23950aefd fix: 修复账号信息内容更新不及时问题 2022-09-26 14:49:34 +08:00
23 changed files with 58 additions and 111 deletions

View File

@@ -1,23 +1,23 @@
FROM node:14.16 as stage-build
ARG TARGETARCH
ARG VERSION
ENV VERSION=$VERSION
FROM node:10 as stage-build
ARG NPM_REGISTRY="https://registry.npmmirror.com"
ENV NPM_REGISTY=$NPM_REGISTRY
ARG SASS_BINARY_SITE="https://npmmirror.com/mirrors/node-sass"
ENV SASS_BINARY_SITE=$SASS_BINARY_SITE
WORKDIR /data
RUN set -ex \
&& npm config set registry ${NPM_REGISTRY} \
&& yarn config set registry ${NPM_REGISTRY} \
&& yarn config set cache-folder /root/.cache/yarn/lina
RUN npm config set sass_binary_site=${SASS_BINARY_SITE}
RUN npm config set registry ${NPM_REGISTRY}
RUN yarn config set registry ${NPM_REGISTRY}
COPY package.json yarn.lock /data/
RUN yarn install
RUN npm rebuild node-sass
ARG VERSION
ENV VERSION=$VERSION
ADD . /data
RUN --mount=type=cache,target=/root/.cache/yarn \
sed -i "s@Version <strong>.*</strong>@Version <strong>${VERSION}</strong>@g" src/layout/components/Footer/index.vue \
&& yarn install \
&& yarn build
RUN cd utils && bash -xieu build.sh build
FROM nginx:alpine
COPY --from=stage-build /data/lina /opt/lina
COPY --from=stage-build /data/release/lina /opt/lina
COPY nginx.conf /etc/nginx/conf.d/default.conf

View File

@@ -7,7 +7,6 @@
"scripts": {
"dev": "vue-cli-service serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",

View File

@@ -326,9 +326,9 @@ export default {
const url = `${curUrl}${cloneFrom}/${query ? ('?' + query) : ''}`
object = await this.getObjectDetail(url)
if (object['name']) {
object.name = this.$t('common.cloneFrom') + object.name
object.name = this.$t('common.cloneFrom') + ' ' + object.name
} else if (object['hostname']) {
object.hostname = this.$t('common.cloneFrom') + object.hostname
object.hostname = this.$t('common.cloneFrom') + ' ' + object.hostname
}
} else {
object = await this.getObjectDetail(this.iUrl)

View File

@@ -177,7 +177,7 @@ export default {
}
&>>> .el-input__icon {
color: #606266!important;
color: #606266;
}
}

View File

@@ -12,7 +12,7 @@ export default {
<style scoped>
.wrapper-content {
padding: 20px 25px 10px;
padding: 20px 25px 40px;
}
.wrapper-content >>> .el-alert {

View File

@@ -43,10 +43,6 @@ export default {
</script>
<style scoped>
.page {
height: calc(100vh - 55px - 41px);
overflow: auto;
}
@media print {
.disabled-when-print{
display: none;

View File

@@ -46,6 +46,7 @@ Vue.use(require('vue-moment'), {
moment
})
// logger
import VueLogger from 'vuejs-logger'
import loggerOptions from './utils/logger'
Vue.use(VueLogger, loggerOptions)
@@ -54,14 +55,14 @@ import ECharts from 'vue-echarts'
Vue.component('echarts', ECharts)
import service from '@/utils/request'
Vue.prototype.$axios = service
// lodash
// import _ from 'lodash'
window._ = require('lodash')
// Vue.set(Vue.prototype, '_', _)
import { Message } from '@/utils/Message'
Vue.prototype.$message = Message
// if the table component cannot access `this.$axios`, it cannot send request
Vue.prototype.$axios = service
// 注册全局事件总线
Vue.prototype.$eventBus = new Vue()
new Vue({

View File

@@ -182,9 +182,6 @@ input[type=file] {
.el-col.el-col-sm-24 .ibox {
margin-bottom: 10px;
&:last-child {
margin-bottom: 0;
}
}
.el-pagination {

View File

@@ -1,20 +0,0 @@
// 重置message防止重复点击重复弹出message弹框
import { Message as elMessage } from 'element-ui'
let messageDom = null
const Message = (options) => {
// 判断弹窗是否已存在, 若存在则关闭
if (messageDom) messageDom.close()
messageDom = elMessage(options)
}
const typeArray = ['success', 'error', 'warning', 'info']
typeArray.forEach(type => {
Message[type] = options => {
if (typeof options === 'string') options = { message: options }
options.type = type
return Message(options)
}
})
export { Message }

View File

@@ -3,8 +3,7 @@ import i18n from '@/i18n/i18n'
import { getTokenFromCookie } from '@/utils/auth'
import { getErrorResponseMsg } from '@/utils/common'
import { refreshSessionIdAge } from '@/api/users'
import { MessageBox } from 'element-ui'
import { Message } from '@/utils/Message'
import { Message, MessageBox } from 'element-ui'
import store from '@/store'
import axiosRetry from 'axios-retry'
import router from '@/router'

View File

@@ -3,7 +3,7 @@ import store from '@/store'
import router, { resetRouter } from '@/router'
import Vue from 'vue'
import VueCookie from 'vue-cookie'
import { Message } from '@/utils/Message'
import { Message } from 'element-ui'
import orgUtil from '@/utils/org'
import orgs from '@/api/orgs'
import { getPropView, isViewHasOrgs } from '@/utils/jms'

View File

@@ -1,9 +1,11 @@
import { MONGODB, REDIS } from '../const'
import { ORACLE, MONGODB, REDIS } from '../const'
export function getDatabaseTypeFieldsMap(type) {
const baseParams = ['host', 'port', 'database']
const tlsParams = ['use_ssl', 'ca_cert']
switch (type) {
case ORACLE:
return baseParams.concat(['version'])
case REDIS:
return baseParams.concat(tlsParams.concat(['client_cert', 'cert_key']))
case MONGODB:

View File

@@ -15,7 +15,7 @@ export default {
},
fields: [
[this.$t('common.Basic'), ['name']],
[this.$t('common.Correlation'), ['users', 'user_groups', 'nodes', 'assets', 'applications', 'system_users']],
[this.$t('common.Correlation'), ['users', 'user_groups', 'assets', 'applications', 'system_users']],
[this.$t('common.Other'), ['is_active', 'comment']]
],
fieldsMeta: {
@@ -36,17 +36,6 @@ export default {
url: '/api/v1/users/groups/'
}
},
nodes: {
el: {
value: [],
ajax: {
url: '/api/v1/assets/nodes/',
transformOption: (item) => {
return { label: item.full_value, value: item.id }
}
}
}
},
assets: {
type: 'assetSelect',
component: AssetSelect,

View File

@@ -37,7 +37,8 @@ import DetailCard from '@/components/DetailCard'
import QuickActions from '@/components/QuickActions'
import UserConfirmDialog from '@/components/UserConfirmDialog'
import { toSafeLocalDateStr } from '@/utils/common'
import store from '@/store'
import { getProfile } from '@/api/users'
import { mapState } from 'vuex'
export default {
name: 'ProfileInfo',
@@ -47,14 +48,9 @@ export default {
QuickActions,
UserConfirmDialog
},
props: {
object: {
type: Object,
default: () => store.state.users.profile
}
},
data() {
return {
object: this.userProfile || {},
url: `/api/v1/users/profile/`,
showPasswordDialog: false,
currentEdit: '',
@@ -217,6 +213,9 @@ export default {
}
},
computed: {
...mapState({
userProfile: state => state.users.profile
}),
detailCardItems() {
return [
{
@@ -299,6 +298,12 @@ export default {
return url
}
},
created() {
getProfile().then(res => {
this.object = res
this.$store.commit('users/SET_PROFILE', res)
})
},
methods: {
updateUserReceiveBackends(val) {
this.$axios.patch(
@@ -306,7 +311,6 @@ export default {
{ 'receive_backends': this.getReceiveBackendList() }
).then(res => {
this.$message.success(this.$t('common.updateSuccessMsg'))
this.$store.dispatch('users/getProfile', true)
}).catch(err => {
this.$message.error(this.$t('common.updateErrorMsg' + ' ' + err))
})

View File

@@ -12,7 +12,7 @@
v-on="$listeners"
@confirm="onConfirm()"
>
<GenericCreateUpdateForm ref="form" v-bind="iConfig" @submitSuccess="submitSuccess" />
<GenericCreateUpdateForm v-bind="iConfig" @submitSuccess="submitSuccess" />
</Dialog>
</div>
</template>
@@ -52,16 +52,6 @@ export default {
submitSuccess(res) {
this.$emit('input', !!res[this.enableField])
this.visible = false
},
testPerformError(error) {
const data = error.response.data
for (const key of Object.keys(data)) {
let value = data[key]
if (value instanceof Array) {
value = value.join(';')
}
this.$refs.form.$refs.form.setFieldError(key, value)
}
}
}
}

View File

@@ -1,5 +1,5 @@
<template>
<BaseSMS ref="baseSms" :title="$t('setting.CMPP2')" :config="$data" />
<BaseSMS :title="$t('setting.CMPP2')" :config="$data" />
</template>
<script>
@@ -28,9 +28,8 @@ export default {
value
).then(res => {
vm.$message.success(res['msg'])
}).catch((error) => {
}).catch(() => {
vm.$log.error('err occur')
vm.$refs.baseSms.testPerformError(error)
}).finally(() => { btn.loading = false })
}
}

View File

@@ -1,5 +1,5 @@
<template>
<BaseSMS ref="baseSms" :title="$t('setting.AlibabaCloud')" :config="$data" />
<BaseSMS :title="$t('setting.AlibabaCloud')" :config="$data" />
</template>
<script>
@@ -28,9 +28,8 @@ export default {
value
).then(res => {
vm.$message.success(res['msg'])
}).catch((error) => {
}).catch(() => {
vm.$log.error('err occur')
vm.$refs.baseSms.testPerformError(error)
}).finally(() => { btn.loading = false })
}
}

View File

@@ -1,5 +1,5 @@
<template>
<BaseSMS ref="baseSms" :title="$t('setting.HuaweiCloud')" :config="$data" />
<BaseSMS :title="$t('setting.HuaweiCloud')" :config="$data" />
</template>
<script>
@@ -28,9 +28,8 @@ export default {
value
).then(res => {
vm.$message.success(res['msg'])
}).catch((error) => {
}).catch(() => {
vm.$log.error('err occur')
vm.$refs.baseSms.testPerformError(error)
}).finally(() => { btn.loading = false })
}
}

View File

@@ -1,5 +1,5 @@
<template>
<BaseSMS ref="baseSms" :title="$t('setting.TencentCloud')" :config="$data" />
<BaseSMS :title="$t('setting.TencentCloud')" :config="$data" />
</template>
<script>
@@ -28,9 +28,8 @@ export default {
value
).then(res => {
vm.$message.success(res['msg'])
}).catch((error) => {
}).catch(() => {
vm.$log.error('err occur')
vm.$refs.baseSms.testPerformError(error)
}).finally(() => { btn.loading = false })
}
}

View File

@@ -23,15 +23,13 @@ export default {
this.$t('applications.port'),
[
'http_port', 'https_port', 'ssh_port', 'rdp_port',
'magnus_listen_port_range'
'mysql_port', 'mariadb_port', 'postgresql_port', 'redis_port',
'oracle_11g_port', 'oracle_12c_port'
]
],
[this.$t('common.Other'), ['comment']]
],
fieldsMeta: {
magnus_listen_port_range: {
disabled: true
}
},
hasDetailInMsg: false
}

View File

@@ -20,15 +20,17 @@ export default {
url: '/api/v1/terminal/endpoints/',
columns: [
'name', 'host',
'http_port', 'https_port', 'ssh_port', 'rdp_port',
'magnus_listen_port_range',
'http_port', 'https_port', 'ssh_port',
'rdp_port', 'mysql_port', 'mariadb_port',
'postgresql_port', 'redis_port',
'oracle_11g_port', 'oracle_12c_port',
'date_created', 'comment', 'actions'
],
columnsShow: {
min: ['name', 'actions'],
default: [
'name', 'host', 'actions',
'http_port', 'https_port', 'ssh_port', 'rdp_port', 'magnus_listen_port_range'
'http_port', 'https_port', 'ssh_port', 'rdp_port'
]
},
columnsMeta: {

View File

@@ -27,8 +27,7 @@ export default {
initial: {
type: storageType,
endpoint_suffix: 'core.chinacloudapi.cn',
protocol: 'http',
is_default: true
protocol: 'http'
},
getUrl() {
const params = this.$route.params

View File

@@ -14,9 +14,7 @@ export default {
},
data() {
return {
initial: {
need_update_password: true
},
initial: {},
user: {
'can_public_key_auth': false
},
@@ -171,9 +169,6 @@ export default {
if (value.update_password !== undefined) {
delete value.update_password
}
if (value.source !== 'local') {
delete value.need_update_password
}
return value
}
}