refactoring
This commit is contained in:
@@ -36,7 +36,7 @@ const Logbook: React.FC<unknown> = () => {
|
|||||||
? { headers: { Authorization: `${token}` } }
|
? { headers: { Authorization: `${token}` } }
|
||||||
: {};
|
: {};
|
||||||
const response: AxiosResponse = await httpClient.get(`api/logs`, config);
|
const response: AxiosResponse = await httpClient.get(`api/logs`, config);
|
||||||
|
console.log(response)
|
||||||
dispatch({ type: 'SET_ENTRIES', payload: response.data });
|
dispatch({ type: 'SET_ENTRIES', payload: response.data });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const axiosError = error as AxiosError;
|
const axiosError = error as AxiosError;
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ const SiteNav: React.FC<unknown> = () => {
|
|||||||
instance.logoutRedirect();
|
instance.logoutRedirect();
|
||||||
};
|
};
|
||||||
const getUserProfile = async (accessToken: string): Promise<User> => {
|
const getUserProfile = async (accessToken: string): Promise<User> => {
|
||||||
|
console.log(accessToken)
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse = await httpClient.get(`api/userProfile`, {
|
const response: AxiosResponse = await httpClient.get(`api/userProfile`, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -66,6 +67,7 @@ const SiteNav: React.FC<unknown> = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const getUserPhoto = async (accessToken: string): Promise<string> => {
|
const getUserPhoto = async (accessToken: string): Promise<string> => {
|
||||||
|
console.log(accessToken)
|
||||||
try {
|
try {
|
||||||
const response: AxiosResponse = await httpClient.get(`api/userPhoto`, {
|
const response: AxiosResponse = await httpClient.get(`api/userPhoto`, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -28,11 +28,6 @@ resource "azurerm_container_app" "container_app_api" {
|
|||||||
password_secret_name = "docker-io-password"
|
password_secret_name = "docker-io-password"
|
||||||
}
|
}
|
||||||
|
|
||||||
dapr {
|
|
||||||
app_id = module.environment.container_app_api_dapr_app_id
|
|
||||||
app_port = 3000
|
|
||||||
}
|
|
||||||
|
|
||||||
template {
|
template {
|
||||||
min_replicas = 0
|
min_replicas = 0
|
||||||
max_replicas = 2
|
max_replicas = 2
|
||||||
@@ -68,7 +63,7 @@ resource "azurerm_container_app" "container_app_api" {
|
|||||||
ingress {
|
ingress {
|
||||||
allow_insecure_connections = false
|
allow_insecure_connections = false
|
||||||
external_enabled = true
|
external_enabled = true
|
||||||
target_port = 9090
|
target_port = 3000
|
||||||
transport = "auto"
|
transport = "auto"
|
||||||
|
|
||||||
traffic_weight {
|
traffic_weight {
|
||||||
@@ -84,7 +79,7 @@ resource "azurerm_container_app" "container_app_api" {
|
|||||||
|
|
||||||
secret {
|
secret {
|
||||||
name = "azure-storage-connection-string"
|
name = "azure-storage-connection-string"
|
||||||
value = var.AZURE_STORAGE_CONNECTION_STRING
|
value = azurerm_storage_account.storage_account.primary_connection_string
|
||||||
}
|
}
|
||||||
|
|
||||||
secret {
|
secret {
|
||||||
@@ -128,26 +123,6 @@ resource "azurerm_container_app" "container_app_app" {
|
|||||||
image = module.environment.container_app_app_container_image
|
image = module.environment.container_app_app_container_image
|
||||||
cpu = 0.25
|
cpu = 0.25
|
||||||
memory = "0.5Gi"
|
memory = "0.5Gi"
|
||||||
|
|
||||||
env {
|
|
||||||
name = "VITE_API_URL"
|
|
||||||
value = azurerm_container_app.container_app_api.latest_revision_fqdn
|
|
||||||
}
|
|
||||||
|
|
||||||
env {
|
|
||||||
name = "VITE_CLIENT_ID"
|
|
||||||
secret_name = "client-id"
|
|
||||||
}
|
|
||||||
|
|
||||||
env {
|
|
||||||
name = "VITE_REDIRECT_URL"
|
|
||||||
value = module.environment.container_app_app_redirect_url
|
|
||||||
}
|
|
||||||
|
|
||||||
env {
|
|
||||||
name = "VITE_TENANT_ID"
|
|
||||||
secret_name = "tenant-id"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,21 +138,11 @@ resource "azurerm_container_app" "container_app_app" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
secret {
|
|
||||||
name = "client-id"
|
|
||||||
value = var.CLIENT_ID
|
|
||||||
}
|
|
||||||
|
|
||||||
secret {
|
secret {
|
||||||
name = "docker-io-password"
|
name = "docker-io-password"
|
||||||
value = var.DOCKER_IO_PASSWORD
|
value = var.DOCKER_IO_PASSWORD
|
||||||
}
|
}
|
||||||
|
|
||||||
secret {
|
|
||||||
name = "tenant-id"
|
|
||||||
value = var.TENANT_ID
|
|
||||||
}
|
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
ignore_changes = [ template[0].container[0].image ]
|
ignore_changes = [ template[0].container[0].image ]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user