diff --git a/Acessts/Imagens/Iconis/lupa.png b/Acessts/Imagens/Iconis/lupa.png new file mode 100644 index 0000000..e10ed83 Binary files /dev/null and b/Acessts/Imagens/Iconis/lupa.png differ diff --git a/Ambiente_Usuario_copy.html b/Ambiente_Usuario_copy.html index 6bbbc1c..d4d0013 100644 --- a/Ambiente_Usuario_copy.html +++ b/Ambiente_Usuario_copy.html @@ -8,27 +8,32 @@ - + + Ambiente do Usuario + + + + - + +
+ +
-
+ - - - - + \ No newline at end of file diff --git a/Css/page/Ambiente/Estrutura/estrutura.css b/Css/page/Ambiente/Estrutura/estrutura.css new file mode 100644 index 0000000..c290177 --- /dev/null +++ b/Css/page/Ambiente/Estrutura/estrutura.css @@ -0,0 +1,12 @@ +@import url(./estrutura_menu.css); +@import url(./menu_hover.css); +@import url(./sec_cap_1.css); +@import url(./sec_cap_2.css); +@import url(./tela_hover.css); + +@import url(../../../../Css/global/import.css); + +.estrutura { + display: flex; + align-items: center; +} \ No newline at end of file diff --git a/Css/page/Ambiente/Estrutura/estrutura_menu.css b/Css/page/Ambiente/Estrutura/estrutura_menu.css new file mode 100644 index 0000000..357f235 --- /dev/null +++ b/Css/page/Ambiente/Estrutura/estrutura_menu.css @@ -0,0 +1,254 @@ +.menu_lateral { + + width: 3.6vw; + height: 100vh; + transition: 1s ease; + position: fixed; + z-index: 10; + + display: flex; + flex-direction: row; + justify-content: space-between; +} + +.seguimentacao_1 { + width: 3.6vw; + height: 100vh; + background-color: var(--Cor_Segundaria_5_1); + + display: flex; + flex-direction: column; + +} + +.seguimentacao_1 .coluna_1 { + + width: 100%; + height: 10vh; + display: flex; + align-items: start; + justify-content: center; + transition: 1s ease; + + +} + +.seguimentacao_1 .coluna_1 .subcolunas_1 { + margin-top: 2vh; + +} + +.seguimentacao_1 .coluna_1 .subcolunas_1 img { + width: 2.3vw; + filter: drop-shadow(2px 5px 0px var(--Cor_Segundaria_5_2)); + +} + + +.seguimentacao_1 .coluna_2 { + + + width: 100%; + height: 90vh; + display: flex; + flex-direction: column; + transition: 1s ease; + transition: 1s ease; +} + +.img { + width: 1.8vw; + filter: drop-shadow(2px 5px 0px var(--Cor_Segundaria_5_2)); +} + + +.seguimentacao_1 .coluna_2 .subcolunas_1 { + width: 100%; + height: 70vh; + transition: 1s ease; + + +} + +.seguimentacao_1 .coluna_2 .subcolunas_2 { + width: 100%; + height: 20vh; + transition: 1s ease; + + +} + +.seguimentacao_2 { + width: 0vw; + + height: 100vh; + background-color: var(--Cor_Segundaria_5_1); + overflow: hidden; + transition: 1s ease; + display: flex; + flex-direction: column; +} + +.seguimentacao_2 .coluna_1 { + width: 100%; + height: 30vh; + + display: flex; + flex-direction: row; + + background-image: url(../../../../Acessts/Imagens/1605305486169.jpg); + background-position: center; + background-size: cover; + + overflow: hidden; + transition: 1s ease; +} + +.seguimentacao_2 .coluna_1 .subcolunas_1 { + width: 25vw; + height: 30vh; + background-color: rgba(0, 0, 0, 0.341); + backdrop-filter: blur(3px); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + align-content: center; + +} + +.seguimentacao_2 .coluna_1 .subcolunas_1 .filheira { + font-family: var(--font_titulo); + color: var(--Matriz); + font-size: 0vw; + filter: blur(5px); + + + opacity: 0; + text-align: center; + transition: 1s ease; + +} + + +.seguimentacao_2 .subcolunas_1 .filheira img { + width: 0vw; + opacity: 0; + filter: blur(5px); + border-radius: 100%; + transition: 1s ease; +} + +.seguimentacao_2 .coluna_1 .subcolunas_1 .filheira h2 { + margin-bottom: -2vh; +} + + +.seguimentacao_2 .coluna_1 .subcolunas_2 { + + width: 5vw; + height: 30vh; + + background-color: #12365552; + backdrop-filter: blur(8px); + + display: flex; + justify-content: center; + align-items: start; + +} + +.subcolunas_2 button { + background: none; + outline: none; + border: none; + + margin-top: 2vh; + margin-right: 0.5vw; + background-color: #c6c6c6; + + width: 3vw; + height: 4vh; + + font-family: var(--font_titulo); + color: var(--Matriz); + font-size: 0.9vw; + text-align: center; + + box-shadow: -5px 5px 0px 2px #9a9a9a; + transition: 1s ease; + +} + +.imgjust { + width: 1vw; + transition: 1s ease; +} + + + +.seguimentacao_2 .coluna_2 { + width: 96.1%; + height: 70vh; + + padding-left: 0.3vw; + padding-right: 0.5vw; + display: flex; + flex-direction: column; +} + +.seguimentacao_2 .coluna_2 .subcolunas_1 { + width: 100%; + height: 50vh; + +} + +.filheira_a { + text-decoration: none; + color: var(--Matriz); +} + +.seguimentacao_1 .coluna_2 .subcolunas_1 .filheira { + display: flex; + justify-content: center; +} + +.seguimentacao_1 .coluna_2 .subcolunas_1 .filheira, +.seguimentacao_2 .coluna_2 .subcolunas_1 .filheira { + width: 100%; + height: 4vh; + margin-top: 2vh; + + display: flex; + align-items: center; + + font-family: var(--font_titulo); + + font-size: 0.6vw; + transition: 1s ease; +} + +.seguimentacao_2 .coluna_2 .subcolunas_2 { + width: 100%; + height: 20vh; +} + +.seguimentacao_1 .coluna_2 .subcolunas_2 .filheira { + display: flex; + justify-content: center; +} + +.seguimentacao_1 .coluna_2 .subcolunas_2 .filheira, +.seguimentacao_2 .coluna_2 .subcolunas_2 .filheira { + width: 100%; + height: 4vh; + margin-top: 2vh; + + display: flex; + align-items: center; + + font-family: var(--font_titulo); + + font-size: 0.6vw; + transition: 1s ease; +} \ No newline at end of file diff --git a/Css/page/Ambiente/Estrutura/menu_hover.css b/Css/page/Ambiente/Estrutura/menu_hover.css new file mode 100644 index 0000000..f9a278c --- /dev/null +++ b/Css/page/Ambiente/Estrutura/menu_hover.css @@ -0,0 +1,151 @@ +.menu_lateral:hover { + + width: 20vw; + position: fixed; + z-index: 10; + left: 0; + top: 0; + transition: 1s ease; + + .seguimentacao_2 { + width: 17vw; + transition: 1s ease; + } + + .seguimentacao_1 .coluna_1 { + height: 30vh; + + transition: 1s ease; + } + + .seguimentacao_1 .coluna_2 { + height: 70vh; + transition: 1s ease; + } + + .seguimentacao_1 .coluna_2 .subcolunas_1 { + height: 50vh; + transition: 1s ease; + } + + .seguimentacao_1 .coluna_2 .subcolunas_2 { + height: 20vh; + transition: 1s ease; + } + + .seguimentacao_2 .coluna_1 .subcolunas_1 .filheira { + + font-size: 0.9vw; + opacity: 1; + filter: blur(0px); + transition: 1s ease; + + } + + + .seguimentacao_2 .subcolunas_1 .filheira img { + width: 6vw; + height: 10vh; + opacity: 1; + filter: blur(0px); + + transition: 1s ease; + } + + +} + + +.menu_lateral.expansao { + + + width: 20vw; + transition: 1s ease; + + .seguimentacao_2 { + width: 17vw; + transition: 1s ease; + } + + .seguimentacao_1 .coluna_1 { + height: 30vh; + transition: 1s ease; + } + + .seguimentacao_1 .coluna_2 { + height: 70vh; + transition: 1s ease; + } + + .seguimentacao_1 .coluna_2 .subcolunas_1 { + height: 50vh; + transition: 1s ease; + } + + .seguimentacao_1 .coluna_2 .subcolunas_2 { + height: 20vh; + transition: 1s ease; + } + + .seguimentacao_2 .coluna_1 .subcolunas_1 .filheira { + + font-size: 0.9vw; + opacity: 1; + filter: blur(0px); + transition: 1s ease; + + } + + + .seguimentacao_2 .subcolunas_1 .filheira img { + width: 6vw; + height: 10vh; + opacity: 1; + filter: blur(0px); + + transition: 1s ease; + } + + .imgjust { + transform: rotate(180deg); + transition: 1s ease; + } + + +} + + +a:hover { + color: var(--Cor_Segundaria_5_1); + +} + +.seguimentacao_2 .coluna_2 .subcolunas_1 .filheira:hover { + + background-color: var(--Matriz); + border-radius: 2vw 0vw 0vw 2vw; + padding-left: 2vw; + transition: 1s ease; + +} + + + +.seguimentacao_2 .coluna_2 .subcolunas_2 .filheira:hover { + + background-color: var(--Matriz); + border-radius: 2vw 0vw 0vw 2vw; + padding-left: 2vw; + transition: 1s ease; + + + +} + +.subcolunas_2 button:hover { + margin-right: 1vw; + + background-color: var(--Cor_Segundaria_2_1); + box-shadow: 5px 5px 0px 2px var(--Cor_Segundaria_2_2); + transition: 1s ease; +} \ No newline at end of file diff --git a/Css/page/Ambiente/Estrutura/sec_cap_1.css b/Css/page/Ambiente/Estrutura/sec_cap_1.css new file mode 100644 index 0000000..3555678 --- /dev/null +++ b/Css/page/Ambiente/Estrutura/sec_cap_1.css @@ -0,0 +1,101 @@ +/* ------------------- +Estrutura de apresentação, possuindo a tela iframe, e cabeçario com o logo e o logout +-------------------------- */ + +/* ------------------- +Cabeçario da tela +-------------------------- */ + + +.capitulo_1 { + width: 96.4vw; + height: 10vh; + background-color: var(--Cor_Segundaria_5_1); + + position: fixed; + right: 0; + top: 0; + z-index: 1; + + display: flex; + flex-direction: row; + align-content: center; + align-items: center; + justify-content: space-between; + transition: 1s ease; + + +} + +.companyLogo { + width: 14vw; + margin-left: 2vw; +} + +.Bloco_subcab1_2 { + + display: flex; + flex-direction: row; + padding-right: 2vw; + align-content: center; + align-items: center; + +} + +.Bloco_subcab1_2 button { + width: 10vw; + height: 5vh; + font-family: var(--font_titulo); + font-size: 1vw; + + outline: none; + border: none; + background: none; + + background-color: var(--Matriz); + color: var(--Cor_Segundaria_5_1); + transition: 1s ease; +} + +.Bloco_subcab1_2 button:hover { + + border-left: 0.2vw solid var(--Matriz); + border-right: 0.2vw solid var(--Matriz); + border-top: 0.2vw solid var(--Matriz); + border-bottom: 0.2vw solid var(--Matriz); + + background-color: var(--Cor_Segundaria_5_1); + color: var(--Matriz); + transition: 1s ease; +} + + +.cabecario_2 { + width: 73%; + display: flex; + flex-direction: row; + align-content: center; + align-items: center; + justify-content: space-between; + background-color: var(--Matriz); + height: 10vh; +} + +.Bloco_subcab2_1 { + display: flex; + flex-direction: row; + align-items: center; + align-content: center; + justify-content: space-around; + width: 8vw; +} + +.Bloco_subcab2_1 .icon_subcab1_1 { + width: 3vw; +} + + + +.Bloco_subcab2_2 .icon_subcab2_1 { + width: 2.5vw; +} \ No newline at end of file diff --git a/Css/page/Ambiente/Estrutura/sec_cap_2.css b/Css/page/Ambiente/Estrutura/sec_cap_2.css new file mode 100644 index 0000000..f9971a6 --- /dev/null +++ b/Css/page/Ambiente/Estrutura/sec_cap_2.css @@ -0,0 +1,32 @@ +/*-------------- +Tela de apresentação de conteudo +------------------*/ + + +.capitulo_2 { + width: 96.4vw; + height: 90vh; + position: fixed; + right: 0; + top: 10vh; + z-index: -1; + transition: 1s ease; +} + +.transmissão { + width: 100%; + height: 100%; + + + transition: 1s ease; +} + + + +.Corpo_2 .Colunas_1 .transmissão.expansao { + + width: 81vw; + height: 82vh; + transition: 1s ease; + +} \ No newline at end of file diff --git a/Css/page/Ambiente/Estrutura/tela_hover.css b/Css/page/Ambiente/Estrutura/tela_hover.css new file mode 100644 index 0000000..7c443a3 --- /dev/null +++ b/Css/page/Ambiente/Estrutura/tela_hover.css @@ -0,0 +1,11 @@ +.capitulo_1.expansao { + width: 80vw; + z-index: 1; + transition: 1s ease; +} + +.capitulo_2.expansao { + width: 80vw; + z-index: 1; + transition: 1s ease; +} \ No newline at end of file diff --git a/Css/page/Ambiente/Service/Ferramentas.css b/Css/page/Ambiente/Service/Ferramentas.css new file mode 100644 index 0000000..3c3b971 --- /dev/null +++ b/Css/page/Ambiente/Service/Ferramentas.css @@ -0,0 +1,4 @@ +@import url(../../../global/import.css); +@import url(./sec_cap_1.css); +@import url(./sec_cap_2.css); +@import url(./pop_up.css); \ No newline at end of file diff --git a/Css/page/Ambiente/Service/pop_up.css b/Css/page/Ambiente/Service/pop_up.css new file mode 100644 index 0000000..b3d4b77 --- /dev/null +++ b/Css/page/Ambiente/Service/pop_up.css @@ -0,0 +1,71 @@ +.popup_contener { + display: none; + position: fixed; + top: 10vh; + left: 20vw; + padding: 2vw; + + flex-direction: column; + align-items: center; + justify-content: center; + align-content: center; + + width: 50vw; + height: 70vh; + background-color: var(--Cor_Segundaria_5_1); + box-shadow: 10px 10px 0px var(--Cor_Segundaria_5_2); + animation: surgirpopupcenter 1s ease; +} + +@keyframes surgirpopupcenter { + to { + opacity: 1; + transform: scale(1); + + } + + from { + opacity: 0; + transform: scale(0); + } + +} + +.colun_1 { + width: 50vw; + height: 8vh; + display: flex; + align-items: center; + align-content: center; + justify-content: start; +} + +.colun_1 button { + background: none; + border: none; + outline: none; + + width: 8vw; + height: 5vh; + background-color: #c6c6c6; + box-shadow: 5px 5px 0px #9a9a9a; + font-size: 1vw; + color: var(--Matriz); + transition: 1s ease; +} + +.colun_1 button:hover { + background-color: var(--Cor_Segundaria_2_1); + box-shadow: -5px 5px 0px var(--Cor_Segundaria_2_2); +} + +.colun_2 { + width: 50vw; + height: 62vh; + + display: flex; + align-items: center; + align-content: center; + justify-content: center; + overflow: hidden; +} \ No newline at end of file diff --git a/Css/page/Ambiente/Service/sec_cap_1.css b/Css/page/Ambiente/Service/sec_cap_1.css new file mode 100644 index 0000000..b400c2d --- /dev/null +++ b/Css/page/Ambiente/Service/sec_cap_1.css @@ -0,0 +1,62 @@ +.capitulo_1 { + width: 100%; + height: 20vh; + display: flex; + flex-direction: row; + justify-content: end; + align-items: center; + align-content: center; + margin-bottom: 2vh; + +} + + +.campo { + width: 70; + height: 10vh; + display: flex; + flex-direction: row; + align-items: center; + justify-content: end; + padding-right: 2vw; + gap: 2vw; +} + +.campo input { + border: none; + outline: none; + background: none; + + + border: 0.2vw solid var(--Cor_Segundaria_2_1); + box-shadow: 5px 5px 0px 2px var(--Cor_Segundaria_2_2); + font-size: 2vw; + color: var(--Cor_Segundaria_2_1); + padding-left: 1vw; + padding-right: 1vw; + + width: 50vw; + height: 8vh; +} + +.campo button { + border: none; + outline: none; + background: none; + background-color: #c6c6c6; + box-shadow: 5px 5px 0px #9a9a9a; + transition: 1s ease; + + width: 6vw; + height: 8vh; +} + +.campo img { + width: 3vw; +} + +.campo button:hover { + background-color: var(--Cor_Segundaria_2_1); + box-shadow: -5px 5px 0px 2px var(--Cor_Segundaria_2_2); + +} \ No newline at end of file diff --git a/Css/page/Ambiente/Service/sec_cap_2.css b/Css/page/Ambiente/Service/sec_cap_2.css new file mode 100644 index 0000000..4005dc9 --- /dev/null +++ b/Css/page/Ambiente/Service/sec_cap_2.css @@ -0,0 +1,46 @@ +.capitulo_2 { + width: 100vw; + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + gap: 2vw; +} + +.capitulo_2 .painel { + width: 20vw; + height: 40vh; + + display: flex; + flex-direction: column; + align-items: center; + align-content: center; + justify-content: center; + + background-color: #c6c6c6; + box-shadow: -5px 5px 0px #9a9a9a; + transition: 1s ease; + + +} + +.capitulo_2 .painel:hover { + + background-color: var(--Cor_Segundaria_5_1); + box-shadow: 10px 10px 0px var(--Cor_Segundaria_5_2); + +} + +.capitulo_2 .painel .Colun_1 img { + width: 8vw; + filter: drop-shadow(2px 2px 0px var(--Cor_Segundaria_2_1)); +} + +.capitulo_2 .painel .Colun_2 {} + + +.capitulo_2 .painel .Colun_2 h2 { + font-size: 1.3vw; + color: var(--Matriz); + font-family: var(--font_titulo); +} \ No newline at end of file diff --git a/Css/page/Telas_acao/load.css b/Css/page/Telas_acao/load.css index cfd998b..6c1e965 100644 --- a/Css/page/Telas_acao/load.css +++ b/Css/page/Telas_acao/load.css @@ -1,16 +1,27 @@ -body, -html { - margin: 0; - padding: 0; - height: 100%; +@import url(../../global/import.css); + +.teste { + background-color: rgb(255, 255, 255); + position: fixed; + top: 0; + left: 0; + z-index: 100000; width: 100%; - overflow: hidden; - background-color: #282c34; + height: 100vh; + display: flex; - justify-content: center; + flex-direction: column; align-items: center; + justify-content: center; + align-content: center; + + font-family: var(--font_titulo); + + + border: 1px solid #fff; } -canvas { - border: 1px solid #fff; +.teste canvas { + width: 40vw; + height: 40vh; } \ No newline at end of file diff --git a/html/arquivos_extras/Ambiente_Usuario copy.html b/html/arquivos_extras/Ambiente_Usuario copy.html new file mode 100644 index 0000000..be2c5da --- /dev/null +++ b/html/arquivos_extras/Ambiente_Usuario copy.html @@ -0,0 +1,209 @@ + + + + + Ambiente de teste + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ +
+ +
+ +
+ +
+ + + + + + + + +
+
+ + + + + \ No newline at end of file diff --git a/html/Ambiente_Usuario.html b/html/arquivos_extras/Ambiente_Usuario.html similarity index 100% rename from html/Ambiente_Usuario.html rename to html/arquivos_extras/Ambiente_Usuario.html diff --git a/html/Ambiente_Usuario copy.html b/html/arquivos_extras/Ambiente_teste.html similarity index 100% rename from html/Ambiente_Usuario copy.html rename to html/arquivos_extras/Ambiente_teste.html diff --git a/html/tes.html b/html/arquivos_extras/tes.html similarity index 100% rename from html/tes.html rename to html/arquivos_extras/tes.html diff --git a/html/projetos_itguys.html b/html/projetos_itguys.html new file mode 100644 index 0000000..b59dab1 --- /dev/null +++ b/html/projetos_itguys.html @@ -0,0 +1,30 @@ + + + + + + + Formulário + + + + + +
+
+
+ + +
+
+ +
+ + + +
+ + + \ No newline at end of file diff --git a/js/Ambiente/Estrutura/Estrutura_Primaria.js b/js/Ambiente/Estrutura/Estrutura_Primaria.js index 98f1f34..30f847f 100644 --- a/js/Ambiente/Estrutura/Estrutura_Primaria.js +++ b/js/Ambiente/Estrutura/Estrutura_Primaria.js @@ -1,216 +1,526 @@ -//Varivel para valida a autenticação do usuário, se for true o ambiente é construido, se for false, um tela de erro é apresentada no lugar do ambiente, e caso a resposta demore para ser apresentada um tela de carregamento é apresentada. -var autenteticação = true; - -//If que constrola o cenario de true -if (autenteticação == true) { - - //constante que controla o estilo css que está estilizando todo o ambiente do usuário. - const estilos = document.getElementById('conexao'); - estilos.href = '../Css/global/Estrutura.css'; - - //variaveis de conexão de informações, possuindo informações algumas informaçõe sendo elas: - //Nome do usuário - //Nome da empresa - //Imagem do usuário - //Imagem de fundo do usuário - var Usuário = 'Daivid'; - var Empresa = 'ItGuys'; - var ImagemUser = '../Acessts/Imagens/1605305486169.jpg'; - var imagemFun = 'url(../Acessts/Imagens/01160209321024.jpg)'; - - //Essa ultima variavel é dedicada ao controle de hiriaquia, caso alguem tenha permissão para visualizar essa categoria, será true, caso ela não tenha permissão, será false, e então toda essa categoria não será apresentada. - var visuMonitor = true; - - - //constante conectada com estilos internos dentro do próprio html, para trazer a capacidade de controlar a imagem que está no fundo do perfil do suário. - const fundouser = document.getElementById('fundouser'); - - fundouser.innerHTML = - '.Corpo_1 .Colunas_1 {' - + - 'display: flex;' - + - 'flex-direction: row;' - + - 'background-image:' + imagemFun + ';' - + - 'background-position: center;' - + - 'background-size: cover;' - + - 'width: 15vw;' - + - 'height: 10vh;' - + - 'overflow: hidden;' - + - 'transition: 1s ease;' - ; - - //Constante de construção primira do ambiente do usuário, é aqui onde toda á página é construida, ao mesmo tempo que as variaveis mudificam certas informações. - const construtor_primario = document.getElementById('entrada_1'); - - construtor_primario.innerHTML = - '' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '' - + - '' - + - '
' - + - '

' + Usuário + '
' + Empresa + '

' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '

Home

' - + - '
' - + - //Estrutura vaizia dedicada para aparesentação do painel de monitoramento caso o usuário tenha permissão para o visualizar. - '
' - + - '
' - + - '

Servicedesk

' - + - '
' - + - '
' - + - '

Suporte

' - + - '

Configuracões

' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - ; - - //Construtores responsavels sobre a construção de alguns scripts que não são default, que só atendem o ambiente do usuário. - - //construtor da reação do menu sobre as interações do usuário - const script1 = document.createElement('script'); - script1.src = '../js/Ambiente/Estrutura/Reacao_menu.js'; - document.body.appendChild(script1); - - //construtor da sub camada de construção, alinhada sobre a condicional onde se a pessoa possui permisão para visualizar o monitoramente de sua empresa, visuMonitor será igual á true, enquanto se ela não tiver permissão para visualizar o visuMonitor será igual á false - if (visuMonitor == true) { - const script2 = document.createElement('script'); - script2.src = './js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js'; - document.body.appendChild(script2); - }; - +// Função para obter a URL base da API +async function getApiUrl() { + try { + const response = await fetch('../../../Sites/Site_ItGuys/php/config_url.php'); // Solicita a URL base do PHP + if (!response.ok) { + throw new Error('Network response was not ok'); + } + const data = await response.json(); + return data.apiUrl; // Retorna a URL base + } catch (error) { + console.error('Error fetching API URL:', error); + throw error; + } } -//Else sendo a reação opostao ao do if, logo sendo esse o cenario onde a autenticação não seja valida. -else { - - //Constante de controle sobre estilos css do painel de erro. - const estilos = document.getElementById('conexao'); - estilos.href = '../Css/page/Telas_acao/erro_404.css'; - - //variaveis de conexão de informações, possuindo informações algumas informaçõe sendo elas: - //o Status do erro - //Mensagem do erro - //Um mensagem complementar sobre o erro - var Status = 'Erro 404'; - var mensagem = 'Desculpe mas sua página não foi encontrada'; - var sub_mensagem = 'Tente fazer seu, login novamente'; - - //Constante usada para a criação da estrutura, sendo usada para apresentar todo o painel - const erro = document.getElementById('entrada_1'); - - erro.innerHTML = '
' - + - '

' + Status + '

' - + - '
' - + - '

' + mensagem + '

' + sub_mensagem + '

' - + - '' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - ; - - - - +// Função para obter o token do localStorage +function getAuthToken() { + return localStorage.getItem('x-access-token'); } -// Event listener para o botão de logout -const logoutButton = document.getElementById('logoutButton'); -if (logoutButton) { - logoutButton.addEventListener('click', function () { - // Limpar o token do localStorage ao clicar no botão de logout - clearAuthToken(); - // Redirecionar para a página de login ou qualquer outra página desejada após o logout - window.location.href = '../login.html'; - }); +const Permissoes = { + visuMonitor: true, +}; + + + +// Função para carregar uma imagem protegida com token JWT e exibi-la + +// Função para carregar e exibir as imagens protegidas +async function criarBlocos() { + try { + const apiUrl = await getApiUrl(); // Obtém a URL da API a partir do PHP + const token = getAuthToken(); // Obtém o token JWT do localStorage + + // Faz uma requisição para obter os dados da rota /mounting + const response = await fetch(`${apiUrl}/mounting`, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + 'x-access-token': token ? token : '' + } + }); + + if (!response.ok) { + throw new Error('Erro na requisição: ' + response.statusText); + + } + + const data = await response.json(); + + // Agora acessa as propriedades do objeto + const nomeCompleto = data.usuario.nome; // Nome completo do usuário + const primeiroNome = nomeCompleto.split(' ')[0].substring(0, 10); // Pega o primeiro nome e limita a 10 caracteres // Limita a 10 caracteres; + const Empresa = data.empresa.nome; + const ImagemUser = `${apiUrl}${data.usuario.img_perfil}`; + //const ImagemUser2 = `${apiUrl}${data.usuario.img_perfil}`; + const logoEmpresa = `${apiUrl}${data.empresa.logo}`; + + + + + // Exibe as imagens protegidas usando os URLs retornados pela API + loadImage(ImagemUser, 'profileImage'); + //loadImage(ImagemUser2, 'profileImage'); // Imagem de perfil do usuário + loadImage(logoEmpresa, 'companyLogo'); // Logo da empresa + + // Acessando o primeiro objeto do array retornado + + console.log(data); + console.log(primeiroNome); + console.log(Empresa); + console.log(ImagemUser); + console.log(logoEmpresa); + + + //var visuMonitor = usuarioInfo.Permissoes_Monitor; + + + //constante que controla o estilo css que está estilizando todo o ambiente do usuário. + const estilos = document.getElementById('conexao'); + estilos.href = './Css/page/Ambiente/Estrutura/estrutura.css'; + + + const construtor_primario = document.getElementById('entrada_1'); + + construtor_primario.innerHTML = + '' + + + '
' + + + '
' + + + '
' + + + '' + + + '
' + + + '
' + + + '' + + + '
' + + + '
' + + + '
' + + + ' ' + + + '
' + + + '
' + + const construido = true; + + ; + localStorage.setItem('construido', JSON.stringify(construido)); + + var botao = document.getElementById('id_ajuste'); + var cabecario = document.querySelector('.capitulo_1'); + var tela = document.querySelector('.capitulo_2'); + var menu = document.querySelector('.menu_lateral'); + + if (botao) { + botao.addEventListener('click', function () { + console.log('Botão clicado!'); + if (menu) menu.classList.toggle('expansao'); + if (cabecario) cabecario.classList.toggle('expansao'); + if (tela) tela.classList.toggle('expansao'); + }); + } else { + console.error('Botão não encontrado!'); + } + + + if (Permissoes.visuMonitor) { + const script2 = document.createElement('script'); + script2.src = './js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js'; + script2.setAttribute // Acessando a propriedade corretamente + document.body.appendChild(script2); + } + + // Adiciona o listener de clique após a construção do HTML + + + + + + + //Construtores responsavels sobre a construção de alguns scripts que não são default, que só atendem o ambiente do usuário. + + //construtor da reação do menu sobre as interações do usuário + + + + + + + + + + } catch (error) { + + + //Constante de controle sobre estilos css do painel de erro. + const estilos = document.getElementById('conexao'); + estilos.href = '../Css/page/Telas_acao/erro_404.css'; + + //variaveis de conexão de informações, possuindo informações algumas informaçõe sendo elas: + //o Status do erro + //Mensagem do erro + //Um mensagem complementar sobre o erro + + + const apiUrl = await getApiUrl(); // Obtém a URL da API a partir do PHP + const token = getAuthToken(); // Obtém o token JWT do localStorage + + // Faz uma requisição para obter os dados da rota /mounting + const response = await fetch(`${apiUrl}/mounting`, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + 'x-access-token': token ? token : '' + } + }); + + const respostaserver = response.status + + if (respostaserver == 401) { + + var Status = 'Erro 401'; + var mensagem = 'Desculpe mas sua página não foi encontrada'; + var sub_mensagem = 'Tente fazer seu, login novamente'; + var button_info = 'Retorne'; + var button_acao = '/Sites/Site_ItGuys/ambiente_do_usu%C3%A1rio/login.html'; + + } + + if (respostaserver == 404) { + + var Status = 'Erro 404'; + var mensagem = 'Houve um problema com seu ambiente !!'; + var sub_mensagem = 'Por favor contate o suporte suporte@itguys.com.br'; + var button_info = 'Nós contate'; + var button_acao = 'https://api.whatsapp.com/send?phone=5521966344698'; + + } + + + //Constante usada para a criação da estrutura, sendo usada para apresentar todo o painel + const erro = document.getElementById('entrada_1'); + + erro.innerHTML = '
' + + + '

' + Status + '

' + + + '
' + + + '

' + mensagem + '

' + sub_mensagem + '

' + + + '' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + ; + + + + + console.error('Erro ao criar blocos:', error); + + + + } } +// Função para carregar uma imagem protegida com token JWT e exibi-la + +async function loadImage(url, imgElementClass) { + try { + const token = getAuthToken(); + console.log('Token:', token); + console.log('URL da imagem:', url); + + const response = await fetch(url, { + method: 'GET', + headers: { + 'x-access-token': token ? token : '' + } + }); + + if (!response.ok) { + throw new Error('Erro ao carregar a imagem: ' + response.statusText); + } + + const blob = await response.blob(); + const imageUrl = URL.createObjectURL(blob); + + // Seleciona todos os elementos com a classe + const imgElements = document.getElementsByClassName(imgElementClass); + if (imgElements.length > 0) { + for (let i = 0; i < imgElements.length; i++) { + imgElements[i].src = imageUrl; + } + } else { + console.warn('Nenhum elemento encontrado com a classe:', imgElementClass); + } + + return imageUrl; // Retorna a URL da imagem carregada + } catch (error) { + console.error('Erro ao carregar a imagem:', error); + console.log('Classe do elemento:', imgElementClass); + return null; // Retorna null em caso de erro + } +} +// Função para carregar a imagem de fundo +async function loadBackgroundAndUpdateStyle() { + try { + const apiUrl = await getApiUrl(); + const token = getAuthToken(); + const response = await fetch(`${apiUrl}/mounting`, { + method: 'GET', + headers: { + 'x-access-token': token ? token : '' + } + }); + + if (!response.ok) { + throw new Error('Erro ao carregar os dados: ' + response.statusText); + } + + const data = await response.json(); + const imagemFun = `${apiUrl}${data.usuario.img_fundo}`; + + const fundoResponse = await fetch(imagemFun, { + method: 'GET', + headers: { + 'x-access-token': token ? token : '' + } + }); + + if (!fundoResponse.ok) { + throw new Error('Erro ao carregar a imagem de fundo: ' + fundoResponse.statusText); + } + + const blob = await fundoResponse.blob(); + const fundoUserUrl = URL.createObjectURL(blob); + + const fundouser = document.getElementById('fundouser'); + fundouser.innerHTML = + '.seguimentacao_2 .coluna_1 {' + + 'width: 100%;' + + 'height: 30vh;' + + 'display: flex;' + + 'flex-direction: row;' + + 'background-image: url("' + fundoUserUrl + '");' + + 'background-position: center;' + 'background-position: center;' + + 'background-size: cover;' + + 'overflow: hidden;' + + 'transition: 1s ease;' + + '}'; + console.log('Imagem de fundo carregada e estilo aplicado com sucesso.'); + } catch (error) { + console.error('Erro ao carregar a imagem de fundo:', error); + } +} + +// Inicia o carregamento das imagens quando o script for carregado +document.addEventListener('DOMContentLoaded', async () => { + + await criarBlocos(); + await loadBackgroundAndUpdateStyle(); + +}); diff --git a/js/Ambiente/Estrutura/Estrutura_Primaria_modelo.js b/js/Ambiente/Estrutura/Estrutura_Primaria_modelo.js new file mode 100644 index 0000000..98f1f34 --- /dev/null +++ b/js/Ambiente/Estrutura/Estrutura_Primaria_modelo.js @@ -0,0 +1,216 @@ + + +//Varivel para valida a autenticação do usuário, se for true o ambiente é construido, se for false, um tela de erro é apresentada no lugar do ambiente, e caso a resposta demore para ser apresentada um tela de carregamento é apresentada. +var autenteticação = true; + +//If que constrola o cenario de true +if (autenteticação == true) { + + //constante que controla o estilo css que está estilizando todo o ambiente do usuário. + const estilos = document.getElementById('conexao'); + estilos.href = '../Css/global/Estrutura.css'; + + //variaveis de conexão de informações, possuindo informações algumas informaçõe sendo elas: + //Nome do usuário + //Nome da empresa + //Imagem do usuário + //Imagem de fundo do usuário + var Usuário = 'Daivid'; + var Empresa = 'ItGuys'; + var ImagemUser = '../Acessts/Imagens/1605305486169.jpg'; + var imagemFun = 'url(../Acessts/Imagens/01160209321024.jpg)'; + + //Essa ultima variavel é dedicada ao controle de hiriaquia, caso alguem tenha permissão para visualizar essa categoria, será true, caso ela não tenha permissão, será false, e então toda essa categoria não será apresentada. + var visuMonitor = true; + + + //constante conectada com estilos internos dentro do próprio html, para trazer a capacidade de controlar a imagem que está no fundo do perfil do suário. + const fundouser = document.getElementById('fundouser'); + + fundouser.innerHTML = + '.Corpo_1 .Colunas_1 {' + + + 'display: flex;' + + + 'flex-direction: row;' + + + 'background-image:' + imagemFun + ';' + + + 'background-position: center;' + + + 'background-size: cover;' + + + 'width: 15vw;' + + + 'height: 10vh;' + + + 'overflow: hidden;' + + + 'transition: 1s ease;' + ; + + //Constante de construção primira do ambiente do usuário, é aqui onde toda á página é construida, ao mesmo tempo que as variaveis mudificam certas informações. + const construtor_primario = document.getElementById('entrada_1'); + + construtor_primario.innerHTML = + '' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '' + + + '' + + + '
' + + + '

' + Usuário + '
' + Empresa + '

' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '

Home

' + + + '
' + + + //Estrutura vaizia dedicada para aparesentação do painel de monitoramento caso o usuário tenha permissão para o visualizar. + '
' + + + '
' + + + '

Servicedesk

' + + + '
' + + + '
' + + + '

Suporte

' + + + '

Configuracões

' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + ; + + //Construtores responsavels sobre a construção de alguns scripts que não são default, que só atendem o ambiente do usuário. + + //construtor da reação do menu sobre as interações do usuário + const script1 = document.createElement('script'); + script1.src = '../js/Ambiente/Estrutura/Reacao_menu.js'; + document.body.appendChild(script1); + + //construtor da sub camada de construção, alinhada sobre a condicional onde se a pessoa possui permisão para visualizar o monitoramente de sua empresa, visuMonitor será igual á true, enquanto se ela não tiver permissão para visualizar o visuMonitor será igual á false + if (visuMonitor == true) { + const script2 = document.createElement('script'); + script2.src = './js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js'; + document.body.appendChild(script2); + }; + + +} + +//Else sendo a reação opostao ao do if, logo sendo esse o cenario onde a autenticação não seja valida. +else { + + //Constante de controle sobre estilos css do painel de erro. + const estilos = document.getElementById('conexao'); + estilos.href = '../Css/page/Telas_acao/erro_404.css'; + + //variaveis de conexão de informações, possuindo informações algumas informaçõe sendo elas: + //o Status do erro + //Mensagem do erro + //Um mensagem complementar sobre o erro + var Status = 'Erro 404'; + var mensagem = 'Desculpe mas sua página não foi encontrada'; + var sub_mensagem = 'Tente fazer seu, login novamente'; + + //Constante usada para a criação da estrutura, sendo usada para apresentar todo o painel + const erro = document.getElementById('entrada_1'); + + erro.innerHTML = '
' + + + '

' + Status + '

' + + + '
' + + + '

' + mensagem + '

' + sub_mensagem + '

' + + + '' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + + + '
' + ; + + + + +} + + +// Event listener para o botão de logout +const logoutButton = document.getElementById('logoutButton'); +if (logoutButton) { + logoutButton.addEventListener('click', function () { + // Limpar o token do localStorage ao clicar no botão de logout + clearAuthToken(); + // Redirecionar para a página de login ou qualquer outra página desejada após o logout + window.location.href = '../login.html'; + }); +} + + + + + + + + + diff --git a/js/Ambiente/Estrutura/Reacao_menu.js b/js/Ambiente/Estrutura/Reacao_menu.js index 3bd33df..ebec226 100644 --- a/js/Ambiente/Estrutura/Reacao_menu.js +++ b/js/Ambiente/Estrutura/Reacao_menu.js @@ -1,33 +1,17 @@ -//Função de adapitação do menu e da tela do ambiente do usuário, resumidamente ao apertar na seinha do menu, todo o ambiente do usuário é reajustado, enquanto da mesma forma ao pertar a setinha novamente todo o ambiente do usuário retornar ao seu laouyt tradicional - -//Aqui são as variaveis que conectao todos esses elementos, dentre elas: -//botão conecta o pontao de condicional da ação -//cabecario elemento pertencente da tela do usuário -//tela seria o iframe que apresenta todas as informações do ambiente do usuário -//menu seria os elementos visuais do usuário -//temas seria alguns elementos do proprio menu -var botao = document.querySelector('#menu') -var cabecario = document.querySelector('.cabecario_1') -var tela = document.querySelector('.transmissão') -var menu = document.querySelector('.capitulo_1') -var temas = document.querySelectorAll('.item_menu') +var botao = document.getElementById('id_ajuste'); +var cabecario = document.querySelector('.capitulo_1'); +var tela = document.querySelector('.capitulo_2'); +var menu = document.querySelector('.menu_lateral'); - -//Aqui se aplica o evento de cliente, sobre afunção que aplica as classes no menu caberio e telas -botao.addEventListener('click', function () { - menu.classList.toggle('expansao'); - cabecario.classList.toggle('expansao'); - tela.classList.toggle('expansao'); - -}); - -function selectLink() { - temas.forEach((item) => - item.classList.remove('ativo') - ) - this.classList.add('ativo') +if (botao) { + botao.addEventListener('click', function () { + console.log('Botão clicado!'); + if (menu) menu.classList.toggle('expansao'); + if (cabecario) cabecario.classList.toggle('expansao'); + if (tela) tela.classList.toggle('expansao'); + }); +} else { + console.error('Botão não encontrado!'); } -temas.forEach((item) => - item.addEventListener('click', selectLink)) \ No newline at end of file diff --git a/js/Ambiente/Estrutura/load.js b/js/Ambiente/Estrutura/load.js index f81aa47..cc96c6e 100644 --- a/js/Ambiente/Estrutura/load.js +++ b/js/Ambiente/Estrutura/load.js @@ -1,82 +1,86 @@ -// Adiciona um ouvinte de evento para quando o conteúdo do DOM estiver completamente carregado -document.addEventListener("DOMContentLoaded", function () { - // Obtém o elemento com o ID 'entrada_1' +function verificarAmbiente() { var main = document.getElementById("entrada_1"); + const tela_laod = document.getElementById('entrada_2'); + let elemento_1; + let elemento_2; - // Verifica se a tag main está vazia if (main.innerHTML.trim() === "") { - // Se a tag estiver vazia, obtém novamente o mesmo elemento - const tela_laod = document.getElementById('entrada_1'); + elemento_1 = 'Estamos carregando sua página'; + } else { + elemento_1 = 'Algo foi encontrado mas estamos preparando'; + } - // Adiciona um elemento canvas ao conteúdo da tag main - tela_laod.innerHTML = ''; + elemento_2 = ''; + tela_laod.innerHTML = '

' + elemento_1 + '

' + elemento_2 + '
'; +} - // Obtém o contexto 2D do canvas para desenhar - const canvas = document.getElementById('animationCanvas'); - const ctx = canvas.getContext('2d'); +function finalizar() { + const tela_laod = document.getElementById('entrada_2'); + setTimeout(() => { + tela_laod.innerHTML = ''; + }, 3000); +} - // Define as dimensões do canvas para preencher a tela +window.addEventListener('DOMContentLoaded', iniciarAnimacao) + +window.addEventListener('load', () => { + finalizar(); +}); + + + +function iniciarAnimacao() { + const canvas = document.getElementById('animationCanvas'); + const ctx = canvas.getContext('2d'); + canvas.width = window.innerWidth; + canvas.height = window.innerHeight; + + const circle = { + centerX: canvas.width / 2, + centerY: canvas.height / 2, + radius: 150, + rotationSpeed: 0.10, + angle: 0, + linePath: [], + maxPathLength: 350 + }; + + function drawCircularPath() { + ctx.clearRect(0, 0, canvas.width, canvas.height); + const pathX = circle.centerX + circle.radius * Math.cos(circle.angle); + const pathY = circle.centerY + circle.radius * Math.sin(circle.angle); + circle.linePath.push({ x: pathX, y: pathY }); + + ctx.beginPath(); + for (let i = 0; i < circle.linePath.length - 1; i++) { + ctx.moveTo(circle.linePath[i].x, circle.linePath[i].y); + ctx.lineTo(circle.linePath[i + 1].x, circle.linePath[i + 1].y); + } + ctx.strokeStyle = '#22c0a3'; + ctx.lineWidth = 10; + ctx.stroke(); + + if (circle.linePath.length > circle.maxPathLength) { + circle.linePath.shift(); + if (circle.angle >= Math.PI * 2) { + circle.angle = 0; + circle.linePath = []; + } + } + } + + function animate() { + circle.angle += circle.rotationSpeed; + drawCircularPath(); + requestAnimationFrame(animate); + } + + animate(); + + window.addEventListener('resize', () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; - - // Define um objeto 'circle' que armazena as propriedades da animação - const circle = { - centerX: canvas.width / 2, // Centro do círculo no eixo X - centerY: canvas.height / 2, // Centro do círculo no eixo Y - radius: 150, // Raio do círculo - rotationSpeed: 0.10, // Velocidade de rotação - angle: 0, // Ângulo atual - linePath: [], // Armazena a trajetória do ponto - maxPathLength: 350 // Comprimento máximo da trajetória - }; - - // Função para desenhar a trajetória circular - function drawCircularPath() { - // Limpa o canvas antes de desenhar - ctx.clearRect(0, 0, canvas.width, canvas.height); - - // Calcula as coordenadas do ponto atual na trajetória circular - const pathX = circle.centerX + circle.radius * Math.cos(circle.angle); - const pathY = circle.centerY + circle.radius * Math.sin(circle.angle); - // Adiciona o ponto atual à trajetória - circle.linePath.push({ x: pathX, y: pathY }); - - // Desenha a trajetória acumulada - ctx.beginPath(); - for (let i = 0; i < circle.linePath.length - 1; i++) { - ctx.moveTo(circle.linePath[i].x, circle.linePath[i].y); - ctx.lineTo(circle.linePath[i + 1].x, circle.linePath[i + 1].y); - } - ctx.strokeStyle = '#22c0a3'; // Define a cor da linha - ctx.lineWidth = 10; // Define a largura da linha - ctx.stroke(); // Desenha a linha no canvas - - // Limita o comprimento da trajetória - if (circle.linePath.length > circle.maxPathLength) { - circle.linePath.shift(); // Remove o primeiro ponto do caminho - // Reinicia a trajetória se um ciclo completo foi completado - if (circle.angle >= Math.PI * 2) { // Verifica se completou um ciclo - circle.angle = 0; // Reinicia o ângulo - circle.linePath = []; // Limpa a trajetória - } - } - } - - // Função de animação que atualiza a posição do ponto e desenha a trajetória - function animate() { - circle.angle += circle.rotationSpeed; // Atualiza o ângulo - drawCircularPath(); // Desenha a trajetória atual - requestAnimationFrame(animate); // Solicita a próxima animação - } - - animate(); // Inicia a animação - - // Ajusta o tamanho do canvas quando a janela é redimensionada - window.addEventListener('resize', () => { - canvas.width = window.innerWidth; // Ajusta a largura - canvas.height = window.innerHeight; // Ajusta a altura - circle.centerX = canvas.width / 2; // Atualiza o centro X - circle.centerY = canvas.height / 2; // Atualiza o centro Y - }); - } -}); + circle.centerX = canvas.width / 2; + circle.centerY = canvas.height / 2; + }); +} \ No newline at end of file diff --git a/js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js b/js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js index cdc04d5..1f03494 100644 --- a/js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js +++ b/js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js @@ -1,39 +1,23 @@ // Verifica se a variável 'visuMonitor' é verdadeira + if (Permissoes.visuMonitor) { // Obtém o elemento com o ID 'sub_entrada' para inserir o conteúdo - const construtor_Secundarios_Monitoramento = document.getElementById('sub_entrada'); + const construtor_Secundarios_Monitoramento_icon = document.getElementById('sub_entrada_moni_1'); + const construtor_Secundarios_Monitoramento_button = document.getElementById('sub_entrada_moni_2'); // Define o conteúdo HTML a ser inserido no 'sub_entrada' - construtor_Secundarios_Monitoramento.innerHTML = - '

Monitoramento

' - + // Cria o item do menu "Monitoramento" - ''; // Fecha o submenu + construtor_Secundarios_Monitoramento_button.innerHTML = + ` +
+

Monitoramento

+
+
`; + + construtor_Secundarios_Monitoramento_icon.innerHTML = + `
+ +
`; }; diff --git a/js/Ambiente/Service/Contrutor_Serviços.js b/js/Ambiente/Service/Contrutor_Serviços.js new file mode 100644 index 0000000..a19c13e --- /dev/null +++ b/js/Ambiente/Service/Contrutor_Serviços.js @@ -0,0 +1,108 @@ +const painel_serviços_icon = document.getElementById('saida'); + +function renderService(service) { + const { nome, Imagem, id_server, resposta_popup, resposta_script, resposta_estilo } = service; + const serviceDiv = document.createElement('div'); + serviceDiv.classList.add('painel'); + serviceDiv.id = id_server; + + serviceDiv.innerHTML = ` +
+ +
+
+

${nome}

+
+`; + + painel_serviços_icon.appendChild(serviceDiv); + + serviceDiv.addEventListener('click', () => { + popup(resposta_popup, resposta_script, resposta_estilo); + }); +} + +function renderAllServices() { + painel_serviços_icon.innerHTML = ''; + + // Renderiza os serviços de Ser_Itguys + for (const service of Object.values(Data_Center.Ser_Itguys)) { + renderService(service); + } + + // Renderiza os serviços de Ser_User + for (const service of Object.values(Data_Center.Ser_User)) { + renderService(service); + } +} + +// Inicializa a renderização +renderAllServices(); + +function popup(resposta, script, estilo) { + const painel_serviços = document.getElementById('painel_Servico'); + painel_serviços.innerHTML = ` +
+
+ +
+
+ ${resposta} +
+
+`; + + // Remover estilos e scripts anteriores + const existingStyles = document.querySelectorAll('style'); + existingStyles.forEach(style => style.remove()); + const existingScripts = document.querySelectorAll('script[data-dynamic]'); + existingScripts.forEach(script => script.remove()); + + // Injetar estilo se houver + if (estilo) { + const style = document.createElement('style'); + style.innerHTML = estilo; + document.head.appendChild(style); + } + + // Injetar script se houver + if (script) { + const scriptElement = document.createElement('script'); + scriptElement.setAttribute('data-dynamic', ''); + scriptElement.src = script; + document.body.appendChild(scriptElement); + } + + const button_servi = document.getElementById('fechar'); + button_servi.addEventListener('click', fecharPopup); + + function fecharPopup() { + painel_serviços.style.display = "none"; + } + + painel_serviços.style.display = "flex"; +} + +const button_pesquisa = document.getElementById('button_pesqui'); +const input_pesquisa = document.getElementById('pesquisa'); + +button_pesquisa.addEventListener('click', pesquisar); +input_pesquisa.addEventListener('keypress', function (event) { + if (event.key === 'Enter') { + pesquisar(); + } +}); + +function pesquisar() { + const query = input_pesquisa.value.toLowerCase(); + painel_serviços_icon.innerHTML = ''; + + // Filtra e renderiza os serviços + for (const service of Object.values(Data_Center.Ser_Itguys).concat(Object.values(Data_Center.Ser_User))) { + if (service.nome.toLowerCase().includes(query)) { + renderService(service); + } + } +} \ No newline at end of file diff --git a/js/Ambiente/Service/Datas_service.js b/js/Ambiente/Service/Datas_service.js new file mode 100644 index 0000000..9536658 --- /dev/null +++ b/js/Ambiente/Service/Datas_service.js @@ -0,0 +1,66 @@ +const Data_Center = { + Ser_User: {}, + Ser_Itguys: {} +}; + +const permissa_User = true; + +if (permissa_User === true) { + Data_Center.Ser_User = { + resetar_senha: { + nome: 'Resetar senha', + Imagem: '../../Acessts/Imagens/Iconis/ferramentas.png', + id_server: 'serv_gat_2', + resposta_popup: '

Olá do Resetar Senha!

', + resposta_script: `console.log('Script para Resetar Senha');`, + resposta_estilo: `document.body.style.backgroundColor = '#f0f0f0';` + } + }; +} + +const permissa_Itguys = true; + +if (permissa_Itguys === true) { + Data_Center.Ser_Itguys = { + Gerador_de_arquivos_telefonia: { + nome: 'Configurador de Telefonia', + Imagem: '../../Acessts/Imagens/Iconis/ferramentas.png', + id_server: 'serv_gat_1', + resposta_popup: ` +
+ +
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
`, + resposta_script: '../js/Ambiente/Service/List/Gerador_XML_Telefonia.js', + resposta_estilo: `.control {width: 100%;display: flex;flex-direction: column;justify-content: center;align-content: center;align-items: center;}.formulario {width: 80%;display: flex;flex-direction: column;animation: surgirpopup 1s ease;}@keyframes surgirpopup {to {opacity: 1;transform: translateY(0);}from {opacity: 0;transform: translateY(40vw);}}.formulario input {border:none;outline: none;background: none;background-color: var(--Matriz);border: 0.2vw solid var(--Cor_Segundaria_2_1);box-shadow: 5px 5px 0px 2px var(--Cor_Segundaria_2_2);font-family: var(--font_titulo);font-size: 0.9vw;color: var(--Cor_Segundaria_2_1);padding-left: 1vw;padding-right: 1vw;width: 100%;height: 3vh;}.formulario label {font-family: var(--font_titulo);font-size: 1vw;color: var(--Matriz);}.formulario button {border: none;outline: none;background: none;font-family: var(--font_titulo);font-size: 1vw;color: var(--Matriz);background-color: #c6c6c6;box-shadow: -5px 5px 0px #9a9a9a;transition: 1s ease;width: 8vw;height: 4vh;}.formulario button:hover {background-color: var(--Cor_Segundaria_2_1);box-shadow: 5px 5px 0px var(--Cor_Segundaria_2_2);};` + } + }; +} diff --git a/js/Ambiente/Service/List/Gerador_XML_Telefonia.js b/js/Ambiente/Service/List/Gerador_XML_Telefonia.js new file mode 100644 index 0000000..72347f1 --- /dev/null +++ b/js/Ambiente/Service/List/Gerador_XML_Telefonia.js @@ -0,0 +1,207 @@ + +function gerarArquivo() { + const macEquipamento = document.getElementById('mac_equipamento').value; + const nomeCliente = document.getElementById('nome_cliente').value; + const nomeSetor = document.getElementById('nome_setor').value; + const usuarioSip = document.getElementById('usuario_sip').value; + const senhaSip = document.getElementById('senha_sip').value; + + let conteudo = ` + + SIP + admin + p06++kc37$6 + + + D/M/YY + E. South America Standard/Daylight Time + + + 200.160.0.8 + Unicast + + + + + + + + + 5060 + + 172.16.254.130 + + + + + + + + + + + + true + + + true + x-cisco-serviceuri-cfwdall + x-cisco-serviceuri-pickup + x-cisco-serviceuri-opickup + x-cisco-serviceuri-gpickup + x-cisco-serviceuri-meetme + x-cisco-serviceuri-abbrdial + false + 2 + true + true + 2 + 2 + 0 + true + + + 6 + 10 + 180 + 3600 + 5 + 120 + 120 + 5 + 500 + 4000 + 70 + false + None + + 1 + false + true + false + false + 3 + avt + false + false + 3 + + + ${nomeSetor} + 1 + false + 10 + false + 16384 + 32766 + + + 9 + ${nomeCliente} + USECALLMANAGER + 5060 + ${usuarioSip} + + + + + 2 + + 3 + ${usuarioSip} + ${senhaSip} + false + 1 + voicemail extension + 4 + 5 + i${nomeCliente} + + true + false + false + true + + + + 5060 + 184 + 0 + dialplan.xml + + + + true + 2 + + sip78xx.14-2-1-0001-14 + + false + false + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 22 + 0 + 0 + 1 + cisco + 7 + 00:00 + 00:00 + 00:00 + 7 + 00:00 + 1 + 1 + 1 + + + 1143565489-a3cbf294-7526-4c29-8791-c4fce4ce4c42 + 0 + + + 3804 + + + + false + `; + + async function criarArquivosZip(conteudo, macEquipamento) { + const zip = new JSZip(); + + // Adicionando o arquivo com conteúdo + zip.file(`SEP${macEquipamento.toUpperCase()}.cnf.xml`, conteudo); + + // Adicionando arquivos vazios + zip.file(`CTLSEP${macEquipamento.toUpperCase()}.tlv`, ''); + zip.file(`ITLSEP${macEquipamento.toUpperCase()}.tlv`, ''); + + // Gerando o arquivo ZIP + const zipContent = await zip.generateAsync({ type: 'blob' }); + + // Criando o link para download + const url = URL.createObjectURL(zipContent); + const a = document.createElement('a'); + a.href = url; + a.download = `Arquivos_${macEquipamento.toUpperCase()}.zip`; // Nome do arquivo ZIP + document.body.appendChild(a); + a.click(); + document.body.removeChild(a); + URL.revokeObjectURL(url); + } + + // Chame a função passando o conteúdo e o MAC do equipamento + criarArquivosZip(conteudo, macEquipamento); + +} + + +const scriptElement = document.createElement('script'); +scriptElement.src = 'https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js'; +document.body.appendChild(scriptElement); \ No newline at end of file diff --git a/js/padrao_A1.js b/js/padrao_A1.js deleted file mode 100644 index d0bd356..0000000 --- a/js/padrao_A1.js +++ /dev/null @@ -1,340 +0,0 @@ - - - -// Função para obter a URL base da API -async function getApiUrl() { - try { - const response = await fetch('../../../Sites/Site_ItGuys/php/config_url.php'); // Solicita a URL base do PHP - if (!response.ok) { - throw new Error('Network response was not ok'); - } - const data = await response.json(); - return data.apiUrl; // Retorna a URL base - } catch (error) { - console.error('Error fetching API URL:', error); - throw error; - } -} - -// Função para obter o token do localStorage -function getAuthToken() { - return localStorage.getItem('x-access-token'); -} - - -const Permissoes = { - visuMonitor: true, -}; - - - -// Função para carregar uma imagem protegida com token JWT e exibi-la - -// Função para carregar e exibir as imagens protegidas -async function criarBlocos() { - try { - const apiUrl = await getApiUrl(); // Obtém a URL da API a partir do PHP - const token = getAuthToken(); // Obtém o token JWT do localStorage - - // Faz uma requisição para obter os dados da rota /mounting - const response = await fetch(`${apiUrl}/mounting`, { - method: 'GET', - headers: { - 'Content-Type': 'application/json', - 'x-access-token': token ? token : '' - } - }); - - if (!response.ok) { - throw new Error('Erro na requisição: ' + response.statusText); - - } - - const data = await response.json(); - - // Agora acessa as propriedades do objeto - const nomeCompleto = data.usuario.nome; // Nome completo do usuário - const primeiroNome = nomeCompleto.split(' ')[0].substring(0, 10); // Pega o primeiro nome e limita a 10 caracteres // Limita a 10 caracteres; - const Empresa = data.empresa.nome; - const ImagemUser = `${apiUrl}${data.usuario.img_perfil}`; - //const ImagemUser2 = `${apiUrl}${data.usuario.img_perfil}`; - const logoEmpresa = `${apiUrl}${data.empresa.logo}`; - - - - - // Exibe as imagens protegidas usando os URLs retornados pela API - loadImage(ImagemUser, 'profileImage'); - //loadImage(ImagemUser2, 'profileImage'); // Imagem de perfil do usuário - loadImage(logoEmpresa, 'companyLogo'); // Logo da empresa - - // Acessando o primeiro objeto do array retornado - - console.log(data); - console.log(primeiroNome); - console.log(Empresa); - console.log(ImagemUser); - console.log(logoEmpresa); - - - //var visuMonitor = usuarioInfo.Permissoes_Monitor; - - - //constante que controla o estilo css que está estilizando todo o ambiente do usuário. - const estilos = document.getElementById('conexao'); - estilos.href = './Css/global/Estrutura.css'; - - - const construtor_primario = document.getElementById('entrada_1'); - - construtor_primario.innerHTML = - '' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '' - + - '' - + - '
' - + - '

' + primeiroNome + '
' + Empresa + '

' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '

Home

' - + - '
' - + - //Estrutura vaizia dedicada para aparesentação do painel de monitoramento caso o usuário tenha permissão para o visualizar. - '
' - + - '
' - + - '

Servicedesk

' - + - '
' - + - '
' - + - '

Suporte

' - + - '

Configuracões

' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - ; - - - - - //Construtores responsavels sobre a construção de alguns scripts que não são default, que só atendem o ambiente do usuário. - - //construtor da reação do menu sobre as interações do usuário - const script1 = document.createElement('script'); - script1.src = './js/Ambiente/Estrutura/Reacao_menu.js'; - document.body.appendChild(script1); - - - if (Permissoes.visuMonitor) { - const script2 = document.createElement('script'); - script2.src = './js/Ambiente/Monitoramento/Estrutura_Secundaria_Monitor.js'; - script2.setAttribute // Acessando a propriedade corretamente - document.body.appendChild(script2); - } - - - - - - } catch (error) { - - - //Constante de controle sobre estilos css do painel de erro. - const estilos = document.getElementById('conexao'); - estilos.href = '../Css/page/Telas_acao/erro_404.css'; - - //variaveis de conexão de informações, possuindo informações algumas informaçõe sendo elas: - //o Status do erro - //Mensagem do erro - //Um mensagem complementar sobre o erro - var Status = 'Erro 404'; - var mensagem = 'Desculpe mas sua página não foi encontrada'; - var sub_mensagem = 'Tente fazer seu, login novamente'; - - //Constante usada para a criação da estrutura, sendo usada para apresentar todo o painel - const erro = document.getElementById('entrada_1'); - - erro.innerHTML = '
' - + - '

' + Status + '

' - + - '
' - + - '

' + mensagem + '

' + sub_mensagem + '

' - + - '' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - + - '
' - ; - - - - - console.error('Erro ao criar blocos:', error); - - - - } -} - - - -// Função para carregar uma imagem protegida com token JWT e exibi-la - -async function loadImage(url, imgElementClass) { - try { - const token = getAuthToken(); - console.log('Token:', token); - console.log('URL da imagem:', url); - - const response = await fetch(url, { - method: 'GET', - headers: { - 'x-access-token': token ? token : '' - } - }); - - if (!response.ok) { - throw new Error('Erro ao carregar a imagem: ' + response.statusText); - } - - const blob = await response.blob(); - const imageUrl = URL.createObjectURL(blob); - - // Seleciona todos os elementos com a classe - const imgElements = document.getElementsByClassName(imgElementClass); - if (imgElements.length > 0) { - for (let i = 0; i < imgElements.length; i++) { - imgElements[i].src = imageUrl; - } - } else { - console.warn('Nenhum elemento encontrado com a classe:', imgElementClass); - } - - return imageUrl; // Retorna a URL da imagem carregada - } catch (error) { - console.error('Erro ao carregar a imagem:', error); - console.log('Classe do elemento:', imgElementClass); - return null; // Retorna null em caso de erro - } -} -// Função para carregar a imagem de fundo -async function loadBackgroundAndUpdateStyle() { - try { - const apiUrl = await getApiUrl(); - const token = getAuthToken(); - const response = await fetch(`${apiUrl}/mounting`, { - method: 'GET', - headers: { - 'x-access-token': token ? token : '' - } - }); - - if (!response.ok) { - throw new Error('Erro ao carregar os dados: ' + response.statusText); - } - - const data = await response.json(); - const imagemFun = `${apiUrl}${data.usuario.img_fundo}`; - - const fundoResponse = await fetch(imagemFun, { - method: 'GET', - headers: { - 'x-access-token': token ? token : '' - } - }); - - if (!fundoResponse.ok) { - throw new Error('Erro ao carregar a imagem de fundo: ' + fundoResponse.statusText); - } - - const blob = await fundoResponse.blob(); - const fundoUserUrl = URL.createObjectURL(blob); - - const fundouser = document.getElementById('fundouser'); - fundouser.innerHTML = - '.Corpo_1 .Colunas_1 {' + - 'display: flex;' + - 'flex-direction: row;' + - 'background-image: url("' + fundoUserUrl + '");' + - 'background-position: center;' + - 'background-size: cover;' + - 'width: 15vw;' + - 'height: 10vh;' + - 'overflow: hidden;' + - 'transition: 1s ease;' + - '}'; - - console.log('Imagem de fundo carregada e estilo aplicado com sucesso.'); - } catch (error) { - console.error('Erro ao carregar a imagem de fundo:', error); - } -} - -// Inicia o carregamento das imagens quando o script for carregado -document.addEventListener('DOMContentLoaded', async () => { - await criarBlocos(); - await loadBackgroundAndUpdateStyle(); -}); diff --git a/login.html b/login.html index ae51013..e82d68b 100644 --- a/login.html +++ b/login.html @@ -69,7 +69,7 @@ + placeholder="escreva sua senha" writingsuggestions="on" autocomplete="password">