<commit_before>import { Component, OnInit } from '@angular/core';

import { Cluster } from '../cluster';
import { ClusterPersistenceService } from '../cluster-persistence.service';
import { User } from '../user';

@Component({
  selector: 'app-session-ops',
  templateUrl: './session-ops.component.html',
  styleUrls: ['./session-ops.component.css']
})
export class SessionOpsComponent implements OnInit
{
   public user: User;
   
   private get cluster(): Cluster { return this._persistenceSvc.currentClusterSubject.value; }
   public get clusterName(): string { return this.cluster.name};
   public set clusterName( aName: string) { this.cluster.name = aName};
   
   private getUser(): void
   {
      // ".then()" --> hooks up promise resolution event, I think.  Resolution will drive a UI "digest" cycle that will
      // result in the UI being updated with new data.  At this point, I'll just go ahead and call Angular "amazing".

      this._persistenceSvc.user.then( 
         user => {
            console.log( `user = ${user}`);
            console.log( `cluster has ${this.cluster.numSystems} systems`);
            this.user = user;
         });
   }

   constructor( /* private _cluster: Cluster, */ private _persistenceSvc: ClusterPersistenceService) { }

   ngOnInit()
   {
      this.getUser();           // I think this basically hooks up the promise resolution event.
   }

   public login()
   {
      let me = this.constructor.name + ".login(): ";
      console.log( me + "logging in");<commit_msg>Verify that slash in cluster name causes problems.<commit_after>import { Component, OnInit } from '@angular/core';

import { Cluster } from '../cluster';
import { ClusterPersistenceService } from '../cluster-persistence.service';
import { User } from '../user';

@Component({
  selector: 'app-session-ops',
  templateUrl: './session-ops.component.html',
  styleUrls: ['./session-ops.component.css']
})
export class SessionOpsComponent implements OnInit
{
   public user: User;
   
   private get cluster(): Cluster { return this._persistenceSvc.currentClusterSubject.value; }
   public get clusterName(): string { return this.cluster.name};
   public set clusterName( aName: string)
   {
      // let me = this.constructor.name + '.set clusterName(): ';
      this.cluster.name = aName
      // let jsonStringifiedName = JSON.stringify( aName);
      // console.log( me + `JSON name: ${jsonStringifiedName}`);
   };
   
   private getUser(): void
   {
      // ".then()" --> hooks up promise resolution event, I think.  Resolution will drive a UI "digest" cycle that will
      // result in the UI being updated with new data.  At this point, I'll just go ahead and call Angular "amazing".

      this._persistenceSvc.user.then( 
         user => {
            console.log( `user = ${user}`);
            console.log( `cluster has ${this.cluster.numSystems} systems`);
            this.user = user;
         });
   }

   constructor( /* private _cluster: Cluster, */ private _persistenceSvc: ClusterPersistenceService) { }

   ngOnInit()
   {
      this.getUser();           // I think this basically hooks up the promise resolution event.
   }

   public login()
   {
      let me = this.constructor.name + ".login(): ";
      console.log( me + "logging in");
{'fraction_non_alphanumeric': 0.1323170731707317, 'fraction_numerical': 0.0, 'mean_word_length': 2.855464159811986, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5044832', 'n_tokens_mistral': 920, 'n_tokens_neox': 906, 'n_words': 284}