Compare commits
143 Commits
v4.0
...
pr@dev@per
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a69398ea3f | ||
|
|
9b7c4ed353 | ||
|
|
41f841532f | ||
|
|
0b9f47dd84 | ||
|
|
d32a376e8c | ||
|
|
0f8a8845df | ||
|
|
8bb2c66b99 | ||
|
|
b3d0be2f60 | ||
|
|
5a94ddd976 | ||
|
|
7b9627a80b | ||
|
|
5fcfecc060 | ||
|
|
f4d7a2283c | ||
|
|
40bb8410d3 | ||
|
|
45344ac620 | ||
|
|
5b894c9667 | ||
|
|
d89bd15b6d | ||
|
|
5e640dd45c | ||
|
|
09aa750794 | ||
|
|
744b215800 | ||
|
|
f4e11da053 | ||
|
|
2e6b5706d5 | ||
|
|
440a5b27ef | ||
|
|
932e16844e | ||
|
|
aff2e439dd | ||
|
|
a618794c14 | ||
|
|
8dd66c400a | ||
|
|
ac3ce464b7 | ||
|
|
4d01c6dabe | ||
|
|
47eeac23eb | ||
|
|
592f783245 | ||
|
|
c34ac6a56f | ||
|
|
9a7162cc9e | ||
|
|
5edf2f34dd | ||
|
|
859d824195 | ||
|
|
c382cc633e | ||
|
|
653e24773f | ||
|
|
ae489610ee | ||
|
|
b5e85c66e4 | ||
|
|
4060fa4c4a | ||
|
|
9630b79daa | ||
|
|
ad93917387 | ||
|
|
691590da7b | ||
|
|
71828fd78b | ||
|
|
5a45f31ac4 | ||
|
|
44901eee23 | ||
|
|
2d91fa107d | ||
|
|
7a6ade4bd9 | ||
|
|
951778668f | ||
|
|
0aca23bf38 | ||
|
|
9b97dc9a74 | ||
|
|
32cd030479 | ||
|
|
607bb476db | ||
|
|
1d676ec9b7 | ||
|
|
614ebb4121 | ||
|
|
8c2719a95d | ||
|
|
c6b0a958a6 | ||
|
|
3edebf3f4f | ||
|
|
f63405978e | ||
|
|
c582c8de98 | ||
|
|
c44e79ed3b | ||
|
|
fc7d5b9c29 | ||
|
|
335febd4a5 | ||
|
|
5ea2918fe7 | ||
|
|
7668d10ba5 | ||
|
|
df15d141da | ||
|
|
e2f4bbde79 | ||
|
|
3ca7de42af | ||
|
|
e6a577ba9b | ||
|
|
6290179460 | ||
|
|
4f3c9e9353 | ||
|
|
aa28a8f765 | ||
|
|
98d0a52fa2 | ||
|
|
8d9e1ffadb | ||
|
|
b3be312a4d | ||
|
|
7c41d148aa | ||
|
|
6dee911642 | ||
|
|
6dd35e5173 | ||
|
|
fdaa33f68d | ||
|
|
0b813bb719 | ||
|
|
7ba6b8d4e4 | ||
|
|
ef99e25fde | ||
|
|
d1e7b907e3 | ||
|
|
83f7dda5e7 | ||
|
|
80f929fdea | ||
|
|
1ec3d02933 | ||
|
|
fdf148cc2b | ||
|
|
c9e6ef89dc | ||
|
|
59f9f88f8b | ||
|
|
16417ae843 | ||
|
|
58bd0a17c8 | ||
|
|
c4a1eb6938 | ||
|
|
b7d9031889 | ||
|
|
96b29a9dc2 | ||
|
|
336e176639 | ||
|
|
2df4a9d66d | ||
|
|
45a102cff1 | ||
|
|
57ebfa0812 | ||
|
|
4e9dd57efe | ||
|
|
3fcc4ca160 | ||
|
|
958760811c | ||
|
|
b60e0251c2 | ||
|
|
3db0ed756e | ||
|
|
453c4b1e4e | ||
|
|
bf4d8ce7a6 | ||
|
|
34effdbe15 | ||
|
|
274db466f2 | ||
|
|
cbe697f9dc | ||
|
|
fb7acb100e | ||
|
|
ebb36847df | ||
|
|
beba4f1994 | ||
|
|
452796e3f5 | ||
|
|
02a7969d90 | ||
|
|
798dbec151 | ||
|
|
0e11a56e37 | ||
|
|
be5344344c | ||
|
|
e75d711e0a | ||
|
|
46ee116f3e | ||
|
|
f4b304338f | ||
|
|
e93e78307c | ||
|
|
d22079446f | ||
|
|
d57b99b00c | ||
|
|
e7321356af | ||
|
|
a0edc2c527 | ||
|
|
10ebcfd64d | ||
|
|
a3fedb9697 | ||
|
|
1eb8a18c66 | ||
|
|
f491c57c34 | ||
|
|
50b7f54652 | ||
|
|
5bf298a5bf | ||
|
|
124ff9a8c2 | ||
|
|
387ab4f1b3 | ||
|
|
d6fbdfa7ea | ||
|
|
cd4260fd8d | ||
|
|
baeece62d3 | ||
|
|
576c8f5891 | ||
|
|
5e97600807 | ||
|
|
4e2eb3a37d | ||
|
|
e92173f8e8 | ||
|
|
412d9c804e | ||
|
|
b84a725d4a | ||
|
|
58b39743e0 | ||
|
|
7651443c25 | ||
|
|
8d64e331d1 |
72
.github/workflows/build-base-image.yml
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
name: Build and Push Base Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'pr*'
|
||||
paths:
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'yarn.lock'
|
||||
- 'Dockerfile-base'
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Lock Pull Request
|
||||
run: |
|
||||
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-d '{"state":"pending", "description":"Action running, merge disabled", "context":"Lock PR"}' \
|
||||
"https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }}"
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Extract date
|
||||
id: vars
|
||||
run: echo "IMAGE_TAG=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_ENV
|
||||
|
||||
- name: Extract repository name
|
||||
id: repo
|
||||
run: echo "REPO=$(basename ${{ github.repository }})" >> $GITHUB_ENV
|
||||
|
||||
- name: Build and push multi-arch image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
file: Dockerfile-base
|
||||
tags: jumpserver/${{ env.REPO }}-base:${{ env.IMAGE_TAG }}
|
||||
|
||||
- name: Update Dockerfile
|
||||
run: |
|
||||
sed -i 's|-base:.* AS stage-build|-base:${{ env.IMAGE_TAG }} AS stage-build|' Dockerfile
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||
git add Dockerfile
|
||||
git commit -m "perf: Update Dockerfile with new base image tag"
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Unlock Pull Request
|
||||
run: |
|
||||
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-d '{"state":"success", "description":"Action running, merge disabled", "context":"Lock PR"}' \
|
||||
"https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }}"
|
||||
46
.github/workflows/jms-build-test.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: "Run Build Test"
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'Dockerfile'
|
||||
- 'Dockerfile*'
|
||||
- 'package.json'
|
||||
- 'yarn.lock'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
component: [lina]
|
||||
version: [v4]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Prepare Build
|
||||
run: |
|
||||
sed -i 's@registry.npmmirror.com@registry.yarnpkg.com@g' yarn.lock
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: Dockerfile
|
||||
tags: ghcr.io/jumpserver/${{ matrix.component }}:${{ matrix.version }}
|
||||
platforms: linux/amd64
|
||||
build-args: |
|
||||
VERSION=${{ matrix.version }}
|
||||
APT_MIRROR=http://deb.debian.org
|
||||
NPM_REGISTRY=https://registry.yarnpkg.com
|
||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
46
.github/workflows/jms-build-test.yml.disabled
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
name: "Run Build Test"
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'Dockerfile'
|
||||
- 'Dockerfile*'
|
||||
- 'package.json'
|
||||
- 'yarn.lock'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
component: [ lina ]
|
||||
version: [ v4 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Prepare Build
|
||||
run: |
|
||||
sed -i 's@registry.npmmirror.com@registry.yarnpkg.com@g' yarn.lock
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build Image
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: Dockerfile
|
||||
tags: ghcr.io/jumpserver/${{ matrix.component }}:${{ matrix.version }}
|
||||
platforms: linux/amd64
|
||||
build-args: |
|
||||
VERSION=${{ matrix.version }}
|
||||
APT_MIRROR=http://deb.debian.org
|
||||
NPM_REGISTRY=https://registry.yarnpkg.com
|
||||
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
2
.github/workflows/release-drafter.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
||||
tag: ${{ steps.get_version.outputs.TAG }}
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16.20'
|
||||
node-version: '20.15'
|
||||
- name: Install dependencies
|
||||
run: yarn install
|
||||
- name: Build web
|
||||
|
||||
32
Dockerfile
@@ -1,34 +1,4 @@
|
||||
FROM node:16.20-bullseye-slim AS stage-build
|
||||
ARG TARGETARCH
|
||||
|
||||
ARG DEPENDENCIES=" \
|
||||
g++ \
|
||||
make \
|
||||
python3"
|
||||
|
||||
ARG APT_MIRROR=http://mirrors.ustc.edu.cn
|
||||
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||
set -ex \
|
||||
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
||||
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache \
|
||||
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
|
||||
&& apt-get update \
|
||||
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
|
||||
&& echo "no" | dpkg-reconfigure dash
|
||||
|
||||
ARG NPM_REGISTRY="https://registry.npmmirror.com"
|
||||
|
||||
RUN set -ex \
|
||||
&& npm config set registry ${NPM_REGISTRY} \
|
||||
&& yarn config set registry ${NPM_REGISTRY}
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked \
|
||||
--mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=yarn.lock,target=yarn.lock \
|
||||
yarn install
|
||||
FROM jumpserver/lina-base:20240723_084702 AS stage-build
|
||||
|
||||
ARG VERSION
|
||||
ENV VERSION=$VERSION
|
||||
|
||||
22
Dockerfile-base
Normal file
@@ -0,0 +1,22 @@
|
||||
FROM node:20.15-bullseye-slim
|
||||
|
||||
ARG DEPENDENCIES=" \
|
||||
g++ \
|
||||
make \
|
||||
python3"
|
||||
|
||||
RUN set -ex \
|
||||
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
||||
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
|
||||
&& apt-get update \
|
||||
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
|
||||
&& echo "no" | dpkg-reconfigure dash
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
ARG NPM_MIRROR="https://registry.npmjs.org"
|
||||
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=yarn-cache \
|
||||
sed -i "s|https://registry.npmmirror.com|${NPM_MIRROR}|g" yarn.lock \
|
||||
&& yarn install
|
||||
11
package.json
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "Lina",
|
||||
"name": "lina",
|
||||
"version": "v4.0.0",
|
||||
"description": "JumpServer Web UI",
|
||||
"author": "JumpServer Team <support@fit2cloud.com>",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"scripts": {
|
||||
"dev": "vue-cli-service serve",
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
|
||||
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
|
||||
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
|
||||
"build:prod": "vue-cli-service build",
|
||||
"build:stage": "vue-cli-service build --mode staging",
|
||||
"preview": "node build/index.js --preview",
|
||||
@@ -30,6 +30,7 @@
|
||||
"@ztree/ztree_v3": "3.5.44",
|
||||
"axios": "0.28.0",
|
||||
"axios-retry": "^3.1.9",
|
||||
"caniuse-lite": "^1.0.30001642",
|
||||
"cron-parser": "^4.0.0",
|
||||
"crypto-js": "^4.1.1",
|
||||
"css-color-function": "^1.3.3",
|
||||
@@ -95,7 +96,7 @@
|
||||
"@vue/test-utils": "1.0.0-beta.29",
|
||||
"autoprefixer": "^9.5.1",
|
||||
"babel-core": "7.0.0-bridge.0",
|
||||
"babel-eslint": "10.0.1",
|
||||
"babel-eslint": "10.0.2",
|
||||
"babel-jest": "23.6.0",
|
||||
"chalk": "2.4.2",
|
||||
"compression-webpack-plugin": "^6.1.1",
|
||||
|
||||
@@ -65,10 +65,6 @@ export function logout() {
|
||||
})
|
||||
}
|
||||
|
||||
export function refreshSessionIdAge() {
|
||||
return getProfile()
|
||||
}
|
||||
|
||||
export default {
|
||||
getProfile,
|
||||
getUserList
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 9.8 KiB |
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 961 B After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 916 B After Width: | Height: | Size: 2.4 KiB |
BIN
src/assets/img/icons/h3c.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 940 B |
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.1 KiB |
@@ -2,6 +2,7 @@
|
||||
<Dialog
|
||||
:close-on-click-modal="false"
|
||||
:title="$tc('Assets')"
|
||||
:disabled-status="!isLoaded"
|
||||
custom-class="asset-select-dialog"
|
||||
top="2vh"
|
||||
v-bind="$attrs"
|
||||
@@ -22,6 +23,8 @@
|
||||
:url="baseUrl"
|
||||
class="tree-table"
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
@loaded="handleTableLoaded"
|
||||
/>
|
||||
</Dialog>
|
||||
</template>
|
||||
@@ -64,6 +67,7 @@ export default {
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
isLoaded: false,
|
||||
dialogVisible: false,
|
||||
rowSelected: _.cloneDeep(this.value) || [],
|
||||
rowsAdd: [],
|
||||
@@ -124,6 +128,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleTableLoaded() {
|
||||
this.isLoaded = true
|
||||
},
|
||||
handleClose() {
|
||||
this.$refs.ListPage.$refs.TreeList.componentKey += 1
|
||||
},
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
<script>
|
||||
import Select2 from '@/components/Form/FormFields/Select2.vue'
|
||||
import AssetSelectDialog from './dialog.vue'
|
||||
import { b } from 'css-color-function/lib/adjusters'
|
||||
|
||||
export default {
|
||||
componentName: 'AssetSelect',
|
||||
@@ -38,6 +37,10 @@ export default {
|
||||
type: String,
|
||||
default: '/api/v1/assets/assets/'
|
||||
},
|
||||
defaultPageSize: {
|
||||
type: Number,
|
||||
default: 10
|
||||
},
|
||||
baseNodeUrl: {
|
||||
type: String,
|
||||
default: '/api/v1/assets/nodes/'
|
||||
@@ -71,6 +74,7 @@ export default {
|
||||
value: iValue,
|
||||
multiple: true,
|
||||
clearable: true,
|
||||
defaultPageSize: this.defaultPageSize,
|
||||
ajax: {
|
||||
url: this.baseUrl,
|
||||
transformOption: (item) => {
|
||||
@@ -81,7 +85,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
b,
|
||||
handleFocus() {
|
||||
this.$refs.select2.selectRef.blur()
|
||||
this.dialogVisible = true
|
||||
|
||||
@@ -176,12 +176,12 @@ export default {
|
||||
setParam('node_id', '')
|
||||
setParam('asset_id', assetId)
|
||||
} else if (treeNode.meta.type === 'category') {
|
||||
url = setUrlParam(url, 'category', treeNode.meta.category)
|
||||
setParam('category', treeNode.meta.category)
|
||||
} else if (treeNode.meta.type === 'type') {
|
||||
setParam('category', treeNode.meta.category)
|
||||
setParam('type', treeNode.meta._type)
|
||||
} else if (treeNode.meta.type === 'platform') {
|
||||
url = setUrlParam(url, 'platform', treeNode.id)
|
||||
setParam('platform', treeNode.id)
|
||||
}
|
||||
setTimeout(() => {
|
||||
const query = this.setTreeUrlQuery()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<AssetTreeTable
|
||||
ref="AssetTreeTable"
|
||||
:header-actions="headerActions"
|
||||
:table-config="tableConfig"
|
||||
:tree-setting="treeSetting"
|
||||
@@ -47,9 +48,19 @@ export default {
|
||||
return this.tableUrl.replace('/assets/', `/assets/${row.id}/accounts/`)
|
||||
}
|
||||
},
|
||||
nameDisabled: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
name: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
route: 'AssetDetail',
|
||||
can: true
|
||||
}
|
||||
})
|
||||
},
|
||||
comment: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -80,11 +91,7 @@ export default {
|
||||
},
|
||||
columnsMeta: {
|
||||
name: {
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
route: 'AssetDetail',
|
||||
can: !this.nameDisabled
|
||||
}
|
||||
...this.name
|
||||
},
|
||||
labels: {
|
||||
formatterArgs: {
|
||||
@@ -99,7 +106,8 @@ export default {
|
||||
formatter: AccountInfoFormatter,
|
||||
width: '100px'
|
||||
},
|
||||
connectivity: connectivityMeta
|
||||
connectivity: connectivityMeta,
|
||||
comment: { ...this.comment }
|
||||
},
|
||||
tableAttrs: {
|
||||
rowClassName({ row }) {
|
||||
|
||||
@@ -10,13 +10,16 @@
|
||||
v-bind="$attrs"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<slot />
|
||||
<div v-loading="disabledStatus">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<div v-if="showButtons" slot="footer" class="dialog-footer">
|
||||
<slot name="footer">
|
||||
<el-button v-if="showCancel && showButtons" size="small" @click="onCancel">{{ cancelTitle }}</el-button>
|
||||
<el-button
|
||||
v-if="showConfirm && showButtons"
|
||||
:loading="loadingStatus"
|
||||
:disabled="disabledStatus"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="onConfirm"
|
||||
@@ -69,7 +72,7 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
loadingStatus: {
|
||||
disabledStatus: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
@@ -79,7 +82,8 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iWidth() {
|
||||
|
||||
@@ -85,6 +85,7 @@ export default {
|
||||
// 如果不想等,证明是 value 自己变化导致的, 需要重新渲染
|
||||
if (valJson !== this.formJson) {
|
||||
this.iValue = val
|
||||
this.$log.debug('Sub form value changed, rerender form: ', this.formJson, valJson)
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
@@ -95,11 +96,12 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
outputValue: _.debounce(function(val) {
|
||||
this.$emit('input', val)
|
||||
}),
|
||||
updateValue(val) {
|
||||
this.iValue = val
|
||||
setTimeout(() => {
|
||||
this.$emit('input', val)
|
||||
}, 100)
|
||||
this.outputValue(val)
|
||||
},
|
||||
objectToString(obj) {
|
||||
let data = ''
|
||||
|
||||
@@ -197,6 +197,24 @@ export class FormFieldGenerator {
|
||||
return field
|
||||
}
|
||||
|
||||
setChoicesTips(field, fieldMeta, fieldRemoteMeta) {
|
||||
// 设置 checkbox 的 tips
|
||||
if (['checkbox-group', 'radio-group'].indexOf(field.type) !== -1) {
|
||||
field.options.map(option => {
|
||||
if (!option.tip && field.tips) {
|
||||
option.tip = field.tips[option.value]
|
||||
}
|
||||
if (!option.tip) {
|
||||
const match = option.label.match(/^(.+?)\s*\((.*?)\)$/)
|
||||
if (match) {
|
||||
option.label = match[1]
|
||||
option.tip = match[2]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
afterGenerateField(field) {
|
||||
field.label = toSentenceCase(field.label)
|
||||
|
||||
@@ -204,15 +222,7 @@ export class FormFieldGenerator {
|
||||
field.el.placeholder = field.placeholder
|
||||
}
|
||||
|
||||
// 设置 checkbox 的 tips
|
||||
if (field.tips && ['checkbox-group', 'radio-group'].indexOf(field.type) !== -1) {
|
||||
field.options.map(option => {
|
||||
if (!option.tip && field.tips[option.value]) {
|
||||
option.tip = field.tips[option.value]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.setChoicesTips(field)
|
||||
return field
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
>
|
||||
{{ iSubmitBtnText }}
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-if="defaultButton && hasSaveContinue"
|
||||
size="small"
|
||||
@@ -40,6 +41,7 @@
|
||||
>
|
||||
{{ $t("SaveAndAddAnother") }}
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-if="defaultButton && hasReset"
|
||||
size="small"
|
||||
@@ -47,6 +49,7 @@
|
||||
>
|
||||
{{ $t("Reset") }}
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-for="button in moreButtons"
|
||||
v-show="!button.hidden"
|
||||
@@ -217,7 +220,7 @@ export default {
|
||||
|
||||
.el-form-item__label {
|
||||
padding: 0 30px 0 0;
|
||||
line-height: 32px;
|
||||
line-height: 30px;
|
||||
color: var(--color-text-primary);
|
||||
|
||||
i {
|
||||
|
||||
@@ -8,99 +8,118 @@
|
||||
:label="item.name"
|
||||
:prop="item.name"
|
||||
>
|
||||
|
||||
<template v-if="item.type === 'button' && !item.isVisible">
|
||||
<el-button
|
||||
:type="item.el && item.el.type"
|
||||
class="start-stop-btn"
|
||||
size="mini"
|
||||
@click="item.callback()"
|
||||
>
|
||||
<i :class="item.icon" />{{ item.name }}
|
||||
</el-button>
|
||||
<el-tooltip :disabled="!item.tip" :content="item.tip">
|
||||
<el-button
|
||||
:type="item.el && item.el.type"
|
||||
class="start-stop-btn"
|
||||
size="mini"
|
||||
@click="item.callback()"
|
||||
>
|
||||
<i :class="item.icon" />
|
||||
|
||||
{{ item.name }}
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="item.type === 'input' && item.el && item.el.autoComplete">
|
||||
<el-autocomplete
|
||||
v-model="formModel[item.name]"
|
||||
:fetch-suggestions="item.el.query"
|
||||
:placeholder="item.placeholder"
|
||||
class="inline-input"
|
||||
size="mini"
|
||||
@change="handleInputChange(item)"
|
||||
@select="handleInputChange(item)"
|
||||
/>
|
||||
<el-tooltip :disabled="!item.tip" :content="item.tip">
|
||||
<el-autocomplete
|
||||
v-model="formModel[item.name]"
|
||||
:fetch-suggestions="item.el.query"
|
||||
:placeholder="item.placeholder"
|
||||
class="inline-input"
|
||||
size="mini"
|
||||
clearable
|
||||
@change="handleInputChange(item)"
|
||||
@select="handleInputChange(item)"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-else-if="item.type === 'input'">
|
||||
<el-input
|
||||
v-model="formModel[item.name]"
|
||||
:class="!isFold ? 'special-style' : ''"
|
||||
:placeholder="item.placeholder"
|
||||
class="inline-input"
|
||||
size="mini"
|
||||
@change="item.callback(formModel[item.name])"
|
||||
/>
|
||||
<el-tooltip :disabled="!item.tip" :content="item.tip">
|
||||
<el-input
|
||||
v-model="formModel[item.name]"
|
||||
:class="!isFold ? 'special-style' : ''"
|
||||
:placeholder="item.placeholder"
|
||||
class="inline-input"
|
||||
size="mini"
|
||||
@change="item.callback(formModel[item.name])"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="item.type === 'select' && item.el && item.el.create">
|
||||
<span class="filter-label">{{ item.name }}:</span>
|
||||
<el-select
|
||||
v-if="item.type === 'select' && item.el && item.el.create"
|
||||
:key="index"
|
||||
v-model="formModel[item.name]"
|
||||
:allow-create="item.el.create || false"
|
||||
:filterable="item.el.create || false"
|
||||
:multiple="item.el.multiple"
|
||||
:placeholder="item.name"
|
||||
class="autoWidth-select"
|
||||
default-first-option
|
||||
size="mini"
|
||||
@change="item.callback(item.value)"
|
||||
>
|
||||
<template slot="prefix">{{ item.label + ':' + item.value }}</template>
|
||||
<el-option
|
||||
v-for="(option, id) in item.options"
|
||||
:key="id"
|
||||
:label="option.label"
|
||||
:title="option.value"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-tooltip :disabled="!item.tip" :content="item.tip">
|
||||
<span class="filter-label">{{ item.name }}:</span>
|
||||
<el-select
|
||||
v-if="item.type === 'select' && item.el && item.el.create"
|
||||
:key="index"
|
||||
v-model="formModel[item.name]"
|
||||
:allow-create="item.el.create || false"
|
||||
:filterable="item.el.create || false"
|
||||
:multiple="item.el.multiple"
|
||||
:placeholder="item.name"
|
||||
class="autoWidth-select"
|
||||
default-first-option
|
||||
size="mini"
|
||||
@change="item.callback(item.value)"
|
||||
>
|
||||
<template slot="prefix">{{ item.label + ':' + item.value }}</template>
|
||||
<el-option
|
||||
v-for="(option, id) in item.options"
|
||||
:key="id"
|
||||
:label="option.label"
|
||||
:title="option.value"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="item.type === 'select' && (!item.el || !item.el.create)">
|
||||
<el-dropdown
|
||||
class="select-dropdown"
|
||||
trigger="click"
|
||||
@command="(command) => {
|
||||
item.value = command
|
||||
item.callback(command)
|
||||
}"
|
||||
>
|
||||
<el-button size="mini" type="primary">
|
||||
<div class="text-content">
|
||||
<span class="content">
|
||||
{{ getLabel(item.value, item.options) }}
|
||||
<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
</div>
|
||||
</el-button>
|
||||
<el-dropdown-menu v-slot="dropdown">
|
||||
<el-dropdown-item
|
||||
v-for="(option, i) in item.options"
|
||||
:key="i"
|
||||
:command="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-tooltip :disabled="!item.tip" :content="item.tip">
|
||||
<el-dropdown
|
||||
class="select-dropdown"
|
||||
trigger="click"
|
||||
@command="(command) => {
|
||||
item.value = command
|
||||
item.callback(command)
|
||||
}"
|
||||
>
|
||||
<el-button size="mini" type="primary">
|
||||
<div class="text-content">
|
||||
<span class="content">
|
||||
{{ getLabel(item.value, item.options) }}
|
||||
<i class="el-icon-arrow-down el-icon--right" />
|
||||
</span>
|
||||
</div>
|
||||
</el-button>
|
||||
<el-dropdown-menu v-slot="dropdown">
|
||||
<el-dropdown-item
|
||||
v-for="(option, i) in item.options"
|
||||
:key="i"
|
||||
:command="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
||||
<template v-if="item.type === 'switch'">
|
||||
<el-switch
|
||||
v-model="formModel[item.name]"
|
||||
:active-text="item.name"
|
||||
:disabled="item.disabled"
|
||||
@change="item.callback(formModel[item.name])"
|
||||
/>
|
||||
<el-tooltip :disabled="!item.tip" :content="item.tip">
|
||||
<el-switch
|
||||
v-model="formModel[item.name]"
|
||||
:active-text="item.name"
|
||||
:disabled="item.disabled"
|
||||
@change="item.callback(formModel[item.name])"
|
||||
/>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-form-item>
|
||||
<div
|
||||
@@ -379,7 +398,6 @@ $input-border-color: #C0C4CC;
|
||||
}
|
||||
|
||||
.editor {
|
||||
//margin-left: 30px;
|
||||
border: 1px solid var(--color-border);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-input v-model="rawValue.phone" required :placeholder="$tc('InputPhone')" @input="OnInputChange">
|
||||
<el-input v-model="rawValue.phone" :placeholder="$tc('InputPhone')" required @input="onInputChange">
|
||||
<el-select
|
||||
slot="prepend"
|
||||
:placeholder="$tc('Select')"
|
||||
:value="rawValue.code"
|
||||
style="width: 75px;"
|
||||
@change="OnChange"
|
||||
style="width: 105px;"
|
||||
@change="onChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="country in countries"
|
||||
:key="country.value"
|
||||
:key="country.name"
|
||||
:label="country.value"
|
||||
:value="country.value"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<span style="float: left">{{ country.name }}</span>
|
||||
<span class="country-name">{{ country.name }}</span>
|
||||
<span style="float: right; font-size: 13px">{{ country.value }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -24,19 +23,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'PhoneInput',
|
||||
props: {
|
||||
value: {
|
||||
type: [Object, String],
|
||||
default: () => ({ 'code': '+86', 'phone': '' })
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rawValue: {}
|
||||
rawValue: {},
|
||||
countries: [{ 'name': 'China', 'value': '+86' }]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -45,26 +44,38 @@ export default {
|
||||
return ''
|
||||
}
|
||||
return `${this.rawValue.code}${this.rawValue.phone}`
|
||||
},
|
||||
countries: {
|
||||
get() {
|
||||
return this.publicSettings.COUNTRY_CALLING_CODES
|
||||
}
|
||||
},
|
||||
...mapGetters(['publicSettings'])
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.rawValue = this.value || { code: '+86', phone: '' }
|
||||
const defaults = { code: localStorage.getItem('prePhoneCode') || '+86', phone: '' }
|
||||
this.rawValue = this.value || defaults
|
||||
this.$axios.get('/api/v1/common/countries/').then(res => {
|
||||
this.countries = res.map(item => {
|
||||
return { name: `${item.flag} ${item.name}`, value: item.phone_code }
|
||||
})
|
||||
})
|
||||
this.$emit('input', this.fullPhone)
|
||||
},
|
||||
methods: {
|
||||
OnChange(countryCode) {
|
||||
onChange(countryCode) {
|
||||
this.rawValue.code = countryCode
|
||||
this.OnInputChange()
|
||||
this.onInputChange()
|
||||
localStorage.setItem('prePhoneCode', countryCode)
|
||||
},
|
||||
OnInputChange() {
|
||||
onInputChange() {
|
||||
this.$emit('input', this.fullPhone)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.country-name {
|
||||
display: inline-block;
|
||||
width: 150px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
padding-right: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -144,9 +144,6 @@ export default {
|
||||
watch: {
|
||||
choices: {
|
||||
handler(value, oldValue) {
|
||||
if (value?.length === oldValue?.length) {
|
||||
return
|
||||
}
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.setDefaultItems(value)
|
||||
@@ -345,6 +342,10 @@ export default {
|
||||
.protocol-item {
|
||||
display: flex;
|
||||
margin: 5px 0;
|
||||
|
||||
&:first-of-type {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.input-button {
|
||||
|
||||
@@ -125,16 +125,19 @@ export default {
|
||||
allowCreate: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
defaultPageSize: {
|
||||
type: Number,
|
||||
default: 10
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
const defaultPageSize = 10
|
||||
const defaultParams = {
|
||||
search: '',
|
||||
page: 1,
|
||||
hasMore: true,
|
||||
pageSize: defaultPageSize
|
||||
pageSize: vm.defaultPageSize
|
||||
}
|
||||
// 设置axios全局报错提示不显示
|
||||
const validateStatus = (status) => {
|
||||
@@ -194,7 +197,6 @@ export default {
|
||||
}
|
||||
},
|
||||
iAjax() {
|
||||
const defaultPageSize = 10
|
||||
const defaultMakeParams = (params) => {
|
||||
const page = params.page || 1
|
||||
const offset = (page - 1) * params.pageSize
|
||||
@@ -237,7 +239,7 @@ export default {
|
||||
}
|
||||
const defaultAjax = {
|
||||
url: '',
|
||||
pageSize: defaultPageSize,
|
||||
pageSize: this.defaultPageSize,
|
||||
makeParams: defaultMakeParams,
|
||||
transformOption: defaultTransformOption,
|
||||
processResults: defaultProcessResults,
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
:close-on-click-modal="false"
|
||||
:title="label"
|
||||
:visible.sync="showTransfer"
|
||||
:disabled-status="!isLoaded"
|
||||
class="the-dialog"
|
||||
width="730px"
|
||||
@cancel="handleTransCancel"
|
||||
@confirm="handleTransConfirm"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<krryPaging v-if="selectInitialized" ref="pageTransfer" class="transfer" v-bind="pagingTransfer" />
|
||||
</Dialog>
|
||||
@@ -77,13 +79,16 @@ export default {
|
||||
if (keyword) {
|
||||
params['search'] = keyword
|
||||
}
|
||||
this.isLoaded = false
|
||||
const data = await this.$axios.get(url, { params })
|
||||
this.isLoaded = true
|
||||
return data['results'].map(item => {
|
||||
const n = transformOption(item)
|
||||
return { id: n.value, label: n.label }
|
||||
})
|
||||
}
|
||||
return {
|
||||
isLoaded: false,
|
||||
showTransfer: false,
|
||||
selectInitialized: false,
|
||||
select2: {
|
||||
@@ -167,7 +172,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -90,8 +90,14 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$eventBus.$off('showColumnSettingPopover', this.showColumnSettingPopoverHandler)
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('showColumnSettingPopover', ({ url }) => {
|
||||
this.$eventBus.$on('showColumnSettingPopover', this.showColumnSettingPopoverHandler)
|
||||
},
|
||||
methods: {
|
||||
showColumnSettingPopoverHandler({ url }) {
|
||||
if (url === this.url) {
|
||||
this.checkAll = false
|
||||
this.showColumnSettingPopover = true
|
||||
@@ -105,9 +111,7 @@ export default {
|
||||
this.checkAll = false
|
||||
this.isIndeterminate = true
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
handleColumnConfirm() {
|
||||
this.showColumnSettingPopover = false
|
||||
this.$emit('columnsUpdate', { columns: this.iCurrentColumns, url: this.url })
|
||||
|
||||
@@ -153,6 +153,8 @@ export default {
|
||||
this.toggleRowSelection(row, true)
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit('loaded')
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
localStorage.setItem('paginationSize', val)
|
||||
|
||||
@@ -171,14 +171,18 @@ export default {
|
||||
]
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$eventBus.$off('showExportDialog', this.showExportDialogHandler)
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('showExportDialog', ({ selectedRows, url, name }) => {
|
||||
this.$eventBus.$on('showExportDialog', this.showExportDialogHandler)
|
||||
},
|
||||
methods: {
|
||||
showExportDialogHandler({ selectedRows, url, name }) {
|
||||
if (url === this.url || url.indexOf(this.url) > -1) {
|
||||
this.showExportDialog()
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
showExportDialog() {
|
||||
if (!this.mfaVerifyRequired) {
|
||||
this.exportDialogShow = true
|
||||
|
||||
@@ -142,14 +142,18 @@ export default {
|
||||
this.showTable = false
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$eventBus.$off('showImportDialog', this.showImportEventHandler)
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('showImportDialog', ({ url }) => {
|
||||
this.$eventBus.$on('showImportDialog', this.showImportEventHandler)
|
||||
},
|
||||
methods: {
|
||||
showImportEventHandler({ url }) {
|
||||
if (url === this.url) {
|
||||
this.showImportDialog = true
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
},
|
||||
closeDialog() {
|
||||
this.showImportDialog = false
|
||||
this.$emit('importDialogClose')
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
import DataTable from '@/components/Table/DataTable/index.vue'
|
||||
import { getUpdateObjURL } from '@/utils/common'
|
||||
import { sleep } from '@/utils/time'
|
||||
import { EditableInputFormatter, StatusFormatter } from '@/components/Table/TableFormatters'
|
||||
import { EditableInputFormatter } from '@/components/Table/TableFormatters'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
import getStatusColumnMeta from '@/components/Table/ListTable/TableAction/const'
|
||||
|
||||
export default {
|
||||
name: 'ImportTable',
|
||||
@@ -223,38 +224,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
generateTableColumns(tableTitles, tableData) {
|
||||
const vm = this
|
||||
const columns = [{
|
||||
prop: '@status',
|
||||
label: vm.$t('Status'),
|
||||
width: '80px',
|
||||
align: 'center',
|
||||
formatter: StatusFormatter,
|
||||
formatterArgs: {
|
||||
faChoices: {
|
||||
ok: 'fa-check text-primary',
|
||||
error: 'fa-times text-danger',
|
||||
pending: 'fa-clock-o'
|
||||
},
|
||||
getChoicesKey(val) {
|
||||
if (val === 'ok' || val === 'pending') {
|
||||
return val
|
||||
}
|
||||
return 'error'
|
||||
},
|
||||
getTip(val) {
|
||||
if (val === 'ok') {
|
||||
return vm.$t('Success')
|
||||
} else if (val === 'pending') {
|
||||
return vm.$t('Pending')
|
||||
} else if (val && val.name === 'error') {
|
||||
return val.error
|
||||
}
|
||||
return ''
|
||||
},
|
||||
hasTips: true
|
||||
}
|
||||
}]
|
||||
const columns = [{ ...getStatusColumnMeta.bind(this)().status }]
|
||||
for (const item of tableTitles) {
|
||||
const dataItemLens = tableData.map(d => {
|
||||
if (!d) {
|
||||
|
||||
@@ -71,7 +71,16 @@ export default {
|
||||
this.listenViewPort()
|
||||
},
|
||||
mounted() {
|
||||
this.$eventBus.$on('labelSearch', label => {
|
||||
this.$eventBus.$on('labelSearch', this.labelSearchHandler)
|
||||
},
|
||||
beforeDestroy(label) {
|
||||
this.$eventBus.$off('labelSearch', this.labelSearchHandler)
|
||||
},
|
||||
methods: {
|
||||
handleCascaderFocus() {
|
||||
this.setSearchFocus()
|
||||
},
|
||||
labelSearchHandler(label) {
|
||||
if (!label) {
|
||||
this.labelValue = []
|
||||
this.showLabelSearch = true
|
||||
@@ -82,14 +91,6 @@ export default {
|
||||
setTimeout(() => {
|
||||
this.showLabelSearch = true
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
destroyed() {
|
||||
this.$eventBus.$off('labelSearch')
|
||||
},
|
||||
methods: {
|
||||
handleCascaderFocus() {
|
||||
this.setSearchFocus()
|
||||
},
|
||||
handleCascaderVisibleChange(visible) {
|
||||
const input = this.$refs.labelCascader.$el
|
||||
|
||||
40
src/components/Table/ListTable/TableAction/const.js
Normal file
@@ -0,0 +1,40 @@
|
||||
import { StatusFormatter } from '@/components/Table/TableFormatters'
|
||||
import i18n from '@/i18n/i18n'
|
||||
|
||||
export const getStatusColumnMeta = (prop = '@status') => {
|
||||
return {
|
||||
status: {
|
||||
prop: prop,
|
||||
label: i18n.t('Status'),
|
||||
width: '80px',
|
||||
align: 'center',
|
||||
formatter: StatusFormatter,
|
||||
formatterArgs: {
|
||||
faChoices: {
|
||||
ok: 'fa-check text-primary',
|
||||
error: 'fa-times text-danger',
|
||||
pending: 'fa-clock-o'
|
||||
},
|
||||
getChoicesKey: (val) => {
|
||||
if (val === 'ok' || val === 'pending') {
|
||||
return val
|
||||
}
|
||||
return 'error'
|
||||
},
|
||||
getTip: (val) => {
|
||||
if (val === 'ok') {
|
||||
return i18n.t('Success')
|
||||
} else if (val === 'pending') {
|
||||
return i18n.t('Pending')
|
||||
} else if ((val && val.name === 'error') || val.error !== undefined) {
|
||||
return val.error
|
||||
}
|
||||
return ''
|
||||
},
|
||||
hasTips: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default getStatusColumnMeta
|
||||
@@ -189,22 +189,23 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.urlUpdated[this.tableUrl] = location.href
|
||||
this.$set(this.urlUpdated, this.tableUrl, location.href)
|
||||
},
|
||||
deactivated() {
|
||||
this.isDeactivated = true
|
||||
},
|
||||
activated() {
|
||||
this.isDeactivated = false
|
||||
const preURL = this.urlUpdated[this.tableUrl]
|
||||
if (!preURL || preURL === location.href) {
|
||||
return
|
||||
}
|
||||
this.urlUpdated[this.tableUrl] = location.href
|
||||
this.$log.debug('Reload the table get latest data: pre ', preURL, ' current: ', location.href)
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
this.isDeactivated = false
|
||||
const cleanUrl = this.tableUrl.split('?')[0]
|
||||
const preURL = this.urlUpdated[cleanUrl]
|
||||
|
||||
if (!preURL || preURL === location.href) return
|
||||
|
||||
this.$set(this.urlUpdated, this.tableUrl, location.href)
|
||||
this.$log.debug('Reload the table get latest data: pre ', preURL, ' current: ', location.href)
|
||||
this.reloadTable()
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleActionInitialDone() {
|
||||
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
const formatterArgs = Object.assign(this.formatterArgsDefault, this.col.formatterArgs || {})
|
||||
return {
|
||||
formatterArgs: formatterArgs,
|
||||
data: formatterArgs.async ? [] : (this.cellValue || []),
|
||||
listData: formatterArgs.async ? [] : (this.cellValue || []),
|
||||
amount: '',
|
||||
asyncGetDone: false
|
||||
}
|
||||
@@ -68,17 +68,18 @@ export default {
|
||||
return [this.$t('Loading') + '...']
|
||||
}
|
||||
const getItem = this.formatterArgs.getItem || (item => item.name)
|
||||
|
||||
let data = []
|
||||
if (Array.isArray(this.data)) {
|
||||
data = this.data.map(item => getItem(item)) || []
|
||||
} else {
|
||||
// object {key: [value]}
|
||||
data = Object.entries(this.data).map(([key, value]) => {
|
||||
|
||||
if (Array.isArray(this.listData)) {
|
||||
data = this.listData.map(item => getItem(item)).filter(Boolean)
|
||||
} else if (this.listData && typeof this.listData === 'object') {
|
||||
data = Object.entries(this.listData).map(([key, value]) => {
|
||||
const item = { key: key, value: value }
|
||||
return getItem(item)
|
||||
}) || []
|
||||
}).filter(Boolean)
|
||||
}
|
||||
data = data.filter(Boolean)
|
||||
|
||||
return data
|
||||
},
|
||||
showItems() {
|
||||
@@ -86,8 +87,12 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
cellValue() {
|
||||
this.computeAmount()
|
||||
cellValue: {
|
||||
handler(newValue) {
|
||||
// listData 需要重新赋值一遍 items 重新计算
|
||||
this.listData = newValue
|
||||
this.computeAmount()
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
@@ -105,6 +110,7 @@ export default {
|
||||
// object {key: [value]}
|
||||
cellValue = Object.keys(this.cellValue)
|
||||
}
|
||||
|
||||
this.amount = (cellValue?.filter(value => !this.cellValueToRemove.includes(value)) || []).length
|
||||
}
|
||||
},
|
||||
@@ -127,7 +133,7 @@ export default {
|
||||
const params = this.formatterArgs.ajax.params || {}
|
||||
const transform = this.formatterArgs.ajax.transform || (resp => resp[this.col.prop.replace('_amount', '')])
|
||||
const response = await this.$axios.get(url, { params: params })
|
||||
this.data = transform(response)
|
||||
this.listData = transform(response)
|
||||
this.asyncGetDone = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<span>{{ value }}</span>
|
||||
<span class="date">{{ dateValue }}</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -10,24 +10,31 @@ export default {
|
||||
name: 'DateFormatter',
|
||||
extends: BaseFormatter,
|
||||
data() {
|
||||
let value
|
||||
if (this.cellValue) {
|
||||
value = toSafeLocalDateStr(this.cellValue)
|
||||
} else {
|
||||
value = '-'
|
||||
}
|
||||
// let value
|
||||
// if (this.cellValue) {
|
||||
// value = toSafeLocalDateStr(this.cellValue)
|
||||
// } else {
|
||||
// value = '-'
|
||||
// }
|
||||
// const locale = this.$i18n.locale
|
||||
// const value = dt.toLocaleString(locale, { hourCycle: 'h23' })
|
||||
// debug(this.$i18n.locale)
|
||||
return {
|
||||
value: value
|
||||
}
|
||||
// return {
|
||||
// value: value
|
||||
// }
|
||||
// return {
|
||||
// value: `${year}-${month}-${date} ${hour}:${minutes}:${seconds}`
|
||||
// }
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
dateValue() {
|
||||
if (this.cellValue) {
|
||||
return toSafeLocalDateStr(this.cellValue)
|
||||
} else {
|
||||
return '-'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div style="width: 100%;min-height: 20px" @click.stop="editCell">
|
||||
<div class="edit-container" style="min-height: 20px" @click.stop="editCell">
|
||||
<el-input
|
||||
v-if="inEditMode"
|
||||
ref="inputRef"
|
||||
v-model="value"
|
||||
class="editInput"
|
||||
size="mini"
|
||||
@@ -9,8 +10,17 @@
|
||||
@keyup.enter.native="onInputEnter"
|
||||
/>
|
||||
<template v-else>
|
||||
<span>{{ iCellValue }}</span>
|
||||
<span class="cellValue">{{ iCellValue }}</span>
|
||||
<a
|
||||
v-if="formatterArgs.showEditBtn"
|
||||
:class="[{ 'disabled-link': this.$store.getters.currentOrgIsRoot },'edit-btn']"
|
||||
style="padding-left: 5px"
|
||||
@click="editCell"
|
||||
>
|
||||
<i class="fa fa-edit" />
|
||||
</a>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -61,6 +71,9 @@ export default {
|
||||
editCell() {
|
||||
if (this.formatterArgs.canEdit) {
|
||||
this.inEditMode = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.inputRef.focus()
|
||||
})
|
||||
}
|
||||
},
|
||||
getCellValue(val) {
|
||||
@@ -88,7 +101,7 @@ export default {
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
.editInput ::v-deep .el-input__inner {
|
||||
padding: 2px;
|
||||
line-height: 12px;
|
||||
@@ -97,4 +110,35 @@ export default {
|
||||
.editInput {
|
||||
padding: -6px;
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
transition: all 1s;
|
||||
|
||||
& > i {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.edit-container {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
|
||||
&:hover {
|
||||
.edit-btn {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.cellValue {
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<span v-if="!iLabels || iLabels.length === 0" style="vertical-align: top;">
|
||||
-
|
||||
</span>
|
||||
<div v-else>
|
||||
<div
|
||||
<span v-else class="label-wrapper">
|
||||
<span
|
||||
v-for="label of iLabels"
|
||||
:key="label.id"
|
||||
>
|
||||
@@ -15,8 +15,9 @@
|
||||
class="tag-formatter"
|
||||
@click="handleLabelSearch(label)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span />
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
<a
|
||||
v-if="formatterArgs.showEditBtn"
|
||||
@@ -30,15 +31,16 @@
|
||||
v-if="showDialog"
|
||||
:title="$tc('BindLabel')"
|
||||
:visible.sync="showDialog"
|
||||
class="tag-dialog"
|
||||
width="600px"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
>
|
||||
<el-row :gutter="1" class="tag-select">
|
||||
<el-row class="tag-select">
|
||||
<el-col :span="12">
|
||||
<Select2 v-model="keySelect2.value" v-bind="keySelect2" @change="handleKeyChanged" />
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="12" style="padding-left: 5px">
|
||||
<Select2
|
||||
v-model="valueSelect2.value"
|
||||
:disabled="!keySelect2.value"
|
||||
@@ -207,18 +209,11 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
|
||||
& > span {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-select {
|
||||
::v-deep .el-input__inner::placeholder {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-btn {
|
||||
visibility: hidden;
|
||||
position: relative;
|
||||
@@ -233,9 +228,14 @@ export default {
|
||||
|
||||
.label-container {
|
||||
display: flex;
|
||||
height: 28px;
|
||||
|
||||
.label-formatter-col {
|
||||
overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
@@ -249,15 +249,23 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.tag-zone {
|
||||
margin: 20px 0 0 0;
|
||||
border: solid 1px #ebeef5;
|
||||
padding: 10px;
|
||||
background: #f2f2f5;
|
||||
.tag-dialog {
|
||||
.tag-zone {
|
||||
margin: 20px 0 0 0;
|
||||
border: solid 1px #ebeef5;
|
||||
padding: 10px;
|
||||
background: #f2f2f5;
|
||||
|
||||
.tag-formatter {
|
||||
margin: 1px 3px;
|
||||
display: inline-block;
|
||||
.tag-formatter {
|
||||
margin: 1px 3px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.tag-select {
|
||||
::v-deep .el-input__inner::placeholder {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,7 +278,6 @@ export default {
|
||||
|
||||
.tag-formatter {
|
||||
margin: 2px 0;
|
||||
|
||||
}
|
||||
|
||||
.tag-tip {
|
||||
|
||||
@@ -55,8 +55,9 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tag {
|
||||
display: flex;
|
||||
display: inline-block;
|
||||
flex-wrap: wrap;
|
||||
|
||||
& > span {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -234,12 +234,10 @@ export default {
|
||||
delete routeFilter.search
|
||||
}
|
||||
const asFilterTags = _.cloneDeep(this.filterTags)
|
||||
setTimeout(() => {
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
}, 100)
|
||||
this.filterTags = {
|
||||
...asFilterTags,
|
||||
...routeFilter
|
||||
}
|
||||
},
|
||||
getValueLabel(key, value) {
|
||||
for (const field of this.options) {
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
showRenameBtn: false,
|
||||
drag: {
|
||||
isCopy: false,
|
||||
isMove: true
|
||||
isMove: !this.$store.getters.currentOrgIsRoot
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
|
||||
@@ -35,13 +35,29 @@ export default {
|
||||
]),
|
||||
announcement() {
|
||||
const ann = this.publicSettings.ANNOUNCEMENT
|
||||
return { id: ann['ID'], subject: ann['SUBJECT'], content: ann['CONTENT'], link: ann['LINK'] }
|
||||
return {
|
||||
id: ann['ID'],
|
||||
subject: ann['SUBJECT'],
|
||||
content: ann['CONTENT'],
|
||||
link: ann['LINK'],
|
||||
date_start: ann['DATE_START'],
|
||||
date_end: ann['DATE_END']
|
||||
}
|
||||
},
|
||||
enabled() {
|
||||
return this.publicSettings.ANNOUNCEMENT_ENABLED && (this.announcement.content || this.announcement.subject)
|
||||
return this.publicSettings.ANNOUNCEMENT_ENABLED && (this.announcement.content || this.announcement.subject) && this.isDateValid
|
||||
},
|
||||
title() {
|
||||
return this.$t('Announcement') + ': ' + this.announcement.subject
|
||||
},
|
||||
isDateValid() {
|
||||
if (this.announcement.date_start === undefined || this.announcement.date_end === undefined) {
|
||||
return true
|
||||
}
|
||||
const now = new Date()
|
||||
const start = new Date(this.announcement.date_start)
|
||||
const end = new Date(this.announcement.date_end)
|
||||
return now >= start && now <= end
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -33,11 +33,13 @@ export default {
|
||||
query[k] = v
|
||||
}
|
||||
|
||||
let key
|
||||
if (this.$route.name.toLowerCase().includes('list')) {
|
||||
return _.trimEnd(this.$route.path, '/') + '?' + new URLSearchParams(query).toString()
|
||||
key = _.trimEnd(this.$route.path, '/') + '?' + new URLSearchParams(query).toString()
|
||||
} else {
|
||||
return new Date().getTime()
|
||||
key = new Date().getTime()
|
||||
}
|
||||
return key
|
||||
},
|
||||
chatAiEnabled() {
|
||||
return this.publicSettings?.CHAT_AI_ENABLED
|
||||
|
||||
@@ -59,18 +59,22 @@ export default {
|
||||
this.$router.push({ name: 'Profile' })
|
||||
break
|
||||
case 'PasswordAndSSHKey':
|
||||
this.$router.push({ name: 'PasswordAndSSHKey' })
|
||||
this.$router.push({ name: 'SSHKeyList' })
|
||||
break
|
||||
case 'Preferences':
|
||||
this.$router.push({ name: 'Preferences' })
|
||||
break
|
||||
case 'logout':
|
||||
this.logout()
|
||||
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
|
||||
break
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
async logout() {
|
||||
const currentOrg = this.$store.getters.currentOrg
|
||||
if (currentOrg.autoEnter) {
|
||||
await this.$store.dispatch('users/setCurrentOrg', this.$store.getters.preOrg)
|
||||
}
|
||||
window.location.href = `${process.env.VUE_APP_LOGOUT_PATH}?next=${this.$route.fullPath}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<span class="msg-detail-time">{{ formatDate(currentMsg.date_created) }}</span>
|
||||
</div>
|
||||
<div class="msg-detail-txt">
|
||||
<span v-sanitize="currentMsg.content.message" />
|
||||
<MarkDown :value="currentMsg.content.message" />
|
||||
</div>
|
||||
</div>
|
||||
</Dialog>
|
||||
@@ -80,10 +80,14 @@
|
||||
<script>
|
||||
import { toSafeLocalDateStr } from '@/utils/time'
|
||||
import Dialog from '@/components/Dialog'
|
||||
import MarkDown from '@/components/Widgets/MarkDown'
|
||||
|
||||
export default {
|
||||
name: 'SiteMessages',
|
||||
components: { Dialog },
|
||||
components: {
|
||||
Dialog,
|
||||
MarkDown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
methods: {
|
||||
async handleSelectView(key, keyPath) {
|
||||
const routeName = this.viewsMapper[key] || '/'
|
||||
localStorage.setItem('PreView', key)
|
||||
localStorage.setItem('preView', key)
|
||||
// Next 之前要重置 init 状态,否则这些路由守卫就不走了
|
||||
await store.dispatch('app/reset')
|
||||
if (!this.tipHasRead) {
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<el-alert v-if="helpMessage" type="success">
|
||||
<span v-sanitize="helpMessage" class="announcement-main" />
|
||||
</el-alert>
|
||||
<transition v-if="!loading" appear mode="out-in" name="fade-transform">
|
||||
<transition appear mode="out-in" name="fade-transform">
|
||||
<slot>
|
||||
<keep-alive>
|
||||
<component :is="computeActiveComponent" />
|
||||
@@ -83,16 +83,18 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
toSentenceCase: toSentenceCase
|
||||
loading: false,
|
||||
toSentenceCase: toSentenceCase,
|
||||
activeTab: this.activeMenu
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iActiveMenu: {
|
||||
get() {
|
||||
return this.activeMenu
|
||||
return this.activeTab
|
||||
},
|
||||
set(item) {
|
||||
this.activeTab = item
|
||||
this.$emit('update:activeMenu', item)
|
||||
}
|
||||
},
|
||||
@@ -119,16 +121,13 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
$route(to, from) {
|
||||
const activeTab = to.query?.tab
|
||||
if (activeTab && this.iActiveMenu !== activeTab) {
|
||||
this.iActiveMenu = activeTab
|
||||
}
|
||||
// 好像没必要
|
||||
// const activeTab = to.query?.tab
|
||||
// if (activeTab && this.iActiveMenu !== activeTab) {
|
||||
// this.iActiveMenu = activeTab
|
||||
// }
|
||||
}
|
||||
},
|
||||
activated() {
|
||||
this.iActiveMenu = this.getPropActiveTab()
|
||||
this.loading = false
|
||||
},
|
||||
created() {
|
||||
this.iActiveMenu = this.getPropActiveTab()
|
||||
this.loading = false
|
||||
@@ -136,15 +135,8 @@ export default {
|
||||
methods: {
|
||||
handleTabClick(tab) {
|
||||
this.$emit('tab-click', tab)
|
||||
this.$emit('update:activeMenu', tab.name)
|
||||
|
||||
this.iActiveMenu = tab.name
|
||||
this.$cookie.set(this.$route.path, tab.name, 1)
|
||||
|
||||
if (this.$router.currentRoute.query[this.$route.path]) {
|
||||
this.$router.push({
|
||||
query: { ...this.$route.query, [this.$route.path]: '' }
|
||||
})
|
||||
}
|
||||
},
|
||||
getPropActiveTab() {
|
||||
let activeTab = ''
|
||||
|
||||
@@ -201,7 +201,7 @@ export default [
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('CommandGroupDetail'),
|
||||
activeMenu: ''
|
||||
activeMenu: '/console/perms/acls/cmd-acls'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -28,13 +28,39 @@ export default {
|
||||
},
|
||||
{
|
||||
path: '/profile/password-and-ssh-key',
|
||||
name: 'PasswordAndSSHKey',
|
||||
component: () => import('@/views/profile/PasswordAndSSHKey/index'),
|
||||
component: empty,
|
||||
meta: {
|
||||
title: i18n.t('PasswordAndSSHKey'),
|
||||
icon: 'personal',
|
||||
permissions: []
|
||||
}
|
||||
icon: 'personal'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/profile/PasswordAndSSHKey/index'),
|
||||
name: 'SSHKeyList',
|
||||
icon: 'key',
|
||||
meta: { title: i18n.t('PasswordAndSSHKey'), permissions: ['authentication.view_sshkey'] }
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
component: () => import('@/views/profile/PasswordAndSSHKey/SSHKey/SSHKeyCreateUpdate.vue'),
|
||||
name: 'SSHKeyCreate',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('SSHKey'),
|
||||
permissions: ['authentication.add_sshkey']
|
||||
}
|
||||
},
|
||||
{
|
||||
path: ':id/update',
|
||||
component: () => import('@/views/profile/PasswordAndSSHKey/SSHKey/SSHKeyCreateUpdate.vue'),
|
||||
name: 'SSHKeyUpdate',
|
||||
hidden: true,
|
||||
meta: {
|
||||
title: i18n.t('SSHKey'),
|
||||
permissions: ['authentication.change_sshkey']
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/profile/passkeys',
|
||||
|
||||
@@ -586,3 +586,10 @@ li.rmenu i.fa {
|
||||
color: var(--color-link);
|
||||
}
|
||||
}
|
||||
|
||||
.el-table__row {
|
||||
::-webkit-scrollbar {
|
||||
width: 6px; /* 设置垂直滚动条的宽度 */
|
||||
height: 6px; /* 设置水平滚动条的高度 */
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,15 +112,15 @@
|
||||
background: url('./icons/gpt.png') no-repeat center left transparent;
|
||||
}
|
||||
|
||||
&.WebCloud_ico_docu {
|
||||
background: url('icons/cloud.png') no-repeat center left transparent;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
&.clickhouse_ico_docu {
|
||||
background: url('./icons/clickhouse.png') no-repeat center left transparent;
|
||||
}
|
||||
|
||||
&.WebCloud_ico_docu {
|
||||
background: url('./icons/cloud.png') no-repeat center left transparent;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
&.ico_loading {
|
||||
background: url(./icons/loading.gif) no-repeat scroll 0 0 transparent;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import VueCookie from 'vue-cookie'
|
||||
|
||||
const CURRENT_ORG_KEY = 'jms_current_org'
|
||||
const CURRENT_ROLE_KEY = 'jms_current_role'
|
||||
const CURRENT_ORG_KEY = 'currentOrg'
|
||||
const CURRENT_ROLE_KEY = 'currentRole'
|
||||
let cookieNamePrefix = VueCookie.get('SESSION_COOKIE_NAME_PREFIX')
|
||||
if (!cookieNamePrefix || ['""', "''"].indexOf(cookieNamePrefix) > -1) {
|
||||
cookieNamePrefix = ''
|
||||
@@ -17,7 +17,7 @@ export function setTokenToCookie(value, expires) {
|
||||
}
|
||||
|
||||
export function getCurrentRoleLocal(username) {
|
||||
const key = CURRENT_ROLE_KEY + '_' + username
|
||||
const key = CURRENT_ROLE_KEY + ':' + username
|
||||
const role = localStorage.getItem(key)
|
||||
if (role) {
|
||||
return parseInt(role) || null
|
||||
@@ -26,12 +26,12 @@ export function getCurrentRoleLocal(username) {
|
||||
}
|
||||
|
||||
export function saveCurrentRoleLocal(username, role) {
|
||||
const key = CURRENT_ROLE_KEY + '_' + username
|
||||
const key = CURRENT_ROLE_KEY + ':' + username
|
||||
return localStorage.setItem(key, role)
|
||||
}
|
||||
|
||||
export function getCurrentOrgLocal(username) {
|
||||
const key = CURRENT_ORG_KEY + '_' + username
|
||||
const key = CURRENT_ORG_KEY + ':' + username
|
||||
const value = localStorage.getItem(key)
|
||||
try {
|
||||
return JSON.parse(value)
|
||||
@@ -41,18 +41,18 @@ export function getCurrentOrgLocal(username) {
|
||||
}
|
||||
|
||||
export function saveCurrentOrgLocal(username, org) {
|
||||
const key = CURRENT_ORG_KEY + '_' + username
|
||||
const key = CURRENT_ORG_KEY + ':' + username
|
||||
localStorage.setItem(key, JSON.stringify(org))
|
||||
VueCookie.set('X-JMS-ORG', org.id)
|
||||
}
|
||||
|
||||
export function setPreOrgLocal(username, org) {
|
||||
const key = 'PRE_ORG_' + username
|
||||
const key = 'preOrg' + ':' + username
|
||||
localStorage.setItem(key, JSON.stringify(org))
|
||||
}
|
||||
|
||||
export function getPreOrgLocal(username) {
|
||||
const key = 'PRE_ORG_' + username
|
||||
const key = 'preOrg' + ':' + username
|
||||
const value = localStorage.getItem(key)
|
||||
try {
|
||||
return JSON.parse(value)
|
||||
|
||||
@@ -26,7 +26,8 @@ Object.assign(Table.components.TableBody.methods, {
|
||||
const range = document.createRange()
|
||||
range.setStart(cellChild, 0)
|
||||
range.setEnd(cellChild, cellChild.childNodes.length)
|
||||
const rangeWidth = range.getBoundingClientRect().width
|
||||
// rangeWidth 有可能是小数,因此就会导致原本 rangeWidth + padding = cellChild.offsetWidth 的大于了 cellChild.offsetWidth
|
||||
const rangeWidth = Math.floor(range.getBoundingClientRect().width)
|
||||
const padding = (parseInt(getStyle(cellChild, 'paddingLeft'), 10) || 0) +
|
||||
(parseInt(getStyle(cellChild, 'paddingRight'), 10) || 0)
|
||||
if (
|
||||
|
||||
@@ -109,7 +109,7 @@ export function isSameView(to, from) {
|
||||
|
||||
export function getPropView() {
|
||||
const hasPermedViews = getPermedViews()
|
||||
const preView = localStorage.getItem('PreView')
|
||||
const preView = localStorage.getItem('preView')
|
||||
const hasPerm = hasPermedViews.indexOf(preView) > -1
|
||||
if (hasPerm) {
|
||||
return preView
|
||||
|
||||
@@ -3,7 +3,6 @@ import i18n from '@/i18n/i18n'
|
||||
import { eventBus } from '@/utils/const'
|
||||
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 store from '@/store'
|
||||
@@ -102,20 +101,6 @@ export function flashErrorMsg({ response, error }) {
|
||||
}
|
||||
}
|
||||
|
||||
let timer = null
|
||||
|
||||
function refreshSessionAgeDelay(response) {
|
||||
if (response.request.responseURL.indexOf('/users/profile/') !== -1) {
|
||||
return
|
||||
}
|
||||
if (timer) {
|
||||
clearTimeout(timer)
|
||||
}
|
||||
timer = setTimeout(function() {
|
||||
refreshSessionIdAge()
|
||||
}, 30 * 1000)
|
||||
}
|
||||
|
||||
function ifConfirmRequired({ response, error }) {
|
||||
if (response.status !== 412) {
|
||||
return null
|
||||
@@ -142,7 +127,6 @@ service.interceptors.response.use(
|
||||
*/
|
||||
response => {
|
||||
// NProgress.done()
|
||||
refreshSessionAgeDelay(response)
|
||||
const res = response.data
|
||||
store.dispatch('common/digestSQLQuery', response).then()
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@ async function checkLogin({ to, from, next }) {
|
||||
} catch (e) {
|
||||
Vue.$log.error(e)
|
||||
const status = e.response.status
|
||||
if (store.getters.currentOrg.autoEnter) {
|
||||
await store.dispatch('users/setCurrentOrg', store.getters.preOrg)
|
||||
}
|
||||
if (status === 401 || status === 403) {
|
||||
setTimeout(() => {
|
||||
window.location = process.env.VUE_APP_LOGIN_PATH
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
}
|
||||
},
|
||||
reviewers: {
|
||||
hidden: (item) => !['review', 'warning'].includes(item.action),
|
||||
hidden: (item) => !['review', 'warning', 'notify_and_warn'].includes(item.action),
|
||||
rules: [rules.RequiredChange],
|
||||
el: {
|
||||
value: [],
|
||||
|
||||
@@ -68,11 +68,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
activated() {
|
||||
setTimeout(() => {
|
||||
this.$refs.listTable.reloadTable()
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -32,15 +32,9 @@ export default {
|
||||
title: this.$t('Basic'),
|
||||
name: 'Detail'
|
||||
}
|
||||
],
|
||||
actions: {
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -53,11 +53,6 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -36,8 +36,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
handleTabClick(tab) {
|
||||
const query = _.cloneDeep(this.$route.query)
|
||||
|
||||
@@ -47,6 +47,7 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
platform: {},
|
||||
changePlatformID: '',
|
||||
defaultConfig: {
|
||||
initial: {},
|
||||
platform: {},
|
||||
@@ -131,7 +132,7 @@ export default {
|
||||
const { defaultConfig } = this
|
||||
const { node, platform } = this.$route?.query || {}
|
||||
const nodesInitial = node ? [node] : []
|
||||
const platformId = platform || 'Linux'
|
||||
const platformId = this.changePlatformID ? this.changePlatformID : (platform || 'Linux')
|
||||
const url = `/api/v1/assets/platforms/${platformId}/`
|
||||
this.platform = await this.$axios.get(url)
|
||||
const initial = {
|
||||
|
||||
@@ -25,17 +25,17 @@ export default {
|
||||
const platform = this.$route.query.type
|
||||
const baseFields = [[this.$t('Basic'), ['db_name']]]
|
||||
let tlsFields = ['use_ssl', 'ca_cert']
|
||||
switch (platform) {
|
||||
case 'redis':
|
||||
tlsFields = tlsFields.concat(['client_cert', 'client_key'])
|
||||
break
|
||||
case 'mysql':
|
||||
tlsFields = tlsFields.concat(['client_cert', 'client_key', 'allow_invalid_cert'])
|
||||
break
|
||||
case 'mongodb':
|
||||
tlsFields = tlsFields.concat(['client_key', 'allow_invalid_cert'])
|
||||
break
|
||||
const platformFieldsMap = {
|
||||
redis: ['client_cert', 'client_key'],
|
||||
postgresql: ['client_cert', 'client_key', 'allow_invalid_cert'],
|
||||
mysql: ['client_cert', 'client_key', 'allow_invalid_cert'],
|
||||
mongodb: ['client_key', 'allow_invalid_cert']
|
||||
}
|
||||
|
||||
if (platformFieldsMap[platform]) {
|
||||
tlsFields = tlsFields.concat(platformFieldsMap[platform])
|
||||
}
|
||||
|
||||
if (tlsFields.length > 2) {
|
||||
const secureField = [
|
||||
this.$t('Secure'), tlsFields, 2
|
||||
|
||||
@@ -60,7 +60,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: this.$t('QuickTest'),
|
||||
title: this.$t('Test'),
|
||||
templateDialogVisible: false,
|
||||
columnsDefault: ['name', 'username', 'asset'],
|
||||
headerExtraActions: [
|
||||
|
||||
@@ -22,15 +22,17 @@
|
||||
:key="platform.id"
|
||||
:span="6"
|
||||
>
|
||||
<el-card
|
||||
:style="{ borderLeftColor: randomBorderColor(index) }"
|
||||
class="platform-item"
|
||||
shadow="hover"
|
||||
@click.native="createAsset(platform)"
|
||||
>
|
||||
<img :src="loadImage(platform)" alt="icon" class="asset-icon">
|
||||
<span class="platform-name">{{ platform.name }}</span>
|
||||
</el-card>
|
||||
<el-tooltip :content="platform.name" :open-delay="1000">
|
||||
<el-card
|
||||
:style="{ borderLeftColor: randomBorderColor(index) }"
|
||||
class="platform-item"
|
||||
shadow="hover"
|
||||
@click.native="createAsset(platform)"
|
||||
>
|
||||
<img :src="loadImage(platform)" alt="icon" class="asset-icon">
|
||||
<span class="platform-name">{{ platform.name }}</span>
|
||||
</el-card>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
@@ -195,7 +197,11 @@ export default {
|
||||
margin: 5px 0;
|
||||
|
||||
& ::v-deep .el-card__body {
|
||||
padding: 10px
|
||||
padding: 10px;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
border-left: solid 4px;
|
||||
@@ -230,14 +236,16 @@ export default {
|
||||
}
|
||||
|
||||
.asset-icon {
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
vertical-align: -0.2em;
|
||||
fill: currentColor;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.platform-name {
|
||||
margin-left: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -89,14 +89,15 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleTabClick(tab) {
|
||||
const query = _.cloneDeep(this.$route.query)
|
||||
const newQuery = {
|
||||
...query,
|
||||
tab: tab.name
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$router.replace({ query: newQuery })
|
||||
})
|
||||
// 这样不行,会闪
|
||||
// const query = _.cloneDeep(this.$route.query)
|
||||
// const newQuery = {
|
||||
// ...query,
|
||||
// tab: tab.name
|
||||
// }
|
||||
// this.$nextTick(() => {
|
||||
// this.$router.replace({ query: newQuery })
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
},
|
||||
{
|
||||
key: this.$t('Region'),
|
||||
value: this.object.task?.regions,
|
||||
value: this.object.task?.regions_display,
|
||||
formatter(row, value) {
|
||||
return (<div>{
|
||||
value?.map((content) => {
|
||||
|
||||
@@ -64,8 +64,11 @@ export default {
|
||||
formatter: DateFormatter
|
||||
},
|
||||
{
|
||||
prop: 'summary.triggerMode',
|
||||
label: this.$t('TriggerMode')
|
||||
prop: 'trigger',
|
||||
label: this.$t('TriggerMode'),
|
||||
formatter: row => {
|
||||
return row.trigger.label
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'actions',
|
||||
|
||||
@@ -51,6 +51,7 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
console.log('ProviderPanel', this.providers)
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -73,6 +73,7 @@ export default {
|
||||
btn.loading = true
|
||||
}
|
||||
})
|
||||
form.value.interval = parseInt(form.value.interval, 10)
|
||||
this.$refs.form.$refs.form.dataForm.submitForm('form', false)
|
||||
},
|
||||
handleSubmitSuccess(res) {
|
||||
|
||||
@@ -31,6 +31,12 @@ export default {
|
||||
}
|
||||
],
|
||||
actions: {
|
||||
canUpdate: () => {
|
||||
return this.Account.name !== 'default'
|
||||
},
|
||||
canDelete: () => {
|
||||
return this.Account.name !== 'default'
|
||||
},
|
||||
deleteSuccessRoute: 'CloudAccountList',
|
||||
updateCallback: () => {
|
||||
const id = this.$route.params.id
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
detailFields: [
|
||||
'name', 'assets_amount',
|
||||
{
|
||||
key: this.$t('Gateways amount'),
|
||||
key: this.$t('Gateway'),
|
||||
value: `${this.object.gateways.length}`
|
||||
},
|
||||
'date_created', 'comment'
|
||||
|
||||
@@ -11,11 +11,10 @@ export default {
|
||||
BaseAssetCreateUpdate
|
||||
},
|
||||
data() {
|
||||
const platformType = this.$route.query.platform_type
|
||||
return {
|
||||
url: '/api/v1/assets/gateways/',
|
||||
updateInitial: async(initial) => {
|
||||
const url = `/api/v1/assets/platforms/?name=Gateway`
|
||||
const url = `/api/v1/assets/platforms/?name__startswith=Gateway`
|
||||
const platform = await this.$axios.get(url)
|
||||
initial.platform = parseInt(platform[0].id)
|
||||
initial.domain = this.$route.query.domain
|
||||
@@ -26,11 +25,11 @@ export default {
|
||||
disabled: true
|
||||
},
|
||||
platform: {
|
||||
disabled: true,
|
||||
helpText: this.$t('GatewayPlatformHelpText'),
|
||||
el: {
|
||||
multiple: false,
|
||||
ajax: {
|
||||
url: `/api/v1/assets/platforms/?type=${platformType}`,
|
||||
url: `/api/v1/assets/platforms/?name__startswith=Gateway`,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name, value: item.id }
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<script>
|
||||
import Dialog from '@/components/Dialog'
|
||||
import AutoDataForm from '@/components/Form/AutoDataForm'
|
||||
import { DynamicInput } from '@/components/Form/FormFields'
|
||||
import { DynamicInput, Switcher } from '@/components/Form/FormFields'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -145,6 +145,9 @@ export default {
|
||||
case 'list':
|
||||
component = DynamicInput
|
||||
break
|
||||
case 'boolean':
|
||||
component = Switcher
|
||||
break
|
||||
}
|
||||
|
||||
if (param) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<template>
|
||||
<BaseList v-bind="tableConfig" />
|
||||
<BaseList v-bind="config" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import BaseList from '../../Asset/AssetList/components/BaseList'
|
||||
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -12,20 +13,34 @@ export default {
|
||||
props: {
|
||||
object: {
|
||||
type: Object,
|
||||
default: () => { }
|
||||
default: () => {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableConfig: {
|
||||
config: {
|
||||
category: 'all',
|
||||
url: `/api/v1/assets/assets/?platform=${this.object.id}`,
|
||||
tableConfig: {
|
||||
columnsMeta: {
|
||||
name: {
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: false
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
has: false
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasCreate: false,
|
||||
hasRefresh: true,
|
||||
hasRefresh: false,
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
hasMoreActions: true
|
||||
hasMoreActions: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<script>
|
||||
import { GenericListTable, TabPage } from '@/layout/components'
|
||||
import { ChoicesFormatter, ProtocolsFormatter } from '../../../components/Table/TableFormatters'
|
||||
import AmountFormatter from '@/components/Table/TableFormatters/AmountFormatter.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -35,9 +36,28 @@ export default {
|
||||
columnsExclude: ['automation'],
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'category', 'type', 'actions']
|
||||
default: ['name', 'assets_amount', 'category', 'type', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
assets_amount: {
|
||||
width: '160px',
|
||||
formatter: AmountFormatter,
|
||||
formatterArgs: {
|
||||
async: true,
|
||||
permissions: 'assets.view_asset',
|
||||
getRoute({ row }) {
|
||||
return {
|
||||
name: 'PlatformDetail',
|
||||
params: {
|
||||
id: row.id
|
||||
},
|
||||
query: {
|
||||
tab: 'Assets'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
type: {
|
||||
formatter: ChoicesFormatter
|
||||
},
|
||||
@@ -72,7 +92,10 @@ export default {
|
||||
width: '140px'
|
||||
},
|
||||
internal: {
|
||||
width: '100px'
|
||||
width: '100px',
|
||||
formatterArgs: {
|
||||
showFalse: false
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
formatterArgs: {
|
||||
|
||||
@@ -29,10 +29,10 @@ export const filterSelectValues = (values) => {
|
||||
function updatePlatformProtocols(vm, platformType, updateForm, isPlatformChanged = false) {
|
||||
setTimeout(() => vm.init().then(() => {
|
||||
const isCreate = vm?.$route?.meta.action === 'create' && vm?.$route?.query.clone_from === undefined
|
||||
const need_modify = isCreate || isPlatformChanged
|
||||
const platformProtocols = vm.platform.protocols
|
||||
if (!need_modify) return
|
||||
if (platformType === 'website') {
|
||||
const need_modify = isCreate || isPlatformChanged
|
||||
if (!need_modify) return
|
||||
const platformProtocols = vm.platform.protocols
|
||||
const setting = Array.isArray(platformProtocols) ? platformProtocols[0].setting : platformProtocols.setting
|
||||
updateForm({
|
||||
'autofill': setting.autofill ? setting.autofill : 'basic',
|
||||
@@ -42,6 +42,8 @@ function updatePlatformProtocols(vm, platformType, updateForm, isPlatformChanged
|
||||
'username_selector': setting.username_selector
|
||||
})
|
||||
}
|
||||
vm.iConfig.fieldsMeta.protocols.el.choices = platformProtocols.map(item => ({ name: item.name, port: item.port }))
|
||||
updateForm({ protocols: [] })
|
||||
}), 100)
|
||||
}
|
||||
|
||||
@@ -100,12 +102,10 @@ export const assetFieldsMeta = (vm) => {
|
||||
change: ([event], updateForm) => {
|
||||
const pk = event.pk
|
||||
const url = window.location.href
|
||||
const newURL = url.replace(/platform=[^&]*/, 'platform=' + pk)
|
||||
|
||||
vm.changePlatformID = pk
|
||||
if (url.includes('clone')) {
|
||||
updatePlatformProtocols(vm, platformType, updateForm, true)
|
||||
} else {
|
||||
window.history.replaceState(null, null, newURL)
|
||||
vm.$nextTick(() => {
|
||||
updatePlatformProtocols(vm, platformType, updateForm, true)
|
||||
})
|
||||
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
width: '60%',
|
||||
tableConfig: {
|
||||
hasSelection: false,
|
||||
url: `/api/v1/ops/adhocs/`,
|
||||
url: `/api/v1/ops/adhocs/?only_mine=true`,
|
||||
columns: ['name', 'module', 'args', 'comment', 'actions'],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
|
||||
@@ -120,11 +120,21 @@ export default {
|
||||
autoComplete: true,
|
||||
query: (query, cb) => {
|
||||
const { hosts, nodes } = this.getSelectedNodesAndHosts()
|
||||
|
||||
if (hosts.length === 0) {
|
||||
this.$message.warning(`${this.$t('RequiredAssetOrNode')}`)
|
||||
return cb([])
|
||||
}
|
||||
|
||||
this.$axios.post('/api/v1/ops/username-hints/', {
|
||||
nodes: nodes,
|
||||
assets: hosts,
|
||||
query: query
|
||||
}).then(data => {
|
||||
if (Array.isArray(data) && data.length === 0) {
|
||||
this.$message.info(`${this.$t('NoAccountFound')}`)
|
||||
return cb([])
|
||||
}
|
||||
const ns = data.map(item => {
|
||||
return { value: item.username }
|
||||
})
|
||||
@@ -470,9 +480,9 @@ $container-bg-color: #f7f7f7;
|
||||
flex-direction: column;
|
||||
|
||||
.xterm-container {
|
||||
margin-left: 30px;
|
||||
height: calc(100vh - 549px);
|
||||
min-height: 255px;
|
||||
margin-left: 30px;
|
||||
border: 1px solid var(--color-border);
|
||||
border-radius: 5px;
|
||||
background-color: $container-bg-color;
|
||||
|
||||
@@ -83,7 +83,7 @@ export default {
|
||||
multiple: false,
|
||||
value: [],
|
||||
ajax: {
|
||||
url: '/api/v1/ops/playbooks/',
|
||||
url: `/api/v1/ops/playbooks/?only_mine=true`,
|
||||
transformOption: (item) => {
|
||||
return { label: item.name, value: item.id }
|
||||
}
|
||||
|
||||
129
src/views/ops/Job/components/Adhoc.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
||||
<JobRunDialog v-if="showJobRunDialog" :item="item" :visible.sync="showJobRunDialog" @submit="runJob" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JobRunDialog from '@/views/ops/Job/JobRunDialog'
|
||||
import GenericListTable from '@/layout/components/GenericListTable'
|
||||
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
import { ActionsFormatter, DateFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericListTable,
|
||||
JobRunDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
item: {},
|
||||
tableConfig: {
|
||||
url: '/api/v1/ops/jobs/?type=adhoc',
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'name', 'type', 'asset_amount', 'average_time_cost',
|
||||
'summary', 'date_last_run', 'actions'
|
||||
]
|
||||
},
|
||||
columns: [
|
||||
'name', 'type', 'summary', 'average_time_cost', 'asset_amount',
|
||||
'date_last_run', 'comment', 'date_updated', 'date_created', 'actions'
|
||||
],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
width: '140px',
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: true,
|
||||
getRoute: ({ row }) => ({
|
||||
name: 'JobDetail',
|
||||
params: { id: row.id }
|
||||
})
|
||||
}
|
||||
},
|
||||
type: {
|
||||
width: '96px',
|
||||
formatter: (row) => {
|
||||
return row.type.label
|
||||
}
|
||||
},
|
||||
comment: {
|
||||
width: '240px'
|
||||
},
|
||||
summary: {
|
||||
label: this.$t('Summary'),
|
||||
formatter: (row) => {
|
||||
return row.summary['success'] + '/' + row.summary['total']
|
||||
}
|
||||
},
|
||||
average_time_cost: {
|
||||
formatter: (row) => {
|
||||
return row.average_time_cost.toFixed(2) + 's'
|
||||
}
|
||||
},
|
||||
asset_amount: {
|
||||
label: this.$t('AssetsOfNumber'),
|
||||
formatter: (row) => {
|
||||
return row.assets.length
|
||||
}
|
||||
},
|
||||
date_last_run: {
|
||||
width: '140px',
|
||||
formatter: DateFormatter
|
||||
},
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: true,
|
||||
canUpdate: this.$hasPerm('ops.change_job') && !this.$store.getters.currentOrgIsRoot,
|
||||
updateRoute: 'JobUpdate',
|
||||
hasDelete: true,
|
||||
canDelete: this.$hasPerm('ops.delete_job'),
|
||||
hasClone: false,
|
||||
extraActions: [
|
||||
{
|
||||
title: this.$t('Run'),
|
||||
name: 'run',
|
||||
can: this.$hasPerm('ops.add_jobexecution') && !this.$store.getters.currentOrgIsRoot,
|
||||
callback: ({ row }) => {
|
||||
if (row?.use_parameter_define && row?.parameters_define) {
|
||||
const params = JSON.parse(row.parameters_define)
|
||||
if (Object.keys(params).length > 0) {
|
||||
this.item = row
|
||||
this.showJobRunDialog = true
|
||||
}
|
||||
} else {
|
||||
this.runJob(row)
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
createRoute: 'JobCreate',
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false
|
||||
},
|
||||
showJobRunDialog: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
runJob(row, parameters) {
|
||||
this.$axios.post('/api/v1/ops/job-executions/', {
|
||||
job: row.id,
|
||||
parameters: parameters
|
||||
}).then((resp) => {
|
||||
openTaskPage(resp.task_id)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
136
src/views/ops/Job/components/PlayBook.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
|
||||
<JobRunDialog v-if="showJobRunDialog" :item="item" :visible.sync="showJobRunDialog" @submit="runJob" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import JobRunDialog from '@/views/ops/Job/JobRunDialog'
|
||||
import GenericListTable from '@/layout/components/GenericListTable'
|
||||
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
import { ActionsFormatter, DateFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
GenericListTable,
|
||||
JobRunDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
item: {},
|
||||
tableConfig: {
|
||||
url: '/api/v1/ops/jobs/?type=playbook',
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'name', 'type', 'asset_amount', 'average_time_cost',
|
||||
'summary', 'date_last_run', 'actions'
|
||||
]
|
||||
},
|
||||
columns: [
|
||||
'name', 'type', 'summary', 'average_time_cost', 'asset_amount',
|
||||
'date_last_run', 'comment', 'date_updated', 'date_created', 'actions'
|
||||
],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
width: '140px',
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: true,
|
||||
getRoute: ({ row }) => ({
|
||||
name: 'JobDetail',
|
||||
params: { id: row.id }
|
||||
})
|
||||
}
|
||||
},
|
||||
type: {
|
||||
width: '96px',
|
||||
formatter: (row) => {
|
||||
return row.type.label
|
||||
}
|
||||
},
|
||||
comment: {
|
||||
width: '240px'
|
||||
},
|
||||
summary: {
|
||||
label: this.$t('Summary'),
|
||||
formatter: (row) => {
|
||||
return row.summary['success'] + '/' + row.summary['total']
|
||||
}
|
||||
},
|
||||
average_time_cost: {
|
||||
formatter: (row) => {
|
||||
return row.average_time_cost.toFixed(2) + 's'
|
||||
}
|
||||
},
|
||||
asset_amount: {
|
||||
label: this.$t('AssetsOfNumber'),
|
||||
formatter: (row) => {
|
||||
return row.assets.length
|
||||
}
|
||||
},
|
||||
date_last_run: {
|
||||
width: '140px',
|
||||
formatter: DateFormatter
|
||||
},
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: true,
|
||||
canUpdate: this.$hasPerm('ops.change_job') && !this.$store.getters.currentOrgIsRoot,
|
||||
updateRoute: 'JobUpdate',
|
||||
hasDelete: true,
|
||||
canDelete: this.$hasPerm('ops.delete_job'),
|
||||
hasClone: false,
|
||||
extraActions: [
|
||||
{
|
||||
title: this.$t('Run'),
|
||||
name: 'run',
|
||||
can: this.$hasPerm('ops.add_jobexecution') && !this.$store.getters.currentOrgIsRoot,
|
||||
callback: ({ row }) => {
|
||||
if (row?.use_parameter_define && row?.parameters_define) {
|
||||
const params = JSON.parse(row.parameters_define)
|
||||
if (Object.keys(params).length > 0) {
|
||||
this.item = row
|
||||
this.showJobRunDialog = true
|
||||
}
|
||||
} else {
|
||||
this.runJob(row)
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
createRoute: () => {
|
||||
return {
|
||||
name: 'JobCreate',
|
||||
query: {
|
||||
type: 'playbook'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
showJobRunDialog: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
runJob(row, parameters) {
|
||||
this.$axios.post('/api/v1/ops/job-executions/', {
|
||||
job: row.id,
|
||||
parameters: parameters
|
||||
}).then((resp) => {
|
||||
openTaskPage(resp.task_id)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,151 +1,39 @@
|
||||
<template>
|
||||
<div>
|
||||
<JobRunDialog v-if="showJobRunDialog" :item="item" :visible.sync="showJobRunDialog" @submit="runJob" />
|
||||
<GenericListPage :header-actions="headerActions" :table-config="tableConfig" />
|
||||
</div>
|
||||
<TabPage
|
||||
:active-menu.sync="activeMenu"
|
||||
:submenu="submenu"
|
||||
>
|
||||
<component :is="activeMenu" />
|
||||
</TabPage>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import GenericListPage from '@/layout/components/GenericListPage'
|
||||
import { ActionsFormatter, DateFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
|
||||
import JobRunDialog from '@/views/ops/Job/JobRunDialog'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
import Adhoc from './components/Adhoc.vue'
|
||||
import Playbook from './components/PlayBook.vue'
|
||||
import TabPage from '@/layout/components/TabPage/index.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
JobRunDialog,
|
||||
GenericListPage
|
||||
Adhoc,
|
||||
TabPage,
|
||||
Playbook
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
item: {},
|
||||
runtime_parameters: {},
|
||||
showJobRunDialog: false,
|
||||
tableConfig: {
|
||||
url: '/api/v1/ops/jobs/',
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: [
|
||||
'name', 'type', 'asset_amount', 'average_time_cost',
|
||||
'summary', 'date_last_run', 'actions'
|
||||
]
|
||||
activeMenu: 'Adhoc',
|
||||
submenu: [
|
||||
{
|
||||
title: this.$t('AdhocManage'),
|
||||
name: 'Adhoc',
|
||||
hidden: () => !this.$hasPerm('ops.view_adhoc')
|
||||
},
|
||||
columns: [
|
||||
'name', 'type', 'summary', 'average_time_cost', 'asset_amount',
|
||||
'date_last_run', 'comment', 'date_updated', 'date_created', 'actions'
|
||||
],
|
||||
columnsMeta: {
|
||||
name: {
|
||||
width: '140px',
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
can: true,
|
||||
getRoute: ({ row }) => ({
|
||||
name: 'JobDetail',
|
||||
params: { id: row.id }
|
||||
})
|
||||
}
|
||||
},
|
||||
type: {
|
||||
width: '96px',
|
||||
formatter: (row) => {
|
||||
return row.type.label
|
||||
}
|
||||
},
|
||||
comment: {
|
||||
width: '240px'
|
||||
},
|
||||
summary: {
|
||||
label: this.$t('Summary'),
|
||||
formatter: (row) => {
|
||||
return row.summary['success'] + '/' + row.summary['total']
|
||||
}
|
||||
},
|
||||
average_time_cost: {
|
||||
formatter: (row) => {
|
||||
return row.average_time_cost.toFixed(2) + 's'
|
||||
}
|
||||
},
|
||||
asset_amount: {
|
||||
label: this.$t('AssetsOfNumber'),
|
||||
formatter: (row) => {
|
||||
return row.assets.length
|
||||
}
|
||||
},
|
||||
date_last_run: {
|
||||
width: '140px',
|
||||
formatter: DateFormatter
|
||||
},
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: true,
|
||||
canUpdate: this.$hasPerm('ops.change_job') && !this.$store.getters.currentOrgIsRoot,
|
||||
updateRoute: 'JobUpdate',
|
||||
hasDelete: true,
|
||||
canDelete: this.$hasPerm('ops.delete_job'),
|
||||
hasClone: false,
|
||||
extraActions: [
|
||||
{
|
||||
title: this.$t('Run'),
|
||||
name: 'run',
|
||||
can: this.$hasPerm('ops.add_jobexecution') && !this.$store.getters.currentOrgIsRoot,
|
||||
callback: ({ row }) => {
|
||||
if (row?.use_parameter_define && row?.parameters_define) {
|
||||
const params = JSON.parse(row.parameters_define)
|
||||
if (Object.keys(params).length > 0) {
|
||||
this.item = row
|
||||
this.showJobRunDialog = true
|
||||
}
|
||||
} else {
|
||||
this.runJob(row)
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
{
|
||||
title: this.$t('PlaybookManage'),
|
||||
name: 'Playbook',
|
||||
hidden: () => !this.$hasPerm('ops.view_playbook')
|
||||
}
|
||||
},
|
||||
headerActions: {
|
||||
createRoute: 'JobCreate',
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
moreCreates: {
|
||||
callback: (item) => {
|
||||
this.$router.push({
|
||||
name: 'JobCreate',
|
||||
query: { type: item.name }
|
||||
})
|
||||
},
|
||||
dropdown: [
|
||||
{
|
||||
name: 'adhoc',
|
||||
title: this.$t('Command')
|
||||
},
|
||||
{
|
||||
name: 'playbook',
|
||||
title: 'Playbook'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
runJob(row, parameters) {
|
||||
this.$axios.post('/api/v1/ops/job-executions/', {
|
||||
job: row.id,
|
||||
parameters: parameters
|
||||
}).then((resp) => {
|
||||
openTaskPage(resp.task_id)
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -11,12 +11,13 @@ export default {
|
||||
GenericListTable
|
||||
},
|
||||
data() {
|
||||
const currentUserID = this.$store.state.users.profile.id
|
||||
return {
|
||||
tableConfig: {
|
||||
url: '/api/v1/ops/adhocs/',
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'module', 'args', 'comment', 'date_created', 'actions']
|
||||
default: ['name', 'module', 'args', 'comment', 'scope', 'date_created', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
name: {
|
||||
@@ -29,10 +30,14 @@ export default {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: true,
|
||||
canUpdate: this.$hasPerm('ops.change_adhoc'),
|
||||
canUpdate: ({ row }) => {
|
||||
return this.$hasPerm('ops.change_adhoc') && row.creator === currentUserID
|
||||
},
|
||||
updateRoute: 'AdhocUpdate',
|
||||
hasDelete: true,
|
||||
canDelete: this.$hasPerm('ops.delete_adhoc'),
|
||||
canDelete: ({ row }) => {
|
||||
return this.$hasPerm('ops.delete_adhoc') && row.creator === currentUserID
|
||||
},
|
||||
hasClone: false
|
||||
}
|
||||
}
|
||||
@@ -49,7 +54,3 @@ export default {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -14,7 +14,7 @@ export default {
|
||||
return {
|
||||
url: '/api/v1/ops/adhocs/',
|
||||
fields: [
|
||||
[this.$t('Basic'), ['name', 'module', 'args', 'comment']]
|
||||
[this.$t('Basic'), ['name', 'module', 'args', 'comment', 'scope']]
|
||||
],
|
||||
initial: {
|
||||
module: 'shell',
|
||||
|
||||
@@ -16,6 +16,7 @@ export default {
|
||||
GenericListTable
|
||||
},
|
||||
data() {
|
||||
const currentUserID = this.$store.state.users.profile.id
|
||||
return {
|
||||
createDialogVisible: false,
|
||||
uploadDialogVisible: false,
|
||||
@@ -23,7 +24,7 @@ export default {
|
||||
url: '/api/v1/ops/playbooks/',
|
||||
columnsShow: {
|
||||
min: ['name', 'actions'],
|
||||
default: ['name', 'comment', 'date_created', 'actions']
|
||||
default: ['name', 'comment', 'scope', 'date_created', 'actions']
|
||||
},
|
||||
columnsMeta: {
|
||||
name: {
|
||||
@@ -36,11 +37,15 @@ export default {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
hasUpdate: true,
|
||||
canUpdate: this.$hasPerm('ops.change_playbook'),
|
||||
canUpdate: ({ row }) => {
|
||||
return this.$hasPerm('ops.change_playbook') && row.creator === currentUserID
|
||||
},
|
||||
updateRoute: 'PlaybookUpdate',
|
||||
hasDelete: true,
|
||||
canDelete: this.$hasPerm('ops.delete_playbook'),
|
||||
hasClone: false
|
||||
canDelete: ({ row }) => {
|
||||
return this.$hasPerm('ops.delete_playbook') && row.creator === currentUserID
|
||||
},
|
||||
hasClone: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ export default {
|
||||
return {
|
||||
url: '/api/v1/ops/playbooks/',
|
||||
fields: [
|
||||
[this.$t('Basic'), ['name', 'comment']]
|
||||
[this.$t('Basic'), ['name', 'comment', 'scope']]
|
||||
],
|
||||
createSuccessNextRoute: {
|
||||
name: 'Template'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<NewNodeDialog v-if="createDialogVisible" :visible.sync="createDialogVisible" @confirm="doCreate" />
|
||||
<TreeTable ref="TreeTable" :tree-setting="treeSetting">
|
||||
<template slot="rMenu">
|
||||
<template v-if="!disableEdit" slot="rMenu">
|
||||
<li id="m_create_file" class="rmenu" tabindex="-1" @click="onCreate('file')">
|
||||
{{ $tc('NewFile') }}
|
||||
</li>
|
||||
@@ -62,7 +62,9 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const disableEdit = this.object.creator !== this.$store.state.users.profile.id
|
||||
return {
|
||||
disableEdit: disableEdit,
|
||||
newNode: {},
|
||||
createDialogVisible: false,
|
||||
createType: 'directory',
|
||||
@@ -70,7 +72,8 @@ export default {
|
||||
closing: false,
|
||||
DataZTree: 0,
|
||||
cmOptions: {
|
||||
mode: 'yaml'
|
||||
mode: 'yaml',
|
||||
readOnly: disableEdit
|
||||
},
|
||||
toolbar: {
|
||||
left: {
|
||||
@@ -82,6 +85,7 @@ export default {
|
||||
el: {
|
||||
type: 'primary'
|
||||
},
|
||||
isVisible: disableEdit,
|
||||
callback: () => {
|
||||
this.onSave()
|
||||
}
|
||||
@@ -94,6 +98,7 @@ export default {
|
||||
el: {
|
||||
type: 'primary'
|
||||
},
|
||||
isVisible: disableEdit,
|
||||
callback: () => {
|
||||
this.onReset()
|
||||
}
|
||||
@@ -298,7 +303,7 @@ export default {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.workspace-tab{
|
||||
.workspace-tab {
|
||||
::v-deep .el-tabs__header {
|
||||
margin: 0 0 15px 30px !important;
|
||||
}
|
||||
|
||||
@@ -36,12 +36,6 @@ export default {
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -76,6 +76,8 @@ export default {
|
||||
}],
|
||||
el: {
|
||||
value: [],
|
||||
defaultPageSize: 300,
|
||||
baseUrl: '/api/v1/assets/assets/?fields_size=mini',
|
||||
treeSetting: {
|
||||
showSearch: false,
|
||||
showRefresh: false
|
||||
|
||||