| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  | {{define "inboundInfoModal"}} | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  | <a-modal id="inbound-info-modal" | 
					
						
							|  |  |  |     v-model="infoModal.visible" title='{{ i18n "pages.inbounds.details"}}' | 
					
						
							|  |  |  |     :closable="true" | 
					
						
							|  |  |  |     :mask-closable="true" | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |     :class="themeSwitcher.darkCardClass" | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |     :footer="null" | 
					
						
							|  |  |  |     width="600px" | 
					
						
							|  |  |  |     > | 
					
						
							| 
									
										
										
										
											2023-02-12 13:50:09 +00:00
										 |  |  |     <table style="margin-bottom: 10px; width: 100%;"> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |         <tr><td> | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |                 <table> | 
					
						
							|  |  |  |                     <tr><td>{{ i18n "protocol" }}</td><td><a-tag color="green">[[ dbInbound.protocol ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                     <tr><td>{{ i18n "pages.inbounds.address" }}</td><td><a-tag color="blue">[[ dbInbound.address ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                     <tr><td>{{ i18n "pages.inbounds.port" }}</td><td><a-tag color="green">[[ dbInbound.port ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                 </table> | 
					
						
							|  |  |  |             </td> | 
					
						
							|  |  |  |             <td v-if="dbInbound.isVMess || dbInbound.isVLess || dbInbound.isTrojan || dbInbound.isSS"> | 
					
						
							|  |  |  |                 <table> | 
					
						
							|  |  |  |                     <tr> | 
					
						
							|  |  |  |                         <td>{{ i18n "transmission" }}</td><td><a-tag color="green">[[ inbound.network ]]</a-tag></td> | 
					
						
							|  |  |  |                     </tr> | 
					
						
							|  |  |  |                     <template v-if="inbound.isTcp || inbound.isWs || inbound.isH2"> | 
					
						
							|  |  |  |                         <tr v-if="inbound.host"><td>{{ i18n "host" }}</td><td><a-tag color="green">[[ inbound.host ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                         <tr v-else><td>{{ i18n "host" }}</td><td><a-tag color="orange">{{ i18n "none" }}</a-tag></td></tr> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                         <tr v-if="inbound.path"><td>{{ i18n "path" }}</td><td><a-tag color="green">[[ inbound.path ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                         <tr v-else><td>{{ i18n "path" }}</td><td><a-tag color="orange">{{ i18n "none" }}</a-tag></td></tr> | 
					
						
							|  |  |  |                     </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <template v-if="inbound.isQuic"> | 
					
						
							|  |  |  |                         <tr><td>quic {{ i18n "encryption" }}</td><td><a-tag color="green">[[ inbound.quicSecurity ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                         <tr><td>quic {{ i18n "password" }}</td><td><a-tag color="green">[[ inbound.quicKey ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                         <tr><td>quic {{ i18n "camouflage" }}</td><td><a-tag color="green">[[ inbound.quicType ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                     </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <template v-if="inbound.isKcp"> | 
					
						
							|  |  |  |                         <tr><td>kcp {{ i18n "encryption" }}</td><td><a-tag color="green">[[ inbound.kcpType ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                         <tr><td>kcp {{ i18n "password" }}</td><td><a-tag color="green">[[ inbound.kcpSeed ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                     </template> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                     <template v-if="inbound.isGrpc"> | 
					
						
							|  |  |  |                         <tr><td>grpc serviceName</td><td><a-tag color="green">[[ inbound.serviceName ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                         <tr><td>grpc multiMode</td><td><a-tag color="green">[[ inbound.stream.grpc.multiMode ]]</a-tag></td></tr> | 
					
						
							|  |  |  |                     </template> | 
					
						
							|  |  |  |                 </table> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </td></tr> | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |         <tr colspan="2" v-if="dbInbound.hasLink()"> | 
					
						
							|  |  |  |             <td v-if="inbound.tls"> | 
					
						
							|  |  |  |                 tls: <a-tag color="green">{{ i18n "enabled" }}</a-tag><br /> | 
					
						
							|  |  |  |                 tls {{ i18n "domainName" }}: <a-tag :color="inbound.serverName ? 'green' : 'orange'">[[ inbound.serverName ? inbound.serverName : '' ]]</a-tag> | 
					
						
							|  |  |  |             </td> | 
					
						
							|  |  |  |             <td v-else-if="inbound.xtls"> | 
					
						
							|  |  |  |                 xtls: <a-tag color="green">{{ i18n "enabled" }}</a-tag><br /> | 
					
						
							|  |  |  |                 xtls {{ i18n "domainName" }}: <a-tag :color="inbound.serverName ? 'green' : 'orange'">[[ inbound.serverName ? inbound.serverName : '' ]]</a-tag> | 
					
						
							|  |  |  |             </td> | 
					
						
							|  |  |  |             <td v-else-if="inbound.reality"> | 
					
						
							|  |  |  |                 reality: <a-tag color="green">{{ i18n "enabled" }}</a-tag><br /> | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |                 reality Destination: <a-tag :color="inbound.stream.reality.dest ? 'green' : 'orange'">[[ inbound.stream.reality.dest ]]</a-tag> | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |             </td> | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |             <td v-else>tls: <a-tag color="red">{{ i18n "disabled" }}</a-tag> | 
					
						
							| 
									
										
										
										
											2023-02-12 13:50:09 +00:00
										 |  |  |             </td> | 
					
						
							|  |  |  |         </tr> | 
					
						
							|  |  |  |     </table> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |     <template v-if="infoModal.clientSettings"> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |         <a-divider>{{ i18n "pages.inbounds.client" }}</a-divider> | 
					
						
							|  |  |  |         <table style="margin-bottom: 10px;"> | 
					
						
							|  |  |  |             <tr> | 
					
						
							|  |  |  |                 <td>{{ i18n "pages.inbounds.email" }}</td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ infoModal.clientSettings.email ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr v-if="infoModal.clientSettings.id"> | 
					
						
							|  |  |  |                 <td>ID</td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ infoModal.clientSettings.id ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr v-if="infoModal.inbound.canEnableTlsFlow()"> | 
					
						
							|  |  |  |                 <td>Flow</td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ infoModal.clientSettings.flow ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr v-if="infoModal.clientSettings.password"> | 
					
						
							|  |  |  |                 <td>Password</td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ infoModal.clientSettings.password ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr> | 
					
						
							|  |  |  |                 <td>{{ i18n "status" }}</td> | 
					
						
							|  |  |  |                 <td> | 
					
						
							|  |  |  |                     <a-tag v-if="isEnable" color="blue">{{ i18n "enabled" }}</a-tag> | 
					
						
							|  |  |  |                     <a-tag v-else color="red">{{ i18n "disabled" }}</a-tag> | 
					
						
							|  |  |  |                     <a-tag v-if="!isActive" color="red">{{ i18n "depleted" }}</a-tag> | 
					
						
							|  |  |  |                 </td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |             <tr v-if="infoModal.clientStats"> | 
					
						
							|  |  |  |                 <td>{{ i18n "usage" }}</td> | 
					
						
							|  |  |  |                 <td> | 
					
						
							|  |  |  |                     <a-tag color="green">[[ sizeFormat(infoModal.clientStats.up + infoModal.clientStats.down) ]]</a-tag> | 
					
						
							|  |  |  |                     <a-tag color="blue">↑ [[ sizeFormat(infoModal.clientStats.up) ]] / [[ sizeFormat(infoModal.clientStats.down) ]] ↓</a-tag> | 
					
						
							|  |  |  |                 </td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |         </table> | 
					
						
							|  |  |  |         <table style="margin-bottom: 10px; width: 100%;"> | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |             <tr> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |                 <th>{{ i18n "remained" }}</th> | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |                 <th>{{ i18n "pages.inbounds.totalFlow" }}</th> | 
					
						
							|  |  |  |                 <th>{{ i18n "pages.inbounds.expireDate" }}</th> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </tr> | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |         <tr> | 
					
						
							|  |  |  |             <td> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |                 <a-tag v-if="infoModal.clientStats && infoModal.clientSettings.totalGB > 0" :color="statsColor(infoModal.clientStats)"> | 
					
						
							|  |  |  |                     [[ sizeFormat(infoModal.clientSettings.totalGB - infoModal.clientStats.up - infoModal.clientStats.down) ]] | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |                 </a-tag> | 
					
						
							|  |  |  |             </td> | 
					
						
							|  |  |  |             <td> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |                 <a-tag v-if="infoModal.clientSettings.totalGB > 0" :color="statsColor(infoModal.clientStats)"> | 
					
						
							|  |  |  |                     [[ sizeFormat(infoModal.clientSettings.totalGB) ]] | 
					
						
							|  |  |  |                 </a-tag> | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |                 <a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag> | 
					
						
							|  |  |  |             </td> | 
					
						
							|  |  |  |             <td> | 
					
						
							|  |  |  |                 <template v-if="infoModal.clientSettings.expiryTime > 0"> | 
					
						
							| 
									
										
										
										
											2023-05-16 22:31:56 +00:00
										 |  |  |                     <a-tag :color="usageColor(new Date().getTime(), app.expireDiff, infoModal.clientSettings.expiryTime)"> | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |                         [[ DateUtil.formatMillis(infoModal.clientSettings.expiryTime) ]] | 
					
						
							|  |  |  |                     </a-tag> | 
					
						
							|  |  |  |                 </template> | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |                 <a-tag v-else-if="infoModal.clientSettings.expiryTime < 0" color="cyan">[[ infoModal.clientSettings.expiryTime / -86400000 ]] {{ i18n "pages.client.days" }}</a-tag> | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |                 <a-tag v-else color="green">{{ i18n "indefinite" }}</a-tag> | 
					
						
							|  |  |  |             </td> | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |         </tr> | 
					
						
							|  |  |  |     </table> | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |     <template v-if="app.subSettings.enable && infoModal.clientSettings.subId"> | 
					
						
							|  |  |  |         <a-divider>Subscription link</a-divider> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |         <a-row> | 
					
						
							|  |  |  |             <a-col :span="22"><a :href="[[ infoModal.subLink ]]" target="_blank">[[ infoModal.subLink ]]</a></a-col> | 
					
						
							|  |  |  |             <a-col :span="2"> | 
					
						
							|  |  |  |                 <a-tooltip title='{{ i18n "copy" }}'> | 
					
						
							|  |  |  |                     <button class="ant-btn ant-btn-primary" id="copy-sub-link" @click="copyToClipboard('copy-sub-link', infoModal.subLink)"> | 
					
						
							|  |  |  |                         <a-icon type="snippets"></a-icon> | 
					
						
							|  |  |  |                     </button> | 
					
						
							|  |  |  |                 </a-tooltip> | 
					
						
							|  |  |  |             </a-col> | 
					
						
							|  |  |  |         </a-row> | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |     </template> | 
					
						
							|  |  |  |     <template v-if="app.tgBotEnable && infoModal.clientSettings.tgId"> | 
					
						
							|  |  |  |         <a-divider>Telegram Username</a-divider> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |         <a-row> | 
					
						
							|  |  |  |             <a-col :span="22"><a :href="[[ infoModal.tgLink ]]" target="_blank">@[[ infoModal.clientSettings.tgId ]]</a></a-col> | 
					
						
							|  |  |  |             <a-col :span="2"> | 
					
						
							|  |  |  |                 <a-tooltip title='{{ i18n "copy" }}'> | 
					
						
							|  |  |  |                     <button class="ant-btn ant-btn-primary" id="copy-tg-link" @click="copyToClipboard('copy-tg-link', '@' + infoModal.clientSettings.tgId)"> | 
					
						
							|  |  |  |                         <a-icon type="snippets"></a-icon> | 
					
						
							|  |  |  |                     </button> | 
					
						
							|  |  |  |                 </a-tooltip> | 
					
						
							|  |  |  |             </a-col> | 
					
						
							|  |  |  |         </a-row> | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |     </template> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |     <template v-if="dbInbound.hasLink()"> | 
					
						
							|  |  |  |         <a-divider>URL</a-divider> | 
					
						
							|  |  |  |         <a-row v-for="(link,index) in infoModal.links"> | 
					
						
							|  |  |  |             <a-col :span="22"><a-tag color="cyan">[[ link.remark ]]</a-tag><br />[[ link.link ]]</a-col> | 
					
						
							|  |  |  |             <a-col :span="2" style="text-align: right;"> | 
					
						
							|  |  |  |                 <a-tooltip title='{{ i18n "copy" }}'> | 
					
						
							|  |  |  |                     <button class="ant-btn ant-btn-primary" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)"> | 
					
						
							|  |  |  |                         <a-icon type="snippets"></a-icon> | 
					
						
							|  |  |  |                     </button> | 
					
						
							|  |  |  |                 </a-tooltip> | 
					
						
							|  |  |  |             </a-col> | 
					
						
							|  |  |  |         </a-row> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |     </template> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  | </template> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |     <template v-else> | 
					
						
							|  |  |  |         <a-divider></a-divider> | 
					
						
							|  |  |  |         <table v-if="inbound.protocol == Protocols.SHADOWSOCKS" style="margin-bottom: 10px; width: 100%;"> | 
					
						
							|  |  |  |             <tr> | 
					
						
							|  |  |  |                 <th>{{ i18n "encryption" }}</th> | 
					
						
							|  |  |  |                 <th>{{ i18n "password" }}</th> | 
					
						
							|  |  |  |                 <th>{{ i18n "pages.inbounds.network" }}</th> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </tr><tr> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                 <td><a-tag color="green">[[ inbound.settings.method ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="blue">[[ inbound.settings.password ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ inbound.settings.network ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |         </table> | 
					
						
							| 
									
										
										
										
											2023-07-17 23:49:01 +00:00
										 |  |  |         <template v-if="inbound.protocol == Protocols.SHADOWSOCKS && !inbound.isSSMultiUser"> | 
					
						
							|  |  |  |             <a-divider>URL</a-divider> | 
					
						
							|  |  |  |             <a-row v-for="(link,index) in infoModal.links"> | 
					
						
							|  |  |  |                 <a-col :span="22"><a-tag color="cyan">[[ link.remark ]]</a-tag><br />[[ link.link ]]</a-col> | 
					
						
							|  |  |  |                 <a-col :span="2" style="text-align: right;"> | 
					
						
							|  |  |  |                     <a-tooltip title='{{ i18n "copy" }}'> | 
					
						
							|  |  |  |                         <button class="ant-btn ant-btn-primary" :id="'copy-url-link-'+index" @click="copyToClipboard('copy-url-link-'+index, link.link)"> | 
					
						
							|  |  |  |                             <a-icon type="snippets"></a-icon> | 
					
						
							|  |  |  |                         </button> | 
					
						
							|  |  |  |                     </a-tooltip> | 
					
						
							|  |  |  |                 </a-col> | 
					
						
							|  |  |  |             </a-row> | 
					
						
							|  |  |  |         </template> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |         <table v-if="inbound.protocol == Protocols.DOKODEMO" style="margin-bottom: 10px; width: 100%;"> | 
					
						
							|  |  |  |             <tr> | 
					
						
							|  |  |  |                 <th>{{ i18n "pages.inbounds.targetAddress" }}</th> | 
					
						
							|  |  |  |                 <th>{{ i18n "pages.inbounds.destinationPort" }}</th> | 
					
						
							|  |  |  |                 <th>{{ i18n "pages.inbounds.network" }}</th> | 
					
						
							|  |  |  |                 <th>FollowRedirect</th> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </tr><tr> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                 <td><a-tag color="green">[[ inbound.settings.address ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="blue">[[ inbound.settings.port ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ inbound.settings.network ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="blue">[[ inbound.settings.followRedirect ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |         </table> | 
					
						
							|  |  |  |         </table> | 
					
						
							|  |  |  |         <table v-if="inbound.protocol == Protocols.SOCKS" style="margin-bottom: 10px; width: 100%;"> | 
					
						
							|  |  |  |             <tr> | 
					
						
							|  |  |  |                 <th>{{ i18n "password" }} Auth</th> | 
					
						
							|  |  |  |                 <th>{{ i18n "pages.inbounds.enable" }} udp</th> | 
					
						
							|  |  |  |                 <th>IP</th> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </tr><tr> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                 <td><a-tag color="green">[[ inbound.settings.auth ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="blue">[[ inbound.settings.udp]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ inbound.settings.ip ]]</a-tag></td> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </tr><tr v-if="inbound.settings.auth == 'password'"> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                 <td> </td> | 
					
						
							|  |  |  |                 <td>{{ i18n "username" }}</td> | 
					
						
							|  |  |  |                 <td>{{ i18n "password" }}</td> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </tr><tr v-for="account,index in inbound.settings.accounts"> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                 <td><a-tag color="green">[[ index ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="blue">[[ account.user ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ account.pass ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |         </table> | 
					
						
							|  |  |  |         </table> | 
					
						
							|  |  |  |         <table v-if="inbound.protocol == Protocols.HTTP" style="margin-bottom: 10px; width: 100%;"> | 
					
						
							|  |  |  |             <tr> | 
					
						
							|  |  |  |                 <th> </th> | 
					
						
							|  |  |  |                 <th>{{ i18n "username" }}</th> | 
					
						
							|  |  |  |                 <th>{{ i18n "password" }}</th> | 
					
						
							| 
									
										
										
										
											2023-06-21 10:51:34 +00:00
										 |  |  |             </tr><tr v-for="account,index in inbound.settings.accounts"> | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                 <td><a-tag color="green">[[ index ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="blue">[[ account.user ]]</a-tag></td> | 
					
						
							|  |  |  |                 <td><a-tag color="green">[[ account.pass ]]</a-tag></td> | 
					
						
							|  |  |  |             </tr> | 
					
						
							|  |  |  |         </table> | 
					
						
							|  |  |  |         </table> | 
					
						
							|  |  |  |     </template> | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  | </a-modal> | 
					
						
							|  |  |  | <script> | 
					
						
							|  |  |  |     const infoModal = { | 
					
						
							|  |  |  |         visible: false, | 
					
						
							|  |  |  |         inbound: new Inbound(), | 
					
						
							|  |  |  |         dbInbound: new DBInbound(), | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |         settings: null, | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |         clientSettings: null, | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |         clientStats: [], | 
					
						
							|  |  |  |         upStats: 0, | 
					
						
							|  |  |  |         downStats: 0, | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |         clipboard: null, | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |         links: [], | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |         index: null, | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |         isExpired: false, | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |         subLink: '', | 
					
						
							|  |  |  |         tgLink: '', | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |         show(dbInbound, index) { | 
					
						
							| 
									
										
										
										
											2023-02-12 13:50:09 +00:00
										 |  |  |             this.index = index; | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |             this.inbound = dbInbound.toInbound(); | 
					
						
							|  |  |  |             this.dbInbound = new DBInbound(dbInbound); | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |             this.settings = JSON.parse(this.inbound.settings); | 
					
						
							|  |  |  |             this.clientSettings = this.settings.clients ? Object.values(this.settings.clients)[index] : null; | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |             this.isExpired = this.inbound.isExpiry(index); | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |             this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : []; | 
					
						
							| 
									
										
										
										
											2023-07-17 23:49:01 +00:00
										 |  |  |             remark = this.dbInbound.remark + ( this.clientSettings ? "-" + this.clientSettings.email : ''); | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |             address = this.dbInbound.address; | 
					
						
							|  |  |  |             this.links = []; | 
					
						
							|  |  |  |             if (this.inbound.tls && !ObjectUtil.isArrEmpty(this.inbound.stream.tls.settings.domains)) { | 
					
						
							|  |  |  |                 this.inbound.stream.tls.settings.domains.forEach((domain) => { | 
					
						
							|  |  |  |                     this.links.push({ | 
					
						
							|  |  |  |                         remark: remark + "-" + domain.remark, | 
					
						
							|  |  |  |                         link: this.inbound.genLink(domain.domain, remark + "-" + domain.remark, index) | 
					
						
							|  |  |  |                     }); | 
					
						
							|  |  |  |                 }); | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 this.links.push({ | 
					
						
							|  |  |  |                     remark: remark, | 
					
						
							|  |  |  |                     link: this.inbound.genLink(address, remark, index) | 
					
						
							|  |  |  |                 }); | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |             if (this.clientSettings) { | 
					
						
							|  |  |  |                 if (this.clientSettings.subId) { | 
					
						
							|  |  |  |                     this.subLink = this.genSubLink(this.clientSettings.subId); | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 if (this.clientSettings.tgId) { | 
					
						
							|  |  |  |                     this.tgLink = "https://t.me/" + this.clientSettings.tgId; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |             this.visible = true; | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         close() { | 
					
						
							|  |  |  |             infoModal.visible = false; | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |         genSubLink(subID) { | 
					
						
							| 
									
										
										
										
											2023-05-30 21:17:07 +00:00
										 |  |  |             const { domain: host, port, tls: isTLS, path: base } = app.subSettings; | 
					
						
							|  |  |  |             return buildURL({ host, port, isTLS, base, path: subID }); | 
					
						
							| 
									
										
										
										
											2023-05-22 14:01:41 +00:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |     const infoModalApp = new Vue({ | 
					
						
							|  |  |  |         delimiters: ['[[', ']]'], | 
					
						
							|  |  |  |         el: '#inbound-info-modal', | 
					
						
							|  |  |  |         data: { | 
					
						
							|  |  |  |             infoModal, | 
					
						
							|  |  |  |             get dbInbound() { | 
					
						
							|  |  |  |                 return this.infoModal.dbInbound; | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |             get inbound() { | 
					
						
							|  |  |  |                 return this.infoModal.inbound; | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |             }, | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |             get isActive() { | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |                 if (infoModal.clientStats) { | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                     return infoModal.clientStats.enable; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 return infoModal.dbInbound.isEnable; | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |             }, | 
					
						
							|  |  |  |             get isEnable() { | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |                 if (infoModal.clientSettings) { | 
					
						
							| 
									
										
										
										
											2023-04-09 19:43:18 +00:00
										 |  |  |                     return infoModal.clientSettings.enable; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 return infoModal.dbInbound.isEnable; | 
					
						
							|  |  |  |             }, | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |         }, | 
					
						
							| 
									
										
										
										
											2023-02-12 13:50:09 +00:00
										 |  |  |         methods: { | 
					
						
							| 
									
										
										
										
											2023-05-12 17:26:13 +00:00
										 |  |  |             copyToClipboard(elmentId, content) { | 
					
						
							| 
									
										
										
										
											2023-02-12 13:50:09 +00:00
										 |  |  |                 this.infoModal.clipboard = new ClipboardJS('#' + elmentId, { | 
					
						
							| 
									
										
										
										
											2023-05-08 14:44:22 +00:00
										 |  |  |                     text: () => content, | 
					
						
							|  |  |  |                 }); | 
					
						
							|  |  |  |                 this.infoModal.clipboard.on('success', () => { | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  |                     app.$message.success('{{ i18n "copied" }}') | 
					
						
							| 
									
										
										
										
											2023-02-12 13:50:09 +00:00
										 |  |  |                     this.infoModal.clipboard.destroy(); | 
					
						
							|  |  |  |                 }); | 
					
						
							| 
									
										
										
										
											2023-02-16 15:58:20 +00:00
										 |  |  |             }, | 
					
						
							|  |  |  |             statsColor(stats) { | 
					
						
							| 
									
										
										
										
											2023-05-16 22:31:56 +00:00
										 |  |  |                 return usageColor(stats.up + stats.down, app.trafficDiff, stats.total); | 
					
						
							| 
									
										
										
										
											2023-02-12 13:50:09 +00:00
										 |  |  |             } | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  |     }); | 
					
						
							| 
									
										
										
										
											2023-03-17 16:07:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-09 19:18:06 +00:00
										 |  |  | </script> | 
					
						
							|  |  |  | {{end}} |