| <!-- |
| ~ Licensed to the Apache Software Foundation (ASF) under one |
| ~ or more contributor license agreements. See the NOTICE file |
| ~ distributed with this work for additional information |
| ~ regarding copyright ownership. The ASF licenses this file |
| ~ to you under the Apache License, Version 2.0 (the |
| ~ "License"); you may not use this file except in compliance |
| ~ with the License. You may obtain a copy of the License at |
| ~ |
| ~ http://www.apache.org/licenses/LICENSE-2.0 |
| ~ |
| ~ Unless required by applicable law or agreed to in writing, |
| ~ software distributed under the License is distributed on an |
| ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ~ KIND, either express or implied. See the License for the |
| ~ specific language governing permissions and limitations |
| ~ under the License. |
| --> |
| |
| <div class="source"> |
| |
| <div *ngIf="!resources?.length"> |
| <span *ngIf="!resources.length" class="no-details">no details</span> |
| </div> |
| <div *ngIf="resources?.length"> |
| <div *ngFor="let resource of resources" class="resource-wrap"> |
| <div class="resource-name"> |
| <a class="detailed-link" (click)="detailComputationalResources(environment, resource)"> |
| {{resource.computational_name}} |
| </a> |
| </div> |
| <span ngClass="{{resource.status.toLowerCase() || ''}}" class="resource-status">{{resource.status}}</span> |
| |
| <div class="resource-actions"> |
| <a class="schedule" [ngClass]="{'active': resource.scheduler_data, |
| 'not-allowed': environment.status !== 'running' && environment.status !== 'stopped' |
| || resource.status !== 'running' && resource.status !== 'stopped' }"> |
| <i class="material-icons" (click)="openScheduleDialog(resource)">schedule</i> |
| </a> |
| |
| <a class="start-stop-action" |
| *ngIf="resource.image === 'docker.dlab-dataengine' && environment.status === 'running'"> |
| <i class="material-icons" *ngIf="resource.status === 'running' || resource.status === 'stopping'" |
| (click)="toggleResourceAction(resource, 'stop')" |
| [ngClass]="{'not-allowed' : resource.status === 'stopping' }">pause_circle_outline</i> |
| <i class="material-icons" *ngIf="resource.status === 'stopped' || resource.status === 'starting'" |
| (click)="toggleResourceAction(resource, 'start')" |
| [ngClass]="{'not-allowed' : resource.status === 'starting' }">play_circle_outline</i> |
| </a> |
| |
| <a class="remove_butt" [ngClass]="{'disabled' : environment.status !== 'running' || environment.status !== 'stopped' |
| && resource.status != 'running' && resource.status != 'failed' && resource.status != 'stopped' }" |
| (click)="toggleResourceAction(resource, 'terminate')"> |
| <i class="material-icons">highlight_off</i> |
| </a> |
| </div> |
| </div> |
| </div> |
| </div> |