|
| 1 | +<!-- |
| 2 | + ~ Copyright 2017-2019 Bagaev Dmitry |
| 3 | + ~ |
| 4 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + ~ you may not use this file except in compliance with the License. |
| 6 | + ~ You may obtain a copy of the License at |
| 7 | + ~ |
| 8 | + ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + ~ |
| 10 | + ~ Unless required by applicable law or agreed to in writing, software |
| 11 | + ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + ~ See the License for the specific language governing permissions and |
| 14 | + ~ limitations under the License. |
| 15 | + --> |
| 16 | + |
| 17 | +<div class="ui main content container text fade slow element" style="max-width: 1050px !important; padding-bottom: 75px;"> |
| 18 | + <div class="ui raised segments"> |
| 19 | + <h3 class="ui top attached header centered">Reference search </h3> |
| 20 | + <ng-container [ngSwitch]="isAlive | async"> |
| 21 | + <ng-container *ngSwitchCase="1"> <!-- UNDEFINED --> |
| 22 | + <div class="ui teal segment raised"> |
| 23 | + <div class="ui active centered inline loader"></div> |
| 24 | + </div> |
| 25 | + </ng-container> |
| 26 | + <ng-container *ngSwitchCase="2"> <!-- ALIVE --> |
| 27 | + <div class="ui teal segment raised" [ngClass]="{ 'loading': isLoading | async }"> |
| 28 | + <refsearch-filters></refsearch-filters> |
| 29 | + </div> |
| 30 | + <div class="ui segment raised"> |
| 31 | + <div class="ui grid middle aligned"> |
| 32 | + |
| 33 | + <div class="three wide column"> |
| 34 | + <button class="ui teal fluid button" (click)="search()" [ngClass]="{ 'loading': isLoading | async }">Search</button> |
| 35 | + </div> |
| 36 | + |
| 37 | + <div class="ten wide column"></div> |
| 38 | + |
| 39 | + <div class="three wide column"> |
| 40 | + <button class="ui blue fluid button" (click)="reset()" [ngClass]="{ 'disabled': isLoading | async }">Reset filters</button> |
| 41 | + </div> |
| 42 | + |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + <div class="ui segment raised" *ngIf="(error | async) as errmsg"> |
| 46 | + <div class="ui negative message"> |
| 47 | + <div class="header"> |
| 48 | + Error has occured during the search request |
| 49 | + </div> |
| 50 | + <p>{{ errmsg }}</p> |
| 51 | + </div> |
| 52 | + |
| 53 | + </div> |
| 54 | + <div class="ui segment raised" [ngClass]="{ 'loading': isLoading | async }" *ngIf="!(error | async)"> |
| 55 | + <refsearch-table [rows]="rows | async"></refsearch-table> |
| 56 | + </div> |
| 57 | + </ng-container> |
| 58 | + <ng-container *ngSwitchCase="3"> <!-- UNREACHABLE --> |
| 59 | + <div class="ui teal segment raised"> |
| 60 | + <h2 class="ui center aligned icon header"> |
| 61 | + <i class="exclamation triangle icon"></i> |
| 62 | + The server is unreachable |
| 63 | + <div class="sub header"> |
| 64 | + The reference search backend is not available at the moment. Please, try again later. |
| 65 | + </div> |
| 66 | + </h2> |
| 67 | + </div> |
| 68 | + </ng-container> |
| 69 | + </ng-container> |
| 70 | + </div> |
| 71 | +</div> |
0 commit comments