better view for http header

This commit is contained in:
MHSanaei 2024-01-11 18:11:48 +03:30
parent bee690429f
commit 594f004d2a
9 changed files with 83 additions and 71 deletions

View file

@ -5,54 +5,59 @@
<a-switch v-model="inbound.stream.tcp.acceptProxyProtocol"></a-switch> <a-switch v-model="inbound.stream.tcp.acceptProxyProtocol"></a-switch>
</a-form-item> </a-form-item>
<a-form-item label='HTTP {{ i18n "camouflage" }}'> <a-form-item label='HTTP {{ i18n "camouflage" }}'>
<a-switch <a-switch :checked="inbound.stream.tcp.type === 'http'"
:checked="inbound.stream.tcp.type === 'http'"
@change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'"> @change="checked => inbound.stream.tcp.type = checked ? 'http' : 'none'">
</a-switch> </a-switch>
</a-form-item> </a-form-item>
</a-form> </a-form>
<!-- tcp request --> <a-form v-if="inbound.stream.tcp.type === 'http'" :colon="false" :label-col="{ md: {span:8} }"
<a-form v-if="inbound.stream.tcp.type === 'http'" :colon="false" :label-col="{ md: {span:8} }" :wrapper-col="{ md: {span:14} }"> :wrapper-col="{ md: {span:14} }">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestVersion" }}'> <!-- tcp request -->
<a-divider style="margin:0;">{{ i18n "pages.inbounds.stream.general.request" }}</a-divider>
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
<a-input v-model.trim="inbound.stream.tcp.request.version"></a-input> <a-input v-model.trim="inbound.stream.tcp.request.version"></a-input>
</a-form-item> </a-form-item>
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestMethod" }}'> <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.method" }}'>
<a-input v-model.trim="inbound.stream.tcp.request.method"></a-input> <a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<template slot="label">{{ i18n "pages.inbounds.stream.tcp.requestPath" }} <template slot="label">{{ i18n "pages.inbounds.stream.tcp.path" }}
<a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button> <a-button size="small" @click="inbound.stream.tcp.request.addPath('/')">+</a-button>
</template> </template>
<template v-for="(path, index) in inbound.stream.tcp.request.path"> <template v-for="(path, index) in inbound.stream.tcp.request.path">
<a-input v-model.trim="inbound.stream.tcp.request.path[index]"> <a-input v-model.trim="inbound.stream.tcp.request.path[index]">
<a-button size="small" slot="addonAfter" <a-button size="small" slot="addonAfter" @click="inbound.stream.tcp.request.removePath(index)"
@click="inbound.stream.tcp.request.removePath(index)" v-if="inbound.stream.tcp.request.path.length>1">-</a-button>
v-if="inbound.stream.tcp.request.path.length>1">-</a-button>
</a-input> </a-input>
</template> </template>
</a-form-item> </a-form-item>
<a-form-item label='{{ i18n "pages.inbounds.stream.general.requestHeader" }}'> <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestHeader" }}'>
<a-button size="small" @click="inbound.stream.tcp.request.addHeader('host', '')">+</a-button> <a-button size="small" @click="inbound.stream.tcp.request.addHeader('host', '')">+</a-button>
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{span:24}"> <a-form-item :wrapper-col="{span:24}">
<a-input-group compact v-for="(header, index) in inbound.stream.tcp.request.headers"> <a-input-group compact v-for="(header, index) in inbound.stream.tcp.request.headers">
<a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'> <a-input style="width: 50%" v-model.trim="header.name"
placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
<template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template> <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
</a-input> </a-input>
<a-input style="width: 50%" v-model.trim="header.value" placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'> <a-input style="width: 50%" v-model.trim="header.value"
<a-button slot="addonAfter" size="small" @click="inbound.stream.tcp.request.removeHeader(index)">-</a-button> placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
<a-button slot="addonAfter" size="small"
@click="inbound.stream.tcp.request.removeHeader(index)">-</a-button>
</a-input> </a-input>
</a-input-group> </a-input-group>
</a-form-item> </a-form-item>
<!-- tcp response -->
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}'> <!-- tcp response -->
<a-divider style="margin:0;">{{ i18n "pages.inbounds.stream.general.response" }}</a-divider>
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.version" }}'>
<a-input v-model.trim="inbound.stream.tcp.response.version"></a-input> <a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
</a-form-item> </a-form-item>
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}'> <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.status" }}'>
<a-input v-model.trim="inbound.stream.tcp.response.status"></a-input> <a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
</a-form-item> </a-form-item>
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}'> <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.statusDescription" }}'>
<a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input> <a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
</a-form-item> </a-form-item>
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'> <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
@ -61,11 +66,12 @@
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{span:24}"> <a-form-item :wrapper-col="{span:24}">
<a-input-group compact v-for="(header, index) in inbound.stream.tcp.response.headers"> <a-input-group compact v-for="(header, index) in inbound.stream.tcp.response.headers">
<a-input style="width: 50%" v-model.trim="header.name" placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'> <a-input style="width: 50%" v-model.trim="header.name"
placeholder='{{ i18n "pages.inbounds.stream.general.name" }}'>
<template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template> <template slot="addonBefore" style="margin: 0;">[[ index+1 ]]</template>
</a-input> </a-input>
<a-input style="width: 50%" v-model.trim="header.value" <a-input style="width: 50%" v-model.trim="header.value"
placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'> placeholder='{{ i18n "pages.inbounds.stream.general.value" }}'>
<template slot="addonAfter"> <template slot="addonAfter">
<a-button size="small" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button> <a-button size="small" @click="inbound.stream.tcp.response.removeHeader(index)">-</a-button>
</template> </template>

View file

@ -6,7 +6,7 @@
<a-form-item label='{{ i18n "path" }}'> <a-form-item label='{{ i18n "path" }}'>
<a-input v-model.trim="inbound.stream.ws.path"></a-input> <a-input v-model.trim="inbound.stream.ws.path"></a-input>
</a-form-item> </a-form-item>
<a-form-item label='{{ i18n "pages.inbounds.stream.general.requestHeader" }}'> <a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestHeader" }}'>
<a-button size="small" @click="inbound.stream.ws.addHeader()">+</a-button> <a-button size="small" @click="inbound.stream.ws.addHeader()">+</a-button>
</a-form-item> </a-form-item>
<a-form-item :wrapper-col="{span:24}"> <a-form-item :wrapper-col="{span:24}">

View file

@ -7,7 +7,7 @@
<link rel="stylesheet" href="{{ .base_path }}assets/codemirror/lint/lint.css"> <link rel="stylesheet" href="{{ .base_path }}assets/codemirror/lint/lint.css">
<script src="{{ .base_path }}assets/base64/base64.min.js"></script> <script src="{{ .base_path }}assets/base64/base64.min.js"></script>
<script src="{{ .base_path }}assets/js/model/outbound.js"></script> <script src="{{ .base_path }}assets/js/model/outbound.js?{{ .cur_ver }}"></script>
<script src="{{ .base_path }}assets/codemirror/codemirror.js"></script> <script src="{{ .base_path }}assets/codemirror/codemirror.js"></script>
<script src="{{ .base_path }}assets/codemirror/javascript.js"></script> <script src="{{ .base_path }}assets/codemirror/javascript.js"></script>
<script src="{{ .base_path }}assets/codemirror/jshint.js"></script> <script src="{{ .base_path }}assets/codemirror/jshint.js"></script>

View file

@ -204,17 +204,18 @@
"obtain" = "Obtain" "obtain" = "Obtain"
[pages.inbounds.stream.general] [pages.inbounds.stream.general]
"requestHeader" = "Request Header" "request" = "Request"
"response" = "Response"
"name" = "Name" "name" = "Name"
"value" = "Value" "value" = "Value"
[pages.inbounds.stream.tcp] [pages.inbounds.stream.tcp]
"requestVersion" = "Request Version" "version" = "Version"
"requestMethod" = "Request Method" "method" = "Method"
"requestPath" = "Request Path" "path" = "Path"
"responseVersion" = "Response Version" "status" = "Status"
"responseStatus" = "Response Status" "statusDescription" = "Status Description"
"responseStatusDescription" = "Response Status Description" "requestHeader" = "Request Header"
"responseHeader" = "Response Header" "responseHeader" = "Response Header"
[pages.inbounds.stream.quic] [pages.inbounds.stream.quic]

View file

@ -204,18 +204,19 @@
"obtain" = "Recibir" "obtain" = "Recibir"
[pages.inbounds.stream.general] [pages.inbounds.stream.general]
"requestHeader" = "Encabezado de la Petición" "request" = "Pedido"
"response" = "Respuesta"
"name" = "Nombre" "name" = "Nombre"
"value" = "Valor" "value" = "Valor"
[pages.inbounds.stream.tcp] [pages.inbounds.stream.tcp]
"requestVersion" = "Versión de la Petición" "version" = "Versión"
"requestMethod" = "Método de la Petición" "method" = "Método"
"requestPath" = "Ruta de la Petición" "path" = "Camino"
"responseVersion" = "Versión de la Respuesta" "status" = "Estado"
"responseStatus" = "Estado de la Respuesta" "statusDescription" = "Descripción de la Situación"
"responseStatusDescription" = "Descripción del Estado de la Respuesta" "requestHeader" = "Encabezado de solicitud"
"responseHeader" = "Encabezado de la Respuesta" "responseHeader" = "Encabezado de respuesta"
[pages.inbounds.stream.quic] [pages.inbounds.stream.quic]
"encryption" = "Cifrado" "encryption" = "Cifrado"

View file

@ -204,17 +204,18 @@
"obtain" = "Obtain" "obtain" = "Obtain"
[pages.inbounds.stream.general] [pages.inbounds.stream.general]
"requestHeader" = "درخواست سربرگ" "request" = "درخواست"
"response" = "پاسخ"
"name" = "نام" "name" = "نام"
"value" = "مقدار" "value" = "مقدار"
[pages.inbounds.stream.tcp] [pages.inbounds.stream.tcp]
"requestVersion" = "ورژن درخواست" "version" = "ورژن"
"requestMethod" = "متد درخواست" "method" = "متد"
"requestPath" = "مسیر درخواست" "path" = "مسیر"
"responseVersion" = "ورژن پاسخ" "status" = "وضعیت"
"responseStatus" = "وضعیت پاسخ" "statusDescription" = "توضیحات وضعیت"
"responseStatusDescription" = "توضیحات وضعیت پاسخ" "requestHeader" = "سربرگ درخواست"
"responseHeader" = "سربرگ پاسخ" "responseHeader" = "سربرگ پاسخ"
[pages.inbounds.stream.quic] [pages.inbounds.stream.quic]

View file

@ -204,17 +204,18 @@
"obtain" = "Получить" "obtain" = "Получить"
[pages.inbounds.stream.general] [pages.inbounds.stream.general]
"requestHeader" = "Заголовок запроса" "request" = "Запрос"
"response" = "Ответ"
"name" = "Имя" "name" = "Имя"
"value" = "Значение" "value" = "Ценить"
[pages.inbounds.stream.tcp] [pages.inbounds.stream.tcp]
"requestVersion" = "Версия запроса" "version" = "Версия"
"requestMethod" = "Метод запроса" "method" = "Метод"
"requestPath" = "Путь запроса" "path" = "Путь"
"responseVersion" = "Версия ответа" "status" = "Положение дел"
"responseStatus" = "Статус ответа" "statusDescription" = "Описание статуса"
"responseStatusDescription" = "Описание статуса ответа" "requestHeader" = "Заголовок запроса"
"responseHeader" = "Заголовок ответа" "responseHeader" = "Заголовок ответа"
[pages.inbounds.stream.quic] [pages.inbounds.stream.quic]

View file

@ -204,17 +204,18 @@
"obtain" = "Nhận" "obtain" = "Nhận"
[pages.inbounds.stream.general] [pages.inbounds.stream.general]
"requestHeader" = "Tiêu đề yêu cầu" "request" = "Lời yêu cầu"
"response" = "Phản ứng"
"name" = "Tên" "name" = "Tên"
"value" = "Giá trị" "value" = "Giá trị"
[pages.inbounds.stream.tcp] [pages.inbounds.stream.tcp]
"requestVersion" = "Phiên bản yêu cầu" "version" = "Phiên bản"
"requestMethod" = "Phương thức yêu cầu" "method" = "Phương pháp"
"requestPath" = "Đường dẫn yêu cầu" "path" = "Con đường"
"responseVersion" = "Phiên bản phản hồi" "status" = "Trạng thái"
"responseStatus" = "Trạng thái phản hồi" "statusDescription" = "Tình trạng Mô tả"
"responseStatusDescription" = "Mô tả trạng thái phản hồi" "requestHeader" = "Tiêu đề yêu cầu"
"responseHeader" = "Tiêu đề phản hồi" "responseHeader" = "Tiêu đề phản hồi"
[pages.inbounds.stream.quic] [pages.inbounds.stream.quic]

View file

@ -204,17 +204,18 @@
"obtain" = "获取" "obtain" = "获取"
[pages.inbounds.stream.general] [pages.inbounds.stream.general]
"requestHeader" = "请求头" "request" = "要求"
"name" = "名称" "response" = "回复"
"value" = "值" "name" = "姓名"
"value" = "价值"
[pages.inbounds.stream.tcp] [pages.inbounds.stream.tcp]
"requestVersion" = "请求版本" "version" = "版本"
"requestMethod" = "请求方法" "method" = "方法"
"requestPath" = "请求路径" "path" = "小路"
"responseVersion" = "响应版本" "status" = "地位"
"responseStatus" = "响应状态" "statusDescription" = "状态说明"
"responseStatusDescription" = "响应状态说明" "requestHeader" = "请求头"
"responseHeader" = "响应头" "responseHeader" = "响应头"
[pages.inbounds.stream.quic] [pages.inbounds.stream.quic]