diff options
Diffstat (limited to 'web/html/xui/form/protocol/trojan.html')
| -rw-r--r-- | web/html/xui/form/protocol/trojan.html | 103 |
1 files changed, 42 insertions, 61 deletions
diff --git a/web/html/xui/form/protocol/trojan.html b/web/html/xui/form/protocol/trojan.html index 3127e4c5..e1d82572 100644 --- a/web/html/xui/form/protocol/trojan.html +++ b/web/html/xui/form/protocol/trojan.html @@ -1,11 +1,7 @@ {{define "form/trojan"}} <a-form layout="inline"> -<label style="color: green;">{{ i18n "clients"}}</label> -<a-collapse activeKey="0" v-for="(trojan, index) in inbound.settings.trojans" -:key="`trojan-${index}`"> - - <a-collapse-panel :class="getHeaderStyle(trojan.email)" :header="getHeaderText(trojan.email)"> - <a-tag v-if="isExpiry(index) || ((getUpStats(trojan.email) + getDownStats(trojan.email)) > trojan.totalGB && trojan.totalGB != 0)" color="red" style="margin-bottom: 10px;display: block;text-align: center;">Account is (Expired|Traffic Ended) And Disabled</a-tag> +<a-collapse activeKey="0" v-for="(client, index) in inbound.settings.trojans.slice(0,1)" v-if="!isEdit"> + <a-collapse-panel header="{{ i18n "pages.inbounds.client" }}"> <a-form layout="inline"> <a-form-item> <span slot="label"> @@ -14,18 +10,16 @@ <template slot="title"> The Email Must Be Completely Unique </template> - <!--Renew Svg Icon--> - <svg - @click="getNewEmail(trojan)" - xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="anticon anticon-question-circle" viewBox="0 0 16 16"> <path d="M11.534 7h3.932a.25.25 0 0 1 .192.41l-1.966 2.36a.25.25 0 0 1-.384 0l-1.966-2.36a.25.25 0 0 1 .192-.41zm-11 2h3.932a.25.25 0 0 0 .192-.41L2.692 6.23a.25.25 0 0 0-.384 0L.342 8.59A.25.25 0 0 0 .534 9z"/> <path fill-rule="evenodd" d="M8 3c-1.552 0-2.94.707-3.857 1.818a.5.5 0 1 1-.771-.636A6.002 6.002 0 0 1 13.917 7H12.9A5.002 5.002 0 0 0 8 3zM3.1 9a5.002 5.002 0 0 0 8.757 2.182.5.5 0 1 1 .771.636A6.002 6.002 0 0 1 2.083 9H3.1z"/> </svg> + <a-icon @click="getNewEmail(client)" type="sync"> </a-icon> </a-tooltip> </span> - <a-input v-model.trim="trojan.email" style="width: 150px;"></a-input> + <a-input v-model.trim="client.email" style="width: 150px;" ></a-input> </a-form-item> - <a-form-item label="Password" > - <a-input v-model.trim="trojan.password" style="width: 150px;"></a-input> - </a-form-item> - <a-form-item> + </a-form> + <a-form-item label="Password"> + <a-input v-model.trim="client.password" style="width: 150px;"></a-input> + </a-form-item> + <a-form-item> <span slot="label"> IP Count Limit <a-tooltip> @@ -35,9 +29,9 @@ <a-icon type="question-circle" theme="filled"></a-icon> </a-tooltip> </span> - <a-input type="number" v-model.number="trojan.limitIp" min="0" style="width: 70px;"></a-input> - </a-form-item> - <a-form-item v-if="trojan.email && trojan.limitIp > 0 && isEdit"> + <a-input type="number" v-model.number="client.limitIp" min="0" style="width: 70px;" ></a-input> + </a-form-item> + <a-form-item v-if="client.email && client.limitIp > 0 && isEdit"> <span slot="label"> IP log <a-tooltip> @@ -51,22 +45,26 @@ clear the log </template> <span style="color: #FF4D4F"> - <a-icon type="delete" @click="clearDBClientIps(trojan.email,$event)"></a-icon> + <a-icon type="delete" @click="clearDBClientIps(client.email,$event)"></a-icon> </span> </a-tooltip> </span> <a-form layout="block"> - <a-textarea readonly @click="getDBClientIps(trojan.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 2, maxRows: 10 }"> + <a-textarea readonly @click="getDBClientIps(client.email,$event)" placeholder="Click To Get IPs" :auto-size="{ minRows: 2, maxRows: 10 }"> </a-textarea> </a-form> - </a-form-item> - </a-form> - <a-form-item v-if="inbound.XTLS" label="Flow"> - <a-select v-model="trojan.flow" style="width: 150px"> + </a-form-item> + <a-form-item v-if="inbound.xtls" label="Flow"> + <a-select v-model="client.flow" style="width: 150px"> <a-select-option value="">{{ i18n "none" }}</a-select-option> <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option> </a-select> </a-form-item> + <a-form-item v-if="inbound.tls" label="uTLS" layout="inline"> + <a-select v-model="inbound.settings.trojans[index].fingerprint" label="uTLS" style="width: 150px"> + <a-select-option v-for="key in UTLS_FINGERPRINT" :value="key">[[ key ]]</a-select-option> + </a-select> + </a-form-item> <a-form-item> <span slot="label"> <span >{{ i18n "pages.inbounds.totalFlow" }}</span>(GB) @@ -77,7 +75,7 @@ <a-icon type="question-circle" theme="filled"></a-icon> </a-tooltip> </span> - <a-input-number v-model="trojan._totalGB" :min="0"></a-input-number> + <a-input-number v-model="client._totalGB" :min="0"></a-input-number> </a-form-item> <a-form-item> <span slot="label"> @@ -90,39 +88,22 @@ </a-tooltip> </span> <a-date-picker :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm" - v-model="trojan._expiryTime" style="width: 170px;"></a-date-picker> + v-model="client._expiryTime" style="width: 170px;"></a-date-picker> </a-form-item> - <a-form layout="inline"> - <a-tooltip v-if="trojan._totalGB > 0"> - <template slot="title"> - {{ i18n "pages.inbounds.resetTraffic" }} - </template> - <span style="color: #FF4D4F"> - <a-icon type="delete" @click="resetClientTraffic(trojan,$event)"></a-icon> - </span> - </a-tooltip> - <a-tag color="blue">[[ sizeFormat(getUpStats(trojan.email)) ]] / [[ sizeFormat(getDownStats(trojan.email)) ]]</a-tag> - <a-tag v-if="trojan._totalGB > 0" color="red">used : [[ sizeFormat(getUpStats(trojan.email) + getDownStats(trojan.email)) ]]</a-tag> - <a-tag v-show="inbound.settings.trojans.length > 1" @click="removeClient(index, inbound.settings.trojans)"> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" width="22" height="22" class="mt-2 cursor-pointer"> - <path fill="none" d="M0 0h24v24H0z" /> - <path fill="#EC4899" - d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm0-9.414l2.828-2.829 1.415 1.415L13.414 12l2.829 2.828-1.415 1.415L12 13.414l-2.828 2.829-1.415-1.415L10.586 12 7.757 9.172l1.415-1.415L12 10.586z" - /> - </svg> - </a-tag> - </a-form> </a-collapse-panel> </a-collapse> -<a-tag @click="addClient(inbound.protocol, inbound.settings.trojans)"> - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" class="ml-2 cursor-pointer"> - <path fill="none" d="M0 0h24v24H0z" /> - <path fill="green" - d="M11 11V7h2v4h4v2h-4v4h-2v-4H7v-2h4zm1 11C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16z" - /> - </svg> -</a-tag> - +<a-collapse v-else> + <a-collapse-panel :header="'{{ i18n "pages.client.clientCount"}} : ' + inbound.settings.trojans.length"> + <table width="100%"> + <tr class="client-table-header"> + <th v-for="col in Object.keys(inbound.settings.trojans[0]).slice(0, 3)">[[ col ]]</th> + </tr> + <tr v-for="(client, index) in inbound.settings.trojans" :class="index % 2 == 1 ? 'client-table-odd-row' : ''"> + <td v-for="col in Object.values(client).slice(0, 3)">[[ col ]]</td> + </tr> + </table> + </a-collapse-panel> +</a-collapse> <template v-if="inbound.isTcp && inbound.tls"> <a-form layout="inline"> <a-form-item label="Fallbacks"> @@ -135,26 +116,26 @@ </a-form-item> </a-form> - <!-- trojan fallbacks --> + <!-- trojan fallbacks --> <a-form v-for="(fallback, index) in inbound.settings.fallbacks" layout="inline"> <a-divider> fallback[[ index + 1 ]] <a-icon type="delete" @click="() => inbound.settings.delTrojanFallback(index)" style="color: rgb(255, 77, 79);cursor: pointer;"/> </a-divider> - <a-form-item label="name"> + <a-form-item label="Name"> <a-input v-model="fallback.name"></a-input> </a-form-item> - <a-form-item label="alpn"> + <a-form-item label="Alpn"> <a-input v-model="fallback.alpn"></a-input> </a-form-item> - <a-form-item label="path"> + <a-form-item label="Path"> <a-input v-model="fallback.path"></a-input> </a-form-item> - <a-form-item label="dest"> + <a-form-item label="Dest"> <a-input v-model="fallback.dest"></a-input> </a-form-item> - <a-form-item label="xver"> + <a-form-item label="xVer"> <a-input type="number" v-model.number="fallback.xver"></a-input> </a-form-item> <a-divider v-if="inbound.settings.fallbacks.length - 1 === index"/> |
