-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy-apps.html
202 lines (201 loc) · 11.6 KB
/
my-apps.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-my-apps" 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">
<my-apps inline-template v-on:set-state="setState" v-on:set-page="setPage" v-bind:root-state="rootState" v-if="!$root.isLoading">
<div class="columns">
<transition name="fade">
<div th:replace="webroot/frags/api/api-preview.htm :: apiPreview"></div>
</transition>
<section class="columnn column-main column-main-fixed">
<div class="column-main-fixed-overlay" v-if="rootState == 'add' || rootState == 'edit'" v-on:click="cancelApp()"></div>
<div class="nicescroll--bar">
<div class="fow m-0 p-3 justify-content-center">
<article v-for="(app, index) in sortBy(sort, $root.appList)" v-bind:key="app.uuid" v-bind:class="{'active': isSelected(index)}" class="fol-sm-6 fol-md-4 fol-lg-4 fol-xl-3 fol-xlm-3 fol-xlg-3 thumb-3x card-item field-controls">
<div class="field-sum bg-white shadow-sm" v-bind:class="{'is-deleted': app.isdeleted}">
<a class="field-link app-collapse" data-toggle="collapse" v-bind:data-target="'#app'+index" v-bind:aria-controls="'app'+index" v-on:click="getMyAppDetail(app,index)">
<div>
<div class="h6">
<i class="fas fa-check-circle txt-green" title="Activated" v-if="app.isactivated"></i>
<i class="fas fa-times-circle txt-muted" title="Not Activated" v-if="!app.isactivated"></i>
{{app.firstname}}
</div>
<span class="txt-red txt-uppercase flt-r" v-if="app.expiredCount > 0"><small>Access Token Expired</small> <span class="badge badge-red badge-pill ml-1"><strong>{{app.expiredCount}}</strong></span></span>
<p class="d-block">{{app.description}}</p>
</div>
<div class="fow">
<div class="fol-sm">
<div v-if="app.contracts">
<small class="txt-uppercase">Subscriptions:</small> <strong class="txt-black">{{app.contracts.length}}</strong>
</div>
<small class="txt-uppercase">Organization:</small> <strong class="txt-black">{{app.organization}}</strong>
<div>
<small class="txt-uppercase">URL:</small> <strong class="txt-black">{{app.url}}</strong>
</div>
<code class="txt-line small txt-blue sandbox-item"><small>{{app.uuid}}</small></code>
</div>
<div class="fol-sm txt-sm-r">
<div class="txt-uppercase small">
Created
{{app.created | formatDateTime}}
</div>
<div class="txt-uppercase small">
Updated
{{app.updated | formatDateTime}}
</div>
<div class="txt-uppercase small" v-if="app.isdeleted">
Deleted
{{app.deleted | formatDateTime}}
</div>
<div>
{{activated(app.isactivated)}} |
<strong class="txt-uppercase">{{sandbox(app.issandbox)}}</strong>
</div>
<code class="txt-line small txt-orange sandbox-item" v-if="app.resource"><small>{{app.resource.uuid}}</small></code>
</div>
</div>
</a>
<div class="ficon-actions dropdown dropdown-hover">
<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 v-if="!app.isdeleted"><a title="EDIT APP" v-on:click="$emit('set-state', 'edit'); selectApp(app, index);"><i class="fa fa-pencil"></i> EDIT APP</a></li>
<li><a title="CHANGE LOGS" v-on:click="changeLogs(app.uuid, '/subject*/_search');"><i class="fa fa-search"></i> CHANGE LOGS</a></li>
<li v-if="!app.isdeleted"><a class="" title="DELETE APP" v-on:click="deleteApp(app, index)"><i class="fa fa-trash-alt"></i> DELETE APP</a></li>
</ul>
</div>
</div>
<div v-bind:id="'app'+index" class="collapse field-acc pb-0 bg-white shadow-sm">
<div v-if="app.contracts" v-for="(con,index) in app.contracts" class="brd-b brd-0-last my-app-list" v-bind:class="{'api-unsubscribed': con.isdeleted}">
<div class="fow">
<div class="fol-sm-4 p-0">
<api-list :api="con.api" :index="index" :key="con.api.uuid" v-if="con.api" inline-template>
<div th:replace="webroot/frags/api/api-preview.htm :: apiList"></div>
</api-list>
<div class="px-3 pb-3">
<button class="btn btn-sm btn-outline-purple btn-block" v-on:click="testApi(con.api.openapidocument);">Test API</button>
</div>
</div>
<div class="fol-sm-4 p-3 brd-l brd-r">
<div th:replace="webroot/frags/api/api-preview-items.htm :: apiContract"></div>
</div>
<div class="fol-sm-4 p-0 pb-1">
<div class="" v-for="(license, index) in con.license">
<div th:replace="webroot/frags/api/api-preview-items.htm :: apiLicense"></div>
</div>
</div>
</div>
</div>
</div>
</article>
</div>
</div>
</section>
<aside class="column column-aside add-column">
<div class="clearfix brd-b column-header column-min-button">
<h5 class="column-header-title" v-if="rootState == 'init' || rootState == 'add'">Add New App</h5>
<h5 class="column-header-title" v-if="rootState == 'edit'">Edit App</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('firstname') }">
<label for="firstname">APP Name:</label>
<input type="text" name="firstname" id="firstname" v-model="app.firstname" v-validate="'required'" class="form-control">
<em v-bind:class="{ 'show': errors.has('firstname') }">{{ errors.first('firstname') }}</em>
</div>
<div class="form-group" v-bind:class="{ 'has-error': errors.has('description') }">
<label for="description">Description:</label>
<textarea name="description" id="description" v-model="app.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">Activate APP</label>
<span class="switch switch-primary ml-auto">
<input type="checkbox" name="isactivated" id="isactivated" v-model="app.isactivated" checked>
<label for="isactivated"></label>
</span>
</div>
<div class="form-group" v-bind:class="{ 'has-error': errors.has('url') }">
<label for="url">Url:</label>
<input type="text" name="url" id="url" v-model="app.url" class="form-control" v-validate="'url'">
<em v-bind:class="{ 'show': errors.has('url') }">{{ errors.first('url') }}</em>
</div>
<div class="form-group form-inline">
<label class="d-block">issandbox</label>
<span class="switch switch-primary ml-auto">
<input type="checkbox" name="issandbox" id="issandbox" v-model="app.issandbox" checked>
<label for="issandbox"></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="app.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('dirid') }">
<label>Directory</label>
<select class="form-control" name="dirid" id="dirid" v-model="app.subjectdirectoryid" v-validate="'required'">
<option v-for="(dir,index) in directoryOptions" :value="dir.uuid" :class="{'op-deleted': dir.isdeleted}" :disabled="dir.isdeleted">{{dir.directoryname}}</option>
</select>
<em v-bind:class="{ 'show': errors.has('dirid') }">{{ errors.first('dirid') }}</em>
</div>
<div class="form-group" v-if="app.permission">
<label>Access Token: <small>{{app.permission.accessToken.expiredate | formatDateTimeSec}}</small></label>
<p class="txt-break" :class="{'txt-red': app.permission.accessToken.isexpired}">{{app.permission.accessToken.token}}</p>
</div>
<div class="form-group" v-if="app.permission">
<button class="btn btn-sm btn-outline-blue btn-block" :class="{'btn-outline-red': app.permission.accessToken.isexpired}" v-on:click="regenerateAppsAccessToken()">REGENERATE ACCESS TOKEN</button>
</div>
<div v-if="rootState == 'edit' && showSecretAndKey">
<!-- <div class="clearfix"> -->
<div class="form-group txt-c" v-if="app.password && app.uuid"><a class="btn btn-block btn-sm btn-green js-copy" data-clipboard-targets="#appkey,#appsecret">Copy APP Key & APP Secret</a></div>
<div class="form-group">
<label class="clearfix d-block" for="appkey">App Key:</label>
<input type="text" name="appkey" id="appkey" :value="app.uuid" class="form-control" readonly="">
</div>
<div class="form-group js-showpass" v-bind:class="{ 'has-error': errors.has('appsecret') }">
<label class="clearfix d-block" for="password">App Secret: <a class="flt-r txt-link" v-on:click="regenPass(4,4,4,4)">
<span v-if="!preventCancel">Regenerate</span>
<span v-if="preventCancel">Generate</span>
APP Secret</a></label>
<div class="input-group">
<input type="password" name="appsecret" id="appsecret" v-model="app.password" v-validate="preventCancel ? 'required|min:8|password_strength' : ''" class="form-control">
<a class="txt-link js-eye input-group-addon"><i class="fas fa-eye"></i></a>
</div>
<em v-bind:class="{ 'show': errors.has('appsecret') }">{{ errors.first('appsecret') }}</em>
</div>
</div>
<div class="form-group d-flex justify-content-between">
<button type="button" class="btn btn-secondary btn-rounded" v-on:click="cancelApp()">CANCEL</button>
<button type="button" class="btn btn-primary btn-rounded" v-if="rootState == 'add'" v-on:click="appAction('add')">ADD APP</button>
<button type="button" class="btn btn-primary btn-rounded" v-if="rootState == 'edit'" v-on:click="appAction('edit')">SAVE</button>
</div>
</div>
</div>
</div>
</aside>
<div th:replace="webroot/frags/api/api-preview-items.htm :: apiTest"></div>
<div th:replace="webroot/frags/api/api-preview-items.htm :: apiLegal"></div>
<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 APP "><i class="fas fa-plus"></i></button>
</div>
</div>
</my-apps>
</main>
</div>
<script src="/dist/js/plugins/clipboard.min.js"></script>
<script id="reqVue" data-module="apps" data-main="/dist/js/main" src="/dist/js/lib/require.min.js"></script>
</body>
</html>