Skip to content

Commit cba4d6d

Browse files
iam: roles rules tab (#55)
This adds the rules tab for IAM/roles. Fixes #45 Signed-off-by: Rohit Yadav <[email protected]>
1 parent 5211759 commit cba4d6d

File tree

8 files changed

+3570
-1819
lines changed

8 files changed

+3570
-1819
lines changed

ui/package-lock.json

Lines changed: 3038 additions & 1792 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,50 +38,53 @@
3838
"@fortawesome/free-regular-svg-icons": "^5.11.2",
3939
"@fortawesome/free-solid-svg-icons": "^5.11.2",
4040
"@fortawesome/vue-fontawesome": "^0.1.8",
41-
"ant-design-vue": "~1.4.6",
41+
"ant-design-vue": "~1.4.8",
4242
"axios": "^0.19.0",
43-
"core-js": "^3.4.2",
43+
"core-js": "^3.4.7",
4444
"enquire.js": "^2.1.6",
4545
"js-cookie": "^2.2.1",
4646
"lodash.get": "^4.4.2",
4747
"lodash.pick": "^4.4.0",
4848
"md5": "^2.2.1",
4949
"moment": "^2.24.0",
5050
"node-emoji": "^1.10.0",
51-
"npm-check-updates": "^3.2.1",
51+
"npm-check-updates": "^3.2.2",
5252
"nprogress": "^0.2.0",
5353
"viser-vue": "^2.4.7",
5454
"vue": "^2.6.10",
5555
"vue-clipboard2": "^0.3.1",
5656
"vue-cropper": "0.4.9",
57-
"vue-i18n": "^8.15.0",
57+
"vue-i18n": "^8.15.1",
5858
"vue-ls": "^3.2.1",
5959
"vue-router": "^3.1.3",
6060
"vue-svg-component-runtime": "^1.0.1",
61+
"vuedraggable": "^2.23.2",
6162
"vuex": "^3.1.2"
6263
},
6364
"devDependencies": {
6465
"@kazupon/vue-i18n-loader": "^0.4.1",
65-
"@vue/cli": "^4.0.5",
66-
"@vue/cli-plugin-babel": "^4.0.5",
67-
"@vue/cli-plugin-eslint": "^4.0.5",
68-
"@vue/cli-plugin-unit-jest": "^4.0.5",
69-
"@vue/cli-service": "^4.0.5",
70-
"@vue/eslint-config-standard": "^5.0.0",
66+
"@vue/cli": "^4.1.1",
67+
"@vue/cli-plugin-babel": "^4.1.1",
68+
"@vue/cli-plugin-eslint": "^4.1.1",
69+
"@vue/cli-plugin-unit-jest": "^4.1.1",
70+
"@vue/cli-service": "^4.1.1",
71+
"@vue/eslint-config-standard": "^5.0.1",
7172
"@vue/test-utils": "^1.0.0-beta.20",
7273
"babel-core": "7.0.0-bridge.0",
7374
"babel-eslint": "^10.0.3",
7475
"babel-jest": "^24.9.0",
75-
"babel-plugin-import": "^1.12.2",
76-
"eslint": "^6.6.0",
76+
"babel-plugin-import": "^1.13.0",
77+
"eslint": "^6.7.2",
7778
"eslint-plugin-html": "^6.0.0",
78-
"eslint-plugin-vue": "^6.0.1",
7979
"eslint-plugin-import": "^2.18.2",
8080
"eslint-plugin-node": "^10.0.0",
8181
"eslint-plugin-promise": "^4.2.1",
8282
"eslint-plugin-standard": "^4.0.1",
83+
"eslint-plugin-vue": "^6.0.1",
8384
"less": "^3.10.3",
8485
"less-loader": "^5.0.0",
86+
"node-sass": "^4.13.0",
87+
"sass-loader": "^8.0.0",
8588
"vue-cli-plugin-i18n": "^0.6.0",
8689
"vue-svg-icon-loader": "^2.1.1",
8790
"vue-template-compiler": "^2.6.10",

ui/src/api/index.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,25 @@
1717

1818
import { axios } from '@/utils/request'
1919

20-
export function api (command, args = {}) {
20+
export function api (command, args = {}, method = 'GET', data = {}) {
21+
let params = {}
2122
args.command = command
2223
args.response = 'json'
23-
return axios.get('/', {
24-
params: args
24+
25+
if (data) {
26+
params = new URLSearchParams()
27+
Object.entries(data).forEach(([key, value]) => {
28+
params.append(key, value)
29+
})
30+
}
31+
32+
return axios({
33+
params: {
34+
...args
35+
},
36+
url: '/',
37+
method,
38+
data: params || {}
2539
})
2640
}
2741

ui/src/components/view/DetailSettings.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
<div v-show="showAddDetail">
2424
<a-auto-complete
2525
style="width: 100%"
26+
:filterOption="filterOption"
2627
:value="newKey"
2728
:dataSource="Object.keys(detailOptions)"
2829
placeholder="Name"
2930
@change="e => onAddInputChange(e, 'newKey')" />
3031
<a-auto-complete
3132
style="width: 100%"
33+
:filterOption="filterOption"
3234
:value="newValue"
3335
:dataSource="detailOptions[newKey]"
3436
placeholder="Value"
@@ -112,6 +114,11 @@ export default {
112114
this.updateResource(this.resource)
113115
},
114116
methods: {
117+
filterOption (input, option) {
118+
return (
119+
option.componentOptions.children[0].text.toUpperCase().indexOf(input.toUpperCase()) >= 0
120+
)
121+
},
115122
updateResource (resource) {
116123
if (!resource) {
117124
return

ui/src/config/section/iam.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export default {
224224
name: 'details',
225225
component: () => import('@/components/view/DetailsTab.vue')
226226
}, {
227-
name: 'rules',
227+
name: 'Rules',
228228
component: () => import('@/views/iam/RolePermissionTab.vue')
229229
}],
230230
actions: [
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
<template>
19+
<a-select
20+
:value="defaultValue"
21+
@change="handleChange">
22+
<a-select-option value="allow">Allow</a-select-option>
23+
<a-select-option value="deny">Deny</a-select-option>
24+
</a-select>
25+
</template>
26+
27+
<script>
28+
export default {
29+
props: {
30+
defaultValue: {
31+
type: String,
32+
required: true
33+
}
34+
},
35+
methods: {
36+
handleChange (e) {
37+
this.$emit('change', e)
38+
}
39+
}
40+
41+
}
42+
</script>

0 commit comments

Comments
 (0)