Compare commits
No commits in common. "8856f25eacf4d555d6fbd6a568c1fe25acee29ce" and "75f7caf2cc57aa3b78e4e5a8a6274122d6a7d4f3" have entirely different histories.
8856f25eac
...
75f7caf2cc
|
@ -1,5 +1,5 @@
|
|||
PUBLIC_URL=/network-resurrector/
|
||||
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://lab.code-rove.com/tuitio/identity/authenticate?UserName={username}&Password={password}
|
||||
REACT_APP_IDENTITY_AUTHENTICATION_URL=https://lab.code-rove.com/identity-server-api/identity/authenticate?UserName={username}&Password={password}
|
||||
REACT_APP_NETWORK_RESURRECTOR_API_URL=https://lab.code-rove.com/network-resurrector-api
|
||||
|
||||
#900000 milliseconds = 15 minutes
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "network-resurrector-frontend",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1328,9 +1328,9 @@
|
|||
}
|
||||
},
|
||||
"@flare/js-utils": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://lab.code-rove.com/public-node-registry/@flare%2fjs-utils/-/js-utils-1.0.2.tgz",
|
||||
"integrity": "sha512-49KjpcRUD6fXPC60bmCsPa8frU6wlQyI5RsjMD70zsuvk8BZFdopsETsjsCembbmzTScIhfMACU4RnimOEwg9Q=="
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://lab.code-rove.com/public-node-registry/@flare%2fjs-utils/-/js-utils-1.0.1.tgz",
|
||||
"integrity": "sha512-54zfXBeof4ns9wEGvUeORd6SiAvCcUNEIiamnLtbASVMY6TxrpGp7UL+Dm7iGdC5jmDb5stla6I8aHroQuvvqg=="
|
||||
},
|
||||
"@gar/promisify": {
|
||||
"version": "1.1.3",
|
||||
|
@ -4033,15 +4033,6 @@
|
|||
"integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
|
||||
"optional": true
|
||||
},
|
||||
"bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"file-uri-to-path": "1.0.0"
|
||||
}
|
||||
},
|
||||
"bluebird": {
|
||||
"version": "3.7.2",
|
||||
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
|
||||
|
@ -7010,12 +7001,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"optional": true
|
||||
},
|
||||
"filesize": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/filesize/-/filesize-6.1.0.tgz",
|
||||
|
@ -11149,12 +11134,6 @@
|
|||
"resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz",
|
||||
"integrity": "sha512-cnAsSVxIDsYt0v7HmC0hWZFwwXSh+E6PgCrREDuN/EsjgLwA5XRmlMHhSiDPrt6HxY1gTivEa/Zh7GtODoLevQ=="
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.17.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz",
|
||||
"integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==",
|
||||
"optional": true
|
||||
},
|
||||
"nanoid": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
|
||||
|
@ -16306,11 +16285,7 @@
|
|||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
|
||||
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"bindings": "^1.5.0",
|
||||
"nan": "^2.12.1"
|
||||
}
|
||||
"optional": true
|
||||
},
|
||||
"glob-parent": {
|
||||
"version": "3.1.0",
|
||||
|
@ -16888,11 +16863,7 @@
|
|||
"version": "1.2.13",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
|
||||
"integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"bindings": "^1.5.0",
|
||||
"nan": "^2.12.1"
|
||||
}
|
||||
"optional": true
|
||||
},
|
||||
"glob-parent": {
|
||||
"version": "3.1.0",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "network-resurrector-frontend",
|
||||
"version": "1.1.2",
|
||||
"description": "Frontend component of Network resurrector system",
|
||||
"version": "1.1.1",
|
||||
"description": "Frontend component of Network resurrector",
|
||||
"author": {
|
||||
"name": "Tudor Stanciu",
|
||||
"email": "tudor.stanciu94@gmail.com",
|
||||
|
@ -9,11 +9,11 @@
|
|||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector-frontend"
|
||||
"url": "https://dev.azure.com/tstanciu94/NetworkResurrector/_git/NetworkResurrector_Frontend"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@flare/js-utils": "^1.0.2",
|
||||
"@flare/js-utils": "^1.0.0",
|
||||
"@material-ui/core": "^4.11.2",
|
||||
"@material-ui/icons": "^4.11.2",
|
||||
"@testing-library/jest-dom": "^5.11.6",
|
||||
|
|
|
@ -1,3 +1,20 @@
|
|||
#######################################################################################################################################################
|
||||
Azure DevOps Repository Password: nih65lpohjpmyru3sarcsg62rc26nknsksi7fqo7bas37ssqhpna
|
||||
#######################################################################################################################################################
|
||||
|
||||
***********
|
||||
** INFO: **
|
||||
***********
|
||||
|
||||
In gridul de retea, pe fiecare linie va fi un buton care va deschide un log.
|
||||
Log-ul va fi popup iar continutul lui poate fi ultima componenta de aici https://material-ui.com/components/app-bar/
|
||||
**************************************************************************************************************************
|
||||
|
||||
https://medium.com/@tacomanator/environments-with-create-react-app-7b645312c09d
|
||||
https://create-react-app.dev/docs/adding-custom-environment-variables/
|
||||
https://stackoverflow.com/questions/55690143/what-is-the-difference-between-env-local-and-env-development-local
|
||||
|
||||
|
||||
REACT v4:
|
||||
https://v4.mui.com/getting-started/installation/
|
||||
https://v4.mui.com/components/material-icons/
|
|
@ -0,0 +1,37 @@
|
|||
#######################################################################################################################################################
|
||||
Docker commands:
|
||||
*****************
|
||||
|
||||
Create image:
|
||||
--from solution folder:
|
||||
docker image build -t "network-resurrector-frontend:1.0.0" .
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t "tstanciu/sta-registry:network-resurrector-frontend-1.0.0-arm32v7" --push .
|
||||
|
||||
Run image:
|
||||
docker run -p 5053:80 -it network-resurrector-frontend:1.0.0
|
||||
|
||||
Push image to registry:
|
||||
--tag image
|
||||
docker tag network-resurrector-frontend:1.0.0 alpine-nexus:8500/network-resurrector/network-resurrector-frontend:1.0.0
|
||||
|
||||
--login to registry
|
||||
docker login --username=admin --password="***********" alpine-nexus:8500
|
||||
|
||||
--push image
|
||||
docker push alpine-nexus:8500/network-resurrector/network-resurrector-frontend:1.0.0
|
||||
|
||||
Pull image from registry
|
||||
--login to registry
|
||||
|
||||
--pull image
|
||||
docker pull alpine-nexus:8500/network-resurrector/network-resurrector-frontend:1.0.0
|
||||
|
||||
Run container in prod env
|
||||
docker run -d --name network-resurrector-frontend --restart=always -p 5009:80 alpine-nexus:8500/network-resurrector/network-resurrector-frontend:1.0.0
|
||||
|
||||
Rename container
|
||||
docker rename <container_id> network-resurrector-frontend
|
||||
#######################################################################################################################################################
|
||||
|
||||
Docker container last version: 1.0.0
|
||||
#######################################################################################################################################################
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
echo "Welcome!"
|
||||
|
||||
version="1.1.0"
|
||||
registryPass="***********"
|
||||
|
||||
echo "Create docker image with version $version."
|
||||
docker image build --build-arg APP_VERSION=$version -t "network-resurrector-frontend:$version" .
|
||||
|
||||
echo "Tag docker image with registry prefix."
|
||||
docker tag network-resurrector-frontend:$version alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
|
||||
|
||||
echo "Login to alpine-nexus registry."
|
||||
docker login --username=admin --password=$registryPass alpine-nexus:8500
|
||||
|
||||
echo "Push image network-resurrector-frontend:$version to registry."
|
||||
docker push alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
|
||||
|
||||
echo "DONE!"
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/sh
|
||||
echo "Welcome!"
|
||||
|
||||
version="1.1.0"
|
||||
oldver="1.0.1"
|
||||
|
||||
echo "Pull docker image network-resurrector-frontend:$version from registry."
|
||||
docker pull alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
|
||||
|
||||
echo "Stop old container."
|
||||
docker stop network-resurrector-frontend && docker rm network-resurrector-frontend
|
||||
|
||||
echo "Run new container."
|
||||
docker run -d --name network-resurrector-frontend --restart=always -p 5009:80 alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$version
|
||||
|
||||
echo "Remove old image network-resurrector-frontend:$oldver."
|
||||
docker rmi alpine-nexus:8500/network-resurrector/network-resurrector-frontend:$oldver
|
||||
|
||||
echo "Get container logs:"
|
||||
docker logs network-resurrector-frontend
|
||||
|
||||
echo "DONE!"
|
|
@ -11,7 +11,7 @@ const useApi = () => {
|
|||
let message;
|
||||
switch (err?.status) {
|
||||
case 500:
|
||||
message = err.title;
|
||||
message = `${err.title} ${err.correlationId}`;
|
||||
break;
|
||||
|
||||
case 404:
|
||||
|
@ -19,7 +19,7 @@ const useApi = () => {
|
|||
break;
|
||||
|
||||
default:
|
||||
message = err.title;
|
||||
message = `${err.title} ${err.correlationId}`;
|
||||
}
|
||||
|
||||
error(message);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { localStorage } from "@flare/js-utils";
|
||||
import { getItem } from "../utils/localStorage";
|
||||
import { storageKeys } from "../utils/identity";
|
||||
|
||||
const { getItem } = localStorage;
|
||||
const token = getItem(storageKeys.TOKEN);
|
||||
const userName = getItem(storageKeys.USER);
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import axios from "axios";
|
||||
import i18next from "i18next";
|
||||
import { localStorage } from "@flare/js-utils";
|
||||
import { getItem } from "./localStorage";
|
||||
import { storageKeys } from "./identity";
|
||||
|
||||
const { getItem } = localStorage;
|
||||
|
||||
function getHeaders() {
|
||||
const token = getItem(storageKeys.TOKEN);
|
||||
const language = i18next.language;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import { request } from "./axios";
|
||||
import { localStorage } from "@flare/js-utils";
|
||||
|
||||
const { setItem, getItem, removeItem } = localStorage;
|
||||
import { setItem, getItem, removeItem } from "./localStorage";
|
||||
|
||||
const storageKeys = {
|
||||
TOKEN: "AUTHORIZATION_TOKEN",
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
import { typeValidator } from "@flare/js-utils";
|
||||
|
||||
const setItem = (key, value) => {
|
||||
const { isArray, isObject } = typeValidator;
|
||||
let valueToStore = value;
|
||||
if (isArray(value) || isObject(value)) {
|
||||
valueToStore = JSON.stringify(value);
|
||||
}
|
||||
|
||||
window.localStorage.setItem(key, valueToStore);
|
||||
};
|
||||
|
||||
const getItem = key => {
|
||||
var value = window.localStorage.getItem(key);
|
||||
const { isJson } = typeValidator;
|
||||
var { data, success } = isJson(value);
|
||||
|
||||
if (success) {
|
||||
return data;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
const removeItem = key => {
|
||||
window.localStorage.removeItem(key);
|
||||
};
|
||||
|
||||
const clear = () => {
|
||||
window.localStorage.clear();
|
||||
};
|
||||
|
||||
const key = index => {
|
||||
var keyName = window.localStorage.key(index);
|
||||
return keyName;
|
||||
};
|
||||
|
||||
export { setItem, getItem, removeItem, clear, key };
|
Loading…
Reference in New Issue