mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-13 06:05:12 +00:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66f57af689 | ||
|
|
cdac71876b | ||
|
|
414ff7b8bf | ||
|
|
e50d720e18 | ||
|
|
d1e7822b8f | ||
|
|
f7e6bd0169 | ||
|
|
b3980e56de | ||
|
|
0f8a58209c | ||
|
|
620dcf25a0 | ||
|
|
1bf839ac5a | ||
|
|
65ed7217cd | ||
|
|
a0d3f6096e | ||
|
|
b75f10ec0c | ||
|
|
c45e303127 | ||
|
|
c09d6c96a3 | ||
|
|
da03a92adb | ||
|
|
ef0d0cc260 | ||
|
|
03aa4b60f7 | ||
|
|
668d2e6fc4 | ||
|
|
a0d443b8b0 | ||
|
|
dc2a4d0c54 | ||
|
|
389707a980 | ||
|
|
40922f77b0 | ||
|
|
1702241ccd | ||
|
|
29db60fef5 | ||
|
|
0c897e54a3 |
@@ -1,4 +1,4 @@
|
|||||||
FROM node:16.20-bullseye-slim as stage-build
|
FROM node:16.20-bullseye-slim AS stage-build
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
ARG DEPENDENCIES=" \
|
ARG DEPENDENCIES=" \
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"css-color-function": "^1.3.3",
|
"css-color-function": "^1.3.3",
|
||||||
"decimal.js": "^10.4.3",
|
"decimal.js": "^10.4.3",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
|
"dompurify": "^3.1.6",
|
||||||
"echarts": "4.7.0",
|
"echarts": "4.7.0",
|
||||||
"element-ui": "2.15.14",
|
"element-ui": "2.15.14",
|
||||||
"eslint-plugin-html": "^6.0.0",
|
"eslint-plugin-html": "^6.0.0",
|
||||||
|
|||||||
@@ -157,30 +157,37 @@ export default {
|
|||||||
$('#m_show_asset_only_current_node').css('color', '#606266')
|
$('#m_show_asset_only_current_node').css('color', '#606266')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getAssetsUrl(treeNode) {
|
getAssetsUrl(treeNode) {
|
||||||
let url = this.treeSetting?.url || this.url
|
let url = this.treeSetting?.url || this.url
|
||||||
|
|
||||||
|
const setParam = (param, value, delay) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
url = setUrlParam(url, param, value)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (treeNode.meta.type === 'node') {
|
if (treeNode.meta.type === 'node') {
|
||||||
const nodeId = treeNode.meta.data.id
|
const nodeId = treeNode.meta.data.id
|
||||||
url = setUrlParam(url, 'node_id', nodeId)
|
setParam('node_id', nodeId)
|
||||||
url = setUrlParam(url, 'asset_id', '')
|
setParam('asset_id', '')
|
||||||
} else if (treeNode.meta.type === 'asset') {
|
} else if (treeNode.meta.type === 'asset') {
|
||||||
const assetId = treeNode.meta.data?.id || treeNode.id
|
const assetId = treeNode.meta.data?.id || treeNode.id
|
||||||
url = setUrlParam(url, 'node_id', '')
|
setParam('node_id', '')
|
||||||
url = setUrlParam(url, 'asset_id', assetId)
|
setParam('asset_id', assetId)
|
||||||
} else if (treeNode.meta.type === 'category') {
|
} else if (treeNode.meta.type === 'category') {
|
||||||
url = setUrlParam(url, 'category', treeNode.meta.category)
|
url = setUrlParam(url, 'category', treeNode.meta.category)
|
||||||
} else if (treeNode.meta.type === 'type') {
|
} else if (treeNode.meta.type === 'type') {
|
||||||
url = setUrlParam(url, 'category', treeNode.meta.category)
|
setParam('category', treeNode.meta.category)
|
||||||
url = setUrlParam(url, 'type', treeNode.meta._type)
|
setParam('type', treeNode.meta._type)
|
||||||
} else if (treeNode.meta.type === 'platform') {
|
} else if (treeNode.meta.type === 'platform') {
|
||||||
url = setUrlParam(url, 'platform', treeNode.id)
|
url = setUrlParam(url, 'platform', treeNode.id)
|
||||||
}
|
}
|
||||||
const query = this.setTreeUrlQuery()
|
|
||||||
url = query ? `${url}&${query}` : url
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
const query = this.setTreeUrlQuery()
|
||||||
|
url = query ? `${url}&${query}` : url
|
||||||
this.$set(this.tableConfig, 'url', url)
|
this.$set(this.tableConfig, 'url', url)
|
||||||
}, 300)
|
})
|
||||||
|
|
||||||
if (this.treeSetting.selectSyncToRoute !== false) {
|
if (this.treeSetting.selectSyncToRoute !== false) {
|
||||||
setRouterQuery(this, url)
|
setRouterQuery(this, url)
|
||||||
|
|||||||
@@ -134,7 +134,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<codemirror ref="myCm" v-model="iValue" :options="iOptions" class="editor" />
|
<codemirror
|
||||||
|
ref="myCm"
|
||||||
|
v-model="iValue"
|
||||||
|
:options="iOptions"
|
||||||
|
class="editor"
|
||||||
|
:style="iActions.length > 0 ? { marginLeft: '30px' } : {}"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -208,7 +214,7 @@ export default {
|
|||||||
|
|
||||||
Object.values(actionsObj).forEach(action => {
|
Object.values(actionsObj).forEach(action => {
|
||||||
if (action.name === this.$t('RunAs') && action.type === 'input') {
|
if (action.name === this.$t('RunAs') && action.type === 'input') {
|
||||||
rules[action.name] = [{ required: true, message: '请输入运行用户', trigger: 'blur' }]
|
rules[action.name] = [{ required: true, message: this.$t('RequiredRunas'), trigger: 'blur' }]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -373,7 +379,7 @@ $input-border-color: #C0C4CC;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.editor {
|
.editor {
|
||||||
margin-left: 30px;
|
//margin-left: 30px;
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--color-border);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
import Dialog from '@/components/Dialog/index.vue'
|
import Dialog from '@/components/Dialog/index.vue'
|
||||||
import { createSourceIdCache } from '@/api/common'
|
import { createSourceIdCache } from '@/api/common'
|
||||||
import * as queryUtil from '@/components/Table/DataTable/compenents/el-data-table/utils/query'
|
import * as queryUtil from '@/components/Table/DataTable/compenents/el-data-table/utils/query'
|
||||||
|
import { download } from '@/utils/common'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ExportDialog',
|
name: 'ExportDialog',
|
||||||
@@ -197,10 +198,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
downloadCsv(url) {
|
downloadCsv(url) {
|
||||||
const a = document.createElement('a')
|
download(url)
|
||||||
a.href = url
|
|
||||||
a.click()
|
|
||||||
window.URL.revokeObjectURL(url)
|
|
||||||
},
|
},
|
||||||
async defaultPerformExport(selectRows, exportOption, q, exportTypeOption) {
|
async defaultPerformExport(selectRows, exportOption, q, exportTypeOption) {
|
||||||
const url = (process.env.VUE_APP_ENV === 'production') ? (`${this.url}`) : (`${process.env.VUE_APP_BASE_API}${this.url}`)
|
const url = (process.env.VUE_APP_ENV === 'production') ? (`${this.url}`) : (`${process.env.VUE_APP_BASE_API}${this.url}`)
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import Dialog from '@/components/Dialog/index.vue'
|
import Dialog from '@/components/Dialog/index.vue'
|
||||||
import ImportTable from '@/components/Table/ListTable/TableAction/ImportTable.vue'
|
import ImportTable from '@/components/Table/ListTable/TableAction/ImportTable.vue'
|
||||||
import { getErrorResponseMsg } from '@/utils/common'
|
import { download, getErrorResponseMsg } from '@/utils/common'
|
||||||
import { createSourceIdCache } from '@/api/common'
|
import { createSourceIdCache } from '@/api/common'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -226,10 +226,7 @@ export default {
|
|||||||
this.$message.success(msg)
|
this.$message.success(msg)
|
||||||
},
|
},
|
||||||
downloadCsv(url) {
|
downloadCsv(url) {
|
||||||
const a = document.createElement('a')
|
download(url)
|
||||||
a.href = url
|
|
||||||
a.click()
|
|
||||||
window.URL.revokeObjectURL(url)
|
|
||||||
},
|
},
|
||||||
async handleImportConfirm() {
|
async handleImportConfirm() {
|
||||||
await this.$refs['importTable'].performUpload()
|
await this.$refs['importTable'].performUpload()
|
||||||
|
|||||||
@@ -124,6 +124,9 @@ export default {
|
|||||||
return this.iHasLeftActions ? 'right' : 'left'
|
return this.iHasLeftActions ? 'right' : 'left'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
this.$emit('done')
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleTagSearch(val) {
|
handleTagSearch(val) {
|
||||||
this.searchTable(val)
|
this.searchTable(val)
|
||||||
|
|||||||
@@ -8,9 +8,11 @@
|
|||||||
:selected-rows="selectedRows"
|
:selected-rows="selectedRows"
|
||||||
:table-url="tableUrl"
|
:table-url="tableUrl"
|
||||||
v-bind="iHeaderActions"
|
v-bind="iHeaderActions"
|
||||||
|
@done="handleActionInitialDone"
|
||||||
/>
|
/>
|
||||||
<IBox class="table-content">
|
<IBox class="table-content">
|
||||||
<AutoDataTable
|
<AutoDataTable
|
||||||
|
v-if="actionInit"
|
||||||
ref="dataTable"
|
ref="dataTable"
|
||||||
:config="iTableConfig"
|
:config="iTableConfig"
|
||||||
:filter-table="filter"
|
:filter-table="filter"
|
||||||
@@ -73,9 +75,11 @@ export default {
|
|||||||
return {
|
return {
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
init: false,
|
init: false,
|
||||||
extraQuery: extraQuery,
|
|
||||||
urlUpdated: {},
|
urlUpdated: {},
|
||||||
isDeactivated: false
|
isDeactivated: false,
|
||||||
|
extraQuery: extraQuery,
|
||||||
|
actionInit: this.headerActions.has === false,
|
||||||
|
initQuery: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -203,13 +207,35 @@ export default {
|
|||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handleActionInitialDone() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.actionInit = true
|
||||||
|
}, 100)
|
||||||
|
},
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
this.selectedRows = val
|
this.selectedRows = val
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.dataTable?.getList()
|
this.dataTable?.getList()
|
||||||
},
|
},
|
||||||
|
updateInitQuery(attrs) {
|
||||||
|
if (!this.actionInit) {
|
||||||
|
this.initQuery = attrs
|
||||||
|
for (const key in attrs) {
|
||||||
|
this.$set(this.extraQuery, key, attrs[key])
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
const removeKeys = Object.keys(this.initQuery).filter(key => !attrs[key])
|
||||||
|
for (const key of removeKeys) {
|
||||||
|
this.$delete(this.extraQuery, key)
|
||||||
|
}
|
||||||
|
},
|
||||||
search(attrs) {
|
search(attrs) {
|
||||||
|
const init = this.updateInitQuery(attrs)
|
||||||
|
if (init) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$log.debug('ListTable: search table', attrs)
|
this.$log.debug('ListTable: search table', attrs)
|
||||||
this.$emit('TagSearch', attrs)
|
this.$emit('TagSearch', attrs)
|
||||||
this.$refs.dataTable?.$refs.dataTable?.search(attrs, true)
|
this.$refs.dataTable?.$refs.dataTable?.search(attrs, true)
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ $origin-color: #ffffff;
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
height: 100%;
|
//height: 100%;
|
||||||
background: $origin-color;
|
background: $origin-color;
|
||||||
color: var(--color-border);
|
color: var(--color-border);
|
||||||
|
|
||||||
|
|||||||
@@ -4,28 +4,29 @@
|
|||||||
<div class="action-bar">
|
<div class="action-bar">
|
||||||
<div class="action">
|
<div class="action">
|
||||||
<span>
|
<span>
|
||||||
<i :class="[!isShow ? 'fa-eye' : 'fa-eye-slash']" class="fa" @click="onView" />
|
<i class="fa" :class="[!isShow ? 'fa-eye' : 'fa-eye-slash']" @click="onView" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-col :span="span" :style="{'height': height + 'px' }">
|
<el-col :span="span" :style="{'height': height + 'px' }">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="iValue"
|
v-model="iValue"
|
||||||
:rows="rows"
|
|
||||||
autosize
|
autosize
|
||||||
|
:rows="rows"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
/>
|
/>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-show="isShow" :span="span">
|
<el-col v-show="isShow" :span="span">
|
||||||
<VueMarkdown :html="false" :show="true" :source="iValue" class="result-html" />
|
<VueMarkdown class="result-html" :source="sanitizedValue" :html="false" :show="true" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<VueMarkdown v-else :html="false" :source="iValue" class="source" />
|
<VueMarkdown v-else class="source" :html="false" :source="sanitizedValue" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import DOMPurify from 'dompurify'
|
||||||
import VueMarkdown from 'vue-markdown'
|
import VueMarkdown from 'vue-markdown'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -55,6 +56,17 @@ export default {
|
|||||||
iValue: this.value
|
iValue: this.value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
sanitizedValue() {
|
||||||
|
// 转义特殊字符
|
||||||
|
let content = this.iValue.replace(/\\/g, '\\\\').replace(/\$/g, '\\$')
|
||||||
|
|
||||||
|
// 使用 DOMPurify 进行 XSS 过滤
|
||||||
|
content = DOMPurify.sanitize(content)
|
||||||
|
|
||||||
|
return content
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.resizeObserver = new ResizeObserver(entries => {
|
this.resizeObserver = new ResizeObserver(entries => {
|
||||||
|
|||||||
@@ -23,8 +23,18 @@ export default {
|
|||||||
'publicSettings'
|
'publicSettings'
|
||||||
]),
|
]),
|
||||||
key() {
|
key() {
|
||||||
|
// 想让创建后回来 List 页面不刷新,但是完全不刷新 table 会不对,所以创建完成后,会更新 order 和 updated
|
||||||
|
// query 去掉这两个,如果变了再刷新
|
||||||
|
const query = {}
|
||||||
|
for (const [k, v] of Object.entries(this.$route.query)) {
|
||||||
|
if (k.includes('updated') || k.includes('order')) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
query[k] = v
|
||||||
|
}
|
||||||
|
|
||||||
if (this.$route.name.toLowerCase().includes('list')) {
|
if (this.$route.name.toLowerCase().includes('list')) {
|
||||||
return _.trimEnd(this.$route.path, '/')
|
return _.trimEnd(this.$route.path, '/') + '?' + new URLSearchParams(query).toString()
|
||||||
} else {
|
} else {
|
||||||
return new Date().getTime()
|
return new Date().getTime()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ export default {
|
|||||||
return this.$t('LicenseExpired')
|
return this.$t('LicenseExpired')
|
||||||
}
|
}
|
||||||
if (intervalDays < 7) {
|
if (intervalDays < 7) {
|
||||||
return this.$t('LicenseWillBe') + this.licenseData.date_expired + this.$t('Expire')
|
return this.$t('LicenseWillBe') + ' ' + this.licenseData.date_expired + ' ' + this.$t('Expire')
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ export default {
|
|||||||
hidden: true,
|
hidden: true,
|
||||||
component: () => import('@/views/ops/Template/Adhoc/AdhocUpdateCreate'),
|
component: () => import('@/views/ops/Template/Adhoc/AdhocUpdateCreate'),
|
||||||
meta: {
|
meta: {
|
||||||
title: i18n.t('createAdhoc'),
|
title: i18n.t('AdhocUpdate'),
|
||||||
permissions: ['ops.add_adhoc'],
|
permissions: ['ops.add_adhoc'],
|
||||||
activeMenu: '/workbench/ops/templates'
|
activeMenu: '/workbench/ops/templates'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -217,13 +217,19 @@ export function downloadText(content, filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function download(downloadUrl, filename) {
|
export function download(downloadUrl, filename) {
|
||||||
|
const iframe = document.createElement('iframe')
|
||||||
|
iframe.style.display = 'none'
|
||||||
|
document.body.appendChild(iframe)
|
||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
a.href = downloadUrl
|
a.href = downloadUrl
|
||||||
if (filename) {
|
if (filename) {
|
||||||
a.download = filename
|
a.download = filename
|
||||||
}
|
}
|
||||||
|
iframe.contentWindow.document.body.appendChild(a)
|
||||||
a.click()
|
a.click()
|
||||||
window.URL.revokeObjectURL(downloadUrl)
|
setTimeout(() => {
|
||||||
|
document.body.removeChild(iframe)
|
||||||
|
}, 1000 * 60 * 30) // If you can't download it in half an hour, don't download it.
|
||||||
}
|
}
|
||||||
|
|
||||||
export function diffObject(object, base) {
|
export function diffObject(object, base) {
|
||||||
|
|||||||
@@ -1,13 +1,5 @@
|
|||||||
const moment = require('moment')
|
const moment = require('moment')
|
||||||
|
import { getLangCode } from '@/i18n/utils'
|
||||||
function getUserLang() {
|
|
||||||
const userLangEN = document.cookie.indexOf('django_language=en')
|
|
||||||
if (userLangEN === -1) {
|
|
||||||
return 'zh-CN'
|
|
||||||
} else {
|
|
||||||
return 'en-US'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTimeUnits(u) {
|
function getTimeUnits(u) {
|
||||||
const units = {
|
const units = {
|
||||||
@@ -16,10 +8,11 @@ function getTimeUnits(u) {
|
|||||||
'm': '分',
|
'm': '分',
|
||||||
's': '秒'
|
's': '秒'
|
||||||
}
|
}
|
||||||
if (getUserLang() === 'zh-CN') {
|
if (getLangCode() === 'zh') {
|
||||||
return units[u]
|
return units[u]
|
||||||
|
} else {
|
||||||
|
return u
|
||||||
}
|
}
|
||||||
return u
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function timeOffset(a, b) {
|
export function timeOffset(a, b) {
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ export default {
|
|||||||
},
|
},
|
||||||
extraMoreActions: [
|
extraMoreActions: [
|
||||||
{
|
{
|
||||||
name: 'BatchRetry',
|
name: 'RetrySelected',
|
||||||
title: this.$t('BatchRetry'),
|
title: this.$t('RetrySelected'),
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
fa: 'fa-retweet',
|
fa: 'fa-retweet',
|
||||||
can: ({ selectedRows }) => {
|
can: ({ selectedRows }) => {
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ export default {
|
|||||||
},
|
},
|
||||||
extraMoreActions: [
|
extraMoreActions: [
|
||||||
{
|
{
|
||||||
name: 'BatchRetry',
|
name: 'RetrySelected',
|
||||||
title: this.$t('BatchRetry'),
|
title: this.$t('RetrySelected'),
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
fa: 'fa-retweet',
|
fa: 'fa-retweet',
|
||||||
can: ({ selectedRows }) => {
|
can: ({ selectedRows }) => {
|
||||||
|
|||||||
@@ -10,8 +10,6 @@
|
|||||||
@click="onSetting"
|
@click="onSetting"
|
||||||
/>
|
/>
|
||||||
<Dialog
|
<Dialog
|
||||||
v-if="isVisible"
|
|
||||||
:destroy-on-close="true"
|
|
||||||
:show-cancel="false"
|
:show-cancel="false"
|
||||||
:show-confirm="false"
|
:show-confirm="false"
|
||||||
:title="title"
|
:title="title"
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ export default {
|
|||||||
}
|
}
|
||||||
createJob(data).then(res => {
|
createJob(data).then(res => {
|
||||||
this.executionInfo.timeCost = 0
|
this.executionInfo.timeCost = 0
|
||||||
this.executionInfo.status = 'running'
|
this.executionInfo.status = { value: 'running', label: this.$t('Running') }
|
||||||
this.currentTaskId = res.task_id
|
this.currentTaskId = res.task_id
|
||||||
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
|
this.xtermConfig = { taskId: this.currentTaskId, type: 'shortcut_cmd' }
|
||||||
this.setCostTimeInterval()
|
this.setCostTimeInterval()
|
||||||
@@ -451,12 +451,12 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
setBtn() {
|
setBtn() {
|
||||||
if (this.executionInfo.status !== 'running') {
|
if (this.executionInfo.status.value !== 'running') {
|
||||||
clearInterval(this.executionInfo.cancel)
|
clearInterval(this.executionInfo.cancel)
|
||||||
this.toolbar.left.run.icon = 'fa fa-play'
|
this.toolbar.left.run.icon = 'fa fa-play'
|
||||||
}
|
}
|
||||||
this.toolbar.left.run.isVisible = this.executionInfo.status === 'running'
|
this.toolbar.left.run.isVisible = this.executionInfo.status.value === 'running'
|
||||||
this.toolbar.left.stop.isVisible = this.executionInfo.status !== 'running'
|
this.toolbar.left.stop.isVisible = this.executionInfo.status.value !== 'running'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -470,9 +470,9 @@ $container-bg-color: #f7f7f7;
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.xterm-container {
|
.xterm-container {
|
||||||
margin-left: 30px;
|
|
||||||
height: calc(100vh - 549px);
|
height: calc(100vh - 549px);
|
||||||
min-height: 255px;
|
min-height: 255px;
|
||||||
|
margin-left: 30px;
|
||||||
border: 1px solid var(--color-border);
|
border: 1px solid var(--color-border);
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background-color: $container-bg-color;
|
background-color: $container-bg-color;
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
<span class="status-item">
|
<span class="status-item">
|
||||||
<span>{{ $tc('Status') }}: </span>
|
<span>{{ $tc('Status') }}: </span>
|
||||||
<span
|
<span
|
||||||
:class="{'status_success':executionInfo.status==='success',
|
:class="{'status_success':executionInfo.status.value==='success',
|
||||||
'status_warning':executionInfo.status==='timeout',
|
'status_warning':executionInfo.status.value==='timeout',
|
||||||
'status_danger':executionInfo.status==='failed'
|
'status_danger':executionInfo.status.value==='failed'
|
||||||
}"
|
}"
|
||||||
>{{ $tc('' + executionInfo.status) }}</span>
|
>{{ $tc('' + executionInfo.status.label) }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="status-item">
|
<span class="status-item">
|
||||||
<span>{{ $tc('TimeDelta') }}: </span>
|
<span>{{ $tc('TimeDelta') }}: </span>
|
||||||
@@ -66,9 +66,7 @@ export default {
|
|||||||
executionInfo: {
|
executionInfo: {
|
||||||
type: Object,
|
type: Object,
|
||||||
// eslint-disable-next-line vue/require-valid-default-prop
|
// eslint-disable-next-line vue/require-valid-default-prop
|
||||||
default: {
|
default: {}
|
||||||
status: 'success'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/ops/job-executions/',
|
url: '/api/v1/ops/job-executions/',
|
||||||
columnsExclude: [
|
columnsExclude: [
|
||||||
'summary', 'parameters'
|
'summary', 'parameters', 'timedelta'
|
||||||
],
|
],
|
||||||
columnsShow: {
|
columnsShow: {
|
||||||
min: ['material', 'actions'],
|
min: ['material', 'actions'],
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="table">
|
<template slot="table">
|
||||||
<div class="transition-box" style="width: calc(100% - 17px);">
|
<div class="transition-box" style="width: calc(100% - 17px);">
|
||||||
<el-tabs v-model="activeEditorId" :closable="true" @tab-remove="onCloseEditor">
|
<el-tabs v-model="activeEditorId" :closable="true" class="workspace-tab" @tab-remove="onCloseEditor">
|
||||||
<el-tab-pane
|
<el-tab-pane
|
||||||
v-for="(editor,key) in openedEditor"
|
v-for="(editor,key) in openedEditor"
|
||||||
:key="key"
|
:key="key"
|
||||||
@@ -298,6 +298,12 @@ export default {
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.workspace-tab{
|
||||||
|
::v-deep .el-tabs__header {
|
||||||
|
margin: 0 0 15px 30px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.el-tree {
|
.el-tree {
|
||||||
background-color: inherit !important;
|
background-color: inherit !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<div slot="tip" class="el-upload__tip">
|
<div slot="tip" class="el-upload__tip">
|
||||||
<span :class="{'hasError': hasFileFormatOrSizeError }" />
|
<span :class="{'hasError': hasFileFormatOrSizeError }" />
|
||||||
<div v-if="renderError" class="hasError">{{ renderError }}</div>
|
<div v-if="renderError" class="hasError">{{ renderError }}</div>
|
||||||
<h5>请上传包含以下示例结构目录的 .zip 压缩文件</h5>
|
<h5>{{ $t('UploadHelpText') }}</h5>
|
||||||
<pre style="display:flex; line-height: 1.2em">
|
<pre style="display:flex; line-height: 1.2em">
|
||||||
./
|
./
|
||||||
├── roles
|
├── roles
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import isFalsey from '@/components/Table/DataTable/compenents/el-data-table/util
|
|||||||
import deepmerge from 'deepmerge'
|
import deepmerge from 'deepmerge'
|
||||||
import * as queryUtil from '@/components/Table/DataTable/compenents/el-data-table/utils/query'
|
import * as queryUtil from '@/components/Table/DataTable/compenents/el-data-table/utils/query'
|
||||||
import { createSourceIdCache } from '@/api/common'
|
import { createSourceIdCache } from '@/api/common'
|
||||||
|
import { download } from '@/utils/common'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CommandList',
|
name: 'CommandList',
|
||||||
@@ -134,10 +135,7 @@ export default {
|
|||||||
queryUtil.stringify(query, '=', '&')
|
queryUtil.stringify(query, '=', '&')
|
||||||
url = url + queryStr
|
url = url + queryStr
|
||||||
this.$log.debug('Export url: ', this.url, '=>', url)
|
this.$log.debug('Export url: ', this.url, '=>', url)
|
||||||
const a = document.createElement('a')
|
download(url + queryStr)
|
||||||
a.href = url
|
|
||||||
a.click()
|
|
||||||
window.URL.revokeObjectURL(url + queryStr)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export default {
|
|||||||
label: this.$t('DisplayName'),
|
label: this.$t('DisplayName'),
|
||||||
formatter: DetailFormatter,
|
formatter: DetailFormatter,
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
|
can: vm.$hasPerm('assets.view_asset'),
|
||||||
getTitle: ({ row }) => row.host.name,
|
getTitle: ({ row }) => row.host.name,
|
||||||
getRoute: ({ row }) => ({
|
getRoute: ({ row }) => ({
|
||||||
name: 'AppletHostDetail',
|
name: 'AppletHostDetail',
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
url: '/api/v1/terminal/applet-hosts/',
|
url: '/api/v1/terminal/applet-hosts/',
|
||||||
columnsExclude: ['info'],
|
columnsExclude: ['info', 'auto_config', 'gathered_info', 'deploy_options'],
|
||||||
columnsShow: {
|
columnsShow: {
|
||||||
min: ['name', 'actions'],
|
min: ['name', 'actions'],
|
||||||
default: [
|
default: [
|
||||||
@@ -52,6 +52,7 @@ export default {
|
|||||||
columnsMeta: {
|
columnsMeta: {
|
||||||
name: {
|
name: {
|
||||||
formatterArgs: {
|
formatterArgs: {
|
||||||
|
can: vm.$hasPerm('assets.view_asset'),
|
||||||
getRoute: ({ row }) => {
|
getRoute: ({ row }) => {
|
||||||
return {
|
return {
|
||||||
name: 'AppletHostDetail',
|
name: 'AppletHostDetail',
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export default {
|
|||||||
],
|
],
|
||||||
encryptedFields: ['VAULT_HCP_TOKEN'],
|
encryptedFields: ['VAULT_HCP_TOKEN'],
|
||||||
fields: [
|
fields: [
|
||||||
[this.$t('Backend'),
|
[this.$t('Basic'),
|
||||||
[
|
[
|
||||||
'VAULT_ENABLED',
|
'VAULT_ENABLED',
|
||||||
'VAULT_HCP_HOST',
|
'VAULT_HCP_HOST',
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
value = values[key]
|
value = values[key]
|
||||||
}
|
}
|
||||||
if (value) {
|
if (value !== undefined) {
|
||||||
form.append(key, value)
|
form.append(key, value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-button size="mini" type="primary" icon="el-icon-setting" @click="visible = !visible"> {{ $t("Settings...") }} </el-button>
|
<el-button size="mini" type="primary" icon="el-icon-setting" @click="visible = !visible"> {{ $t("Setting") }} </el-button>
|
||||||
<Dialog
|
<Dialog
|
||||||
v-if="visible"
|
v-if="visible"
|
||||||
:show-cancel="false"
|
:show-cancel="false"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-button size="mini" type="primary" icon="el-icon-setting" @click="visible=true">{{ $t('Settings...') }}</el-button>
|
<el-button size="mini" type="primary" icon="el-icon-setting" @click="visible=true">{{ $t('Setting') }}</el-button>
|
||||||
<Dialog
|
<Dialog
|
||||||
v-if="visible"
|
v-if="visible"
|
||||||
:destroy-on-close="true"
|
:destroy-on-close="true"
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export default {
|
|||||||
canCreate: this.$hasPerm('orgs.add_organization'),
|
canCreate: this.$hasPerm('orgs.add_organization'),
|
||||||
extraActions: [
|
extraActions: [
|
||||||
{
|
{
|
||||||
title: this.$t('Settings...'),
|
title: this.$t('Setting'),
|
||||||
icon: 'el-icon-setting',
|
icon: 'el-icon-setting',
|
||||||
callback: () => {
|
callback: () => {
|
||||||
this.visible = true
|
this.visible = true
|
||||||
|
|||||||
@@ -64,8 +64,7 @@ export default {
|
|||||||
method: 'push_account_method',
|
method: 'push_account_method',
|
||||||
assets: this.asset_ids,
|
assets: this.asset_ids,
|
||||||
nodes: this.node_ids
|
nodes: this.node_ids
|
||||||
},
|
}
|
||||||
helpText: this.$t('ViewBlockedIPSHelpText')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cleanFormValue(value) {
|
cleanFormValue(value) {
|
||||||
|
|||||||
@@ -52,6 +52,14 @@ export default {
|
|||||||
el: {
|
el: {
|
||||||
hiddenGroup: true
|
hiddenGroup: true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
TERMINAL_MAGNUS_ENABLED: {
|
||||||
|
hidden: () => {
|
||||||
|
return !this.$store.getters.hasValidLicense
|
||||||
|
},
|
||||||
|
el: {
|
||||||
|
hiddenGroup: true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getUrl: () => '/api/v1/settings/setting/?category=terminal',
|
getUrl: () => '/api/v1/settings/setting/?category=terminal',
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default {
|
|||||||
hasMoreActions: true,
|
hasMoreActions: true,
|
||||||
extraMoreActions: [
|
extraMoreActions: [
|
||||||
{
|
{
|
||||||
name: 'BatchApproval',
|
name: 'ApproveSelected',
|
||||||
title: this.$t('ApproveSelected'),
|
title: this.$t('ApproveSelected'),
|
||||||
can: ({ selectedRows }) => { return selectedRows.length > 0 },
|
can: ({ selectedRows }) => { return selectedRows.length > 0 },
|
||||||
callback: function({ selectedRows }) {
|
callback: function({ selectedRows }) {
|
||||||
|
|||||||
@@ -11,8 +11,6 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="media-body ">
|
<div class="media-body ">
|
||||||
<strong>{{ item.user_display }}</strong>
|
<strong>{{ item.user_display }}</strong>
|
||||||
<small class="text-muted">{{ formatTime(item.date_created) }}</small>
|
|
||||||
<br>
|
|
||||||
<small class="text-muted">{{ item.date_created | date }}</small>
|
<small class="text-muted">{{ item.date_created | date }}</small>
|
||||||
<MarkDown :value="item.body" />
|
<MarkDown :value="item.body" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -174,8 +174,8 @@ export default {
|
|||||||
},
|
},
|
||||||
afterGetFormValue(obj) {
|
afterGetFormValue(obj) {
|
||||||
if (obj?.id) {
|
if (obj?.id) {
|
||||||
obj.org_roles = obj.org_roles.map(({ id }) => id)
|
obj.org_roles = obj.org_roles?.map(({ id }) => id)
|
||||||
obj.system_roles = obj.system_roles.map(({ id }) => id)
|
obj.system_roles = obj.system_roles?.map(({ id }) => id)
|
||||||
}
|
}
|
||||||
return obj
|
return obj
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4292,6 +4292,11 @@ domhandler@^4.0.0, domhandler@^4.2.0, domhandler@^4.2.2, domhandler@^4.3.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
domelementtype "^2.2.0"
|
domelementtype "^2.2.0"
|
||||||
|
|
||||||
|
dompurify@^3.1.6:
|
||||||
|
version "3.1.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.1.6.tgz#43c714a94c6a7b8801850f82e756685300a027e2"
|
||||||
|
integrity sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==
|
||||||
|
|
||||||
domready@1.0.8:
|
domready@1.0.8:
|
||||||
version "1.0.8"
|
version "1.0.8"
|
||||||
resolved "https://registry.npmmirror.com/domready/-/domready-1.0.8.tgz"
|
resolved "https://registry.npmmirror.com/domready/-/domready-1.0.8.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user