-
Notifications
You must be signed in to change notification settings - Fork 1
/
access-managers.html
202 lines (202 loc) · 12 KB
/
access-managers.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE html>
<html class="vs-access-managers" lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:include="webroot/frags/layout/head.htm :: header">
<script src="/dist/js/lib/jquery.min.js"></script>
<script src="/dist/js/lib/thymus.min.js" id="thymus"
data-thx-base-path="." data-thx-frag-extension=".htm"
data-thx-head-frag="th:include=webroot/frags/layout/head.htm :: header"
data-thx-preload-js="/dist/js/loader.js"
data-thx-onfrags="fragsListener();" data-thx-onfrag="fragListener()"></script>
</head>
<body>
<div id="portal" class="wrapper" v-bind:class="pageClass">
<div th:replace="webroot/frags/layout/navs.htm :: navs"></div>
<main class="page-wrapper">
<access-managers inline-template v-on:set-state="setState" v-on:set-page="setPage" v-bind:root-state="rootState" v-if="!$root.isLoading">
<div class="columns">
<section class="column column-main column-main-fixed">
<div class="column-main-fixed-overlay" v-if="rootState == 'add' || rootState == 'edit'" v-on:click="$emit('set-state', 'init'); cancelAccessManager();"></div>
<div class="nicescroll--bar">
<table class="table table-hover table-bordered table-edge">
<tr>
<th class="td-bool" v-bind:class="sort.order" v-on:click="sortList(sort, 'isactive', Boolean)">Status</th>
<th class="td-name" v-bind:class="sort.order" v-on:click="sortList(sort, 'accessmanagername', String)">Name</th>
<th class="td-name" v-bind:class="sort.order" v-on:click="sortList(sort, 'accessmanagertypeid', String)">Type</th>
<th class="td-datetime-x" v-bind:class="sort.order" v-on:click="sortList(sort, 'created', Date)">Created / Updated / Deleted</th>
<th class="td-action-1"></th>
<th class="td-action-1"></th>
</tr>
<tr v-for="(accessManager, index) in sortBy(sort, accessManagerList)" v-bind:key="accessManager.uuid" v-bind:class="{'active': isSelected(index), 'tr-deleted': accessManager.isdeleted}">
<td class="txt-c">
<i class="fas fa-times-circle" title="Not Active" v-if="!accessManager.isactive"></i>
<i class="fas fa-check-circle txt-green" title="Active" v-if="accessManager.isactive"></i>
</td>
<td>{{accessManager.accessmanagername}} <small class="d-block">{{accessManager.description}}</small></td>
<td>{{getTypeName(accessManager.accessmanagertypeid)}} <code class="d-block txt-line small txt-blue"><small>{{accessManager.accessmanagertypeid}}</small></code></td>
<td>
<div>
<strong class="small">CREATED:</strong>
<small>{{accessManager.created | formatDateTime}}</small>
</div>
<div>
<strong class="small">UPDATED:</strong>
<small>{{accessManager.updated | formatDateTime}}</small>
</div>
<div v-if="accessManager.isdeleted">
<strong class="small">DELETED:</strong>
<small>{{accessManager.deleted | formatDateTime}}</small>
</div>
</td>
<td class="td-action-1">
<a v-if="!accessManager.isdeleted" class="btn btn-xl txt-link btn-square" title="EDIT ACCESS MANAGER" v-on:click="$emit('set-state', 'edit'); selectAccessManager(accessManager, index);"><i class="fas fa-edit"></i></a>
</td>
<td class="td-action-1">
<a v-if="!accessManager.isdeleted" class="btn btn-xl txt-link txt-grey btn-square" title="DELETE ACCESS MANAGER" v-on:click="deleteAccessManager(accessManager, index)"><i class="fas fa-trash-alt"></i></a>
</td>
</tr>
</table>
</div>
</section>
<aside class="column column-aside add-column">
<div class="clearfix brd-b column-header column-min-button">
<h5 class="column-header-title" >
<span v-if="rootState == 'add'">Add New Access Manager</span>
<span v-if="rootState == 'edit'">Edit Access Manager</span>
</h5>
</div>
<div class="column-content">
<div class="nicescroll-bar">
<div class="p-3">
<div class="form-group" v-bind:class="{ 'has-error': errors.has('accessmanagername') }">
<label for="accessmanagername">Name:</label>
<input type="text" name="accessmanagername" id="accessmanagername" v-model="accessManager.accessmanagername" v-validate="'required|min:2|alpha_spaces'" class="form-control">
<em v-bind:class="{ 'show': errors.has('accessmanagername') }">{{ errors.first('accessmanagername') }}</em>
</div>
<div class="form-group" v-bind:class="{ 'has-error': errors.has('description') }">
<label for="description">Decription:</label>
<textarea type="text" name="description" id="description" v-model="accessManager.description" v-validate="'required'" class="form-control"></textarea>
<em v-bind:class="{ 'show': errors.has('description') }">{{ errors.first('description') }}</em>
</div>
<div class="form-group form-inline">
<label class="d-block">Is Active?</label>
<span class="switch switch-green ml-auto">
<input type="checkbox" name="isactive" id="isactive" v-model="accessManager.isactive">
<label for="isactive"></label>
</span>
</div>
<div class="form-group " v-bind:class="{ 'has-error': errors.has('orgid') }">
<label>Organization</label>
<select class="form-control" name="orgid" id="orgid" v-model="accessManager.organizationid" v-validate="'required'">
<option v-for="(org,index) in orgOptions" :value="org.uuid" :class="{'op-deleted': org.isdeleted}" :disabled="org.isdeleted">{{org.name}}</option>
</select>
<em v-bind:class="{ 'show': errors.has('orgid') }">{{ errors.first('orgid') }}</em>
</div>
<div class="form-group " v-bind:class="{ 'has-error': errors.has('type') }">
<label>Access Manager Type</label>
<select class="form-control" name="type" id="type" v-model="accessManager.accessmanagertypeid" v-validate="'required'" v-on:change="getTemplate($event.target.value, true)">
<option v-for="(type,index) in accessManagerTypes" :value="type.uuid">{{type.typename}}</option>
</select>
<em v-bind:class="{ 'show': errors.has('type') }">{{ errors.first('type') }}</em>
</div>
<div class="form-group" v-bind:class="{ 'has-error': errors.has('attributes') }">
<label for="attributes" class="txt-muted">Attributes:</label>
<textarea type="text" name="attributes" id="attributes" v-model="stringifyAttribute" v-validate="'required'" class="form-control" :readonly="!$root.abyssSandbox"></textarea>
<em v-bind:class="{ 'show': errors.has('attributes') }">{{ errors.first('attributes') }}</em>
</div>
<div class="form-group d-flex justify-content-between">
<button type="button" class="btn btn-secondary btn-rounded" v-on:click="$emit('set-state', 'init'); cancelAccessManager()">CANCEL</button>
<button type="button" class="btn btn-primary btn-rounded" v-if="rootState == 'add'" v-on:click="accessManagerAction('add')">ADD</button>
<button type="button" class="btn btn-primary btn-rounded" v-if="rootState == 'edit'" v-on:click="accessManagerAction('edit')">SAVE</button>
</div>
</div>
</div>
</div>
</aside>
<aside class="column column-aside manage-column" v-if="template">
<div class="clearfix brd-b column-header column-min-button">
<h5 class="column-header-title">Configure AM</h5>
</div>
<div class="column-content">
<div class="nicescroll-bar">
<div class="p-3">
<div v-for="(cv, ck, ci) in template.components.schemas">
<div v-for="(pv, pk, pi) in cv.properties">
<schema-template-form :v="pv" :k="pk" :i="pi" :req="cv.required" :attr="accessManager.accessmanagerattributes"></schema-template-form>
</div>
</div>
</div>
</div>
</div>
</aside>
<aside class="column column-aside manage-column column-minimize">
<div class="clearfix brd-b column-header column-min-button">
<h5 class="column-header-title">Access Manager Types</h5>
</div>
<div class="column-content">
<div class="nicescroll-bar">
<access-manager-types v-for="(t,index) in accessManagerTypes" :key="t.uuid" :t="t" :index="index" :orgoptions="orgOptions" inline-template>
<article class="field-controls field-color-grey field-level-1" :class="{'is-deleted': t.isdeleted}">
<div class="field-sum">
<a class="field-link nav-caret d-flex align-items-center" data-toggle="collapse" v-bind:data-target="'#t'+index" v-bind:aria-controls="'t'+index">
<i class="fas fa-times-circle txt-muted mr-2" title="Not Active" v-if="!t.isactive"></i>
<i class="fas fa-check-circle txt-green mr-2" title="Active" v-if="t.isactive"></i>
<strong class="fnt-bold">{{t.typename}}</strong>
</a>
<div class="ficon-actions dropdown dropdown-hover" v-if="!t.isdeleted">
<button type="button" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false"><i class="fas fa-ellipsis-h"></i></button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li><a title="Add Access Manager Type" v-on:click="addType()"><i class="fas fa-lg fa-plus"></i> Add AM Type</a></li>
<li><a title="Remove Access Manager Type" v-on:click="deleteType(t, index)"><i class="fa fa-trash-alt"></i> Remove AM Type</a></li>
</ul>
</div>
</div>
<fieldset v-bind:id="'t'+index" class="collapse field-acc field-tabs" :disabled="t.isdeleted">
<div class="form-group" v-bind:class="{ 'has-error': errors.has('name') }">
<label>Name</label>
<input class="form-control" name="name" v-model="t.typename" v-validate="'required'">
<em v-bind:class="{ 'show': errors.has('name') }">{{ errors.first('name') }}</em>
</div>
<div class="form-group">
<label>Description</label>
<textarea class="form-control" v-model="t.description"></textarea>
</div>
<div class="form-group" v-bind:class="{ 'has-error': errors.has('organization') }">
<label>Organization</label>
<select class="form-control" name="organization" v-model="t.organizationid" v-validate="'required'">
<option v-for="(org,index) in orgoptions" :value="org.uuid" :class="{'op-deleted': org.isdeleted}" :disabled="org.isdeleted">{{org.name}}</option>
</select>
<em v-bind:class="{ 'show': errors.has('organization') }">{{ errors.first('organization') }}</em>
</div>
<div class="form-group form-inline">
<label class="d-block">Is Active?</label>
<span class="switch switch-green ml-auto">
<input type="checkbox" name="isactive" :id="'isactive'+t.uuid" v-model="t.isactive">
<label :for="'isactive'+t.uuid"></label>
</span>
</div>
<div class="form-group" v-bind:class="{ 'has-error': errors.has('template') }">
<label for="template">Template:</label>
<textarea type="text" name="template" id="template" v-model.lazy="stringifyTemplate" v-validate="'required'" class="form-control"></textarea>
<em v-bind:class="{ 'show': errors.has('template') }">{{ errors.first('template') }}</em>
</div>
<div class="form-group d-flex justify-content-center">
<button type="button" class="btn btn-secondary btn-rounded mr-auto" v-if="!t.uuid" v-on:click="cancelAddType(t)">CANCEL</button>
<button type="button" class="btn btn-primary btn-rounded" v-if="!t.uuid" v-on:click="saveAddType(t)">ADD</button>
<button type="button" class="btn btn-primary btn-rounded" v-if="t.uuid" v-on:click="saveType(t)">SAVE</button>
</div>
</fieldset>
</article>
</access-manager-types>
</div>
</div>
</aside>
<div class="btn-float-br btn-float-under">
<button class="btn btn-xl btn-green btn-circle" v-on:click="$emit('set-state', 'add', 'init')" title="ADD NEW ACCESS MANAGER "><i class="fas fa-plus"></i></button>
</div>
</div>
</access-managers>
</main>
</div>
<script id="reqVue" data-module="access-managers" data-main="/dist/js/main" src="/dist/js/lib/require.min.js"></script>
</body>
</html>