From 8eab50138705519a330c200d1396d13996a1f0ca Mon Sep 17 00:00:00 2001 From: Eric Nguyen Date: Sun, 10 Sep 2023 17:06:02 +0700 Subject: [PATCH] init --- .../pages/mixdb-context/_controller.js | 51 ++++ .../pages/mixdb-context/_service.js | 19 ++ .../pages/mixdb-context/details.html | 165 ++++++++++++ .../app-portal/pages/mixdb-context/list.html | 250 ++++++++++++++++++ 4 files changed, 485 insertions(+) create mode 100644 src/app/app-portal/pages/mixdb-context/_controller.js create mode 100644 src/app/app-portal/pages/mixdb-context/_service.js create mode 100644 src/app/app-portal/pages/mixdb-context/details.html create mode 100644 src/app/app-portal/pages/mixdb-context/list.html diff --git a/src/app/app-portal/pages/mixdb-context/_controller.js b/src/app/app-portal/pages/mixdb-context/_controller.js new file mode 100644 index 00000000..e75a5f11 --- /dev/null +++ b/src/app/app-portal/pages/mixdb-context/_controller.js @@ -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 () {}; + }, +]); diff --git a/src/app/app-portal/pages/mixdb-context/_service.js b/src/app/app-portal/pages/mixdb-context/_service.js new file mode 100644 index 00000000..de1a7cc6 --- /dev/null +++ b/src/app/app-portal/pages/mixdb-context/_service.js @@ -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; + }, +]); diff --git a/src/app/app-portal/pages/mixdb-context/details.html b/src/app/app-portal/pages/mixdb-context/details.html new file mode 100644 index 00000000..ae5580c1 --- /dev/null +++ b/src/app/app-portal/pages/mixdb-context/details.html @@ -0,0 +1,165 @@ +
+
+ +
+ +
+ + + +
+
+
+ + +
+
+
+
+
diff --git a/src/app/app-portal/pages/mixdb-context/list.html b/src/app/app-portal/pages/mixdb-context/list.html new file mode 100644 index 00000000..325c4f6b --- /dev/null +++ b/src/app/app-portal/pages/mixdb-context/list.html @@ -0,0 +1,250 @@ +
+
+ +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + DatabaseNameTypeAuthor
+
+ +
+
+ + {{item.displayName}} + + + {{item.systemName}} + + {{item.type}} + + {{item.createdBy}} + + + + + + 🟢 + 🟡 + 🔴 + ⚫️ + + + + +
+
+
+ + +
+
+
+
+