1 import {Plugin, IUserProperties} from "app/models";
2 import {CacheService} from "app/services";
3 import {PluginsService} from "../../ng2/services/plugins.service";
6 interface IPluginsTabViewModelScope extends ng.IScope {
13 onLoadingDone(plugin: Plugin): void;
16 export class PluginsTabViewModel {
20 'Sdc.Services.CacheService',
24 constructor(private $scope:IPluginsTabViewModelScope,
25 private $stateParams:any,
26 private cacheService:CacheService,
27 private pluginsService:PluginsService) {
32 private initScope = ():void => {
33 this.$scope.isLoading = true;
34 this.$scope.plugin = this.pluginsService.getPluginByStateUrl(this.$stateParams.path);
35 this.$scope.version = this.cacheService.get('version');
36 this.$scope.user = this.cacheService.get('user');
38 this.$scope.queryParams = {
39 userId: this.$scope.user.userId,
40 userRole: this.$scope.user.role,
42 parentUrl: window.location.origin,
43 eventsClientId: this.$scope.plugin.pluginId
46 this.$scope.onLoadingDone = (plugin: Plugin) => {
47 if (plugin.pluginId == this.$scope.plugin.pluginId) {
48 this.$scope.isLoading = false;