mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-20 10:46:35 +00:00
26
Dockerfile
26
Dockerfile
@@ -1,23 +1,23 @@
|
|||||||
FROM node:10 as stage-build
|
FROM node:14.16 as stage-build
|
||||||
|
ARG TARGETARCH
|
||||||
|
ARG VERSION
|
||||||
|
ENV VERSION=$VERSION
|
||||||
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
||||||
ENV NPM_REGISTY=$NPM_REGISTRY
|
ENV NPM_REGISTY=$NPM_REGISTRY
|
||||||
ARG SASS_BINARY_SITE="https://npmmirror.com/mirrors/node-sass"
|
|
||||||
ENV SASS_BINARY_SITE=$SASS_BINARY_SITE
|
|
||||||
|
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
RUN npm config set sass_binary_site=${SASS_BINARY_SITE}
|
RUN set -ex \
|
||||||
RUN npm config set registry ${NPM_REGISTRY}
|
&& npm config set registry ${NPM_REGISTRY} \
|
||||||
RUN yarn config set registry ${NPM_REGISTRY}
|
&& yarn config set registry ${NPM_REGISTRY} \
|
||||||
COPY package.json yarn.lock /data/
|
&& yarn config set cache-folder /root/.cache/yarn/lina
|
||||||
RUN yarn install
|
|
||||||
RUN npm rebuild node-sass
|
|
||||||
|
|
||||||
ARG VERSION
|
|
||||||
ENV VERSION=$VERSION
|
|
||||||
ADD . /data
|
ADD . /data
|
||||||
RUN cd utils && bash -xieu build.sh build
|
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
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY --from=stage-build /data/release/lina /opt/lina
|
COPY --from=stage-build /data/lina /opt/lina
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vue-cli-service serve",
|
"dev": "vue-cli-service serve",
|
||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build --mode staging",
|
||||||
"build:prod": "vue-cli-service build",
|
"build:prod": "vue-cli-service build",
|
||||||
"build:stage": "vue-cli-service build --mode staging",
|
"build:stage": "vue-cli-service build --mode staging",
|
||||||
"preview": "node build/index.js --preview",
|
"preview": "node build/index.js --preview",
|
||||||
@@ -32,7 +33,7 @@
|
|||||||
"element-ui": "2.13.2",
|
"element-ui": "2.13.2",
|
||||||
"eslint-plugin-html": "^6.0.0",
|
"eslint-plugin-html": "^6.0.0",
|
||||||
"install": "^0.13.0",
|
"install": "^0.13.0",
|
||||||
"jquery": "^3.5.0",
|
"jquery": "^3.6.1",
|
||||||
"js-cookie": "2.2.0",
|
"js-cookie": "2.2.0",
|
||||||
"jsencrypt": "^3.2.1",
|
"jsencrypt": "^3.2.1",
|
||||||
"krry-transfer": "^1.7.3",
|
"krry-transfer": "^1.7.3",
|
||||||
|
11
src/App.vue
11
src/App.vue
@@ -1,12 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<router-view />
|
<router-view v-if="isRouterAlive" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'App'
|
name: 'App',
|
||||||
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
isRouterAlive: state => state.common.isRouterAlive
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@@ -15,6 +15,16 @@ export default [
|
|||||||
permissions: []
|
permissions: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/ops/ansible/task/:id/log/',
|
||||||
|
component: () => import('@/views/ops/CeleryTaskLog'),
|
||||||
|
name: 'AnsibleTaskLog',
|
||||||
|
hidden: true,
|
||||||
|
meta: {
|
||||||
|
title: i18n.t('route.CeleryTaskLog'),
|
||||||
|
permissions: []
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/ops/task/task/:id/log/',
|
path: '/ops/task/task/:id/log/',
|
||||||
component: () => import('@/views/ops/CeleryTaskLog'),
|
component: () => import('@/views/ops/CeleryTaskLog'),
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
import empty from '@/layout/empty'
|
import empty from '@/layout/empty'
|
||||||
import i18n from '@/i18n/i18n'
|
import i18n from '@/i18n/i18n'
|
||||||
|
|
||||||
|
const activateMenu = '/console/assets/assets'
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
path: 'cloud',
|
path: 'cloud',
|
||||||
@@ -20,7 +22,7 @@ export default [
|
|||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
title: i18n.t('xpack.Cloud.CloudSync'),
|
title: i18n.t('xpack.Cloud.CloudSync'),
|
||||||
activeMenu: '/console/assets/assets'
|
activeMenu: activateMenu
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -71,6 +73,7 @@ export default [
|
|||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
title: i18n.t('xpack.Cloud.AccountDetail'),
|
title: i18n.t('xpack.Cloud.AccountDetail'),
|
||||||
|
activeMenu: activateMenu,
|
||||||
permissions: ['xpack.view_account']
|
permissions: ['xpack.view_account']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,7 +124,8 @@ export default [
|
|||||||
name: 'SyncInstanceTaskDetail',
|
name: 'SyncInstanceTaskDetail',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
title: i18n.t('xpack.Cloud.SyncInstanceTaskDetail')
|
title: i18n.t('xpack.Cloud.SyncInstanceTaskDetail'),
|
||||||
|
activeMenu: activateMenu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -2,7 +2,8 @@ import { optionUrlMeta } from '@/api/common'
|
|||||||
|
|
||||||
const getDefaultState = () => {
|
const getDefaultState = () => {
|
||||||
return {
|
return {
|
||||||
metaMap: {}
|
metaMap: {},
|
||||||
|
isRouterAlive: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11,6 +12,12 @@ const state = getDefaultState()
|
|||||||
const mutations = {
|
const mutations = {
|
||||||
SET_URL_META: (state, { url, meta }) => {
|
SET_URL_META: (state, { url, meta }) => {
|
||||||
state.metaMap[url] = meta
|
state.metaMap[url] = meta
|
||||||
|
},
|
||||||
|
reload: (state) => {
|
||||||
|
state.isRouterAlive = false
|
||||||
|
setTimeout(() => {
|
||||||
|
state.isRouterAlive = true
|
||||||
|
}, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -302,3 +302,8 @@ export function groupedDropdownToCascader(group) {
|
|||||||
|
|
||||||
export { BASE_URL }
|
export { BASE_URL }
|
||||||
|
|
||||||
|
export function openWindow(url, name = '', iWidth = 900, iHeight = 600) {
|
||||||
|
var iTop = (window.screen.height - 30 - iHeight) / 2
|
||||||
|
var iLeft = (window.screen.width - 10 - iWidth) / 2
|
||||||
|
window.open(url, name, 'height=' + iHeight + ',width=' + iWidth + ',top=' + iTop + ',left=' + iLeft)
|
||||||
|
}
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
import { constantRoutes } from '@/router'
|
import { constantRoutes } from '@/router'
|
||||||
|
import { openWindow } from './common'
|
||||||
|
|
||||||
export function openTaskPage(taskId) {
|
export function openTaskPage(taskId, taskType) {
|
||||||
window.open(`/#/ops/celery/task/${taskId}/log/`, '', 'width=900,height=600')
|
taskType = taskType || 'celery'
|
||||||
|
openWindow(`/#/ops/${taskType}/task/${taskId}/log/?type=${taskType}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function checkPermission(permsRequired, permsAll) {
|
export function checkPermission(permsRequired, permsAll) {
|
||||||
|
4
src/utils/jquery-vendor.js
vendored
4
src/utils/jquery-vendor.js
vendored
@@ -1,4 +1,2 @@
|
|||||||
import $ from 'jquery'
|
import $ from 'jquery/dist/jquery.min.js'
|
||||||
window.$ = $
|
|
||||||
window.jQuery = $
|
|
||||||
export default $
|
export default $
|
||||||
|
@@ -30,7 +30,7 @@ async function changeOrg(org) {
|
|||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
location.href = path.substring(0, index)
|
location.href = path.substring(0, index)
|
||||||
}
|
}
|
||||||
setTimeout(() => location.reload(), 400)
|
setTimeout(() => store.commit('common/reload'), 400)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ export default {
|
|||||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.$refs.select2.clearSelected()
|
that.$refs.select2.clearSelected()
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
this.$refs.listTable.$refs.ListTable.reloadTable()
|
this.$refs.listTable.$refs.ListTable.reloadTable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -93,7 +93,7 @@ export default {
|
|||||||
onAddSuccess: (items, that) => {
|
onAddSuccess: (items, that) => {
|
||||||
this.$log.debug('AssetSelect value', that.assets)
|
this.$log.debug('AssetSelect value', that.assets)
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodeRelationConfig: {
|
nodeRelationConfig: {
|
||||||
@@ -120,7 +120,7 @@ export default {
|
|||||||
that.iHasObjects = [...that.iHasObjects, ...objects]
|
that.iHasObjects = [...that.iHasObjects, ...objects]
|
||||||
that.$refs.select2.clearSelected()
|
that.$refs.select2.clearSelected()
|
||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
},
|
},
|
||||||
performDelete: (item) => {
|
performDelete: (item) => {
|
||||||
const data = {
|
const data = {
|
||||||
|
@@ -1,11 +1,9 @@
|
|||||||
import { ORACLE, MONGODB, REDIS } from '../const'
|
import { MONGODB, REDIS } from '../const'
|
||||||
|
|
||||||
export function getDatabaseTypeFieldsMap(type) {
|
export function getDatabaseTypeFieldsMap(type) {
|
||||||
const baseParams = ['host', 'port', 'database']
|
const baseParams = ['host', 'port', 'database']
|
||||||
const tlsParams = ['use_ssl', 'ca_cert']
|
const tlsParams = ['use_ssl', 'ca_cert']
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case ORACLE:
|
|
||||||
return baseParams.concat(['version'])
|
|
||||||
case REDIS:
|
case REDIS:
|
||||||
return baseParams.concat(tlsParams.concat(['client_cert', 'cert_key']))
|
return baseParams.concat(tlsParams.concat(['client_cert', 'cert_key']))
|
||||||
case MONGODB:
|
case MONGODB:
|
||||||
|
@@ -38,6 +38,7 @@ export default {
|
|||||||
},
|
},
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: `/api/v1/xpack/cloud/sync-instance-tasks/${this.object.id}/instances/`,
|
url: `/api/v1/xpack/cloud/sync-instance-tasks/${this.object.id}/instances/`,
|
||||||
|
hasSelection: false,
|
||||||
columns: [
|
columns: [
|
||||||
'instance_id',
|
'instance_id',
|
||||||
{
|
{
|
||||||
|
@@ -58,10 +58,7 @@ export default {
|
|||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
permissions: 'xpack.view_syncinstancedetail',
|
permissions: 'xpack.view_syncinstancedetail',
|
||||||
route: 'SyncInstanceTaskDetail',
|
route: 'SyncInstanceTaskDetail'
|
||||||
routeQuery: {
|
|
||||||
activeTab: 'detail'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
history_count: {
|
history_count: {
|
||||||
|
@@ -15,7 +15,7 @@ export default {
|
|||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
[this.$t('common.Basic'), ['name']],
|
[this.$t('common.Basic'), ['name']],
|
||||||
[this.$t('common.Correlation'), ['users', 'user_groups', 'assets', 'applications', 'system_users']],
|
[this.$t('common.Correlation'), ['users', 'user_groups', 'nodes', 'assets', 'applications', 'system_users']],
|
||||||
[this.$t('common.Other'), ['is_active', 'comment']]
|
[this.$t('common.Other'), ['is_active', 'comment']]
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
@@ -36,6 +36,17 @@ export default {
|
|||||||
url: '/api/v1/users/groups/'
|
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: {
|
assets: {
|
||||||
type: 'assetSelect',
|
type: 'assetSelect',
|
||||||
component: AssetSelect,
|
component: AssetSelect,
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
import ListTable from '@/components/ListTable'
|
import ListTable from '@/components/ListTable'
|
||||||
import { ActionsFormatter } from '@/components/TableFormatters'
|
import { ActionsFormatter } from '@/components/TableFormatters'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
|
import { openTaskPage } from '@/utils/jms'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AdhocExecutionHistory',
|
name: 'AdhocExecutionHistory',
|
||||||
@@ -86,6 +87,14 @@ export default {
|
|||||||
callback: function({ row, tableData }) {
|
callback: function({ row, tableData }) {
|
||||||
return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }})
|
return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'log',
|
||||||
|
title: this.$t('ops.output'),
|
||||||
|
type: 'info',
|
||||||
|
callback: function({ row }) {
|
||||||
|
openTaskPage(row.id, 'ansible')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -15,7 +15,6 @@ import DetailCard from '@/components/DetailCard'
|
|||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
import RunInfoCard from '../../RunInfoCard'
|
import RunInfoCard from '../../RunInfoCard'
|
||||||
import { toLastFailureDisplay, toLastSucessDisplay } from '../business'
|
import { toLastFailureDisplay, toLastSucessDisplay } from '../business'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'HistoryExecutionDetail',
|
name: 'HistoryExecutionDetail',
|
||||||
@@ -72,17 +71,6 @@ export default {
|
|||||||
{
|
{
|
||||||
key: this.$t('ops.isSuccess'),
|
key: this.$t('ops.isSuccess'),
|
||||||
value: this.object.is_success
|
value: this.object.is_success
|
||||||
},
|
|
||||||
{
|
|
||||||
key: this.$t('ops.output'),
|
|
||||||
value: this.object.id,
|
|
||||||
formatter: function(row, value) {
|
|
||||||
const onClick = function() {
|
|
||||||
openTaskPage(value, 'ansible')
|
|
||||||
}
|
|
||||||
const title = this.$t('common.View')
|
|
||||||
return <a onClick={onClick} >{ title }</a>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -108,7 +108,7 @@ export default {
|
|||||||
openTaskPage(value, 'ansible')
|
openTaskPage(value, 'ansible')
|
||||||
}
|
}
|
||||||
const title = this.$t('common.View')
|
const title = this.$t('common.View')
|
||||||
return <a onClick={onClick} >{ title }</a>
|
return <a class='text-link' onClick={onClick} >{ title }</a>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@@ -6,6 +6,7 @@
|
|||||||
import ListTable from '@/components/ListTable'
|
import ListTable from '@/components/ListTable'
|
||||||
import { DetailFormatter } from '@/components/TableFormatters'
|
import { DetailFormatter } from '@/components/TableFormatters'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
|
import { openTaskPage } from '@/utils/jms'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TaskHistory',
|
name: 'TaskHistory',
|
||||||
@@ -95,6 +96,14 @@ export default {
|
|||||||
callback: function({ row, tableData }) {
|
callback: function({ row, tableData }) {
|
||||||
return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }})
|
return this.$router.push({ name: 'HistoryExecutionDetail', params: { id: row.id }})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'log',
|
||||||
|
title: this.$t('ops.output'),
|
||||||
|
type: 'info',
|
||||||
|
callback: function({ row }) {
|
||||||
|
openTaskPage(row.id, 'ansible')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -93,7 +93,7 @@ export default {
|
|||||||
this.$message.success(this.$t('common.updateSuccessMsg'))
|
this.$message.success(this.$t('common.updateSuccessMsg'))
|
||||||
this.$refs.ListTable.reloadTable()
|
this.$refs.ListTable.reloadTable()
|
||||||
that.$refs.assetSelect.$refs.select2.clearSelected()
|
that.$refs.assetSelect.$refs.select2.clearSelected()
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
nodeRelationConfig: {
|
nodeRelationConfig: {
|
||||||
|
@@ -37,7 +37,8 @@ import DetailCard from '@/components/DetailCard'
|
|||||||
import QuickActions from '@/components/QuickActions'
|
import QuickActions from '@/components/QuickActions'
|
||||||
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
import UserConfirmDialog from '@/components/UserConfirmDialog'
|
||||||
import { toSafeLocalDateStr } from '@/utils/common'
|
import { toSafeLocalDateStr } from '@/utils/common'
|
||||||
import store from '@/store'
|
import { getProfile } from '@/api/users'
|
||||||
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ProfileInfo',
|
name: 'ProfileInfo',
|
||||||
@@ -47,14 +48,9 @@ export default {
|
|||||||
QuickActions,
|
QuickActions,
|
||||||
UserConfirmDialog
|
UserConfirmDialog
|
||||||
},
|
},
|
||||||
props: {
|
|
||||||
object: {
|
|
||||||
type: Object,
|
|
||||||
default: () => store.state.users.profile
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
object: this.userProfile || {},
|
||||||
url: `/api/v1/users/profile/`,
|
url: `/api/v1/users/profile/`,
|
||||||
showPasswordDialog: false,
|
showPasswordDialog: false,
|
||||||
currentEdit: '',
|
currentEdit: '',
|
||||||
@@ -160,7 +156,7 @@ export default {
|
|||||||
attrs: {
|
attrs: {
|
||||||
disabled: true,
|
disabled: true,
|
||||||
name: 'site_msg',
|
name: 'site_msg',
|
||||||
model: this.object.receive_backends.indexOf('site_msg') !== -1
|
model: this.object?.receive_backends.indexOf('site_msg') !== -1
|
||||||
},
|
},
|
||||||
callbacks: {
|
callbacks: {
|
||||||
change: this.updateUserReceiveBackends
|
change: this.updateUserReceiveBackends
|
||||||
@@ -171,7 +167,7 @@ export default {
|
|||||||
type: 'switcher',
|
type: 'switcher',
|
||||||
attrs: {
|
attrs: {
|
||||||
name: 'email',
|
name: 'email',
|
||||||
model: this.object.receive_backends.indexOf('email') !== -1
|
model: this.object?.receive_backends.indexOf('email') !== -1
|
||||||
},
|
},
|
||||||
callbacks: {
|
callbacks: {
|
||||||
change: this.updateUserReceiveBackends
|
change: this.updateUserReceiveBackends
|
||||||
@@ -182,7 +178,7 @@ export default {
|
|||||||
type: 'switcher',
|
type: 'switcher',
|
||||||
attrs: {
|
attrs: {
|
||||||
name: 'wecom',
|
name: 'wecom',
|
||||||
model: this.object.receive_backends.indexOf('wecom') !== -1
|
model: this.object?.receive_backends.indexOf('wecom') !== -1
|
||||||
},
|
},
|
||||||
has: this.$store.getters.publicSettings.AUTH_WECOM,
|
has: this.$store.getters.publicSettings.AUTH_WECOM,
|
||||||
callbacks: {
|
callbacks: {
|
||||||
@@ -194,7 +190,7 @@ export default {
|
|||||||
type: 'switcher',
|
type: 'switcher',
|
||||||
attrs: {
|
attrs: {
|
||||||
name: 'dingtalk',
|
name: 'dingtalk',
|
||||||
model: this.object.receive_backends.indexOf('dingtalk') !== -1
|
model: this.object?.receive_backends.indexOf('dingtalk') !== -1
|
||||||
},
|
},
|
||||||
has: this.$store.getters.publicSettings.AUTH_DINGTALK,
|
has: this.$store.getters.publicSettings.AUTH_DINGTALK,
|
||||||
callbacks: {
|
callbacks: {
|
||||||
@@ -206,7 +202,7 @@ export default {
|
|||||||
type: 'switcher',
|
type: 'switcher',
|
||||||
attrs: {
|
attrs: {
|
||||||
name: 'feishu',
|
name: 'feishu',
|
||||||
model: this.object.receive_backends.indexOf('feishu') !== -1
|
model: this.object?.receive_backends.indexOf('feishu') !== -1
|
||||||
},
|
},
|
||||||
has: this.$store.getters.publicSettings.AUTH_FEISHU,
|
has: this.$store.getters.publicSettings.AUTH_FEISHU,
|
||||||
callbacks: {
|
callbacks: {
|
||||||
@@ -217,6 +213,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState({
|
||||||
|
userProfile: state => state.users.profile
|
||||||
|
}),
|
||||||
detailCardItems() {
|
detailCardItems() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -299,6 +298,12 @@ export default {
|
|||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
getProfile().then(res => {
|
||||||
|
this.object = res
|
||||||
|
this.$store.commit('users/SET_PROFILE', res)
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateUserReceiveBackends(val) {
|
updateUserReceiveBackends(val) {
|
||||||
this.$axios.patch(
|
this.$axios.patch(
|
||||||
|
@@ -49,7 +49,7 @@ export default {
|
|||||||
const msg = vm.$t('sessions.TerminateTaskSendSuccessMsg')
|
const msg = vm.$t('sessions.TerminateTaskSendSuccessMsg')
|
||||||
vm.$message.success(msg)
|
vm.$message.success(msg)
|
||||||
window.setTimeout(function() {
|
window.setTimeout(function() {
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
}, 50000)
|
}, 50000)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -175,7 +175,7 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
restoreInterface().then(res => {
|
restoreInterface().then(res => {
|
||||||
this.$message.success(res.success)
|
this.$message.success(res.success)
|
||||||
location.reload()
|
this.$store.commit('common/reload')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
@@ -221,7 +221,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateInterface(form).then(res => {
|
updateInterface(form).then(res => {
|
||||||
location.reload()
|
this.$store.commit('common/reload')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -140,6 +140,7 @@ export default {
|
|||||||
window.open(url, '_blank')
|
window.open(url, '_blank')
|
||||||
},
|
},
|
||||||
importLicense() {
|
importLicense() {
|
||||||
|
const vm = this
|
||||||
if (this.licenseFile['file'] === undefined) {
|
if (this.licenseFile['file'] === undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -148,7 +149,7 @@ export default {
|
|||||||
importLicense(formData).then(res => {
|
importLicense(formData).then(res => {
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
this.$message.success(res.msg)
|
this.$message.success(res.msg)
|
||||||
setTimeout(() => location.reload(), 500)
|
setTimeout(() => vm.$store.commit('common/reload'), 500)
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.msg)
|
this.$message.error(res.msg)
|
||||||
}
|
}
|
||||||
|
@@ -60,6 +60,7 @@ export default {
|
|||||||
actions: {
|
actions: {
|
||||||
prop: 'id',
|
prop: 'id',
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
|
canUpdate: this.$hasPerm('orgs.change_organization'),
|
||||||
canDelete: function({ row }) {
|
canDelete: function({ row }) {
|
||||||
return !row.is_default && vm.$hasPerm('orgs.delete_organization')
|
return !row.is_default && vm.$hasPerm('orgs.delete_organization')
|
||||||
},
|
},
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
@confirm="onConfirm()"
|
@confirm="onConfirm()"
|
||||||
>
|
>
|
||||||
<GenericCreateUpdateForm v-bind="iConfig" @submitSuccess="submitSuccess" />
|
<GenericCreateUpdateForm ref="form" v-bind="iConfig" @submitSuccess="submitSuccess" />
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -52,6 +52,16 @@ export default {
|
|||||||
submitSuccess(res) {
|
submitSuccess(res) {
|
||||||
this.$emit('input', !!res[this.enableField])
|
this.$emit('input', !!res[this.enableField])
|
||||||
this.visible = false
|
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>
|
<template>
|
||||||
<BaseSMS :title="$t('setting.CMPP2')" :config="$data" />
|
<BaseSMS ref="baseSms" :title="$t('setting.CMPP2')" :config="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -28,8 +28,9 @@ export default {
|
|||||||
value
|
value
|
||||||
).then(res => {
|
).then(res => {
|
||||||
vm.$message.success(res['msg'])
|
vm.$message.success(res['msg'])
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
vm.$log.error('err occur')
|
vm.$log.error('err occur')
|
||||||
|
vm.$refs.baseSms.testPerformError(error)
|
||||||
}).finally(() => { btn.loading = false })
|
}).finally(() => { btn.loading = false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseSMS :title="$t('setting.AlibabaCloud')" :config="$data" />
|
<BaseSMS ref="baseSms" :title="$t('setting.AlibabaCloud')" :config="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -28,8 +28,9 @@ export default {
|
|||||||
value
|
value
|
||||||
).then(res => {
|
).then(res => {
|
||||||
vm.$message.success(res['msg'])
|
vm.$message.success(res['msg'])
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
vm.$log.error('err occur')
|
vm.$log.error('err occur')
|
||||||
|
vm.$refs.baseSms.testPerformError(error)
|
||||||
}).finally(() => { btn.loading = false })
|
}).finally(() => { btn.loading = false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseSMS :title="$t('setting.HuaweiCloud')" :config="$data" />
|
<BaseSMS ref="baseSms" :title="$t('setting.HuaweiCloud')" :config="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -28,8 +28,9 @@ export default {
|
|||||||
value
|
value
|
||||||
).then(res => {
|
).then(res => {
|
||||||
vm.$message.success(res['msg'])
|
vm.$message.success(res['msg'])
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
vm.$log.error('err occur')
|
vm.$log.error('err occur')
|
||||||
|
vm.$refs.baseSms.testPerformError(error)
|
||||||
}).finally(() => { btn.loading = false })
|
}).finally(() => { btn.loading = false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseSMS :title="$t('setting.TencentCloud')" :config="$data" />
|
<BaseSMS ref="baseSms" :title="$t('setting.TencentCloud')" :config="$data" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -28,8 +28,9 @@ export default {
|
|||||||
value
|
value
|
||||||
).then(res => {
|
).then(res => {
|
||||||
vm.$message.success(res['msg'])
|
vm.$message.success(res['msg'])
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
vm.$log.error('err occur')
|
vm.$log.error('err occur')
|
||||||
|
vm.$refs.baseSms.testPerformError(error)
|
||||||
}).finally(() => { btn.loading = false })
|
}).finally(() => { btn.loading = false })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -23,13 +23,15 @@ export default {
|
|||||||
this.$t('applications.port'),
|
this.$t('applications.port'),
|
||||||
[
|
[
|
||||||
'http_port', 'https_port', 'ssh_port', 'rdp_port',
|
'http_port', 'https_port', 'ssh_port', 'rdp_port',
|
||||||
'mysql_port', 'mariadb_port', 'postgresql_port', 'redis_port',
|
'magnus_listen_port_range'
|
||||||
'oracle_11g_port', 'oracle_12c_port'
|
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[this.$t('common.Other'), ['comment']]
|
[this.$t('common.Other'), ['comment']]
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
|
magnus_listen_port_range: {
|
||||||
|
disabled: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
hasDetailInMsg: false
|
hasDetailInMsg: false
|
||||||
}
|
}
|
||||||
|
@@ -20,17 +20,15 @@ export default {
|
|||||||
url: '/api/v1/terminal/endpoints/',
|
url: '/api/v1/terminal/endpoints/',
|
||||||
columns: [
|
columns: [
|
||||||
'name', 'host',
|
'name', 'host',
|
||||||
'http_port', 'https_port', 'ssh_port',
|
'http_port', 'https_port', 'ssh_port', 'rdp_port',
|
||||||
'rdp_port', 'mysql_port', 'mariadb_port',
|
'magnus_listen_port_range',
|
||||||
'postgresql_port', 'redis_port',
|
|
||||||
'oracle_11g_port', 'oracle_12c_port',
|
|
||||||
'date_created', 'comment', 'actions'
|
'date_created', 'comment', 'actions'
|
||||||
],
|
],
|
||||||
columnsShow: {
|
columnsShow: {
|
||||||
min: ['name', 'actions'],
|
min: ['name', 'actions'],
|
||||||
default: [
|
default: [
|
||||||
'name', 'host', 'actions',
|
'name', 'host', 'actions',
|
||||||
'http_port', 'https_port', 'ssh_port', 'rdp_port'
|
'http_port', 'https_port', 'ssh_port', 'rdp_port', 'magnus_listen_port_range'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
@@ -39,9 +37,10 @@ export default {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
|
canUpdate: this.$hasPerm('terminal.change_endpoint'),
|
||||||
updateRoute: 'EndpointUpdate',
|
updateRoute: 'EndpointUpdate',
|
||||||
cloneRoute: 'EndpointCreate',
|
cloneRoute: 'EndpointCreate',
|
||||||
canDelete: ({ row }) => row.id !== '00000000-0000-0000-0000-000000000001'
|
canDelete: ({ row }) => row.id !== '00000000-0000-0000-0000-000000000001' && this.$hasPerm('terminal.delete_endpoint')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,6 +38,7 @@ export default {
|
|||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
|
canUpdate: this.$hasPerm('terminal.change_endpointrule'),
|
||||||
updateRoute: 'EndpointRuleUpdate',
|
updateRoute: 'EndpointRuleUpdate',
|
||||||
cloneRoute: 'EndpointRuleCreate'
|
cloneRoute: 'EndpointRuleCreate'
|
||||||
}
|
}
|
||||||
|
@@ -236,7 +236,7 @@ export default {
|
|||||||
return toSafeLocalDateStr(dataStr)
|
return toSafeLocalDateStr(dataStr)
|
||||||
},
|
},
|
||||||
reloadPage() {
|
reloadPage() {
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
},
|
},
|
||||||
handleApprove() {
|
handleApprove() {
|
||||||
if (this.object.approval_step === this.object.process_map.length) {
|
if (this.object.approval_step === this.object.process_map.length) {
|
||||||
|
@@ -244,7 +244,7 @@ export default {
|
|||||||
return toSafeLocalDateStr(dataStr)
|
return toSafeLocalDateStr(dataStr)
|
||||||
},
|
},
|
||||||
reloadPage() {
|
reloadPage() {
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
},
|
},
|
||||||
handleApprove() {
|
handleApprove() {
|
||||||
if (this.object.approval_step === this.object.process_map.length) {
|
if (this.object.approval_step === this.object.process_map.length) {
|
||||||
|
@@ -88,7 +88,7 @@ export default {
|
|||||||
return toSafeLocalDateStr(dataStr)
|
return toSafeLocalDateStr(dataStr)
|
||||||
},
|
},
|
||||||
reloadPage() {
|
reloadPage() {
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -199,7 +199,7 @@ export default {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
reloadPage() {
|
reloadPage() {
|
||||||
window.location.reload()
|
this.$store.commit('common/reload')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,7 +14,9 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
initial: {},
|
initial: {
|
||||||
|
need_update_password: true
|
||||||
|
},
|
||||||
user: {
|
user: {
|
||||||
'can_public_key_auth': false
|
'can_public_key_auth': false
|
||||||
},
|
},
|
||||||
|
@@ -115,6 +115,7 @@ export default {
|
|||||||
actions: {
|
actions: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
hasDelete: hasDelete,
|
hasDelete: hasDelete,
|
||||||
|
canUpdate: this.$hasPerm('users.change_user'),
|
||||||
extraActions: [
|
extraActions: [
|
||||||
{
|
{
|
||||||
title: this.$t('users.Remove'),
|
title: this.$t('users.Remove'),
|
||||||
|
@@ -6290,11 +6290,16 @@ jest@^23.6.0:
|
|||||||
import-local "^1.0.0"
|
import-local "^1.0.0"
|
||||||
jest-cli "^23.6.0"
|
jest-cli "^23.6.0"
|
||||||
|
|
||||||
jquery@>=1.4.4, jquery@^3.5.0:
|
jquery@>=1.4.4:
|
||||||
version "3.5.0"
|
version "3.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.0.tgz#9980b97d9e4194611c36530e7dc46a58d7340fc9"
|
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.5.0.tgz#9980b97d9e4194611c36530e7dc46a58d7340fc9"
|
||||||
integrity sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ==
|
integrity sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ==
|
||||||
|
|
||||||
|
jquery@^3.6.1:
|
||||||
|
version "3.6.1"
|
||||||
|
resolved "https://registry.npmmirror.com/jquery/-/jquery-3.6.1.tgz#fab0408f8b45fc19f956205773b62b292c147a16"
|
||||||
|
integrity sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw==
|
||||||
|
|
||||||
js-base64@^2.1.9:
|
js-base64@^2.1.9:
|
||||||
version "2.5.2"
|
version "2.5.2"
|
||||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209"
|
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.5.2.tgz#313b6274dda718f714d00b3330bbae6e38e90209"
|
||||||
|
Reference in New Issue
Block a user