Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
nhathoang989 committed Sep 10, 2023
1 parent bf307ce commit 8eab501
Show file tree
Hide file tree
Showing 4 changed files with 485 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/app/app-portal/pages/mixdb-context/_controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"use strict";
app.controller("MixDatabaseContextController", [
"$scope",
"$rootScope",
"$location",
"ngAppSettings",
"$routeParams",
"RestMixDatabaseContextService",
function (
$scope,
$rootScope,
$location,
ngAppSettings,
$routeParams,
mixdbContextService
) {
BaseRestCtrl.call(
this,
$scope,
$rootScope,
$location,
$routeParams,
ngAppSettings,
mixdbContextService
);
$scope.defaultAttr = null;
$scope.databaseProvider = ["MySQL", "PostgreSQL", "SQLITE", "SQLSERVER"];
$scope.actions = ["Delete"];
// $scope.request.selects = 'id,title,name,createdDateTime';
$scope.orders = [
{ title: "Id", value: "Id" },
{ title: "Name", value: "DisplayName" },
{ title: "Created Date", value: "CreatedDateTime" },
];
$scope.request.orderBy = "CreatedDateTime";
$scope.request.columns = "id,displayName,systemName,type,createdDatetime";
$scope.request.searchColumns = "displayName,systemName";
$scope.saveDatabase = function () {
$scope.save($scope.viewmodel);
};
$scope.generateName = function () {
$scope.viewmodel.systemName = $rootScope.generateKeyword(
$scope.viewmodel.displayName,
"_",
true,
true
);
};
$scope.getSingleSuccessCallback = async function () {};
},
]);
19 changes: 19 additions & 0 deletions src/app/app-portal/pages/mixdb-context/_service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";
app.factory("RestMixDatabaseContextService", [
"BaseRestService",
function (baseService) {
var serviceFactory = Object.create(baseService);
serviceFactory.init("mixdb-context");

var _getByName = async function (name) {
var url = `${this.prefixUrl}/get-by-name/${name}`;
var req = {
method: "GET",
url: url,
};
return await this.getRestApiResult(req);
};
serviceFactory.getByName = _getByName;
return serviceFactory;
},
]);
165 changes: 165 additions & 0 deletions src/app/app-portal/pages/mixdb-context/details.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<div class="page-wrapper d-flex flex-column pt-4 w-100">
<div class="container-xl">
<div class="page-header d-print-none">
<div class="row align-items-center">
<div class="col">
<div class="page-pretitle">Create / Updating</div>
<h3 class="page-title">MixDb Context</h3>
</div>
</div>
</div>
</div>

<div class="page-body d-flex flex-row-reverse">
<aside class="bd-sidebar sub-sidebar">
<nav class="bd-links p-3" aria-label="Sub-section navigation">
<div class="card">
<div class="card-body">
<div class="btn-toolbar d-flex mb-3" role="group" aria-label="">
<div class="btn-group me-2">
<a href="/admin/mixdb-context/list" class="btn btn-light me-1">
<i class="fa fa-chevron-left"></i>
</a>
</div>
<div class="btn-group flex-fill me-3">
<button
id="btnToSubmit"
type="button"
ng-click="saveDatabase()"
class="btn btn-primary ms-auto"
>
<svg
xmlns="http://www.w3.org/2000/svg"
class="icon icon-tabler icon-tabler-device-floppy"
width="24"
height="24"
viewBox="0 0 24 24"
stroke-width="1.5"
stroke="currentColor"
fill="none"
stroke-linecap="round"
stroke-linejoin="round"
>
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path
d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2"
/>
<circle cx="12" cy="14" r="2" />
<polyline points="14 4 14 8 8 8 8 4" />
</svg>
<span>Save</span>
</button>
</div>
</div>
<label class="form-label">Publish status</label>
<statuses status="viewviewmodel.status"></statuses>
</div>
</div>
</nav>
</aside>

<!-- ----------------------------------------------------------- -->
<div class="content-body py-3 pe-3">
<section class="" ng-init="getSingle()">
<form ng-class="{'submitted': submitted}" ng-submit="saveDatabase()">
<nav class="mb-3">
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<a
class="nav-link active"
id="nav-home-tab"
data-bs-toggle="tab"
href="#nav-home"
role="tab"
aria-controls="nav-home"
aria-selected="true"
>Design database</a
>
</div>
</nav>
<div class="tab-content" id="nav-tabContent">
<div
class="tab-pane fade show active"
id="nav-home"
role="tabpanel"
aria-labelledby="nav-home-tab"
>
<div class="row mb-3">
<div class="col">
<label class="form-label">Title</label>
<input
type="text"
class="form-control"
ng-model="viewmodel.displayName"
ng-blur="gennerateName()"
/>
</div>
</div>
<div class="row mb-3">
<div class="col">
<label class="form-label">System name</label>
<div class="input-group">
<input
type="text"
class="form-control"
ng-model="viewmodel.systemName"
/>
<button
class="btn btn-outline-primary"
type="button"
ng-click="generateName()"
>
<span class="fa fa-redo"></span>
</button>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col">
<label class="form-label">Schema</label>
<div class="input-group">
<input
type="text"
class="form-control"
ng-model="viewmodel.schema"
/>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col">
<label class="form-label">Database Provider</label>
<div class="input-group">
<select
class="form-select"
ng-model="viewmodel.databaseProvider"
>
<option selected value="">All status</option>
<option
ng-repeat="item in databaseProvider track by $index"
value="{{item}}"
>
{{item}}
</option>
</select>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col">
<label class="form-label">Connection String</label>
<div class="input-group">
<input
type="text"
class="form-control"
ng-model="viewmodel.connectionString"
/>
</div>
</div>
</div>
</div>
</div>
</form>
</section>
</div>
</div>
</div>
Loading

0 comments on commit 8eab501

Please sign in to comment.