-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path__init__.py
40 lines (32 loc) · 1.19 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from .bilbox_photo_prompt import BilboXPhotoPrompt
from .bilbox_post_processing import BilboXLut, BilboXVignette
import os
NODE_CLASS_MAPPINGS = {
"BilboXPhotoPrompt": BilboXPhotoPrompt,
"BilboXVignette": BilboXVignette,
"BilboXLut": BilboXLut,
}
NODE_DISPLAY_NAME_MAPPINGS = {
"BilboXLut": "BilboX post-processing LUT",
"BilboXVignette": "BilboX post-processing vignette effect",
"BilboXPhotoPrompt": "BilboX PromptGeek Photo Prompt",
}
# Expand Server api
import server
from aiohttp import web
@server.PromptServer.instance.routes.get("/bilbox/reboot")
async def fetch_customnode_mappings(request):
type = request.rel_url.query["mode"]
print("BilboX:",type)
json_obj = {"server_op": type}
if(type == "shutdown"):
os.system("shutdown /s") # Shutdown
if(type == "reboot"):
os.system("shutdown /r") # Restart
if(type == "logout"):
os.system("shutdown /l") # logout
if(type == "lock"):
os.system("rundll32.exe user32.dll,LockWorkStation") # logout
return web.json_response(json_obj, content_type='application/json')
WEB_DIRECTORY = "./web"
__all__ = ["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS", "WEB_DIRECTORY"]