Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
smart
Commits
833658b4
Commit
833658b4
authored
May 16, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化速度
parent
2da166ae
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1 addition
and
357 deletions
+1
-357
app.module.ts
src/main/webapp/app/app.module.ts
+0
-1
uib-pagination.config.ts
src/main/webapp/app/blocks/config/uib-pagination.config.ts
+1
-2
page-ribbon.component.ts
...main/webapp/app/layouts/profiles/page-ribbon.component.ts
+0
-25
page-ribbon.css
src/main/webapp/app/layouts/profiles/page-ribbon.css
+0
-32
profile-info.model.ts
src/main/webapp/app/layouts/profiles/profile-info.model.ts
+0
-6
profile.service.ts
src/main/webapp/app/layouts/profiles/profile.service.ts
+0
-30
alert-error.component.ts
src/main/webapp/app/shared/alert/alert-error.component.ts
+0
-100
alert.component.ts
src/main/webapp/app/shared/alert/alert.component.ts
+0
-28
error.constants.ts
src/main/webapp/app/shared/constants/error.constants.ts
+0
-4
pagination.constants.ts
src/main/webapp/app/shared/constants/pagination.constants.ts
+0
-1
index.ts
src/main/webapp/app/shared/index.ts
+0
-9
base-entity.ts
src/main/webapp/app/shared/model/base-entity.ts
+0
-4
request-util.ts
src/main/webapp/app/shared/model/request-util.ts
+0
-18
account.model.ts
src/main/webapp/app/shared/user/account.model.ts
+0
-12
user.model.ts
src/main/webapp/app/shared/user/user.model.ts
+0
-45
user.service.ts
src/main/webapp/app/shared/user/user.service.ts
+0
-40
No files found.
src/main/webapp/app/app.module.ts
View file @
833658b4
...
...
@@ -26,7 +26,6 @@ import {
}
from
'./layouts'
;
import
{
AppComponent
}
from
"./app.component"
;
import
{
RouterModule
}
from
"@angular/router"
;
import
{
DEBUG_INFO_ENABLED
}
from
"./app.constants"
;
import
{
route
}
from
"./app.route"
;
import
{
LoginGuard
}
from
"./shared/common/loginGuard"
;
import
{
AppMainModule
}
from
'./app.main.module'
;
...
...
src/main/webapp/app/blocks/config/uib-pagination.config.ts
View file @
833658b4
import
{
ITEMS_PER_PAGE
}
from
'../../shared'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
NgbPaginationConfig
}
from
'@ng-bootstrap/ng-bootstrap'
;
...
...
@@ -8,7 +8,6 @@ export class PaginationConfig {
constructor
(
private
config
:
NgbPaginationConfig
)
{
config
.
boundaryLinks
=
true
;
config
.
maxSize
=
5
;
config
.
pageSize
=
ITEMS_PER_PAGE
;
config
.
size
=
'sm'
;
}
}
src/main/webapp/app/layouts/profiles/page-ribbon.component.ts
deleted
100644 → 0
View file @
2da166ae
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ProfileService
}
from
'./profile.service'
;
import
{
ProfileInfo
}
from
'./profile-info.model'
;
@
Component
({
selector
:
'jhi-page-ribbon'
,
template
:
``
,
styleUrls
:
[
'page-ribbon.css'
]
})
export
class
PageRibbonComponent
implements
OnInit
{
profileInfo
:
ProfileInfo
;
ribbonEnv
:
string
;
constructor
(
private
profileService
:
ProfileService
)
{}
ngOnInit
()
{
// this.profileService.getProfileInfo().then((profileInfo) => {
// this.profileInfo = profileInfo;
// this.ribbonEnv = profileInfo.ribbonEnv;
// });
}
}
src/main/webapp/app/layouts/profiles/page-ribbon.css
deleted
100644 → 0
View file @
2da166ae
/* ==========================================================================
Developement Ribbon
========================================================================== */
.ribbon
{
background-color
:
rgba
(
170
,
0
,
0
,
0.5
);
left
:
-3.5em
;
moz-transform
:
rotate
(
-45deg
);
ms-transform
:
rotate
(
-45deg
);
o-transform
:
rotate
(
-45deg
);
webkit-transform
:
rotate
(
-45deg
);
transform
:
rotate
(
-45deg
);
overflow
:
hidden
;
position
:
absolute
;
top
:
40px
;
white-space
:
nowrap
;
width
:
15em
;
z-index
:
9999
;
pointer-events
:
none
;
opacity
:
0.75
;
}
.ribbon
a
{
color
:
#fff
;
display
:
block
;
font-weight
:
400
;
margin
:
1px
0
;
padding
:
10px
50px
;
text-align
:
center
;
text-decoration
:
none
;
text-shadow
:
0
0
5px
#444
;
pointer-events
:
none
;
}
src/main/webapp/app/layouts/profiles/profile-info.model.ts
deleted
100644 → 0
View file @
2da166ae
export
class
ProfileInfo
{
activeProfiles
:
string
[];
ribbonEnv
:
string
;
inProduction
:
boolean
;
swaggerEnabled
:
boolean
;
}
src/main/webapp/app/layouts/profiles/profile.service.ts
deleted
100644 → 0
View file @
2da166ae
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpResponse
}
from
'@angular/common/http'
;
import
{
SERVER_API_URL
}
from
'../../app.constants'
;
import
{
ProfileInfo
}
from
'./profile-info.model'
;
@
Injectable
()
export
class
ProfileService
{
private
profileInfoUrl
=
SERVER_API_URL
+
'api/profile-info'
;
private
profileInfo
:
Promise
<
ProfileInfo
>
;
constructor
(
private
http
:
HttpClient
)
{
}
getProfileInfo
():
Promise
<
ProfileInfo
>
{
if
(
!
this
.
profileInfo
)
{
this
.
profileInfo
=
this
.
http
.
get
<
ProfileInfo
>
(
this
.
profileInfoUrl
,
{
observe
:
'response'
})
.
map
((
res
:
HttpResponse
<
ProfileInfo
>
)
=>
{
const
data
=
res
.
body
;
const
pi
=
new
ProfileInfo
();
pi
.
activeProfiles
=
data
.
activeProfiles
;
pi
.
ribbonEnv
=
data
.
ribbonEnv
;
pi
.
inProduction
=
data
.
activeProfiles
.
includes
(
'prod'
)
;
pi
.
swaggerEnabled
=
data
.
activeProfiles
.
includes
(
'swagger'
);
return
pi
;
}).
toPromise
();
}
return
this
.
profileInfo
;
}
}
src/main/webapp/app/shared/alert/alert-error.component.ts
deleted
100644 → 0
View file @
2da166ae
import
{
Component
,
OnDestroy
}
from
'@angular/core'
;
import
{
JhiEventManager
,
JhiAlertService
}
from
'ng-jhipster'
;
import
{
Subscription
}
from
'rxjs/Subscription'
;
@
Component
({
selector
:
'jhi-alert-error'
,
template
:
`
<div class="alerts" role="alert">
<div *ngFor="let alert of alerts" [ngClass]="{\'alert.position\': true, \'toast\': alert.toast}">
<ngb-alert *ngIf="alert && alert.type && alert.msg" [type]="alert.type" (close)="alert.close(alerts)">
<pre [innerHTML]="alert.msg"></pre>
</ngb-alert>
</div>
</div>`
})
export
class
JhiAlertErrorComponent
implements
OnDestroy
{
alerts
:
any
[];
cleanHttpErrorListener
:
Subscription
;
// tslint:disable-next-line: no-unused-variable
constructor
(
private
alertService
:
JhiAlertService
,
private
eventManager
:
JhiEventManager
)
{
this
.
alerts
=
[];
this
.
cleanHttpErrorListener
=
eventManager
.
subscribe
(
'bootappApp.httpError'
,
(
response
)
=>
{
let
i
;
const
httpErrorResponse
=
response
.
content
;
switch
(
httpErrorResponse
.
status
)
{
// connection refused, server not reachable
case
0
:
this
.
addErrorAlert
(
'Server not reachable'
,
'error.server.not.reachable'
);
break
;
case
400
:
const
arr
=
httpErrorResponse
.
headers
.
keys
();
let
errorHeader
=
null
;
let
entityKey
=
null
;
arr
.
forEach
((
entry
)
=>
{
if
(
entry
.
endsWith
(
'app-error'
))
{
errorHeader
=
httpErrorResponse
.
headers
.
get
(
entry
);
}
else
if
(
entry
.
endsWith
(
'app-params'
))
{
entityKey
=
httpErrorResponse
.
headers
.
get
(
entry
);
}
});
if
(
errorHeader
)
{
const
entityName
=
entityKey
;
this
.
addErrorAlert
(
errorHeader
,
errorHeader
,
{
entityName
});
}
else
if
(
httpErrorResponse
.
error
!==
''
&&
httpErrorResponse
.
error
.
fieldErrors
)
{
const
fieldErrors
=
httpErrorResponse
.
error
.
fieldErrors
;
for
(
i
=
0
;
i
<
fieldErrors
.
length
;
i
++
)
{
const
fieldError
=
fieldErrors
[
i
];
// convert 'something[14].other[4].id' to 'something[].other[].id' so translations can be written to it
const
convertedField
=
fieldError
.
field
.
replace
(
/
\[\d
*
\]
/g
,
'[]'
);
const
fieldName
=
convertedField
.
charAt
(
0
).
toUpperCase
()
+
convertedField
.
slice
(
1
);
this
.
addErrorAlert
(
'Error on field "'
+
fieldName
+
'"'
,
'error.'
+
fieldError
.
message
,
{
fieldName
});
}
}
else
if
(
httpErrorResponse
.
error
!==
''
&&
httpErrorResponse
.
error
.
message
)
{
this
.
addErrorAlert
(
httpErrorResponse
.
error
.
message
,
httpErrorResponse
.
error
.
message
,
httpErrorResponse
.
error
.
params
);
}
else
{
this
.
addErrorAlert
(
httpErrorResponse
.
error
);
}
break
;
case
404
:
this
.
addErrorAlert
(
'Not found'
,
'error.url.not.found'
);
break
;
default
:
if
(
httpErrorResponse
.
error
!==
''
&&
httpErrorResponse
.
error
.
message
)
{
this
.
addErrorAlert
(
httpErrorResponse
.
error
.
message
);
}
else
{
this
.
addErrorAlert
(
httpErrorResponse
.
error
);
}
}
});
}
ngOnDestroy
()
{
if
(
this
.
cleanHttpErrorListener
!==
undefined
&&
this
.
cleanHttpErrorListener
!==
null
)
{
this
.
eventManager
.
destroy
(
this
.
cleanHttpErrorListener
);
this
.
alerts
=
[];
}
}
addErrorAlert
(
message
,
key
?,
data
?)
{
this
.
alerts
.
push
(
this
.
alertService
.
addAlert
(
{
type
:
'danger'
,
msg
:
message
,
timeout
:
5000
,
toast
:
this
.
alertService
.
isToast
(),
scoped
:
true
},
this
.
alerts
)
);
}
}
src/main/webapp/app/shared/alert/alert.component.ts
deleted
100644 → 0
View file @
2da166ae
import
{
Component
,
OnDestroy
,
OnInit
}
from
'@angular/core'
;
import
{
JhiAlertService
}
from
'ng-jhipster'
;
@
Component
({
selector
:
'jhi-alert'
,
template
:
`
<div class="alerts" role="alert">
<div *ngFor="let alert of alerts" [ngClass]="{\'alert.position\': true, \'toast\': alert.toast}">
<ngb-alert *ngIf="alert && alert.type && alert.msg" [type]="alert.type" (close)="alert.close(alerts)">
<pre [innerHTML]="alert.msg"></pre>
</ngb-alert>
</div>
</div>`
})
export
class
JhiAlertComponent
implements
OnInit
,
OnDestroy
{
alerts
:
any
[];
constructor
(
private
alertService
:
JhiAlertService
)
{
}
ngOnInit
()
{
this
.
alerts
=
this
.
alertService
.
get
();
}
ngOnDestroy
()
{
this
.
alerts
=
[];
}
}
src/main/webapp/app/shared/constants/error.constants.ts
deleted
100644 → 0
View file @
2da166ae
export
const
PROBLEM_BASE_URL
=
''
;
export
const
EMAIL_ALREADY_USED_TYPE
=
PROBLEM_BASE_URL
+
'/email-already-used'
;
export
const
LOGIN_ALREADY_USED_TYPE
=
PROBLEM_BASE_URL
+
'/login-already-used'
;
export
const
EMAIL_NOT_FOUND_TYPE
=
PROBLEM_BASE_URL
+
'/email-not-found'
;
src/main/webapp/app/shared/constants/pagination.constants.ts
deleted
100644 → 0
View file @
2da166ae
export
const
ITEMS_PER_PAGE
=
20
;
src/main/webapp/app/shared/index.ts
View file @
833658b4
export
*
from
'./constants/error.constants'
;
export
*
from
'./constants/pagination.constants'
;
export
*
from
'./alert/alert.component'
;
export
*
from
'./alert/alert-error.component'
;
export
*
from
'./auth/csrf.service'
;
export
*
from
'./auth/state-storage.service'
;
export
*
from
'./auth/account.service'
;
...
...
@@ -11,11 +7,6 @@ export * from './auth/has-any-authority.directive';
export
*
from
'./auth/user-route-access-service'
;
export
*
from
'./login/login.component'
;
export
*
from
'./login/login.service'
;
export
*
from
'./user/account.model'
;
export
*
from
'./user/user.model'
;
export
*
from
'./user/user.service'
;
export
*
from
'./model/request-util'
;
export
*
from
'./model/base-entity'
;
export
*
from
'./shared-libs.module'
;
export
*
from
'./shared-common.module'
;
export
*
from
'./shared.module'
;
src/main/webapp/app/shared/model/base-entity.ts
deleted
100644 → 0
View file @
2da166ae
export
interface
BaseEntity
{
// using type any to avoid methods complaining of invalid type
id
?:
any
;
}
src/main/webapp/app/shared/model/request-util.ts
deleted
100644 → 0
View file @
2da166ae
import
{
HttpParams
}
from
'@angular/common/http'
;
export
const
createRequestOption
=
(
req
?:
any
):
HttpParams
=>
{
let
options
:
HttpParams
=
new
HttpParams
();
if
(
req
)
{
Object
.
keys
(
req
).
forEach
((
key
)
=>
{
if
(
key
!==
'sort'
)
{
options
=
options
.
set
(
key
,
req
[
key
]);
}
});
if
(
req
.
sort
)
{
req
.
sort
.
forEach
((
val
)
=>
{
options
=
options
.
append
(
'sort'
,
val
);
});
}
}
return
options
;
};
src/main/webapp/app/shared/user/account.model.ts
deleted
100644 → 0
View file @
2da166ae
export
class
Account
{
constructor
(
public
activated
:
boolean
,
public
authorities
:
string
[],
public
email
:
string
,
public
firstName
:
string
,
public
langKey
:
string
,
public
lastName
:
string
,
public
login
:
string
,
public
imageUrl
:
string
)
{
}
}
src/main/webapp/app/shared/user/user.model.ts
deleted
100644 → 0
View file @
2da166ae
export
class
User
{
public
id
?:
any
;
public
login
?:
string
;
public
firstName
?:
string
;
public
lastName
?:
string
;
public
email
?:
string
;
public
activated
?:
Boolean
;
public
langKey
?:
string
;
public
authorities
?:
any
[];
public
createdBy
?:
string
;
public
createdDate
?:
Date
;
public
lastModifiedBy
?:
string
;
public
lastModifiedDate
?:
Date
;
public
password
?:
string
;
constructor
(
id
?:
any
,
login
?:
string
,
firstName
?:
string
,
lastName
?:
string
,
email
?:
string
,
activated
?:
Boolean
,
langKey
?:
string
,
authorities
?:
any
[],
createdBy
?:
string
,
createdDate
?:
Date
,
lastModifiedBy
?:
string
,
lastModifiedDate
?:
Date
,
password
?:
string
)
{
this
.
id
=
id
?
id
:
null
;
this
.
login
=
login
?
login
:
null
;
this
.
firstName
=
firstName
?
firstName
:
null
;
this
.
lastName
=
lastName
?
lastName
:
null
;
this
.
email
=
email
?
email
:
null
;
this
.
activated
=
activated
?
activated
:
false
;
this
.
langKey
=
langKey
?
langKey
:
null
;
this
.
authorities
=
authorities
?
authorities
:
null
;
this
.
createdBy
=
createdBy
?
createdBy
:
null
;
this
.
createdDate
=
createdDate
?
createdDate
:
null
;
this
.
lastModifiedBy
=
lastModifiedBy
?
lastModifiedBy
:
null
;
this
.
lastModifiedDate
=
lastModifiedDate
?
lastModifiedDate
:
null
;
this
.
password
=
password
?
password
:
null
;
}
}
src/main/webapp/app/shared/user/user.service.ts
deleted
100644 → 0
View file @
2da166ae
import
{
Injectable
}
from
'@angular/core'
;
import
{
HttpClient
,
HttpResponse
}
from
'@angular/common/http'
;
import
{
Observable
}
from
'rxjs/Observable'
;
import
{
SERVER_API_URL
}
from
'../../app.constants'
;
import
{
User
}
from
'./user.model'
;
import
{
createRequestOption
}
from
'../model/request-util'
;
@
Injectable
()
export
class
UserService
{
private
resourceUrl
=
SERVER_API_URL
+
'api/users'
;
constructor
(
private
http
:
HttpClient
)
{
}
create
(
user
:
User
):
Observable
<
HttpResponse
<
User
>>
{
return
this
.
http
.
post
<
User
>
(
this
.
resourceUrl
,
user
,
{
observe
:
'response'
});
}
update
(
user
:
User
):
Observable
<
HttpResponse
<
User
>>
{
return
this
.
http
.
put
<
User
>
(
this
.
resourceUrl
,
user
,
{
observe
:
'response'
});
}
find
(
login
:
string
):
Observable
<
HttpResponse
<
User
>>
{
return
this
.
http
.
get
<
User
>
(
`
${
this
.
resourceUrl
}
/
${
login
}
`
,
{
observe
:
'response'
});
}
query
(
req
?:
any
):
Observable
<
HttpResponse
<
User
[]
>>
{
const
options
=
createRequestOption
(
req
);
return
this
.
http
.
get
<
User
[]
>
(
this
.
resourceUrl
,
{
params
:
options
,
observe
:
'response'
});
}
delete
(
login
:
string
):
Observable
<
HttpResponse
<
any
>>
{
return
this
.
http
.
delete
(
`
${
this
.
resourceUrl
}
/
${
login
}
`
,
{
observe
:
'response'
});
}
authorities
():
Observable
<
string
[]
>
{
return
this
.
http
.
get
<
string
[]
>
(
SERVER_API_URL
+
'api/users/authorities'
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment