Giter Site home page Giter Site logo

Comments (4)

alireza0 avatar alireza0 commented on July 27, 2024 1

The avoidance pattern is now added and will be available in next version.
For now, you need to change id manually by:

  1. Copy inbound, change id manually (searching by email) to a non zero length string, delete inbound, import changed inbound
  2. change inside database

Then you can modify it by panel.

from x-ui.

alireza0 avatar alireza0 commented on July 27, 2024

In manual/auto disabling process, there is no code which could delete ID or/and SubID.
ID in vless and vmess protocol is a mandatory key value. If it is empty, then it is not possible to use functions like edit and delete.

If you are using 3rd party apps working with x-ui API, ask the developer to fix the problem.

from x-ui.

MJamshidnejad avatar MJamshidnejad commented on July 27, 2024

In manual/auto disabling process, there is no code which could delete ID or/and SubID. ID in vless and vmess protocol is a mandatory key value. If it is empty, then it is not possible to use functions like edit and delete.

If you are using 3rd party apps working with x-ui API, ask the developer to fix the problem.

I don't know the reason but it happened. Please look at this picture:

Screenshot 2024-03-10 185957

I can't change anything in this page. If I do, I get that error. I can't even change the Email!
I don't use any 3rd party apps. I could provide you any information that may help you to find the reason.

from x-ui.

MJamshidnejad avatar MJamshidnejad commented on July 27, 2024

This code worked for me. I hope be useful for a person.

import uuid, json, sqlite3

inbound_id = 2
user_email = "<put_the_problematic_email>"

conn = sqlite3.connect("x-ui.db")
cursor = conn.cursor()
cursor.execute(f"select settings from inbounds where id == {inbound_id}")
tmp = cursor.fetchone()[0]
tmp_json = json.loads(tmp)

idx = -1
for i,c in enumerate(tmp_json['clients']):
	if c["email"] == user_email :
	    idx = i
	    break

tmp_json['clients'][idx]['enable'] =  True
tmp_json['clients'][idx]['id'] =  str(uuid.uuid4())
tmp_json['clients'][idx]['subId'] = "abcd123"

sql = "UPDATE inbounds SET settings = ? WHERE id = ?"
cursor.execute(sql, (json.dumps(tmp_json, indent=2), inbound_id))
conn.commit()

from x-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.