| <!-- |
| ~ 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="install-libraries" id="dialog-box"> |
| <header class="dialog-header"> |
| <h4 class="modal-title">Manage <span>{{ notebook?.name }}</span> Libraries</h4> |
| <button type="button" class="close" (click)="dialogRef.close()">×</button> |
| </header> |
| <div class="dialog-content"> |
| <div class="aligner"> |
| <div class="info" *ngIf="notebook?.status !== 'running'"> |
| <p class=" message">Cannot install libraries: Exploratory |
| <strong>{{ notebook?.name }}</strong> is not running</p> |
| </div> |
| <div class="loading-block" *ngIf="!libs_uploaded && uploading && data.status === 'running'"> |
| <div class="uploading"> |
| <p>Please wait until DLab loads full list of available libraries for you...</p> |
| <img src="assets/img/gif-spinner.gif" alt="loading"> |
| </div> |
| </div> |
| <div *ngIf="notebook?.status === 'running' && !uploading" class="lib-view-wrap"> |
| <div class="search-box"> |
| <div class="search-form"> |
| <div> |
| <div class="control-group constol-select"> |
| <label class="label">Select resource</label> |
| <div class="control"> |
| <dropdown-list #resourceSelect (selectedItem)="onUpdate($event)" (emitClick)="emitClick()"></dropdown-list> |
| </div> |
| </div> |
| <div class="control-group control-select"> |
| <label class="label">Select group</label> |
| <div class="control"> |
| <dropdown-list #groupSelect (selectedItem)="onUpdate($event)" (emitClick)="emitClick()"></dropdown-list> |
| <span class="error-message" *ngIf="!group && libSearch.value">Group field is required. Please choose appropriate group.</span> |
| </div> |
| </div> |
| </div> |
| <p class="other-message"> |
| <span *ngIf="group === 'others'">Other group can include libs from Python 2 and Python 3 groups</span> |
| </p> |
| <div class="search"> |
| <mat-form-field class="chip-list"> |
| <input |
| type="text" |
| [placeholder]="group === 'java' ? |
| 'Enter library name in <groupId>:<artifactId>:<versionId> format' : |
| 'Enter library name in <name>:<version> format(version is not required)'" |
| matInput |
| #trigger="matAutocompleteTrigger" |
| [formControl]="libSearch" |
| [value]="query" |
| [matAutocomplete]="auto" |
| > |
| <!-- <span class="add-icon" [matTooltip]="(isInSelectedList || isInstalled) ? 'Current library dosen\'t exist' : 'You have already added or installed current library'"--> |
| <!-- matTooltipPosition="above"--> |
| <!-- [matTooltipDisabled] = "isLibExist && (isInSelectedList || isInstalled)"--> |
| <span class="add-icon"> |
| <button mat-icon-button class="btn" [disabled]="!isLibExist || query.length < 1 || |
| isDuplicated({name: query.slice(0, query.indexOf(':')), version: query.slice(query.indexOf(':') + 1) || 'N/A'})" (click)="addLibrary(query);$event.stopPropagation()"> |
| <mat-icon matSuffix >add</mat-icon> |
| </button> |
| </span> |
| |
| <mat-autocomplete #auto="matAutocomplete" class="suggestions" > |
| <ng-template ngFor let-item [ngForOf]="filteredList" let-i="index" *ngIf="query.indexOf(':') === -1"> |
| <mat-option [ngClass]="{ 'not-allowed': isDuplicated(item) }"> |
| <div class="option" (click)="selectLibrary(item)"> |
| <a *ngIf="!isDuplicated(item)"> |
| <span [innerHTML]="item.name | highlight:query"></span> |
| <!-- <span *ngIf="item.version && item.version !== 'N/A'">{{ item.version }}</span>--> |
| </a> |
| <span *ngIf="isInSelectedList || isInstalled">{{ item.name }} |
| <span *ngIf="item.version && item.version !== 'N/A'">{{ item.version }}</span> |
| </span> |
| |
| <strong *ngIf="isInSelectedList">selected |
| <i class="material-icons">done</i> |
| </strong> |
| <strong *ngIf="isInstalled">installed |
| <i class="material-icons">done</i> |
| </strong> |
| </div> |
| </mat-option> |
| </ng-template> |
| <mat-option *ngIf="model.isEmpty(filteredList) && !validity_format && query.indexOf(':') === -1"> |
| <span class="configuring">No matches found</span> |
| </mat-option> |
| <mat-option *ngIf="validity_format?.length > 0"> |
| <span class="configuring" *ngIf="query.indexOf(':') === -1">{{ validity_format }}</span > |
| </mat-option> |
| </mat-autocomplete> |
| </mat-form-field> |
| <div class="list-selected list-container" id='scrolling'> |
| <mat-chip-list *ngIf="model.selectedLibs.length && libs_uploaded"> |
| <mat-chip *ngFor="let item of model.selectedLibs"> |
| {{ item.name }} |
| <span *ngIf="item.version && item.version !== 'N/A'"> {{ item.version }}</span> |
| <strong> ({{ groupsListMap[item.group] }}) </strong> |
| <a class="material-icons" (click)="removeSelectedLibrary(item)">clear</a> |
| </mat-chip> |
| </mat-chip-list> |
| </div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="libs-info"> |
| <mat-list> |
| <mat-list-item class="list-header"> |
| <div class="lib-name">Name |
| <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()"> |
| <i class="material-icons"> |
| <span>more_vert</span> |
| </i> |
| </button></div> |
| <div class="lib-group">Group |
| <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()"> |
| <i class="material-icons"> |
| <span>more_vert</span> |
| </i> |
| </button> |
| </div> |
| <div class="lib-destination"><span class="">Destination</span> |
| <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()"> |
| <i class="material-icons"> |
| <span>more_vert</span> |
| </i> |
| </button> |
| </div> |
| <div class="lib-resource-type">Resource type |
| <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()"> |
| <i class="material-icons"> |
| <span>more_vert</span> |
| </i> |
| </button> |
| </div> |
| <div class="lib-status"><span>Status</span> |
| <button mat-icon-button aria-label="More" class="ar" (click)="toggleFilterRow()"> |
| <i class="material-icons"> |
| <span>more_vert</span> |
| </i> |
| </button> |
| </div> |
| </mat-list-item> |
| |
| <ng-container *ngIf="filtered" > |
| <mat-list-item class="lib-col filter-row"> |
| <th class="lib-name lib-input"> |
| <input placeholder="Filter by library name" [value]="filterModel.name" (input)="filterModel.name = $event.target['value']" type="text" class="form-control filter-field "/> |
| </th> |
| <th class="lib-group lib-col"> |
| <multi-select-dropdown |
| (selectionChange)="onFilterUpdate($event)" |
| [items]="this.filterConfiguration.group" |
| [type]="'group'" |
| [model]="this.filterModel.group" |
| > |
| </multi-select-dropdown> |
| </th> |
| <th class="lib-destination lib-col"> |
| <multi-select-dropdown |
| (selectionChange)="onFilterUpdate($event)" |
| [items]="this.filterConfiguration.resource" |
| [type]="'resource'" |
| [model]="this.filterModel.resource" |
| > |
| </multi-select-dropdown> |
| </th> |
| <th class="lib-resource-type lib-col"> |
| <multi-select-dropdown |
| (selectionChange)="onFilterUpdate($event)" |
| [items]="this.filterConfiguration.resourceType" |
| [type]="'resource type'" |
| [model]="this.filterModel.resourceType" |
| > |
| </multi-select-dropdown> |
| </th> |
| <th class="lib-status lib-col"> |
| <multi-select-dropdown |
| (selectionChange)="onFilterUpdate($event)" |
| [items]="this.filterConfiguration.status" |
| [type]="'status'" |
| [model]="this.filterModel.status"> |
| </multi-select-dropdown> |
| </th> |
| <ng-container matColumnDef="action-filter" stickyEnd> |
| <th mat-header-cell> |
| <div class="filter-actions"> |
| <button mat-icon-button class="btn reset" (click)="resetFilterConfigurations()"> |
| <i class="material-icons">close</i> |
| </button> |
| |
| <button mat-icon-button class="btn apply" (click)="filterLibs()"> |
| <i class="material-icons" [ngClass]="{'not-allowed': filterModel.length === 0}">done</i> |
| </button> |
| </div> |
| </th> |
| </ng-container> |
| </mat-list-item> |
| </ng-container> |
| |
| <div class="scrollingList" id="scrolling" *ngIf="notebookLibs?.length"> |
| <!-- <div *ngIf="notebook?.status !== 'running' && notebookFailedLibs.length > 0" class="info message">--> |
| <!-- <p>Cannot retry to reinstall failed libraries: Exploratory {{ notebook?.name }} is not running</p>--> |
| <!-- </div>--> |
| <ng-container *ngFor="let lib of filtredNotebookLibs"> |
| <mat-list-item class="table-item"> |
| <div class="lib-name ellipsis"> |
| <strong>{{ lib.name }}</strong> |
| <span *ngIf="lib.version && lib.version !== 'N/A'">{{ lib.version }}</span> |
| </div> |
| <div class="lib-group-col">{{ groupsListMap[lib.group] }}</div> |
| <div class="st-group"> |
| <ng-template let-item ngFor [ngForOf]="lib.filteredStatus"> |
| <div class="wrap-col"> |
| <div class="lib-destination-col">{{ item.resource }}</div> |
| <div class="lib-resource-type-col">{{ item.resourceType }}</div> |
| <div class="lib-status-col" ngClass="{{ item.status.toLowerCase() || 'failed' }}">{{ item.status }} |
| <div class="warn-action" *ngIf="(item.status === 'failed' || item.status === 'invalid version') && notebook?.status === 'running'"> |
| <div *ngIf="!item.available_versions"> |
| <span *ngIf="!installingInProgress" (click)="reinstallLibrary(item, lib)" matTooltip="Retry installation" matTooltipPosition="above"> |
| <i class="material-icons">replay</i> |
| </span> |
| <span class="not-allowed" *ngIf="installingInProgress" matTooltip="You can't reinstall library until previous process will be completed" |
| matTooltipPosition="above"> |
| <i class="material-icons">replay</i> |
| </span> |
| </div> |
| <div *ngIf="item.status === 'failed' && item.error" class="lib-error" (click)="showErrorMessage(item)"> |
| <i class="material-icons">error_outline</i> |
| </div> |
| <div class="lib-error" |
| *ngIf="item.status === 'invalid version' && item.available_versions?.length" class="lib-error" |
| (click)="openLibInfo(item, 'available');$event.stopPropagation()" |
| matTooltip="Show available version" matTooltipPosition="above" |
| > |
| <i class="material-icons terminated">error_outline</i> |
| </div> |
| </div> |
| <div class="warn-action" matTooltip="Show installed dependency" matTooltipPosition="above" *ngIf="item.add_pkgs?.length"> |
| <span class="info-icon" (click)="openLibInfo(item, 'added');$event.stopPropagation() "> |
| <i class="material-icons">info</i> |
| </span> |
| </div> |
| </div> |
| </div> |
| |
| </ng-template> |
| </div> |
| </mat-list-item> |
| |
| <!-- <mat-list-item *ngIf="isLibInfoOpened[lib.name]">--> |
| <!-- <div class="lib-info">--> |
| <!-- <ul class="libs-version">--> |
| |
| <!-- <li class="dependency-list-header">--> |
| <!-- List of available version:--> |
| <!-- </li>--> |
| |
| <!--<!– <div class="scrolling-content delete-list" id="scrolling">–>--> |
| |
| <!-- <li *ngFor="let object of [1,2,3]" class="delete-item list-item">--> |
| <!-- <!– <div class="object">–>--> |
| <!-- {{lib.name+lib.version}}--> |
| <!-- <!– </div>–>--> |
| <!-- <!– <div class="size">v2.3.4</div>–>--> |
| <!-- <button mat-raised-button type="button" class="butt action">Install</button>--> |
| <!-- </li>--> |
| |
| <!--<!– </div>–>--> |
| <!-- </ul>--> |
| <!-- </div>--> |
| <!-- </mat-list-item>--> |
| </ng-container> |
| <div *ngIf="!filtredNotebookLibs.length && notebookLibs?.length" class="scrollingList info message"> |
| <p>No matches found</p> |
| </div> |
| </div> |
| <div *ngIf="!notebookLibs?.length" class="scrollingList info message"> |
| <p>You have no libraries installed</p> |
| </div> |
| </mat-list> |
| </div> |
| <div class="m-top-15 actions" *ngIf="!uploading && notebook?.status === 'running'"> |
| <button mat-raised-button type="button" class="butt action" (click)="dialogRef.close()">Close</button> |
| <button mat-raised-button type="submit" class="butt butt-success action" (click)="model.confirmAction()" [disabled]="!model.selectedLibs.length || installingInProgress || !destination">Install</button> |
| </div> |
| </div> |
| </div> |
| </div> |