Merge branch 'master' into develop/flex-layout

This commit is contained in:
Igor Kulikov 2024-10-22 18:01:50 +03:00
commit bbdc351bcf
9 changed files with 35 additions and 20 deletions

View File

@ -56,13 +56,13 @@ sudo yum update
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install packages # Install packages
sudo yum -y install epel-release yum-utils sudo yum -y install epel-release yum-utils
sudo yum-config-manager --enable pgdg15 sudo yum-config-manager --enable pgdg16
sudo yum install postgresql15-server postgresql15 sudo yum install postgresql16-server postgresql16 postgresql16-contrib
# Initialize your PostgreSQL DB # Initialize your PostgreSQL DB
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
sudo systemctl start postgresql-15 sudo systemctl start postgresql-16
# Optional: Configure PostgreSQL to start on boot # Optional: Configure PostgreSQL to start on boot
sudo systemctl enable --now postgresql-15 sudo systemctl enable --now postgresql-16
{:copy-code} {:copy-code}
``` ```
@ -74,12 +74,12 @@ sudo systemctl enable --now postgresql-15
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# Install packages # Install packages
sudo dnf -qy module disable postgresql sudo dnf -qy module disable postgresql
sudo dnf -y install postgresql15 postgresql15-server sudo dnf -y install postgresql16 postgresql16-server postgresql16-contrib
# Initialize your PostgreSQL DB # Initialize your PostgreSQL DB
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb sudo /usr/pgsql-16/bin/postgresql-16-setup initdb
sudo systemctl start postgresql-15 sudo systemctl start postgresql-16
# Optional: Configure PostgreSQL to start on boot # Optional: Configure PostgreSQL to start on boot
sudo systemctl enable --now postgresql-15 sudo systemctl enable --now postgresql-16
{:copy-code} {:copy-code}
``` ```
@ -101,7 +101,7 @@ After configuring the password, edit the pg_hba.conf to use MD5 authentication w
Edit pg_hba.conf file: Edit pg_hba.conf file:
```bash ```bash
sudo nano /var/lib/pgsql/15/data/pg_hba.conf sudo nano /var/lib/pgsql/16/data/pg_hba.conf
{:copy-code} {:copy-code}
``` ```
@ -121,7 +121,7 @@ host all all 127.0.0.1/32 md5
Finally, you should restart the PostgreSQL service to initialize the new configuration: Finally, you should restart the PostgreSQL service to initialize the new configuration:
```bash ```bash
sudo systemctl restart postgresql-15.service sudo systemctl restart postgresql-16.service
{:copy-code} {:copy-code}
``` ```

View File

@ -38,7 +38,7 @@ services:
${EXTRA_HOSTS} ${EXTRA_HOSTS}
postgres: postgres:
restart: always restart: always
image: "postgres:15" image: "postgres:16"
ports: ports:
- "5432" - "5432"
environment: environment:

View File

@ -49,7 +49,7 @@ echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo
# install and launch the postgresql service: # install and launch the postgresql service:
sudo apt update sudo apt update
sudo apt -y install postgresql-15 sudo apt -y install postgresql-16
sudo service postgresql start sudo service postgresql start
{:copy-code} {:copy-code}
``` ```

View File

@ -21,7 +21,7 @@ services:
entrypoint: upgrade-tb-edge.sh entrypoint: upgrade-tb-edge.sh
postgres: postgres:
restart: always restart: always
image: "postgres:15" image: "postgres:16"
ports: ports:
- "5432" - "5432"
environment: environment:

View File

@ -19,7 +19,7 @@ version: '3.0'
services: services:
postgres: postgres:
restart: always restart: always
image: "postgres:15" image: "postgres:16"
ports: ports:
- "5432" - "5432"
environment: environment:

View File

@ -19,7 +19,7 @@ version: '3.0'
services: services:
postgres: postgres:
restart: always restart: always
image: "postgres:15" image: "postgres:16"
ports: ports:
- "5432" - "5432"
environment: environment:

View File

@ -16,7 +16,7 @@
FROM thingsboard/openjdk17:bookworm-slim FROM thingsboard/openjdk17:bookworm-slim
ENV PG_MAJOR=15 ENV PG_MAJOR=16
ENV DATA_FOLDER=/data ENV DATA_FOLDER=/data

View File

@ -21,6 +21,9 @@ import { Observable } from 'rxjs';
export function updateUserLang(translate: TranslateService, userLang: string, translations = env.supportedLangs): Observable<any> { export function updateUserLang(translate: TranslateService, userLang: string, translations = env.supportedLangs): Observable<any> {
let targetLang = userLang; let targetLang = userLang;
if (!translations) {
translations = env.supportedLangs;
}
if (!env.production) { if (!env.production) {
console.log(`User lang: ${targetLang}`); console.log(`User lang: ${targetLang}`);
} }

View File

@ -25,6 +25,7 @@ import { merge, Observable } from 'rxjs';
import { MenuSection } from '@core/services/menu.models'; import { MenuSection } from '@core/services/menu.models';
import { ActiveComponentService } from '@core/services/active-component.service'; import { ActiveComponentService } from '@core/services/active-component.service';
import { TbAnchorComponent } from '@shared/components/tb-anchor.component'; import { TbAnchorComponent } from '@shared/components/tb-anchor.component';
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
@Component({ @Component({
selector: 'tb-router-tabs', selector: 'tb-router-tabs',
@ -115,9 +116,20 @@ export class RouterTabsComponent extends PageComponent implements OnInit {
private buildTabsForRoutes(activatedRoute: ActivatedRoute): Array<MenuSection> { private buildTabsForRoutes(activatedRoute: ActivatedRoute): Array<MenuSection> {
const sectionPath = this.getSectionPath(activatedRoute); const sectionPath = this.getSectionPath(activatedRoute);
if (activatedRoute.routeConfig.children.length) { const authority = getCurrentAuthUser(this.store).authority;
const activeRouterChildren = activatedRoute.routeConfig.children.filter(page => page.path !== ''); const children = activatedRoute.routeConfig.children.filter(page => {
return activeRouterChildren.map(tab => ({ if (page.path !== '') {
if (page.data?.auth) {
return page.data?.auth.includes(authority);
} else {
return true;
}
} else {
return false;
}
});
if (children.length) {
return children.map(tab => ({
id: tab.component.name, id: tab.component.name,
type: 'link', type: 'link',
name: tab.data?.breadcrumb?.label ?? '', name: tab.data?.breadcrumb?.label ?? '',