mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-22 03:11:17 +00:00
Compare commits
2 Commits
v4.10.13
...
pr@dev@rem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9128e20ebb | ||
|
|
d8e111a0e3 |
@@ -9,10 +9,15 @@
|
|||||||
<div v-if="expanded" class="close-sidebar">
|
<div v-if="expanded" class="close-sidebar">
|
||||||
<i class="fa fa-compress" style="font-weight: 200" @click="$emit('compress')" />
|
<i class="fa fa-compress" style="font-weight: 200" @click="$emit('compress')" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="close-sidebar">
|
||||||
|
<i class="fa fa-arrows-alt" style="font-weight: 200" @click="openWebsite()" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { BASE_URL } from '@/utils/common/index'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
active: {
|
active: {
|
||||||
@@ -41,6 +46,36 @@ export default {
|
|||||||
},
|
},
|
||||||
handleExpand() {
|
handleExpand() {
|
||||||
this.$emit('expand-full')
|
this.$emit('expand-full')
|
||||||
|
},
|
||||||
|
async openWebsite() {
|
||||||
|
let url = `${BASE_URL}/?_=${Date.now()}`
|
||||||
|
if (process.env.NODE_ENV !== 'production') {
|
||||||
|
url = url.replace('9528', '5173')
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await this.$axios.get('/api/v1/accounts/accounts/chat/')
|
||||||
|
const data = await this.$axios.post(
|
||||||
|
'/api/v1/authentication/admin-connection-token/?oid=00000000-0000-0000-0000-000000000004',
|
||||||
|
{
|
||||||
|
asset: res?.asset.id,
|
||||||
|
account: res?.id,
|
||||||
|
protocol: 'chat',
|
||||||
|
input_username: res?.username,
|
||||||
|
input_secret: '',
|
||||||
|
connect_method: 'web',
|
||||||
|
connect_options: {
|
||||||
|
charset: 'default',
|
||||||
|
disableautohash: false,
|
||||||
|
reusable: false,
|
||||||
|
token_reusable: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
const token = data?.id
|
||||||
|
const newUrl = new URL(url)
|
||||||
|
newUrl.searchParams.set('token', token)
|
||||||
|
window.open(newUrl.toString(), '_blank')
|
||||||
|
return url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,10 +25,7 @@ export default {
|
|||||||
component: AssetSelect,
|
component: AssetSelect,
|
||||||
el: {
|
el: {
|
||||||
value: [],
|
value: [],
|
||||||
baseUrl: '/api/v1/assets/assets/?gateway_enabled=true',
|
baseUrl: '/api/v1/assets/assets/',
|
||||||
treeUrlQuery: {
|
|
||||||
gateway_enabled: true
|
|
||||||
},
|
|
||||||
canSelect: (row) => {
|
canSelect: (row) => {
|
||||||
return !row.platform?.name.startsWith('Gateway')
|
return !row.platform?.name.startsWith('Gateway')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ export default {
|
|||||||
type: 'select2',
|
type: 'select2',
|
||||||
el: {
|
el: {
|
||||||
value: [],
|
value: [],
|
||||||
url: '/api/v1/assets/assets/?gateway_enabled=true',
|
url: '/api/v1/assets/assets/',
|
||||||
treeUrlQuery: {
|
|
||||||
gateway_enabled: true
|
|
||||||
},
|
|
||||||
canSelect: (row) => {
|
canSelect: (row) => {
|
||||||
return !row.platform?.name.startsWith('Gateway') && this.object.assets.map(item => item.id).indexOf(row.id) === -1
|
return !row.platform?.name.startsWith('Gateway') && this.object.assets.map(item => item.id).indexOf(row.id) === -1
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export default {
|
|||||||
multiple: true,
|
multiple: true,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/assets/assets/?gateway_enabled=true&is_gateway=1'
|
url: '/api/v1/assets/assets/?is_gateway=1'
|
||||||
},
|
},
|
||||||
disabledValues: this.object.gateways.map(item => item.id)
|
disabledValues: this.object.gateways.map(item => item.id)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user