Skip to content

Commit eb5ae4e

Browse files
roles: boilerplate stuff
Signed-off-by: Rohit Yadav <[email protected]>
1 parent ba3a4e2 commit eb5ae4e

File tree

3 files changed

+99
-22
lines changed

3 files changed

+99
-22
lines changed

ui/src/config/section/iam.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ export default {
220220
permission: ['listRoles'],
221221
columns: ['name', 'type', 'description'],
222222
details: ['name', 'id', 'type', 'description'],
223+
tabs: [{
224+
name: 'details',
225+
component: () => import('@/components/view/DetailsTab.vue')
226+
}, {
227+
name: 'rules',
228+
component: () => import('@/views/iam/RolePermissionTab.vue')
229+
}],
223230
actions: [
224231
{
225232
api: 'createRole',
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
<div>
20+
Boilerplate for implementation
21+
{{ loading }}
22+
{{ resource }}
23+
</div>
24+
</template>
25+
26+
<script>
27+
28+
export default {
29+
name: 'RolePermissionTab',
30+
components: {
31+
},
32+
props: {
33+
resource: {
34+
type: Object,
35+
required: true
36+
},
37+
loading: {
38+
type: Boolean,
39+
default: false
40+
}
41+
},
42+
data () {
43+
return {
44+
}
45+
},
46+
computed: {
47+
}
48+
}
49+
</script>
50+
51+
<style lang="less" scoped>
52+
</style>

ui/src/views/infra/InfraSummary.vue

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,61 +16,76 @@
1616
// under the License.
1717

1818
<template>
19-
<a-row :gutter="24" style="margin: 6px">
20-
<a-col
21-
:md="6"
22-
:style="{ marginBottom: '12px', marginTop: '12px' }"
23-
v-for="(section, index) in sections"
24-
v-if="routes[section]"
25-
:key="index">
26-
<chart-card :loading="loading">
27-
<div class="chart-card-inner">
28-
<router-link :to="{ name: section.substring(0, section.length - 1) }">
29-
<h2>{{ $t(routes[section].title) }}</h2>
30-
<h1><a-icon :type="routes[section].icon" /> {{ stats[section] }}</h1>
31-
</router-link>
32-
</div>
33-
</chart-card>
19+
<a-row :gutter="24">
20+
<a-col :md="18">
21+
<a-card>
22+
<breadcrumb />
23+
</a-card>
3424
</a-col>
35-
<!-- move refresh and ssl cert setup somewhere more friendly -->
3625
<a-col
37-
:md="6"
38-
:style="{ marginBottom: '12px', marginTop: '12px' }">
26+
:md="6" >
3927
<a-card>
4028
<a-button
41-
style="width: 100%"
42-
icon="reload"
29+
style="margin-left: 10px; float: right"
4330
@click="fetchData()"
31+
icon="reload"
4432
:loading="loading"
4533
type="primary">
4634
{{ $t('Refresh') }}
4735
</a-button>
4836
<a-button
49-
style="width: 100%"
37+
style="margin-left: 10px; float: right"
38+
@click="sslFormVisible = true"
5039
icon="safety-certificate">
5140
{{ $t('SSL Certificate') }}
5241
</a-button>
42+
<a-modal
43+
:title="$t('SSL Certificate')"
44+
v-model="sslFormVisible"
45+
@ok="handle">
46+
<p>Some contents...</p>
47+
<p>Some contents...</p>
48+
<p>Some contents...</p>
49+
</a-modal>
5350
</a-card>
5451
</a-col>
52+
<a-col
53+
:md="6"
54+
:style="{ marginBottom: '12px', marginTop: '12px' }"
55+
v-for="(section, index) in sections"
56+
v-if="routes[section]"
57+
:key="index">
58+
<chart-card :loading="loading">
59+
<div class="chart-card-inner">
60+
<router-link :to="{ name: section.substring(0, section.length - 1) }">
61+
<h2>{{ $t(routes[section].title) }}</h2>
62+
<h1><a-icon :type="routes[section].icon" /> {{ stats[section] }}</h1>
63+
</router-link>
64+
</div>
65+
</chart-card>
66+
</a-col>
5567
</a-row>
5668
</template>
5769

5870
<script>
5971
import { api } from '@/api'
6072
import router from '@/router'
6173
74+
import Breadcrumb from '@/components/widgets/Breadcrumb'
6275
import ChartCard from '@/components/widgets/ChartCard'
6376
6477
export default {
6578
name: 'InfraSummary',
6679
components: {
80+
Breadcrumb,
6781
ChartCard
6882
},
6983
data () {
7084
return {
7185
loading: true,
72-
sections: ['zones', 'pods', 'clusters', 'hosts', 'storagepools', 'imagestores', 'systemvms', 'routers', 'cpusockets', 'managementservers', 'alerts'],
7386
routes: {},
87+
sections: ['zones', 'pods', 'clusters', 'hosts', 'storagepools', 'imagestores', 'systemvms', 'routers', 'cpusockets', 'managementservers', 'alerts'],
88+
sslFormVisible: false,
7489
stats: {}
7590
}
7691
},
@@ -99,6 +114,9 @@ export default {
99114
}).finally(f => {
100115
this.loading = false
101116
})
117+
},
118+
handleSslForm (e) {
119+
console.log(e)
102120
}
103121
}
104122
}

0 commit comments

Comments
 (0)