Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
nhathoang989 committed Oct 13, 2023
1 parent 35eea82 commit 508e6e5
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 199 deletions.
8 changes: 5 additions & 3 deletions src/app/app-portal/components/filter-list/filter-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,20 @@
</select>
</div>
</div>

<div class="col-12">
<div class="input-group">
<input
type="date"
type="datetime-local"
data-date-format="dd.MM.yyyy"
ng-model="$ctrl.dateRange.fromDate"
class="form-control"
ng-change="$ctrl.updateDate()"
/>
</div>

<div class="col-12">
<input
type="date"
type="datetime-local"
data-date-format="dd.MM.yyyy"
ng-model="$ctrl.dateRange.toDate"
class="form-control"
Expand Down
4 changes: 2 additions & 2 deletions src/app/app-portal/pages/application/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ app.controller("MixApplicationController", [
$scope.current = null;
$scope.themeRequest = angular.copy(ngAppSettings.request);
$scope.themeRequest.orderBy = "createdDatetime";
$scope.themeRequest.mixDatabaseName = "mixcorePortalApp";
$scope.themeRequest.mixDatabaseName = "mixApplicationPackage";
$scope.themeRequest.queries = [
{ fieldName: "mixcoreVersion", value: "2.0.1" },
];
Expand Down Expand Up @@ -120,7 +120,7 @@ app.controller("MixApplicationController", [
}
};
$scope.select = function (theme) {
$scope.viewmodel.packateFilePath = theme.additionalData.source;
$scope.viewmodel.packateFilePath = theme.additionalData.builtSourceCode;
$scope.current = theme;
// TODO: verify user - theme to enable install
$scope.current.canInstall = true;
Expand Down
193 changes: 99 additions & 94 deletions src/app/app-portal/pages/audit-log/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,101 +30,106 @@ <h3 class="page-title">All Audit Logs</h3>
<!-- ----------------------------------------------------------- -->

<div class="content-body py-3 pe-3">
<div class="card mb-5">
<div class="card-body">
<table
id="list-page"
class="table table-striped-x table-hover"
dnd-list="data.items"
dnd-disable-if="canDrag"
cellspacing="0"
ng-init="getList()"
>
<thead class="thead-light">
<tr>
<th scope="col" width="15px">
<div class="form-check m-0 p-0">
<input
type="checkbox"
class="form-check-inputx"
ng-model="selectedList.isSelectAll"
ng-change="selectAll(selectedList.isSelectAll)"
id="customCheck_all"
/>
</div>
</th>
<th class="col">Endpoint</th>
<th class="col">Request Ip</th>
<th class="col">Created</th>
<th class="col">Created By</th>
<th class="col"></th>
<th class="col text-end"></th>
</tr>
</thead>
<div class="card mb-5" ng-init="getList()">
<div
ng-repeat="result in data.results track by $index"
ng-if="result.data"
>
<h3 ng-bind="result.searchDate | utcToLocal:'dd.MM.yy'"></h3>
<div class="card-body">
<table
id="list-page"
class="table table-striped-x table-hover"
dnd-list="data.items"
dnd-disable-if="canDrag"
cellspacing="0"
>
<thead class="thead-light">
<tr>
<th scope="col" width="15px">
<div class="form-check m-0 p-0">
<input
type="checkbox"
class="form-check-inputx"
ng-model="selectedList.isSelectAll"
ng-change="selectAll(selectedList.isSelectAll)"
id="customCheck_all"
/>
</div>
</th>
<th class="col">Endpoint</th>
<th class="col">Request Ip</th>
<th class="col">Created</th>
<th class="col">Created By</th>
<th class="col"></th>
<th class="col text-end"></th>
</tr>
</thead>

<tbody class="">
<tr
ng-repeat="item in data.items track by $index"
dnd-draggable="item"
dnd-effect-allowed="move"
dnd-selected="selected = item"
dnd-moved="updateInfos($index)"
ng-class="{'selected': selected === item}"
class=""
sort-model="category"
sort-model-id="{{item.id}}"
>
<td class="align-middle">
<div class="form-check">
<input
type="checkbox"
class="form-check-input"
id="customCheck_{{item.id}}"
ng-model="item.isSelected"
ng-change="select(item.id, item.isSelected)"
/>
<label
class="custom-control-label"
for="customCheck_{{item.id}}"
></label>
</div>
</td>
<td class="">
<a href="" ng-click="view(item)" class="btn-link">
<span
ng-bind="item.endpoint|trim:50"
ng-class="{'text-danger': !item.success}"
></span>
</a>
</td>
<td>
<span ng-bind="item.requestIp|trim:50"></span>
</td>
<td class="text-secondary">
<small>
{{item.createdDateTime | utcToLocal:'dd.MM.yy hh:mm a'}}
</small>
</td>
<td class="text-secondary">
<small>{{item.createdBy}}</small>
</td>
<td>
<a
class="dropdown-item border-radius-md"
ng-click="view(item)"
>
<span class="fa fa-eye"></span
></a>
</td>
<td class="text-black-50">
<small ng-if="item.status == 'Published'">🟢</small>
<small ng-if="item.status == 'Schedule'">🟡</small>
<small ng-if="item.status == 'Draft'">🔴</small>
<small ng-if="item.status == 'Deleted'">⚫️</small>
</td>
</tr>
</tbody>
</table>
<tbody class="">
<tr
ng-repeat="item in result.data.items track by $index"
dnd-draggable="item"
dnd-effect-allowed="move"
dnd-selected="selected = item"
dnd-moved="updateInfos($index)"
ng-class="{'selected': selected === item}"
class=""
sort-model="category"
sort-model-id="{{item.id}}"
>
<td class="align-middle">
<div class="form-check">
<input
type="checkbox"
class="form-check-input"
id="customCheck_{{item.id}}"
ng-model="item.isSelected"
ng-change="select(item.id, item.isSelected)"
/>
<label
class="custom-control-label"
for="customCheck_{{item.id}}"
></label>
</div>
</td>
<td class="">
<a href="" ng-click="view(item)" class="btn-link">
<span
ng-bind="item.endpoint|trim:50"
ng-class="{'text-danger': !item.success}"
></span>
</a>
</td>
<td>
<span ng-bind="item.requestIp|trim:50"></span>
</td>
<td class="text-secondary">
<small>
{{item.createdDateTime | utcToLocal:'dd.MM.yy hh:mm a'}}
</small>
</td>
<td class="text-secondary">
<small>{{item.createdBy}}</small>
</td>
<td>
<a
class="dropdown-item border-radius-md"
ng-click="view(item)"
>
<span class="fa fa-eye"></span
></a>
</td>
<td class="text-black-50">
<small ng-if="item.status == 'Published'">🟢</small>
<small ng-if="item.status == 'Schedule'">🟡</small>
<small ng-if="item.status == 'Draft'">🔴</small>
<small ng-if="item.status == 'Deleted'">⚫️</small>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card-body">
<paging
Expand Down
23 changes: 23 additions & 0 deletions src/app/app-portal/pages/audit-log/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ app.factory("AuditLogRestService", [
function (baseService) {
var serviceFactory = Object.create(baseService);
serviceFactory.initService("/rest", "mix-log/audit-log", true);
var _search = async function (objData, queries = null) {
var data = serviceFactory.parseQuery(objData);

var url = `${this.prefixUrl}/search`;

if (data) {
url += "?";
url = url.concat(data);
if (queries) {
url += "&";
var extraQueries = serviceFactory.parseQuery(queries);
url = url.concat(extraQueries);
}
}
var req = {
serviceBase: this.serviceBase,
apiVersion: this.apiVersion,
method: "GET",
url: url,
};
return await this.getRestApiResult(req);
};
serviceFactory.getList = _search;
return serviceFactory;
},
]);
Loading

0 comments on commit 508e6e5

Please sign in to comment.