-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
607 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
from .hetzner import HetznerManager | ||
from config import EnvFile | ||
|
||
HetznerAPI = HetznerManager(key=EnvFile.HETZNER_API_KEY) | ||
|
||
__all__ = ["HetznerAPI"] | ||
__all__ = ["HetznerManager"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
from .action import Actions | ||
from .callback import ( | ||
ServerAction, | ||
ServerList, | ||
ServerTypeSelect, | ||
LocationTypeSelect, | ||
ImageTypeSelect, | ||
) | ||
from .enums import Actions, Pages, ServerCreate, ServerUpdate | ||
from .callback import PageCB, SelectCB | ||
from .keyboard import KeyboardsCreater | ||
|
||
Keyboards = KeyboardsCreater() | ||
|
||
__all__ = [ | ||
"Actions", | ||
"ServerAction", | ||
"ServerList", | ||
"PageCB", | ||
"SelectCB", | ||
"Pages", | ||
"Keyboards", | ||
"ServerTypeSelect", | ||
"LocationTypeSelect", | ||
"ImageTypeSelect", | ||
"ServerCreate", | ||
"ServerUpdate", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
from aiogram.filters.callback_data import CallbackData | ||
from .enums import Pages, Actions, ServerCreate, ServerUpdate | ||
|
||
|
||
class ServerAction(CallbackData, prefix="server_action"): | ||
action: str | ||
server_id: int | ||
class PageCB(CallbackData, prefix="pages"): | ||
key: str = "KEY" | ||
page: Pages | None = None | ||
action: Actions | ServerUpdate | None = None | ||
server_id: int | None = None | ||
image_id: int | None = None | ||
confirm: bool = False | ||
image_id: int = 0 | ||
|
||
|
||
class ServerList(CallbackData, prefix="server_list"): | ||
action: str | ||
|
||
|
||
class ServerTypeSelect(CallbackData, prefix="server_type"): | ||
server: int = 0 | ||
is_select: bool = False | ||
|
||
|
||
class LocationTypeSelect(CallbackData, prefix="location_type"): | ||
location: int = 0 | ||
is_select: bool = False | ||
|
||
|
||
class ImageTypeSelect(CallbackData, prefix="image_type"): | ||
image: int = 0 | ||
is_select: bool = False | ||
class SelectCB(CallbackData, prefix="select"): | ||
key: str = "KEY" | ||
page: Pages | None = None | ||
action: Actions | None = None | ||
datatype: ServerCreate | None = None | ||
datavalue: str | int | None = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .callbacks import Pages, Actions | ||
from .servers import ServerCreate, ServerUpdate | ||
|
||
__all__ = ["Pages", "Actions", "ServerCreate", "ServerUpdate"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from enum import Enum | ||
|
||
|
||
class Actions(str, Enum): | ||
HOME = "home" | ||
LIST = "list" | ||
INFO = "info" | ||
CREATE = "create" | ||
UPDATE = "update" | ||
DELETE = "delete" | ||
|
||
|
||
class Pages(str, Enum): | ||
HOME = "home" | ||
MENU = "menu" | ||
SERVER = "server" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
from enum import Enum | ||
|
||
|
||
class Actions(str, Enum): | ||
class ServerCreate(str, Enum): | ||
LOCATION = "location" | ||
SERVER = "server" | ||
IMAGE = "image" | ||
|
||
|
||
class ServerUpdate(str, Enum): | ||
POWER_ON = "power_on" | ||
POWER_OFF = "power_off" | ||
REBOOT = "reboot" | ||
RESET_PASSWORD = "reset_password" | ||
DELETE = "delete" | ||
HOME = "home" | ||
INFO = "info" | ||
REBUILD = "rebuild" | ||
UPDATE = "update" | ||
RESET = "reset" | ||
UPDATE = "update" |
Oops, something went wrong.