Commit 52f8fd1a authored by Guillermo Sanz López's avatar Guillermo Sanz López
Browse files

delete invoker and provider working

parent 53cb6d9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
NEXT_PUBLIC_API_BASE_URL="https://10.95.82.71:8085"
#NEXT_PUBLIC_API_BASE_URL="http://10.95.235.20:9000"
NEXT_PUBLIC_GRAFANA_BASE_URL="https://10.95.82.71:3000"
NEXT_PUBLIC_GRAFANA_BASE_URL="http://10.95.82.71:3000"
#NEXT_PUBLIC_GRAFANA_BASE_URL="http://10.95.235.20:3001"
NEXT_PUBLIC_JWT_EXPIRATION= 5m
NEXT_PUBLIC_JWT_SECRET= dd5f3089-40c3-403d-af14-d0c228b05cb4
+8 −0
Original line number Diff line number Diff line
@@ -42,3 +42,11 @@ export const getUsers = async id => {
export const getUser = async id => {
  return axiosInstance.get(`/users/${id}`)
}

export const deleteInvoker = async invokerId => {
  return axiosInstance.delete(`/invokers/${invokerId}`)
}

export const deleteProvider = async providerId => {
  return axiosInstance.delete(`/providers/${providerId}`)
}
+2 −2
Original line number Diff line number Diff line
@@ -44,8 +44,8 @@ export const setUserData = userData => {
}

export const getUserData = () => {
  return Cookies.get(USER_DATA_KEY)
    ? JSON.parse(decryptString(Cookies.get(USER_DATA_KEY), USER_DATA_ENCRYPTION_KEY))
  return Cookies.get(USER_DATA_KEY) // comprueba si existe una cookie con la clave USER_DATA_KEY
    ? JSON.parse(decryptString(Cookies.get(USER_DATA_KEY), USER_DATA_ENCRYPTION_KEY)) // si existe, desencripta el valor de la cookie y lo convierte en un objeto JSON
    : null
}

+2 −1
Original line number Diff line number Diff line
@@ -56,11 +56,12 @@ const AuthProvider = ({ children }) => {
              Authorization: `Bearer ${storedAccessToken}`
            }
          })
          // getUserData() -> devuelve el objeto JSON almacenado en la cookie USER_DATA_KEY
          setUser(getUserData())
          setLoading(false)
        
        // SI EL TOKEN FALLA, 
        } catch (error) { // EN CASO DE ERROR
        } catch (error) { // EN CASO DE ERROR hace lo mismo pero con el token de refresco
          try {
            const response = await axiosInstance.post(authConfig.refreshEndpoint)
            setAccessToken(response.data.access_token)
+1 −3
Original line number Diff line number Diff line
@@ -10,8 +10,6 @@ const Dashboard = () => {
      {/* Card Runing containers*/}
      <Grid item xs={12} sm={4}>
        <iframe
          // src = url del panel de grafana a incrustar
          // NEXT_PUBLIC_GRAFANA_BASE_URL="http://10.95.235.20:3001"
          src={`${
            process.env.NEXT_PUBLIC_GRAFANA_BASE_URL
          }/d-solo/f66dea48-ca2f-46fb-a6f0-50bf50502d74/docker-monitoring?orgId=1&refresh=10s&theme=${
@@ -19,7 +17,7 @@ const Dashboard = () => {
          }&panelId=7`}
          width='100%'
          height='105'
          style={{ border: 0 }}  // delete border of iframe
          style={{ border: 0 }}
        />
      </Grid>

Loading