Commit 0ad76c64 by sawit

Datasource Table

parent b3348a7f
...@@ -93,6 +93,11 @@ export const admin: Routes = [ ...@@ -93,6 +93,11 @@ export const admin: Routes = [
loadComponent: () => loadComponent: () =>
import('./myportal/set-excel-reports/excel-list/excel-list.component').then((m) => m.ExcelListComponent), import('./myportal/set-excel-reports/excel-list/excel-list.component').then((m) => m.ExcelListComponent),
}, },
{
path: 'datasource-table',
loadComponent: () =>
import('./myportal/datasource-table/datasource-table.component').then((m) => m.DatasourceTableComponent),
},
//////////////emp///////////////// //////////////emp/////////////////
{ {
path: 'emp/department', path: 'emp/department',
......
.secure-input {
-webkit-text-security: disc;
text-security: disc;
}
\ No newline at end of file
export interface DatasourceTableModel {
companyId: string
companyName: string
databaseName: string
dbType: string
password: string
portNumber: string
serverName: string
status: string
userName: string
}
export class MyDatasourceTableModel implements DatasourceTableModel {
companyId: string
companyName: string
databaseName: string
dbType: string
password: string
portNumber: string
serverName: string
status: string
userName: string
constructor(data?: Partial<DatasourceTableModel>) {
this.companyId = data?.companyId || ''
this.companyName = data?.companyName || ''
this.databaseName = data?.databaseName || ''
this.dbType = data?.dbType || ''
this.password = data?.password || ''
this.portNumber = data?.portNumber || ''
this.serverName = data?.serverName || ''
this.status = data?.status || ''
this.userName = data?.userName || ''
}
}
\ No newline at end of file
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { DatasourceTableModel } from '../models/datasource-table.model';
import { environment } from '../../../environments/environment';
import { AlertModel } from '../models/alert.model';
@Injectable({
providedIn: 'root'
})
export class DatasourseTableService {
constructor(private http: HttpClient,
private translateService: TranslateService
) { }
getid(companyid: string): Observable<DatasourceTableModel> {
return this.http.get<DatasourceTableModel>(environment.url + "datasource/" + companyid)
}
getList(): Observable<DatasourceTableModel[]> {
return this.http.get<DatasourceTableModel[]>(environment.url + "datasource/lists")
}
post(body: DatasourceTableModel): Observable<AlertModel> {
return this.http.post<AlertModel>(environment.url + "datasource", body)
}
delete(body: DatasourceTableModel): Observable<AlertModel> {
let option = {
headers: new HttpHeaders({
"Content-Type": "application/json",
}),
body: body
}
return this.http.delete<AlertModel>(environment.url + "datasource", option)
}
}
\ No newline at end of file
...@@ -144,8 +144,8 @@ export class NavService implements OnDestroy { ...@@ -144,8 +144,8 @@ export class NavService implements OnDestroy {
}, },
{ {
icon: 'receipt', icon: 'receipt',
path: '/admin/manage-articles', path: '/admin/datasource-table',
title: 'DataSource Tabel', title: 'DataSource Table',
type: 'link', type: 'link',
}, },
{ {
......
...@@ -107,5 +107,7 @@ ...@@ -107,5 +107,7 @@
"Career Cluster ID":"Career Cluster ID", "Career Cluster ID":"Career Cluster ID",
"Invalid email format @":"May be you forgot @ [ Ex. ] username@hostname.com", "Invalid email format @":"May be you forgot @ [ Ex. ] username@hostname.com",
"Invalid email format .":"Why after @ have not dot [ Ex. ] username@hostname.com", "Invalid email format .":"Why after @ have not dot [ Ex. ] username@hostname.com",
"This email already exists":"This email already exists" "This email already exists":"This email already exists",
"Datasource Table Information":"Datasource Table",
"Company Name":"Company Name"
} }
...@@ -107,5 +107,7 @@ ...@@ -107,5 +107,7 @@
"Career Cluster ID":"รหัสกลุ่มอาชีพ", "Career Cluster ID":"รหัสกลุ่มอาชีพ",
"Invalid email format @":"ไม่ได้ใส่ @ [ ตัวอย่าง ] username@hostname.com", "Invalid email format @":"ไม่ได้ใส่ @ [ ตัวอย่าง ] username@hostname.com",
"Invalid email format .":"หลัง @ ไม่ได้ใส่ . หลังชื่อ [ ตัวอย่าง ] username@hostname.com", "Invalid email format .":"หลัง @ ไม่ได้ใส่ . หลังชื่อ [ ตัวอย่าง ] username@hostname.com",
"This email already exists":"อีเมลนี้มีอยู่แล้ว" "This email already exists":"อีเมลนี้มีอยู่แล้ว",
"Datasource Table Information":"Datasource Table",
"Company Name":"ชื่อบริษัท"
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment