mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-14 11:55:34 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
02d1ab25a0 | ||
|
|
5408057c05 | ||
|
|
bb640f63a3 | ||
|
|
7f0df48bb0 | ||
|
|
0225ea95fb | ||
|
|
c599a6aa21 | ||
|
|
7f34195ae4 | ||
|
|
b23950aefd |
26
Dockerfile
26
Dockerfile
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -177,7 +177,7 @@ export default {
|
||||
}
|
||||
|
||||
&>>> .el-input__icon {
|
||||
color: #606266!important;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.wrapper-content {
|
||||
padding: 20px 25px 10px;
|
||||
padding: 20px 25px 40px;
|
||||
}
|
||||
|
||||
.wrapper-content >>> .el-alert {
|
||||
|
||||
@@ -43,10 +43,6 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
height: calc(100vh - 55px - 41px);
|
||||
overflow: auto;
|
||||
}
|
||||
@media print {
|
||||
.disabled-when-print{
|
||||
display: none;
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -182,9 +182,6 @@ input[type=file] {
|
||||
|
||||
.el-col.el-col-sm-24 .ibox {
|
||||
margin-bottom: 10px;
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.el-pagination {
|
||||
|
||||
@@ -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 }
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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))
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user