mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-22 03:29:04 +00:00
[Update] 修改core
This commit is contained in:
@@ -12,3 +12,7 @@ VUE_APP_BASE_API = '/rpc'
|
|||||||
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
|
# Detail: https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/babel-preset-app/index.js
|
||||||
|
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
||||||
|
# External auth
|
||||||
|
LOGIN_PATH = '/core/auth/login/'
|
||||||
|
LOGOUT_PATH = '/core/auth/logout/'
|
||||||
|
@@ -1,5 +1,10 @@
|
|||||||
# just a flag
|
# just a flag
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# base api
|
# base api
|
||||||
VUE_APP_BASE_API = '/'
|
VUE_APP_BASE_API = '/'
|
||||||
|
|
||||||
|
# External auth
|
||||||
|
LOGIN_PATH = '/core/auth/login/'
|
||||||
|
LOGOUT_PATH = '/core/auth/logout/
|
||||||
|
|
||||||
|
BIN
src/assets/img/robot.png
Normal file
BIN
src/assets/img/robot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.2 KiB |
@@ -10,9 +10,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<slot>
|
<slot>
|
||||||
<h1 class="no-margins">
|
<h1 class="no-margins">
|
||||||
<a :href="body.link">
|
<router-link :to="body.route">
|
||||||
<span>{{ body.count }}</span>
|
<span>{{ body.count }}</span>
|
||||||
</a>
|
</router-link>
|
||||||
</h1>
|
</h1>
|
||||||
<small>{{ body.comment }}</small>
|
<small>{{ body.comment }}</small>
|
||||||
</slot>
|
</slot>
|
||||||
|
@@ -62,7 +62,7 @@ export default {
|
|||||||
window.location.href = `/`
|
window.location.href = `/`
|
||||||
break
|
break
|
||||||
case 'logout':
|
case 'logout':
|
||||||
window.location.href = `/auth/logout/?next=${this.$route.fullPath}`
|
window.location.href = `/core/auth/logout/?next=${this.$route.fullPath}`
|
||||||
break
|
break
|
||||||
case 'apiKey':
|
case 'apiKey':
|
||||||
this.$refs.api.showApi()
|
this.$refs.api.showApi()
|
||||||
|
@@ -11,7 +11,7 @@ NProgress.configure({
|
|||||||
showSpinner: false
|
showSpinner: false
|
||||||
}) // NProgress Configuration
|
}) // NProgress Configuration
|
||||||
|
|
||||||
const whiteList = ['/login', '/auth/login/'] // no redirect whitelist
|
const whiteList = ['/login'] // no redirect whitelist
|
||||||
|
|
||||||
router.beforeEach(async(to, from, next) => {
|
router.beforeEach(async(to, from, next) => {
|
||||||
// start progress bar
|
// start progress bar
|
||||||
@@ -29,7 +29,7 @@ router.beforeEach(async(to, from, next) => {
|
|||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
// other pages that do not have permission to access are redirected to the login page.
|
// other pages that do not have permission to access are redirected to the login page.
|
||||||
next(`/auth/login/`)
|
next(process.env.LOGIN_PATH)
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@@ -237,7 +237,7 @@ export const userRoutes = [
|
|||||||
const createRouter = () => new Router({
|
const createRouter = () => new Router({
|
||||||
// mode: 'history', // require service support
|
// mode: 'history', // require service support
|
||||||
scrollBehavior: () => ({ y: 0 }),
|
scrollBehavior: () => ({ y: 0 }),
|
||||||
mode: 'history',
|
// mode: 'history',
|
||||||
base: '/ui/',
|
base: '/ui/',
|
||||||
routes: constantRoutes
|
routes: constantRoutes
|
||||||
})
|
})
|
||||||
|
@@ -70,7 +70,7 @@ service.interceptors.response.use(
|
|||||||
const response = error.response
|
const response = error.response
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
// 未授权重定向到登录页面
|
// 未授权重定向到登录页面
|
||||||
window.location = '/auth/login/'
|
window.location = process.env.LOGIN_PATH
|
||||||
// const title = ''
|
// const title = ''
|
||||||
// const msg = i18n.t('auth.LoginRequiredMsg')
|
// const msg = i18n.t('auth.LoginRequiredMsg')
|
||||||
// MessageBox.confirm(msg, title, {
|
// MessageBox.confirm(msg, title, {
|
||||||
|
@@ -1,21 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="wscn-http404-container">
|
<div class="error-404-container">
|
||||||
<div class="wscn-http404">
|
<div class="error-404-text">
|
||||||
<div class="pic-404">
|
<h1 class="error-404-title">404 请求错误</h1>
|
||||||
<img class="pic-404__parent" src="@/assets/404_images/404.png" alt="404">
|
<p class="error-404-subtitle">无法访问当前页面</p>
|
||||||
<img class="pic-404__child left" src="@/assets/404_images/404_cloud.png" alt="404">
|
<router-link to="dashboard" class="el-button el-button--success error-button">去往首页</router-link>
|
||||||
<img class="pic-404__child mid" src="@/assets/404_images/404_cloud.png" alt="404">
|
</div>
|
||||||
<img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404">
|
<div class="error-404-image-container">
|
||||||
</div>
|
<img class="error-404-error-image" src="@/assets/img/robot.png" alt="page error">
|
||||||
<div class="bullshit">
|
|
||||||
<div class="bullshit__oops">OOPS!</div>
|
|
||||||
<div class="bullshit__info">All rights reserved
|
|
||||||
<a style="color:#20a0ff" href="https://wallstreetcn.com" target="_blank">wallstreetcn</a>
|
|
||||||
</div>
|
|
||||||
<div class="bullshit__headline">{{ message }}</div>
|
|
||||||
<div class="bullshit__info">Please check that the URL you entered is correct, or click the button below to return to the homepage.</div>
|
|
||||||
<a href="" class="bullshit__return-home">Back to home</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -33,196 +24,51 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.wscn-http404-container{
|
.error-404-container {
|
||||||
transform: translate(-50%,-50%);
|
display: -webkit-box;
|
||||||
position: absolute;
|
display: -ms-flexbox;
|
||||||
top: 40%;
|
display: flex;
|
||||||
left: 50%;
|
-webkit-box-pack: center;
|
||||||
}
|
-ms-flex-pack: center;
|
||||||
.wscn-http404 {
|
justify-content: center;
|
||||||
position: relative;
|
margin-top: 180px;
|
||||||
width: 1200px;
|
|
||||||
padding: 0 50px;
|
|
||||||
overflow: hidden;
|
|
||||||
.pic-404 {
|
|
||||||
position: relative;
|
|
||||||
float: left;
|
|
||||||
width: 600px;
|
|
||||||
overflow: hidden;
|
|
||||||
&__parent {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
&__child {
|
|
||||||
position: absolute;
|
|
||||||
&.left {
|
|
||||||
width: 80px;
|
|
||||||
top: 17px;
|
|
||||||
left: 220px;
|
|
||||||
opacity: 0;
|
|
||||||
animation-name: cloudLeft;
|
|
||||||
animation-duration: 2s;
|
|
||||||
animation-timing-function: linear;
|
|
||||||
animation-fill-mode: forwards;
|
|
||||||
animation-delay: 1s;
|
|
||||||
}
|
|
||||||
&.mid {
|
|
||||||
width: 46px;
|
|
||||||
top: 10px;
|
|
||||||
left: 420px;
|
|
||||||
opacity: 0;
|
|
||||||
animation-name: cloudMid;
|
|
||||||
animation-duration: 2s;
|
|
||||||
animation-timing-function: linear;
|
|
||||||
animation-fill-mode: forwards;
|
|
||||||
animation-delay: 1.2s;
|
|
||||||
}
|
|
||||||
&.right {
|
|
||||||
width: 62px;
|
|
||||||
top: 100px;
|
|
||||||
left: 500px;
|
|
||||||
opacity: 0;
|
|
||||||
animation-name: cloudRight;
|
|
||||||
animation-duration: 2s;
|
|
||||||
animation-timing-function: linear;
|
|
||||||
animation-fill-mode: forwards;
|
|
||||||
animation-delay: 1s;
|
|
||||||
}
|
|
||||||
@keyframes cloudLeft {
|
|
||||||
0% {
|
|
||||||
top: 17px;
|
|
||||||
left: 220px;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
20% {
|
|
||||||
top: 33px;
|
|
||||||
left: 188px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
80% {
|
|
||||||
top: 81px;
|
|
||||||
left: 92px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
top: 97px;
|
|
||||||
left: 60px;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes cloudMid {
|
|
||||||
0% {
|
|
||||||
top: 10px;
|
|
||||||
left: 420px;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
20% {
|
|
||||||
top: 40px;
|
|
||||||
left: 360px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
70% {
|
|
||||||
top: 130px;
|
|
||||||
left: 180px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
top: 160px;
|
|
||||||
left: 120px;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@keyframes cloudRight {
|
|
||||||
0% {
|
|
||||||
top: 100px;
|
|
||||||
left: 500px;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
20% {
|
|
||||||
top: 120px;
|
|
||||||
left: 460px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
80% {
|
|
||||||
top: 180px;
|
|
||||||
left: 340px;
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
top: 200px;
|
|
||||||
left: 300px;
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.bullshit {
|
|
||||||
position: relative;
|
.error-404-text {
|
||||||
float: left;
|
-webkit-box-align: start;
|
||||||
width: 300px;
|
-ms-flex-align: start;
|
||||||
padding: 30px 0;
|
align-items: flex-start;
|
||||||
overflow: hidden;
|
display: -webkit-box;
|
||||||
&__oops {
|
display: -ms-flexbox;
|
||||||
font-size: 32px;
|
display: flex;
|
||||||
font-weight: bold;
|
-webkit-box-orient: vertical;
|
||||||
line-height: 40px;
|
-webkit-box-direction: normal;
|
||||||
color: #1482f0;
|
-ms-flex-direction: column;
|
||||||
opacity: 0;
|
flex-direction: column;
|
||||||
margin-bottom: 20px;
|
-webkit-box-pack: center;
|
||||||
animation-name: slideUp;
|
-ms-flex-pack: center;
|
||||||
animation-duration: 0.5s;
|
justify-content: center;
|
||||||
animation-fill-mode: forwards;
|
min-width: 384px;
|
||||||
}
|
}
|
||||||
&__headline {
|
|
||||||
font-size: 20px;
|
.error-404-title {
|
||||||
line-height: 24px;
|
font-size: 40px;
|
||||||
color: #222;
|
font-weight: 600;
|
||||||
font-weight: bold;
|
font-synthesis: style;
|
||||||
opacity: 0;
|
}
|
||||||
margin-bottom: 10px;
|
|
||||||
animation-name: slideUp;
|
.error-404-subtitle {
|
||||||
animation-duration: 0.5s;
|
font-size: 18px;
|
||||||
animation-delay: 0.1s;
|
margin-top: 10px;
|
||||||
animation-fill-mode: forwards;
|
color: #646464;
|
||||||
}
|
line-height: 1.4;
|
||||||
&__info {
|
}
|
||||||
font-size: 13px;
|
|
||||||
line-height: 21px;
|
.error-button {
|
||||||
color: grey;
|
margin-top: 20px;
|
||||||
opacity: 0;
|
}
|
||||||
margin-bottom: 30px;
|
|
||||||
animation-name: slideUp;
|
a {
|
||||||
animation-duration: 0.5s;
|
color: white !important;
|
||||||
animation-delay: 0.2s;
|
|
||||||
animation-fill-mode: forwards;
|
|
||||||
}
|
|
||||||
&__return-home {
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
width: 110px;
|
|
||||||
height: 36px;
|
|
||||||
background: #1482f0;
|
|
||||||
border-radius: 100px;
|
|
||||||
text-align: center;
|
|
||||||
color: #ffffff;
|
|
||||||
opacity: 0;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 36px;
|
|
||||||
cursor: pointer;
|
|
||||||
animation-name: slideUp;
|
|
||||||
animation-duration: 0.5s;
|
|
||||||
animation-delay: 0.3s;
|
|
||||||
animation-fill-mode: forwards;
|
|
||||||
}
|
|
||||||
@keyframes slideUp {
|
|
||||||
0% {
|
|
||||||
transform: translateY(60px);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
transform: translateY(0);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@@ -32,7 +32,7 @@ export default {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
link: '/users/users',
|
route: `/users/users`,
|
||||||
count: this.counter.total_count_users,
|
count: this.counter.total_count_users,
|
||||||
comment: 'All users'
|
comment: 'All users'
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ export default {
|
|||||||
type: 'info'
|
type: 'info'
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
link: '/users/assets',
|
route: `/assets/assets`,
|
||||||
count: this.counter.total_count_assets,
|
count: this.counter.total_count_assets,
|
||||||
comment: 'All assets'
|
comment: 'All assets'
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ export default {
|
|||||||
type: 'primary'
|
type: 'primary'
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
link: '/terminal/sessions',
|
route: `/terminal/sessions`,
|
||||||
count: this.counter.total_count_online_users,
|
count: this.counter.total_count_online_users,
|
||||||
comment: 'Online users'
|
comment: 'Online users'
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ export default {
|
|||||||
type: 'danger'
|
type: 'danger'
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
link: '/terminal/sessions',
|
route: `/terminal/sessions`,
|
||||||
count: this.counter.total_count_online_sessions,
|
count: this.counter.total_count_online_sessions,
|
||||||
comment: 'Online sessions'
|
comment: 'Online sessions'
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
<ListTable :table-config="tableConfig" :header-actions="headerActions" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script type="text/jsx">
|
||||||
import ListTable from '@/components/ListTable'
|
import ListTable from '@/components/ListTable'
|
||||||
import { timeOffset, toSafeLocalDateStr } from '@/utils/common'
|
import { timeOffset, toSafeLocalDateStr } from '@/utils/common'
|
||||||
import { ActionsFormatter } from '@/components/ListTable/formatters'
|
import { ActionsFormatter } from '@/components/ListTable/formatters'
|
||||||
|
@@ -28,7 +28,8 @@ export default {
|
|||||||
asset: {
|
asset: {
|
||||||
label: this.$t('xpack.Asset'),
|
label: this.$t('xpack.Asset'),
|
||||||
formatter: function(row, column, cellValue, index) {
|
formatter: function(row, column, cellValue, index) {
|
||||||
return <a class='detail el-link el-link--success is-underline' href={ `/assets/assets/${cellValue}` }>{ row.asset_info.hostname }</a>
|
const url = `/assets/assets/${cellValue}`
|
||||||
|
return <router-link to={ url } >{ row.asset_info.hostname }</router-link>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
is_success: {
|
is_success: {
|
||||||
|
@@ -47,7 +47,7 @@ module.exports = {
|
|||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'^/(auth|static)': {
|
'^/core/': {
|
||||||
target: `http://localhost:8080`,
|
target: `http://localhost:8080`,
|
||||||
changeOrigin: true
|
changeOrigin: true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user