This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 8123 default_server; | |
| listen [::]:8123 default_server; | |
| server_name your_server; | |
| add_header Strict-Transport-Security "max-age=31536000"; | |
| access_log /var/log/nginx/some_app.access.log; | |
| error_log /var/log/nginx/some_app.error.log; | |
| location / { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| root /opt/www; | |
| # Add index.php to the list if you are using PHP | |
| index index.html index.htm index.nginx-debian.html; | |
| server_name your_server www.your_server; | |
| location / { | |
| # First attempt to serve request as file, then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| memtotal=$(free | grep Mem | awk '{ print $2 }') | |
| memuse=$(free | grep Mem | awk '{ print $3 }') | |
| let "memusepercent = $memuse * 100 / $memtotal " | |
| let "memtolerance = $memtotal * 0.9 " | |
| echo "MemTotal: $memtotal (Usage tolerance: $memtolerance )" | |
| echo "MemUsed: $memuse ($memusepercent %)" | |
| if [ $memuse -ge $memtolerance ]; then | |
| echo "Memory use over 90%" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** UIRouter Config */ | |
| export function uiRouterConfigFn(router: UIRouter, injector: Injector) { | |
| // If no URL matches, go to the `login` state by default | |
| router.urlService.rules.otherwise({ | |
| state: 'login' | |
| }); | |
| const transitionService = router.transitionService; | |
| requiresAuthHook(transitionService); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const redirectToLogin = (transition) => { | |
| const authService: AuthService = transition.injector().get(AuthService); | |
| const $state = transition.router.stateService; | |
| if (!authService.isAuthenticated()) { | |
| return $state.target('login', undefined, { location: false }); | |
| } else { | |
| const toState = transition.to(); | |
| try { | |
| if (!toState.data.routeEnabled) { | |
| return $state.target(null, undefined, { location: false }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| name: 'main.dashboards', | |
| url: '/dashboards', | |
| data: { | |
| requiresAuth: true, | |
| routeEnabled: true | |
| }, | |
| views: { | |
| 'desktop-view@main': DashboardsPageComponent | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| imports: [ | |
| UIRouterModule.forRoot({ | |
| states: APP_STATES, | |
| useHash: true, | |
| otherwise: { state: 'home' }, | |
| config: routerConfigFn, | |
| }), | |
| GlobalModule, | |
| BrowserModule, | |
| FormsModule, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { TransitionService } from '@uirouter/core'; | |
| import { AuthService } from './auth.service'; | |
| /** | |
| * This file contains a Transition Hook which protects a | |
| * route that requires authentication. | |
| * | |
| * This hook redirects to /login when both: | |
| * - The user is not authenticated | |
| * - The user is navigating to a state that requires authentication |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| const _ = require('lodash'); | |
| const Utils = require('../../utils'); | |
| const DataTypes = require('../../data-types'); | |
| const TableHints = require('../../table-hints'); | |
| const AbstractQueryGenerator = require('../abstract/query-generator'); | |
| const randomBytes = require('crypto').randomBytes; | |
| const semver = require('semver'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="row mt-3"> | |
| <div class="col-2 p-1 text-center align-self-center" | |
| [ngClass]="{ | |
| 'bg-info': item.color === 'blue', | |
| 'bg-success': item.color === 'green', | |
| 'bg-warning': item.color === 'yellow', | |
| 'bg-danger': item.color === 'red', | |
| 'bounceIn': filterApplied | |
| }" | |
| [ngStyle]="(filterApplied)?{ 'animation-delay': (150 + gridIdx * 1000 / filteredData.length ) + 'ms' }:{}" |