mirror of
https://github.com/openziti/zrok.git
synced 2025-06-23 19:22:19 +02:00
full support for untunelling services and disabling environments from the ui (#87)
This commit is contained in:
parent
37ef68af45
commit
b3f3b3bd73
@ -9,7 +9,6 @@ const Environments = (props) => {
|
|||||||
const disableEnvironment = (envId) => {
|
const disableEnvironment = (envId) => {
|
||||||
console.log(envId)
|
console.log(envId)
|
||||||
if(window.confirm('really disable environment "' + envId +'"?')) {
|
if(window.confirm('really disable environment "' + envId +'"?')) {
|
||||||
console.log("will delete environment: " + envId)
|
|
||||||
identity.disable({body: {identity: envId}}).then(resp => {
|
identity.disable({body: {identity: envId}}).then(resp => {
|
||||||
console.log(resp);
|
console.log(resp);
|
||||||
})
|
})
|
||||||
@ -52,11 +51,9 @@ const Environments = (props) => {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const servicesComponent = ({ data }) => <Services services={data.services} />
|
const servicesComponent = ({ data }) => <Services envId={data.environment.zId} services={data.services} />
|
||||||
const servicesExpanded = row => row.services != null && row.services.length > 0
|
const servicesExpanded = row => row.services != null && row.services.length > 0
|
||||||
|
|
||||||
console.log('now', Date.now())
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h2>Environments</h2>
|
<h2>Environments</h2>
|
||||||
|
@ -2,12 +2,15 @@ import DataTable from 'react-data-table-component';
|
|||||||
import {Sparklines, SparklinesLine, SparklinesSpots} from 'react-sparklines';
|
import {Sparklines, SparklinesLine, SparklinesSpots} from 'react-sparklines';
|
||||||
import {mdiCloseOutline} from "@mdi/js";
|
import {mdiCloseOutline} from "@mdi/js";
|
||||||
import Icon from "@mdi/react";
|
import Icon from "@mdi/react";
|
||||||
|
import * as tunnel from './api/tunnel';
|
||||||
|
|
||||||
const Services = (props) => {
|
const Services = (props) => {
|
||||||
const humanizeDuration = require("humanize-duration")
|
const humanizeDuration = require("humanize-duration")
|
||||||
const untunnelService = (svcName) => {
|
const untunnelService = (envId, svcName) => {
|
||||||
if(window.confirm('really disable service "' + svcName +'"?')) {
|
if(window.confirm('really disable service "' + svcName +'"?')) {
|
||||||
console.log("will disable serivce: " + svcName)
|
tunnel.untunnel({body: {zId: envId, svcName: svcName}}).then(resp => {
|
||||||
|
console.log(resp)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,7 +28,7 @@ const Services = (props) => {
|
|||||||
{
|
{
|
||||||
name: 'Actions',
|
name: 'Actions',
|
||||||
selector: row => <>
|
selector: row => <>
|
||||||
<button data-value={row.name} onClick={e => untunnelService(row.name)} title={"Disable Service '"+row.name+"'"}>
|
<button data-value={row.name} onClick={e => untunnelService(props.envId, row.name)} title={"Disable Service '"+row.name+"'"}>
|
||||||
<Icon path={mdiCloseOutline} size={0.7}/>
|
<Icon path={mdiCloseOutline} size={0.7}/>
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user