activate()

in src/app/webserver/vdirs/vdir-list.component.ts [329:365]


    activate() {
        if (this.loaded) {
            return;
        }
        if (this.website) {
            //
            // Load by WebSite
            this._service.getBySite(this.website).then(_ => {
                this._service.vdirs.subscribe(vdirs => {
                    this.loaded = true;
                    this._vdirs = [];
                    vdirs.forEach(v => {
                        if (v.website.id == this.website.id
                            && !this.isRootVdir(v)
                            && !this.isNonSiteVdir(v)) {
                            this._vdirs.push(v);
                        }
                    });
                });
            });
        }
        if (this.webapp) {
            //
            // Load by WebApp
            this._service.getByApp(this.webapp).then(_ => {
                this._service.vdirs.subscribe(vdirs => {
                    this.loaded = true;
                    this._vdirs = [];
                    vdirs.forEach(v => {
                        if (v.webapp.id == this.webapp.id && v.path != '/') {
                            this._vdirs.push(v);
                        }
                    });
                });
            });
        }
    }