Change port start developping

This commit is contained in:
DomySh
2022-06-30 17:48:04 +02:00
parent 2dacd49623
commit c6fe46cdfa
11 changed files with 60 additions and 91 deletions

View File

@@ -16,7 +16,8 @@ export type Service = {
export type ServiceAddForm = {
name:string,
port:number
port:number,
internalPort?:number
}
export type ServerResponse = {
@@ -27,6 +28,11 @@ export type ServerResponseWithID = {
id:string
}
export type ChangePort = {
port?: number,
internalPort?: number
}
export type ServerResponseToken = {
status:string,
access_token?:string

View File

@@ -1,7 +1,7 @@
import { showNotification } from "@mantine/notifications";
import { ImCross } from "react-icons/im";
import { TiTick } from "react-icons/ti"
import { GeneralStats, Service, ServiceAddForm, ServerResponse, RegexFilter, RegexAddForm, ServerStatusResponse, PasswordSend, ChangePassword, LoginResponse, ServerResponseToken, ServerResponseWithID } from "./models";
import { GeneralStats, Service, ServiceAddForm, ServerResponse, RegexFilter, RegexAddForm, ServerStatusResponse, PasswordSend, ChangePassword, LoginResponse, ServerResponseToken, ServerResponseWithID, ChangePort } from "./models";
var Buffer = require('buffer').Buffer
@@ -128,6 +128,11 @@ export async function regenport(service_id:string){
return status === "ok"?undefined:status
}
export async function changeports(service_id:string, data:ChangePort){
const { status } = await postapi(`service/${service_id}/change-ports`,data) as ServerResponse;
return status === "ok"?undefined:status
}
export async function addservice(data:ServiceAddForm) {
return await postapi("services/add",data) as ServerResponseWithID;
}