resource pool system
This commit is contained in:
parent
dc989dd7cb
commit
16f7e2199d
19 changed files with 382 additions and 105 deletions
|
@ -14,6 +14,7 @@ class Group(AbstractConfiguration):
|
|||
eotks = db.relationship("Eotk", back_populates="group")
|
||||
onions = db.relationship("Onion", back_populates="group")
|
||||
smart_proxies = db.relationship("SmartProxy", back_populates="group")
|
||||
pools = db.relationship("Pool", secondary="pool_group", back_populates="groups")
|
||||
|
||||
@classmethod
|
||||
def csv_header(cls) -> List[str]:
|
||||
|
@ -22,7 +23,27 @@ class Group(AbstractConfiguration):
|
|||
]
|
||||
|
||||
|
||||
class Pool(AbstractConfiguration):
|
||||
pool_name = db.Column(db.String(80), unique=True, nullable=False)
|
||||
|
||||
@classmethod
|
||||
def csv_header(cls) -> List[str]:
|
||||
return super().csv_header() + [
|
||||
"pool_name"
|
||||
]
|
||||
|
||||
proxies = db.relationship("Proxy", back_populates="pool")
|
||||
lists = db.relationship("MirrorList", back_populates="pool")
|
||||
groups = db.relationship("Group", secondary="pool_group", back_populates="pools")
|
||||
|
||||
|
||||
class PoolGroup(db.Model): # type: ignore[misc]
|
||||
pool_id = db.Column(db.Integer, db.ForeignKey("pool.id"), primary_key=True)
|
||||
group_id = db.Column(db.Integer, db.ForeignKey("group.id"), primary_key=True)
|
||||
|
||||
|
||||
class MirrorList(AbstractConfiguration):
|
||||
pool_id = db.Column(db.Integer, db.ForeignKey("pool.id"))
|
||||
provider = db.Column(db.String(255), nullable=False)
|
||||
format = db.Column(db.String(20), nullable=False)
|
||||
encoding = db.Column(db.String(20), nullable=False)
|
||||
|
@ -31,6 +52,8 @@ class MirrorList(AbstractConfiguration):
|
|||
role = db.Column(db.String(255), nullable=True)
|
||||
filename = db.Column(db.String(255), nullable=False)
|
||||
|
||||
pool = db.relationship("Pool", back_populates="lists")
|
||||
|
||||
providers_supported = {
|
||||
"github": "GitHub",
|
||||
"gitlab": "GitLab",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue