Skip to content

Commit

Permalink
fix(Project Overview): Indicate that resource usage for migrated proj… (
Browse files Browse the repository at this point in the history
#5981)

* fix(Project Overview): Indicate that resource usage for migrated projects is visible on new platform

* fix(Link-Check): Adjust links to new wiki

---------

Co-authored-by: Ubuntu <[email protected]>
  • Loading branch information
vktrrdk and Ubuntu authored Dec 11, 2023
1 parent 2e0a5ef commit 0bcb732
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 24 deletions.
4 changes: 4 additions & 0 deletions src/app/applications/application.model/application.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ export class Application {
return this.project_application_statuses?.includes(Application_States.SUBMITTED);
}

public isMigrated(): boolean {
return this.migrate_to_simple_vm || this.migrated_simple_vm_resources;
}

public hasTerminatedStatus(): boolean {
return this.project_application_statuses?.includes(Application_States.TERMINATED);
}
Expand Down
5 changes: 4 additions & 1 deletion src/app/pipe-module/pipe-module.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { IsFutureTimePipe } from './pipes/futureTime.pipe';
import { IsMigratedProjectIdPipe } from './pipes/migratedList';
import { HasStatusNotInListPipe } from './pipes/has-status-not-in-list.pipe';
import { SignificancePipe } from '../shared/shared_modules/components/maintenance-notification/significance-pipe/significance.pipe';
import { IsMigratedProjectPipe } from './pipes/isMigratedProject';

/**
* Pipemodule
Expand All @@ -39,6 +40,7 @@ import { SignificancePipe } from '../shared/shared_modules/components/maintenanc
IsMigratedProjectIdPipe,
HasStatusNotInListPipe,
SignificancePipe,
IsMigratedProjectPipe,
],
exports: [
FlavorCounterPipe,
Expand All @@ -59,8 +61,9 @@ import { SignificancePipe } from '../shared/shared_modules/components/maintenanc
IsMigratedProjectIdPipe,
HasStatusNotInListPipe,
SignificancePipe,
IsMigratedProjectPipe,
],
imports: [CommonModule],
providers: [IsMigratedProjectIdPipe],
providers: [],
})
export class PipeModuleModule {}
14 changes: 14 additions & 0 deletions src/app/pipe-module/pipes/isMigratedProject.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Pipe, PipeTransform } from '@angular/core';
import { Application } from 'app/applications/application.model/application.model';

/**
* Pipe which returns whether a certain project is migrated or marked for migration to SimpleVM-Platform.
*/
@Pipe({
name: 'isMigratedProject',
})
export class IsMigratedProjectPipe implements PipeTransform {
transform(projectApplication: Application) {
return projectApplication.isMigrated();
}
}
2 changes: 1 addition & 1 deletion src/app/pipe-module/pipes/migratedList.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Pipe, PipeTransform } from '@angular/core';

/**
* Pipe which returns counter of flavors.
* Pipe which returns whether a project id belongs to a migrated project or not.
*/
@Pipe({
name: 'isMigratedProjectId',
Expand Down
30 changes: 23 additions & 7 deletions src/app/projectmanagement/overview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,17 @@ <h3>
<div class="col-6">
<div
*ngIf="this.resourceDataLoaded"
class="callout callout-info"
class="callout"
[ngClass]="(project_application | isMigratedProject) ? 'callout-warning' : 'callout-info'"
style="border-top-width: 0; border-bottom-width: 0; border-right-width: 0"
>
<small class="text-muted">Computational Resources</small><br />
<strong *ngIf="project_application?.project_application_openstack_project" class="text-muted"
<strong
*ngIf="
project_application?.project_application_openstack_project ||
(project_application | isMigratedProject)
"
class="text-muted"
>{{ maximumVMs }} VMs with a total of {{ project_application?.project_application_total_cores }} VCPUs
and {{ project_application?.project_application_total_ram }} GBs of RAM
<span
Expand All @@ -420,7 +426,12 @@ <h3>
{{ project_application?.project_modification_request?.date_submitted }}
</span>
</strong>
<strong *ngIf="!project_application?.project_application_openstack_project" class="text-muted"
<strong
*ngIf="
!project_application?.project_application_openstack_project &&
!(project_application | isMigratedProject)
"
class="text-muted"
>{{ vmsInUse }} of {{ maximumVMs }} VMS, {{ coresInUse }} of
{{ project_application?.project_application_total_cores }} VCPUs and {{ ramInUse }}
of
Expand All @@ -436,7 +447,10 @@ <h3>
</span> </strong
><br />
<div
*ngIf="!project_application?.project_application_openstack_project"
*ngIf="
!project_application?.project_application_openstack_project &&
!(project_application | isMigratedProject)
"
class="progress"
style="height: 2px"
>
Expand All @@ -448,6 +462,10 @@ <h3>
role="progressbar"
></div>
</div>
<small class="text-muted" *ngIf="project_application | isMigratedProject">
Please consider: As the project is migrated, the amount of used resources is visible in the
<a [href]="NEW_SVM_PORTAL_LINK" target="_blank" rel="noopener noreferrer">SimpleVM platform</a>.
</small>
</div>
</div>
<div class="col-6">
Expand Down Expand Up @@ -503,9 +521,7 @@ <h3>
<a
*ngIf="!project_application?.project_application_openstack_project && isAbleToStart()"
class="btn btn-outline-success"
[href]="
project_application?.migrated_simple_vm_resources ? NEW_SVM_PORTAL_LINK : '#/virtualmachines/newVM'
"
[href]="(project_application | isMigratedProject) ? NEW_SVM_PORTAL_LINK : '#/virtualmachines/newVM'"
>Start a VM</a
>
<a
Expand Down
30 changes: 15 additions & 15 deletions src/links/check_links.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/bin/bash
WIKI_SNAPSHOTS=https://portal-dev.denbi.de/wiki/simple_vm/snapshots/
WIKI_SNAPSHOTS=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/snapshots/
WIKI=https://portal-dev.denbi.de/wiki/
WIKI_GENERATE_KEYS=https://portal-dev.denbi.de/wiki/quickstart/#generate-ssh-keys
WIKI_NEWS_MANAGEMENT=https://portal-dev.denbi.de/wiki/cloud_admin/news_management/
WIKI_SIMPLEVM_CUSTOMISATION=https://portal-dev.denbi.de/wiki/simple_vm/customization/
WIKI_EXTEND_VOLUME=https://portal-dev.denbi.de/wiki/simple_vm/volumes/#extend-a-volume
WIKI_VOLUME_OVERVIEW=https://portal-dev.denbi.de/wiki/simple_vm/volumes/
WIKI_RESENV_LINK=https://portal-dev.denbi.de/wiki/simple_vm/customization/#research-environments
WIKI_RSTUDIO_LINK=https://portal-dev.denbi.de/wiki/simple_vm/customization/#rstudio
WIKI_GUACAMOLE_LINK=https://portal-dev.denbi.de/wiki/simple_vm/customization/#apache-guacamole
WIKI_NEW_INSTANCE_LINK=https://portal-dev.denbi.de/wiki/simple_vm/new_instance/
WIKI_INSTANCE_OVERVIEW_LINK=https://portal-dev.denbi.de/wiki/simple_vm/instance_overview/
WIKI_INSTANCE_DETAIL_LINK=https://portal-dev.denbi.de/wiki/simple_vm/instance_detail/
WIKI_LINK_ACCOUNTS=https://portal-dev.denbi.de/wiki/portal/user_information/#link-accounts-to-elixir
WIKI_SIMPLEVM_CUSTOMISATION=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/customization/
WIKI_EXTEND_VOLUME=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/volumes/#extend-a-volume
WIKI_VOLUME_OVERVIEW=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/volumes/
WIKI_RESENV_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/customization/#research-environments
WIKI_RSTUDIO_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/customization/#rstudio
WIKI_GUACAMOLE_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/customization/#apache-guacamole
WIKI_NEW_INSTANCE_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/new_instance/
WIKI_INSTANCE_OVERVIEW_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/instance_overview/
WIKI_INSTANCE_DETAIL_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/instance_detail/
WIKI_LINK_ACCOUNTS=https://simplevm-dev.bi.denbi.de/wiki/portal/user_information/#link-accounts-to-elixir
SCALE_SCRIPT_LINK=https://raw.githubusercontent.com/deNBI/user_scripts/master/bibigrid/scaling.py
SCALING_UP_WIKI=https://portal-dev.denbi.de/wiki/simple_vm/Cluster/cluster_overview/#3-scale-up
SCALING_UP_WIKI=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/Cluster/cluster_overview/#3-scale-up
WIKI_PUBLICATIONS=https://portal-dev.denbi.de/wiki/citation_and_publication/#publications
WIKI_MEMBER_MANAGEMENT=https://portal-dev.denbi.de/wiki/portal/project_overview/#member-management
WIKI_FAQ=https://portal-dev.denbi.de/wiki/FAQ/
WIKI_MOTD=https://portal-dev.denbi.de/wiki/cloud_admin/news_management/#message-of-the-day
WIKI_CREATE_SNAPSHOT_LINK=https://portal-dev.denbi.de/wiki/simple_vm/snapshots/#create-snapshot
WIKI_VOLUMES_LINK=https://portal-dev.denbi.de/wiki/simple_vm/volumes/
WIKI_CREATE_SNAPSHOT_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/snapshots/#create-snapshot
WIKI_VOLUMES_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/volumes/
WIKI_MOSH_LINK=https://portal-dev.denbi.de/wiki/Tutorials/Mosh/
WIKI_PERSONAL_DATA=https://portal-dev.denbi.de/wiki/portal/personal_data/
WIKI_EPHEMERAL_LINK=https://portal-dev.denbi.de/wiki/simple_vm/new_instance/#information-for-ephemeral-flavors
WIKI_EPHEMERAL_LINK=https://simplevm-dev.bi.denbi.de/wiki/simple_vm/new_instance/#information-for-ephemeral-flavors
SURVEY_LINK=https://www.surveymonkey.de/r/HQW9V7C


Expand Down

0 comments on commit 0bcb732

Please sign in to comment.