forked from apache/hertzbeat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] HertzBeat Official Template Marketplace [apache#1792]
- Loading branch information
1 parent
679e019
commit b8f69c1
Showing
62 changed files
with
10,499 additions
and
748 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
template-marketplace/hertzbeat-template-hub-web-app/.prettierrc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
250 changes: 57 additions & 193 deletions
250
...te-marketplace/hertzbeat-template-hub-web-app/src/app/layout/market/market.component.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
254 changes: 12 additions & 242 deletions
254
...ketplace/hertzbeat-template-hub-web-app/src/app/routes/home-page/home-page.component.html
Large diffs are not rendered by default.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
...ketplace/hertzbeat-template-hub-web-app/src/app/routes/home-page/home-page.component.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
.image-container { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: relative; | ||
width: 300px; | ||
height: 300px; | ||
margin: auto; | ||
} | ||
|
||
.img1, .img2 { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
} | ||
|
||
.img2 { | ||
opacity: 0.7; | ||
} | ||
|
69 changes: 69 additions & 0 deletions
69
...late-marketplace/hertzbeat-template-hub-web-app/src/app/routes/login/login.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<!-- | ||
~ Licensed to the Apache Software Foundation (ASF) under one | ||
~ or more contributor license agreements. See the NOTICE file | ||
~ distributed with this work for additional information | ||
~ regarding copyright ownership. The ASF licenses this file | ||
~ to you under the Apache License, Version 2.0 (the | ||
~ "License"); you may not use this file except in compliance | ||
~ with the License. You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, | ||
~ software distributed under the License is distributed on an | ||
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
~ KIND, either express or implied. See the License for the | ||
~ specific language governing permissions and limitations | ||
~ under the License. | ||
--> | ||
|
||
<main> | ||
<div class="tp-register__area pt-xxl-4 pb-xxl-5"> | ||
<div class="container"> | ||
<div class="row justify-content-center"> | ||
<div class="col-xl-6"> | ||
<div class="tp-register__form-box"> | ||
<div class="tp-register__form-title text-center mb-5"> | ||
<h6>邮箱登录</h6> | ||
<!-- <span>邮箱登录 <br>--> | ||
<!-- & become our partner</span>--> | ||
</div> | ||
<form> | ||
<div class="row"> | ||
<div class="col-xl-12"> | ||
<div class="tp-register__input-box"> | ||
<label for="email">Email 地址</label> | ||
<input id="email" type="email" placeholder="邮箱地址"> | ||
</div> | ||
</div> | ||
<div class="col-xl-12"> | ||
<div class="tp-register__input-box"> | ||
<label for="password">密码</label> | ||
<input id="password" type="password" placeholder="密码"> | ||
<a href="" class="tp-register__input-text">忘记密码?</a> | ||
</div> | ||
</div> | ||
<div class="col-xl-12"> | ||
<div class="tp-contact-4__comment-agree label-2 pt-5 pb-5"> | ||
<div class="form-check-box"> | ||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault"> | ||
<label class="form-check-label text-theme" for="flexCheckDefault"> | ||
我同意 xxx & <span class="red">xxx</span> 和 xxx | ||
</label> | ||
</div> | ||
</div> | ||
<div class="tp-contact-4__btn"> | ||
<!-- <button nz-button (click)="submitLogin()" nzType="primary">登录</button>--> | ||
<button type="button" class="tp-btn-square w-100" (click)="submitLogin()">登录</button> | ||
<!-- <button class="tp-btn-square w-100">登录</button>--> | ||
<button type="button" class="tp-btn-square w-100">去注册</button> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> |
18 changes: 18 additions & 0 deletions
18
...late-marketplace/hertzbeat-template-hub-web-app/src/app/routes/login/login.component.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
*/ |
74 changes: 74 additions & 0 deletions
74
template-marketplace/hertzbeat-template-hub-web-app/src/app/routes/login/login.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import {Component, Injector, OnDestroy, OnInit} from '@angular/core'; | ||
import {FormBuilder} from '@angular/forms'; | ||
import {AuthService, LoginDTO} from "../../service/auth.service"; | ||
import {LocalStorageService} from "../../service/local-storage.service"; | ||
import {NzMessageService} from "ng-zorro-antd/message"; | ||
import {Router} from "@angular/router"; | ||
import {NzButtonComponent} from "ng-zorro-antd/button"; | ||
|
||
@Component({ | ||
selector: 'login', | ||
templateUrl: './login.component.html', | ||
styleUrls: ['./login.component.less'], | ||
standalone: true, | ||
providers: [], | ||
imports: [ | ||
NzButtonComponent | ||
], | ||
// changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class LoginComponent implements OnInit,OnDestroy { | ||
constructor( | ||
fb: FormBuilder, | ||
private authService: AuthService, | ||
private localStorageService: LocalStorageService, | ||
private msg: NzMessageService, | ||
private injector: Injector, | ||
) {} | ||
|
||
loginForm: LoginDTO={ | ||
type:1, | ||
identifier:'[email protected]', | ||
credential:'123456', | ||
}; | ||
|
||
submitLogin():void{ | ||
this.authService.tryLogin(this.loginForm).subscribe(response => { | ||
if(response.code == 0) { | ||
console.log(response); | ||
this.localStorageService.storageAuthorizationToken(response.data.token); | ||
this.localStorageService.storageRefreshToken(response.data.refreshToken); | ||
this.msg.success('登录成功'); | ||
this.localStorageService.putData('userInfo',this.loginForm.identifier); | ||
this.injector.get(Router).navigateByUrl('/'); | ||
}else{ | ||
this.msg.error('登录失败:'+response.msg) | ||
} | ||
}) | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
|
||
ngOnDestroy(): void { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.