mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	Add version check to app frame
This commit is contained in:
		
							parent
							
								
									7b6dccf5ef
								
							
						
					
					
						commit
						bfd11060ec
					
				@ -183,8 +183,20 @@
 | 
				
			|||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </li>
 | 
					          </li>
 | 
				
			||||||
          <li class="nav-item mt-2">
 | 
					          <li class="nav-item mt-2">
 | 
				
			||||||
            <div class="px-3 py-2 text-muted small">
 | 
					            <div class="px-3 py-2 text-muted small d-flex align-items-center flex-wrap">
 | 
				
			||||||
              {{versionString}}
 | 
					              <div class="me-3">{{ versionString }}</div>
 | 
				
			||||||
 | 
					              <div *ngIf="appRemoteVersion?.greater_than_current" class="version-check">
 | 
				
			||||||
 | 
					                <ng-template #updatePopContent>
 | 
				
			||||||
 | 
					                  <span class="small">Paperless-ngx v{{ appRemoteVersion.version }} <ng-container i18n>is available.</ng-container><br/><ng-container i18n>Click to view.</ng-container></span>
 | 
				
			||||||
 | 
					                </ng-template>
 | 
				
			||||||
 | 
					                <a class="small text-decoration-none" target="_blank" rel="noopener noreferrer" href="https://github.com/paperless-ngx/paperless-ngx/releases"
 | 
				
			||||||
 | 
					                [ngbPopover]="updatePopContent" popoverClass="shadow" triggers="mouseenter:mouseleave" container="body">
 | 
				
			||||||
 | 
					                  <svg fill="currentColor" class="me-1" width="1.2em" height="1.2em" style="vertical-align: text-top;" viewBox="0 0 16 16">
 | 
				
			||||||
 | 
					                    <use xlink:href="assets/bootstrap-icons.svg#info-circle" />
 | 
				
			||||||
 | 
					                  </svg>
 | 
				
			||||||
 | 
					                  <ng-container i18n>Update available</ng-container>
 | 
				
			||||||
 | 
					                </a>
 | 
				
			||||||
 | 
					              </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </li>
 | 
					          </li>
 | 
				
			||||||
        </ul>
 | 
					        </ul>
 | 
				
			||||||
 | 
				
			|||||||
@ -176,3 +176,22 @@
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.version-check {
 | 
				
			||||||
 | 
					  animation: pulse 2s ease-in-out 0s 1;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@keyframes pulse {
 | 
				
			||||||
 | 
					  0% {
 | 
				
			||||||
 | 
					    opacity: 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  25% {
 | 
				
			||||||
 | 
					    opacity: 100%;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  75% {
 | 
				
			||||||
 | 
					    opacity: 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  100% {
 | 
				
			||||||
 | 
					    opacity: 100%;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,10 @@ import { DocumentDetailComponent } from '../document-detail/document-detail.comp
 | 
				
			|||||||
import { Meta } from '@angular/platform-browser'
 | 
					import { Meta } from '@angular/platform-browser'
 | 
				
			||||||
import { DocumentListViewService } from 'src/app/services/document-list-view.service'
 | 
					import { DocumentListViewService } from 'src/app/services/document-list-view.service'
 | 
				
			||||||
import { FILTER_FULLTEXT_QUERY } from 'src/app/data/filter-rule-type'
 | 
					import { FILTER_FULLTEXT_QUERY } from 'src/app/data/filter-rule-type'
 | 
				
			||||||
 | 
					import {
 | 
				
			||||||
 | 
					  RemoteVersionService,
 | 
				
			||||||
 | 
					  AppRemoteVersion,
 | 
				
			||||||
 | 
					} from 'src/app/services/rest/remote-version.service'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Component({
 | 
					@Component({
 | 
				
			||||||
  selector: 'app-app-frame',
 | 
					  selector: 'app-app-frame',
 | 
				
			||||||
@ -32,10 +36,18 @@ export class AppFrameComponent {
 | 
				
			|||||||
    private searchService: SearchService,
 | 
					    private searchService: SearchService,
 | 
				
			||||||
    public savedViewService: SavedViewService,
 | 
					    public savedViewService: SavedViewService,
 | 
				
			||||||
    private list: DocumentListViewService,
 | 
					    private list: DocumentListViewService,
 | 
				
			||||||
    private meta: Meta
 | 
					    private meta: Meta,
 | 
				
			||||||
  ) {}
 | 
					    private remoteVersionService: RemoteVersionService
 | 
				
			||||||
 | 
					  ) {
 | 
				
			||||||
 | 
					    this.remoteVersionService
 | 
				
			||||||
 | 
					      .checkForUpdates()
 | 
				
			||||||
 | 
					      .subscribe((appRemoteVersion: AppRemoteVersion) => {
 | 
				
			||||||
 | 
					        this.appRemoteVersion = appRemoteVersion
 | 
				
			||||||
 | 
					      })
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  versionString = `${environment.appTitle} ${environment.version}`
 | 
					  versionString = `${environment.appTitle} ${environment.version}`
 | 
				
			||||||
 | 
					  appRemoteVersion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  isMenuCollapsed: boolean = true
 | 
					  isMenuCollapsed: boolean = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -271,6 +271,7 @@ table.table {
 | 
				
			|||||||
  .popover-body {
 | 
					  .popover-body {
 | 
				
			||||||
    background-color: var(--ngx-bg-alt);
 | 
					    background-color: var(--ngx-bg-alt);
 | 
				
			||||||
    border-color: var(--bs-border-color);
 | 
					    border-color: var(--bs-border-color);
 | 
				
			||||||
 | 
					    color: var(--bs-body-color);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user