Commit 9c09491a authored by ibuler's avatar ibuler

[Update] 修改收藏取消收藏谈消息

parent cb08d616
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"styles": [ "styles": [
"node_modules/animate.css/animate.min.css", "node_modules/animate.css/animate.min.css",
"node_modules/xterm/dist/xterm.css", "node_modules/xterm/dist/xterm.css",
"node_modules/ngx-toastr/toastr.css",
"src/sass/style.scss", "src/sass/style.scss",
"src/styles.css", "src/styles.css",
"src/assets/ztree/awesomeStyle/awesome.css" "src/assets/ztree/awesomeStyle/awesome.css"
......
...@@ -8906,6 +8906,14 @@ ...@@ -8906,6 +8906,14 @@
"vlq": "^1.0.0" "vlq": "^1.0.0"
} }
}, },
"ngx-toastr": {
"version": "10.2.0",
"resolved": "https://registry.npmjs.org/ngx-toastr/-/ngx-toastr-10.2.0.tgz",
"integrity": "sha512-6ASr5bcvQmtNKb4D2VEsQjCXyROq6GwberBWO0bVt+xcBYPUea4aRTgX8in9apX9buaTafzG+h3HlnIraspoPg==",
"requires": {
"tslib": "^1.9.0"
}
},
"nice-try": { "nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
"utf-8-validate": "^5.0.2" "utf-8-validate": "^5.0.2"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "~7.2.0", "@angular/animations": "^7.2.0",
"@angular/cdk": "^7.3.7", "@angular/cdk": "^7.3.7",
"@angular/common": "~7.2.0", "@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0", "@angular/compiler": "~7.2.0",
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
"neffos.js": "^0.1.19", "neffos.js": "^0.1.19",
"ngx-cookie-service": "^1.0.10", "ngx-cookie-service": "^1.0.10",
"ngx-logger": "4.0.4", "ngx-logger": "4.0.4",
"ngx-toastr": "^10.2.0",
"popper.js": "^1.14.7", "popper.js": "^1.14.7",
"requirejs": "^2.3.5", "requirejs": "^2.3.5",
"rxjs": "~6.3.3", "rxjs": "~6.3.3",
......
...@@ -4,6 +4,8 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms'; // <-- NgModel ...@@ -4,6 +4,8 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms'; // <-- NgModel
import {NGXLogger} from 'ngx-logger'; import {NGXLogger} from 'ngx-logger';
import {HttpClientModule} from '@angular/common/http'; import {HttpClientModule} from '@angular/common/http';
import {CookieService} from 'ngx-cookie-service'; import {CookieService} from 'ngx-cookie-service';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {ToastrModule} from 'ngx-toastr';
import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material'; import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material';
// service // service
...@@ -26,8 +28,10 @@ import {AssetTreeDialogComponent, ManualPasswordDialogComponent} from './element ...@@ -26,8 +28,10 @@ import {AssetTreeDialogComponent, ManualPasswordDialogComponent} from './element
BrowserModule, BrowserModule,
FormsModule, FormsModule,
HttpClientModule, HttpClientModule,
BrowserAnimationsModule,
ReactiveFormsModule, ReactiveFormsModule,
AppRouterModule, AppRouterModule,
ToastrModule.forRoot(),
...PluginModules ...PluginModules
], ],
declarations: [ declarations: [
......
...@@ -3,6 +3,7 @@ import {MatDialog} from '@angular/material'; ...@@ -3,6 +3,7 @@ import {MatDialog} from '@angular/material';
import {BehaviorSubject, Subject} from 'rxjs'; import {BehaviorSubject, Subject} from 'rxjs';
import {takeUntil} from 'rxjs/operators'; import {takeUntil} from 'rxjs/operators';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {ToastrService} from 'ngx-toastr';
import {groupBy} from '@app/utils/common'; import {groupBy} from '@app/utils/common';
import {AppService, HttpService, LogService, NavService, SettingService, TreeFilterService} from '@app/services'; import {AppService, HttpService, LogService, NavService, SettingService, TreeFilterService} from '@app/services';
...@@ -56,7 +57,8 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy { ...@@ -56,7 +57,8 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
public _logger: LogService, public _logger: LogService,
private activatedRoute: ActivatedRoute, private activatedRoute: ActivatedRoute,
private _http: HttpService, private _http: HttpService,
private settingSvc: SettingService private settingSvc: SettingService,
private toastr: ToastrService
) {} ) {}
ngOnInit() { ngOnInit() {
...@@ -301,10 +303,12 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy { ...@@ -301,10 +303,12 @@ export class ElementAssetTreeComponent implements OnInit, OnDestroy {
this._http.favoriteAsset(assetId, false).subscribe(() => { this._http.favoriteAsset(assetId, false).subscribe(() => {
const i = this.favoriteAssets.indexOf(assetId); const i = this.favoriteAssets.indexOf(assetId);
this.favoriteAssets.splice(i, 1); this.favoriteAssets.splice(i, 1);
this.toastr.success(translate('Favorite') + ' ' + translate('success'));
}); });
} else { } else {
this._http.favoriteAsset(assetId, true).subscribe(() => { this._http.favoriteAsset(assetId, true).subscribe(() => {
this.favoriteAssets.push(assetId); this.favoriteAssets.push(assetId);
this.toastr.success(translate('Disfavor') + ' ' + translate('success'));
}); });
} }
} }
......
...@@ -78,5 +78,6 @@ ...@@ -78,5 +78,6 @@
"cols": "列数", "cols": "列数",
"rows": "行数", "rows": "行数",
"favorite": "收藏", "favorite": "收藏",
"disfavor": "取消收藏" "disfavor": "取消收藏",
"success": "成功"
} }
...@@ -124,3 +124,17 @@ body ::-webkit-scrollbar-thumb { ...@@ -124,3 +124,17 @@ body ::-webkit-scrollbar-thumb {
display: inline-block; display: inline-block;
font: normal normal normal 14px/1 FontAwesome !important; font: normal normal normal 14px/1 FontAwesome !important;
} }
#toast-container > .toast-warning:before {
}
#toast-container > .toast-error:before {
}
#toast-container > .toast-info:before {
}
#toast-container > .toast-success:before {
content: "";
}
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