_id: {{ item._id }}
@@ -50,7 +50,7 @@
更新
-
+
@@ -356,4 +356,14 @@ export default {
color: blue;
}
}
+
+ .el-main {
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ // .db-editor {
+ // border: 1px solid lightgray
+ // }
+ }
diff --git a/packages/devops-admin/src/views/database/policies.vue b/packages/devops-admin/src/views/database/policies.vue
index 212247a8ac..77b5028cb2 100644
--- a/packages/devops-admin/src/views/database/policies.vue
+++ b/packages/devops-admin/src/views/database/policies.vue
@@ -139,6 +139,7 @@
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import { db } from '../../api/cloud'
import DeployPanel from '../deploy/components/deploy-panel.vue'
+import { Constants } from '../../api/constants'
// 默认化创建表单的值
function getDefaultFormValue() {
@@ -204,7 +205,7 @@ export default {
},
methods: {
async getFunctions() {
- const r = await db.collection('__functions')
+ const r = await db.collection(Constants.cn.functions)
.where({ status: 1 })
.get()
@@ -228,7 +229,7 @@ export default {
}
// 执行数据查询
- const res = await db.collection('__policies')
+ const res = await db.collection(Constants.cn.policies)
.where(query)
.limit(limit)
.skip((page - 1) * limit)
@@ -238,7 +239,7 @@ export default {
this.list = res.data
// 获取数据总数
- const { total } = await db.collection('__policies')
+ const { total } = await db.collection(Constants.cn.policies)
.where(query)
.limit(limit)
.skip((page - 1) * limit)
@@ -268,7 +269,7 @@ export default {
if (!valid) { return }
// 执行创建请求
- const r = await db.collection('__policies')
+ const r = await db.collection(Constants.cn.policies)
.add(this.form)
if (!r.id) {
@@ -315,7 +316,7 @@ export default {
}
// 执行更新请求
- const r = await db.collection('__policies')
+ const r = await db.collection(Constants.cn.policies)
.where({ _id: this.form._id })
.update(data)
@@ -343,7 +344,7 @@ export default {
await this.$confirm('确认要删除此数据?', '删除确认')
// 执行删除请求
- const r = await db.collection('__policies')
+ const r = await db.collection(Constants.cn.policies)
.where({ _id: row._id })
.remove()
diff --git a/packages/devops-admin/src/views/database/policy.vue b/packages/devops-admin/src/views/database/policy.vue
index b468b36a7f..b5b420d7cf 100644
--- a/packages/devops-admin/src/views/database/policy.vue
+++ b/packages/devops-admin/src/views/database/policy.vue
@@ -17,7 +17,7 @@
选择集合
-
+
{{ item }}
@@ -29,7 +29,7 @@
保存
删除
-
+
@@ -76,6 +76,7 @@ import JsonEditor from '@/components/JsonEditor/rule'
import { db } from '../../api/cloud'
import $ from 'lodash'
import { publishPolicy } from '../../api/publish'
+import { Constants } from '../../api/constants'
const defaultValue = '{}'
const defaultForm = {
@@ -125,7 +126,7 @@ export default {
methods: {
async getPolicies() {
this.loading = true
- const r = await db.collection('__policies')
+ const r = await db.collection(Constants.cn.policies)
.get()
if (!r.ok) {
@@ -154,7 +155,7 @@ export default {
this.loading = true
const rule_data = this.value
const key = `rules.${this.collection_name}`
- const r = await db.collection('__policies')
+ const r = await db.collection(Constants.cn.policies)
.where({
_id: this.policy_id
})
@@ -187,7 +188,7 @@ export default {
this.loading = true
const key = `rules.${this.form.collection}`
- const { total } = await db.collection('__policies')
+ const { total } = await db.collection(Constants.cn.policies)
.where({
_id: this.form.policy_id,
[key]: db.command.exists(true)
@@ -198,7 +199,7 @@ export default {
this.$message('该集合规则已存在!')
return
}
- const r = await db.collection('__policies')
+ const r = await db.collection(Constants.cn.policies)
.where({
_id: this.form.policy_id,
[key]: db.command.exists(false)
@@ -244,7 +245,7 @@ export default {
this.loading = true
const key = `rules.${this.collection_name}`
- const r = await db.collection('__policies')
+ const r = await db.collection(Constants.cn.policies)
.where({
_id: this.policy_id,
[key]: db.command.exists(true)
@@ -314,7 +315,9 @@ export default {
display: flex;
.collection-list {
- width: 200px;
+ width: 250px;
+
+ padding-bottom: 10px;
border-radius: 5px;
box-sizing: border-box;
@@ -323,8 +326,20 @@ export default {
color: gray;
margin-bottom: 10px;
}
- .collection-radio {
+
+ .radio-group {
width: 100%;
+ height: 640px;
+ overflow-y: scroll;
+ overflow-x: hidden;
+ }
+
+ .radio-group::-webkit-scrollbar {
+ display: none;
+ }
+
+ .collection-radio {
+ width: 80%;
margin-bottom: 10px;
margin-left: 0px;
}
@@ -340,12 +355,16 @@ export default {
display: flex;
width: 400px;
justify-content: flex-start;
- margin-bottom: 5px;
+ margin-bottom: 10px;
.btn {
margin-left: 15px;
}
}
+
+ .editor {
+ border: 1px solid lightgray
+ }
}
}
diff --git a/packages/devops-admin/src/views/deploy/components/deploy-panel.vue b/packages/devops-admin/src/views/deploy/components/deploy-panel.vue
index 174221f6b6..83ecae580b 100644
--- a/packages/devops-admin/src/views/deploy/components/deploy-panel.vue
+++ b/packages/devops-admin/src/views/deploy/components/deploy-panel.vue
@@ -59,6 +59,7 @@