mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-25 07:42:42 +00:00
Compare commits
2 commits
ef625c75d8
...
c93467b852
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c93467b852 | ||
|
|
c988d55256 |
2 changed files with 17 additions and 4 deletions
|
|
@ -104,6 +104,10 @@ func (a *InboundController) addInbound(c *gin.Context) {
|
||||||
|
|
||||||
needRestart := false
|
needRestart := false
|
||||||
inbound, needRestart, err = a.inboundService.AddInbound(inbound)
|
inbound, needRestart, err = a.inboundService.AddInbound(inbound)
|
||||||
|
if err != nil {
|
||||||
|
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
|
||||||
|
return
|
||||||
|
}
|
||||||
jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundCreateSuccess"), inbound, err)
|
jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundCreateSuccess"), inbound, err)
|
||||||
if err == nil && needRestart {
|
if err == nil && needRestart {
|
||||||
a.xrayService.SetToNeedRestart()
|
a.xrayService.SetToNeedRestart()
|
||||||
|
|
@ -118,6 +122,10 @@ func (a *InboundController) delInbound(c *gin.Context) {
|
||||||
}
|
}
|
||||||
needRestart := true
|
needRestart := true
|
||||||
needRestart, err = a.inboundService.DelInbound(id)
|
needRestart, err = a.inboundService.DelInbound(id)
|
||||||
|
if err != nil {
|
||||||
|
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
|
||||||
|
return
|
||||||
|
}
|
||||||
jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundDeleteSuccess"), id, err)
|
jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundDeleteSuccess"), id, err)
|
||||||
if err == nil && needRestart {
|
if err == nil && needRestart {
|
||||||
a.xrayService.SetToNeedRestart()
|
a.xrayService.SetToNeedRestart()
|
||||||
|
|
@ -140,6 +148,10 @@ func (a *InboundController) updateInbound(c *gin.Context) {
|
||||||
}
|
}
|
||||||
needRestart := true
|
needRestart := true
|
||||||
inbound, needRestart, err = a.inboundService.UpdateInbound(inbound)
|
inbound, needRestart, err = a.inboundService.UpdateInbound(inbound)
|
||||||
|
if err != nil {
|
||||||
|
jsonMsg(c, I18nWeb(c, "somethingWentWrong"), err)
|
||||||
|
return
|
||||||
|
}
|
||||||
jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundUpdateSuccess"), inbound, err)
|
jsonMsgObj(c, I18nWeb(c, "pages.inbounds.toasts.inboundUpdateSuccess"), inbound, err)
|
||||||
if err == nil && needRestart {
|
if err == nil && needRestart {
|
||||||
a.xrayService.SetToNeedRestart()
|
a.xrayService.SetToNeedRestart()
|
||||||
|
|
|
||||||
9
x-ui.sh
9
x-ui.sh
|
|
@ -69,7 +69,7 @@ confirm_restart() {
|
||||||
}
|
}
|
||||||
|
|
||||||
before_show_menu() {
|
before_show_menu() {
|
||||||
echo && echo -n -e "${yellow}Press enter to return to the main menu: ${plain}" && read temp
|
echo && echo -n -e "${yellow}Press enter to return to the main menu: ${plain}" && read -r temp
|
||||||
show_menu
|
show_menu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -125,8 +125,8 @@ update_menu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
legacy_version() {
|
legacy_version() {
|
||||||
echo "Enter the panel version (like 2.4.0):"
|
echo -n "Enter the panel version (like 2.4.0):"
|
||||||
read tag_version
|
read -r tag_version
|
||||||
|
|
||||||
if [ -z "$tag_version" ]; then
|
if [ -z "$tag_version" ]; then
|
||||||
echo "Panel version cannot be empty. Exiting."
|
echo "Panel version cannot be empty. Exiting."
|
||||||
|
|
@ -256,7 +256,8 @@ check_config() {
|
||||||
}
|
}
|
||||||
|
|
||||||
set_port() {
|
set_port() {
|
||||||
echo && echo -n -e "Enter port number[1-65535]: " && read port
|
echo -n "Enter port number[1-65535]: "
|
||||||
|
read -r port
|
||||||
if [[ -z "${port}" ]]; then
|
if [[ -z "${port}" ]]; then
|
||||||
LOGD "Cancelled"
|
LOGD "Cancelled"
|
||||||
before_show_menu
|
before_show_menu
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue