Linux sagir-us1.hostever.us 5.14.0-570.51.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 8 09:41:34 EDT 2025 x86_64
LiteSpeed
Server IP : 104.247.108.91 & Your IP : 216.73.216.105
Domains : 74 Domain
User : georgeto
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
local /
softaculous /
enduser /
themes /
default /
Delete
Unzip
Name
Size
Permission
Date
Action
admin
[ DIR ]
drwxr-xr-x
2026-01-17 06:43
bootstrap
[ DIR ]
drwxr-xr-x
2025-02-25 07:30
cache
[ DIR ]
drwxr-xr-x
2026-04-27 05:47
css
[ DIR ]
drwxr-xr-x
2025-02-25 07:30
fonts
[ DIR ]
drwxr-xr-x
2025-02-25 07:30
images
[ DIR ]
drwxr-xr-x
2025-07-09 05:43
js
[ DIR ]
drwxr-xr-x
2025-02-25 07:30
addbackuploc_theme.php
19.95
KB
-rwxr-xr-x
2026-04-22 09:09
aefer_adddomain_theme.php
10.33
KB
-rwxr-xr-x
2026-04-22 09:09
aefer_domains_theme.php
2.85
KB
-rwxr-xr-x
2026-04-22 09:09
aefer_editdomain_theme.php
10.5
KB
-rwxr-xr-x
2026-04-22 09:09
ai_theme.php
33.57
KB
-rw-r--r--
2026-04-22 09:09
all_scripts_theme.php
8.47
KB
-rwxr-xr-x
2026-04-22 09:09
backup_theme.php
23.16
KB
-rwxr-xr-x
2026-04-22 09:09
backups_theme.php
10.92
KB
-rwxr-xr-x
2026-04-22 09:09
browse_themes_theme.php
20.59
KB
-rwxr-xr-x
2026-04-22 09:09
classes_theme.php
38.92
KB
-rwxr-xr-x
2026-04-22 09:09
create_template_theme.php
21.12
KB
-rwxr-xr-x
2026-04-22 09:09
dark.css
13.41
KB
-rwxr-xr-x
2026-04-22 09:09
demos_theme.php
4.17
KB
-rwxr-xr-x
2026-04-22 09:09
editbackuploc_theme.php
20.09
KB
-rwxr-xr-x
2026-04-22 09:09
editdetail_theme.php
39.69
KB
-rwxr-xr-x
2026-04-22 09:09
email_theme.php
9.01
KB
-rwxr-xr-x
2026-04-22 09:09
eu_tasklist_theme.php
9.88
KB
-rwxr-xr-x
2026-04-22 09:09
font-awesome.css
7.17
KB
-rwxr-xr-x
2026-04-22 09:09
help_theme.php
1.73
KB
-rwxr-xr-x
2026-04-22 09:09
hf_theme.php
84.58
KB
-rwxr-xr-x
2026-04-22 09:09
ie7.css
8.61
KB
-rwxr-xr-x
2026-04-22 09:09
import_theme.php
44.24
KB
-rwxr-xr-x
2026-04-22 09:09
index.html
94
B
-rwxr-xr-x
2026-04-22 09:09
installations_theme.php
20.39
KB
-rwxr-xr-x
2026-04-22 09:09
java_theme.php
65.89
KB
-rwxr-xr-x
2026-04-22 09:09
js_theme.php
58.4
KB
-rwxr-xr-x
2026-04-22 09:09
listsoftwares_theme.php
6.63
KB
-rwxr-xr-x
2026-04-22 09:09
manage_sets_theme.php
30.69
KB
-rwxr-xr-x
2026-04-22 09:09
motiongallery.css
798
B
-rwxr-xr-x
2026-04-22 09:09
my_themes_theme.php
17.61
KB
-rwxr-xr-x
2026-04-22 09:09
perl_theme.php
67.88
KB
-rwxr-xr-x
2026-04-22 09:09
perl_upgrade_theme.php
16.24
KB
-rwxr-xr-x
2026-04-22 09:09
plans_theme.php
23.71
KB
-rwxr-xr-x
2026-04-22 09:09
pushtolive_theme.php
31.31
KB
-rwxr-xr-x
2026-04-22 09:09
python_theme.php
66.14
KB
-rwxr-xr-x
2026-04-22 09:09
ratings_theme.php
2.81
KB
-rwxr-xr-x
2026-04-22 09:09
remove_theme.php
15.17
KB
-rwxr-xr-x
2026-04-22 09:09
restore_template_theme.php
36.81
KB
-rwxr-xr-x
2026-04-22 09:09
restore_theme.php
16.76
KB
-rwxr-xr-x
2026-04-22 09:09
sclone_theme.php
40.69
KB
-rwxr-xr-x
2026-04-22 09:09
settings_theme.php
15.38
KB
-rwxr-xr-x
2026-04-22 09:09
sign_on_theme.php
1.89
KB
-rwxr-xr-x
2026-04-22 09:09
signin_theme.php
3.69
KB
-rwxr-xr-x
2026-04-22 09:09
sitepad_overview_theme.php
37.13
KB
-rwxr-xr-x
2026-04-22 09:09
sitepad_theme.php
1.27
KB
-rwxr-xr-x
2026-04-22 09:09
software_theme.php
91.53
KB
-rwxr-xr-x
2026-04-22 09:09
spectrum.css
14.07
KB
-rwxr-xr-x
2026-04-22 09:09
staging_theme.php
37.08
KB
-rwxr-xr-x
2026-04-22 09:09
style.css
74.84
KB
-rwxr-xr-x
2026-04-22 09:09
sync_theme.php
10.38
KB
-rwxr-xr-x
2026-04-22 09:09
templates_theme.php
11.04
KB
-rwxr-xr-x
2026-04-22 09:09
theme_settings.php
1.54
KB
-rwxr-xr-x
2026-04-22 09:09
top14_theme.php
27.04
KB
-rwxr-xr-x
2026-04-22 09:09
upgrade_theme.php
24.65
KB
-rwxr-xr-x
2026-04-22 09:09
userindex_theme.php
43.55
KB
-rwxr-xr-x
2026-04-22 09:09
wordpress_theme.php
126.84
KB
-rwxr-xr-x
2026-04-22 09:09
Save
Rename
<?php if(!defined('SOFTACULOUS')){ die('Hacking Attempt'); } function ai_theme(){ global $user, $globals, $l, $theme, $softpanel, $error, $insid, $software, $soft; $insid = GET('insid', ''); $custom_path = GET('path', ''); if(!empty($insid)){ $data = $user['ins'][$insid]; $softpath = !empty($data['softpath']) ? $data['softpath'] : ''; $softurl = !empty($data['softurl']) ? $data['softurl'] : ''; $sw_name = !empty($software['name']) ? $software['name'] : 'Software'; $back_url = $globals['ind'].'act=editdetail&insid='.$insid; }elseif(!empty($custom_path)){ $softpath = $custom_path; $softurl = ''; $sw_name = basename($custom_path); $back_url = $globals['ind'].'act=ai'; }else{ $softpath = ''; $sw_name = 'Software'; $back_url = ''; } $username = !empty($user['username']) ? $user['username'] : ''; $csrf = ''; if(function_exists('csrf_display')){ ob_start(); csrf_display(); $csrf_html = ob_get_clean(); if(preg_match('/value="([^"]+)"/', $csrf_html, $m)){ $csrf = $m[1]; } } $api_base = $globals['index'].'act=ai'; if(!empty($insid)) $api_base .= '&insid='.$insid; if(!empty($custom_path)) $api_base .= '&path='.urlencode($custom_path); softheader(__('$0 - Code with AI', array($sw_name))); ai_render_ui($api_base, $csrf, $softpath, $sw_name, $username, $back_url, $insid); softfooter(); } function ai_render_ui($api_base, $csrf, $softpath, $sw_name, $username, $back_url, $insid){ ?> <style> html,body{margin:0!important;padding:0!important;overflow:hidden!important;height:100%!important;width:100%!important} #header,#breadcrumb,.sai-heading,.sai-footer,.sai-pannel,.sai-sidebar,#leftdiv,.navbar,.panel-heading,.sai-menu,.sai-menu2{display:none!important} .sai-main,.sai-content,.container-fluid{margin:0!important;padding:0!important;width:100%!important;max-width:100%!important;float:none!important} body{background:#0a0a0a!important} </style> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" id="hljs-theme"> <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/12.0.2/marked.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.1.6/purify.min.js"></script> <style> :root{--bg0:#0a0a0a;--bg1:#141414;--bg2:#1e1e1e;--bg3:#282828;--bd:#262626;--bd2:#333;--t1:#e5e5e5;--t2:#a3a3a3;--t3:#737373;--ac:#2563eb;--ac2:#3b82f6;--ok:#22c55e;--err:#ef4444;--warn:#eab308;--sb:280px;--hh:44px;--mono:'SF Mono','JetBrains Mono','Fira Code',monospace;--sans:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',sans-serif} [data-theme="light"]{--bg0:#fafafa;--bg1:#f5f5f5;--bg2:#e5e5e5;--bg3:#d4d4d4;--bd:#e5e5e5;--bd2:#d4d4d4;--t1:#171717;--t2:#737373;--t3:#a3a3a3;--ac:#2563eb;--ac2:#3b82f6;--ok:#16a34a;--err:#dc2626;--warn:#ca8a04} *{box-sizing:border-box;margin:0;padding:0} #oc-app{position:fixed;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;font-family:var(--sans);font-size:13px;background:var(--bg0);color:var(--t1);z-index:999999;overflow:hidden;visibility:visible!important;opacity:1!important} ::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--bd2);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--t3)} .oc-hdr{display:flex;align-items:center;height:var(--hh);padding:0 12px;background:var(--bg1);border-bottom:1px solid var(--bd);flex-shrink:0;gap:6px} .oc-hdr-left{display:flex;align-items:center;gap:6px} .oc-hdr-center{flex:1;display:flex;justify-content:center;align-items:center;gap:6px} .oc-hdr-right{display:flex;align-items:center;gap:6px} .oc-btn{padding:4px 10px;border:1px solid var(--bd);border-radius:6px;background:transparent;color:var(--t2);cursor:pointer;font-size:12px;font-family:var(--sans);display:inline-flex;align-items:center;gap:4px;white-space:nowrap;transition:all .15s} .oc-btn:hover{background:var(--bg2);color:var(--t1)} .oc-btn.active{background:var(--ac);color:#fff;border-color:var(--ac)} .oc-btn-sm{padding:3px 8px;font-size:11px;border-radius:4px} .oc-icon-btn{width:30px;height:30px;border:none;border-radius:6px;background:transparent;color:var(--t2);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px} .oc-icon-btn:hover{background:var(--bg2);color:var(--t1)} .oc-sel{padding:4px 24px 4px 8px;border:1px solid var(--bd);border-radius:6px;background:var(--bg1);color:var(--t2);font-size:12px;font-family:var(--sans);cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 6px center} .oc-sel:hover{border-color:var(--bd2);color:var(--t1)} .oc-sel option{background:var(--bg1);color:var(--t1)} .oc-body{display:flex;flex:1;overflow:hidden} .oc-sb{width:var(--sb);background:var(--bg1);border-right:1px solid var(--bd);display:flex;flex-direction:column;flex-shrink:0;transition:width .2s,opacity .2s;overflow:hidden} .oc-sb.collapsed{width:0;border:none} .oc-sb-hdr{padding:10px 12px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--t3);border-bottom:1px solid var(--bd);display:flex;justify-content:space-between;align-items:center} .oc-sb-list{flex:1;overflow-y:auto;padding:4px 0} .oc-sb-item{display:flex;align-items:center;padding:7px 12px;cursor:pointer;color:var(--t2);gap:8px;transition:background .1s} .oc-sb-item:hover{background:var(--bg2);color:var(--t1)} .oc-sb-item.active{background:var(--bg2);color:var(--t1)} .oc-sb-item.active::before{content:'';position:absolute;left:0;top:0;bottom:0;width:2px;background:var(--ac)} .oc-sb-item{position:relative} .oc-sb-item-icon{width:16px;text-align:center;flex-shrink:0;font-size:14px} .oc-sb-item-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px} .oc-sb-item-time{font-size:10px;color:var(--t3);flex-shrink:0} .oc-sb-item-msgs{font-size:10px;color:var(--t3);background:var(--bg2);padding:1px 6px;border-radius:8px;flex-shrink:0} .oc-sb-item-del{opacity:0;border:none;background:none;color:var(--t3);cursor:pointer;font-size:14px;padding:2px;flex-shrink:0} .oc-sb-item:hover .oc-sb-item-del{opacity:1} .oc-sb-item-del:hover{color:var(--err)} .oc-sb-section{padding:6px 12px;font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--t3);margin-top:8px} .oc-main{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0} .oc-chat{flex:1;overflow-y:auto;padding:20px 0} .oc-chat-inner{max-width:800px;margin:0 auto;padding:0 24px} .oc-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--t3);gap:16px;padding:40px} .oc-empty-icon{font-size:48px;opacity:.4} .oc-empty-title{font-size:18px;color:var(--t2)} .oc-empty-hint{font-size:13px;color:var(--t3);text-align:center;line-height:1.6} .oc-msg{padding:16px 0;display:flex;gap:12px} .oc-msg.user{flex-direction:row-reverse} .oc-msg-avatar{width:28px;height:28px;border-radius:50%;background:var(--bg2);display:flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0;color:var(--t2);font-weight:600} .oc-msg.user .oc-msg-avatar{background:var(--ac);color:#fff} .oc-msg-body{max-width:85%;min-width:0} .oc-msg-bubble{padding:10px 14px;border-radius:12px;line-height:1.6;font-size:13.5px} .oc-msg.user .oc-msg-bubble{background:var(--ac);color:#fff;border-bottom-right-radius:4px} .oc-msg.assistant .oc-msg-bubble{background:transparent;padding:10px 0} .oc-msg.user .oc-msg-text{color:#fff} .oc-md{line-height:1.7} .oc-md p{margin:6px 0}.oc-md p:first-child{margin-top:0}.oc-md p:last-child{margin-bottom:0} .oc-md h1,.oc-md h2,.oc-md h3{margin:14px 0 6px;color:var(--t1)} .oc-md h1{font-size:17px}.oc-md h2{font-size:15px}.oc-md h3{font-size:14px} .oc-md ul,.oc-md ol{margin:6px 0;padding-left:20px}.oc-md li{margin:2px 0} .oc-md strong{color:var(--t1);font-weight:600} .oc-md a{color:var(--ac2);text-decoration:none}.oc-md a:hover{text-decoration:underline} .oc-md code{background:var(--bg2);border:1px solid var(--bd);border-radius:4px;padding:1px 5px;font-family:var(--mono);font-size:12px;color:var(--ac2)} .oc-md pre{margin:10px 0;border-radius:8px;overflow:hidden;border:1px solid var(--bd)} .oc-md pre code{display:block;padding:14px;background:var(--bg1);border:none;font-size:12.5px;line-height:1.55;overflow-x:auto;color:var(--t1)} .oc-md blockquote{border-left:3px solid var(--bd2);padding-left:12px;color:var(--t2);margin:8px 0} .oc-md table{border-collapse:collapse;margin:8px 0;width:100%}.oc-md th,.oc-md td{border:1px solid var(--bd);padding:6px 10px;text-align:left;font-size:12.5px}.oc-md th{background:var(--bg2);font-weight:600} .oc-md hr{border:none;border-top:1px solid var(--bd);margin:12px 0} .oc-code-hdr{display:flex;justify-content:space-between;align-items:center;padding:6px 12px;background:var(--bg2);font-size:11px;color:var(--t3);border-bottom:1px solid var(--bd)} .oc-code-copy{cursor:pointer;color:var(--t3);font-size:11px;padding:2px 6px;border-radius:3px;background:none;border:none;font-family:var(--sans)} .oc-code-copy:hover{color:var(--t1);background:var(--bg3)} .oc-tool{margin:8px 0;border:1px solid var(--bd);border-radius:8px;background:var(--bg1);overflow:hidden;font-size:13px} .oc-tool-hdr{display:flex;align-items:center;padding:8px 12px;cursor:pointer;gap:8px}.oc-tool-hdr:hover{background:var(--bg2)} .oc-tool-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0}.oc-tool-dot.running{background:var(--warn);animation:ocpulse 1s infinite}.oc-tool-dot.done{background:var(--ok)}.oc-tool-dot.err{background:var(--err)} @keyframes ocpulse{0%,100%{opacity:1}50%{opacity:.3}} .oc-tool-name{font-weight:600;color:var(--ac2);font-family:var(--mono);font-size:12px} .oc-tool-detail{color:var(--t3);font-size:11px;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .oc-tool-body{padding:8px 12px;border-top:1px solid var(--bd);max-height:250px;overflow-y:auto;font-family:var(--mono);font-size:12px;white-space:pre-wrap;word-break:break-all;color:var(--t2);display:none} .oc-tool.open .oc-tool-body{display:block} .oc-input-area{border-top:1px solid var(--bd);padding:12px 24px;background:var(--bg0);flex-shrink:0} .oc-input-wrap{max-width:800px;margin:0 auto;display:flex;gap:8px;align-items:flex-end} .oc-input{flex:1;resize:none;border:1px solid var(--bd);border-radius:10px;padding:10px 14px;background:var(--bg1);color:var(--t1);font-family:var(--sans);font-size:14px;min-height:44px;max-height:160px;line-height:1.5;outline:none;transition:border-color .15s} .oc-input:focus{border-color:var(--ac)} .oc-input::placeholder{color:var(--t3)} .oc-send{width:40px;height:40px;border-radius:10px;background:var(--ac);color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0;transition:background .15s} .oc-send:hover{background:var(--ac2)} .oc-send:disabled{opacity:.4;cursor:not-allowed} .oc-status{display:flex;align-items:center;padding:4px 16px;background:var(--bg1);border-top:1px solid var(--bd);font-size:11px;color:var(--t3);gap:16px;flex-shrink:0;min-height:26px} .oc-status-dot{width:6px;height:6px;border-radius:50%;display:inline-block;margin-right:4px} .oc-status-dot.on{background:var(--ok)}.oc-status-dot.off{background:var(--err)} .oc-cursor{display:inline-block;width:2px;height:1em;background:var(--ac);animation:ocblink 1s infinite;vertical-align:text-bottom;margin-left:1px} @keyframes ocblink{0%,50%{opacity:1}51%,100%{opacity:0}} .oc-modal-bg{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:10000;align-items:center;justify-content:center} .oc-modal-bg.open{display:flex} .oc-modal{background:var(--bg1);border:1px solid var(--bd);border-radius:12px;width:560px;max-height:80vh;overflow-y:auto;box-shadow:0 16px 48px rgba(0,0,0,.4)} .oc-modal-hdr{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--bd)} .oc-modal-hdr h3{font-size:15px;font-weight:600} .oc-modal-close{background:none;border:none;color:var(--t2);cursor:pointer;font-size:18px;padding:4px} .oc-modal-close:hover{color:var(--t1)} .oc-modal-body{padding:20px} .oc-fg{margin-bottom:14px} .oc-fg label{display:block;font-size:12px;font-weight:500;margin-bottom:5px;color:var(--t2)} .oc-fi{width:100%;padding:8px 12px;border:1px solid var(--bd);border-radius:6px;background:var(--bg0);color:var(--t1);font-family:var(--sans);font-size:13px;outline:none} .oc-fi:focus{border-color:var(--ac)} .oc-pl{display:flex;flex-direction:column;gap:6px} .oc-pi{display:flex;align-items:center;padding:10px 12px;border:1px solid var(--bd);border-radius:8px;gap:10px;transition:border-color .15s} .oc-pi:hover{border-color:var(--bd2)} .oc-pi-name{flex:1;font-weight:500;font-size:13px} .oc-pi-badge{font-size:10px;padding:2px 7px;border-radius:4px;background:var(--ac);color:#fff} .oc-pi-badge.off{background:var(--bg2);color:var(--t3)} </style> <div id="oc-app"> <div class="oc-hdr"> <div class="oc-hdr-left"> <button class="oc-icon-btn" id="ocToggleSb" title="Toggle sidebar">☰</button> <span style="font-weight:600;font-size:13px;color:var(--t1)"><?php echo htmlspecialchars($sw_name); ?></span> </div> <div class="oc-hdr-center"> <select class="oc-sel" id="ocMode" title="Mode"><option value="build">Build</option><option value="plan">Plan</option></select> <select class="oc-sel" id="ocModel" title="Model"><option value="">Select model</option></select> </div> <div class="oc-hdr-right"> <button class="oc-btn oc-btn-sm" id="ocSettingsBtn">⚙ Settings</button> <?php if(!empty($back_url)): ?><a href="<?php echo $back_url; ?>" class="oc-btn oc-btn-sm">← Back</a><?php endif; ?> <button class="oc-icon-btn" id="ocThemeBtn" title="Toggle theme">☾</button> </div> </div> <div class="oc-body"> <div class="oc-sb" id="ocSidebar"> <div class="oc-sb-hdr"><span>History</span><button class="oc-btn oc-btn-sm" id="ocNewChat">+ New</button></div> <div class="oc-sb-list" id="ocSessionList"></div> </div> <div class="oc-main"> <div class="oc-chat" id="ocChat"><div class="oc-chat-inner" id="ocChatInner"></div></div> <div class="oc-input-area"> <div class="oc-input-wrap"> <textarea class="oc-input" id="ocInput" placeholder="Ask me to code, debug, explain, or refactor..." rows="1"></textarea> <button class="oc-send" id="ocSendBtn">▶</button> </div> </div> <div class="oc-status"> <span><span class="oc-status-dot" id="ocStatusDot"></span><span id="ocStatusText">Ready</span></span> <span id="ocTokenInfo"></span> <span>Path: <?php echo htmlspecialchars($softpath); ?></span> </div> </div> </div> </div> <div class="oc-modal-bg" id="ocSettingsModal"> <div class="oc-modal"> <div class="oc-modal-hdr"><h3>Settings</h3><button class="oc-modal-close" id="ocSettingsClose">×</button></div> <div class="oc-modal-body"> <div class="oc-pl" id="ocProviderList"></div> <div id="ocConnectForm" style="display:none;margin-top:16px"> <div class="oc-fg"><label>API Key</label><input type="password" class="oc-fi" id="ocApiKey" placeholder="Enter your API key"></div> <div class="oc-fg" id="ocBaseUrlGroup" style="display:none"><label>Base URL</label><input type="text" class="oc-fi" id="ocBaseUrl" placeholder="https://api.example.com/v1"></div> <div style="display:flex;gap:8px"><button class="oc-btn" id="ocTestConn">Test</button><button class="oc-btn active" id="ocSaveConn">Connect</button><button class="oc-btn" id="ocCancelConn">Cancel</button></div> </div> </div> </div> </div> <script> (function(){ var API='<?php echo $api_base;?>',CSRF='<?php echo $csrf;?>',SOFTPATH='<?php echo addslashes($softpath);?>',providers=[],streaming=false,curStream=null,activeConvId=null,sessionsLoaded=[]; marked.setOptions({breaks:true,gfm:true}); var R=new marked.Renderer(); R.code=function(code,lang){ var l=lang||'',h='';try{h=hljs.highlightAuto(code).value}catch(e){h=code.replace(/</g,'<')} return '<div class="oc-code-hdr"><span>'+l+'</span><button class="oc-code-copy" onclick="window._cc(this)">Copy</button></div><pre><code class="hljs">'+h+'</code></pre>'; }; marked.use({renderer:R}); window._cc=function(el){var c=el.closest('pre').querySelector('code');navigator.clipboard.writeText(c.textContent);el.textContent='Copied!';setTimeout(function(){el.textContent='Copy'},1500)}; function api(a,d,cb){ var isP=!!d,url=API+'&ai_php_api='+a+'&csrf_token='+CSRF,x=new XMLHttpRequest(); x.open(isP?'POST':'GET',url,true);x.setRequestHeader('Accept','application/json'); if(isP)x.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); x.onload=function(){if(x.status===200){try{cb(null,JSON.parse(x.responseText))}catch(e){cb('Parse error')}}else cb('HTTP '+x.status)}; x.onerror=function(){cb('Network error')};x.send(isP?bp(d):null); } function bp(o){var p=[];for(var k in o)if(o.hasOwnProperty(k))p.push(encodeURIComponent(k)+'='+encodeURIComponent(o[k]));return p.join('&')} function md(t){return t?DOMPurify.sanitize(marked.parse(t)):''} function esc(s){var d=document.createElement('div');d.textContent=s;return d.innerHTML} function setStatus(t,c){document.getElementById('ocStatusText').textContent=t;document.getElementById('ocStatusDot').className='oc-status-dot '+(c?'on':'off')} function renderMsg(msg){ var chat=document.getElementById('ocChatInner'),div=document.createElement('div'); div.className='oc-msg '+msg.role; var avatar=document.createElement('div'); avatar.className='oc-msg-avatar'; avatar.textContent=msg.role==='user'?'U':'AI'; var body=document.createElement('div'); body.className='oc-msg-body'; var bubble=document.createElement('div'); bubble.className='oc-msg-bubble'; if(msg.role==='user'){ bubble.innerHTML='<div class="oc-msg-text">'+esc(msg.content)+'</div>'; }else{ var text=''; var parts=msg.parts||[]; var hasText=false; parts.forEach(function(p){ if(p.type==='text'&&p.text){text+=p.text;hasText=true} }); if(hasText) bubble.innerHTML='<div class="oc-md">'+md(text)+'</div>'; parts.forEach(function(p){ if(p.type==='tool_use'){ var toolDiv=document.createElement('div'); toolDiv.className='oc-tool'; toolDiv.innerHTML='<div class="oc-tool-hdr" onclick="this.parentElement.classList.toggle(\'open\')"><span class="oc-tool-dot done"></span><span class="oc-tool-name">'+esc(p.name||'tool')+'</span><span class="oc-tool-detail">'+esc(JSON.stringify(p.input||{}).substring(0,80))+'</span></div><div class="oc-tool-body">'+esc('Tool call: '+p.name)+'\n'+esc(JSON.stringify(p.input||{},null,2))+'</div>'; bubble.appendChild(toolDiv); } }); if(!hasText&&parts.length===0){ if(typeof msg.content==='string'&&msg.content) bubble.innerHTML='<div class="oc-md">'+md(msg.content)+'</div>'; } } body.appendChild(bubble); div.appendChild(avatar); div.appendChild(body); chat.appendChild(div); var chatEl=document.getElementById('ocChat'); chatEl.scrollTop=chatEl.scrollHeight; return bubble; } function renderMessages(msgs){ var chat=document.getElementById('ocChatInner'); chat.innerHTML=''; if(!msgs||!msgs.length){ chat.innerHTML='<div class="oc-empty"><div class="oc-empty-icon">🤖</div><div class="oc-empty-title">Code with AI</div><div class="oc-empty-hint">Select a model above and start coding.<br>I can read, write, edit files and run commands.</div></div>'; return; } msgs.forEach(function(m){renderMsg(m)}); } function loadConversation(convId){ activeConvId=convId; var url=API+'&ai_php_api=conversation&csrf_token='+CSRF+'&conversation_id='+encodeURIComponent(convId); var x=new XMLHttpRequest();x.open('GET',url,true);x.setRequestHeader('Accept','application/json'); x.onload=function(){if(x.status===200){try{var d=JSON.parse(x.responseText);renderMessages(d.messages||[]);updateSessionHighlight(convId)}catch(e){}}}; x.send(); } function loadSessions(){ api('conversations',null,function(e,d){ if(e||!d)return; sessionsLoaded=d; var list=document.getElementById('ocSessionList'); list.innerHTML=''; if(!d.length){ list.innerHTML='<div style="padding:16px;color:var(--t3);font-size:12px;text-align:center">No sessions yet</div>'; return; } d.forEach(function(s){ var item=document.createElement('div'); item.className='oc-sb-item'+(s.id===activeConvId?' active':''); item.dataset.id=s.id; var timeStr=''; if(s.updated_at){var dt=new Date(s.updated_at*1000);timeStr=dt.toLocaleDateString()===new Date().toLocaleDateString()?dt.toLocaleTimeString([],{hour:'2-digit',minute:'2-digit'}):dt.toLocaleDateString([],{month:'short',day:'numeric'})} item.innerHTML='<span class="oc-sb-item-icon">💬</span><span class="oc-sb-item-text">'+esc(s.title||'Untitled')+'</span>'+(s.message_count?'<span class="oc-sb-item-msgs">'+s.message_count+'</span>':'')+(timeStr?'<span class="oc-sb-item-time">'+timeStr+'</span>':'')+'<button class="oc-sb-item-del" data-del="1" title="Delete">×</button>'; item.addEventListener('click',function(ev){ if(ev.target.dataset.del){ev.stopPropagation();deleteSession(s.id);return} api('start',{provider:document.getElementById('ocModel').value.split('/')[0],model:document.getElementById('ocModel').value.split('/')[1],mode:document.getElementById('ocMode').value},function(){ activeConvId=s.id; api('switch_conversation',{conversation_id:s.id},function(){loadConversation(s.id)}); }); }); list.appendChild(item); }); }); } function deleteSession(id){ if(!confirm('Delete this session?'))return; api('delete_conversation',{conversation_id:id},function(){loadSessions();if(activeConvId===id){activeConvId=null;renderMessages([])}}); } function updateSessionHighlight(convId){ document.querySelectorAll('.oc-sb-item').forEach(function(el){el.classList.toggle('active',el.dataset.id===convId)}); } function newSession(){ api('new_session',{},function(e,r){ if(!e&&r&&r.id){ activeConvId=r.id; renderMessages([]); loadSessions(); api('start',{provider:document.getElementById('ocModel').value.split('/')[0],model:document.getElementById('ocModel').value.split('/')[1],mode:document.getElementById('ocMode').value},function(){}); } }); } function sendMessage(){ var inp=document.getElementById('ocInput'),text=inp.value.trim(); if(!text||streaming)return; inp.value='';inp.style.height='44px'; renderMsg({role:'user',content:text}); streaming=true;document.getElementById('ocSendBtn').disabled=true; setStatus('Thinking...',true); var doSend=function(){ var bubble=null,full='',params='content='+encodeURIComponent(text)+'&csrf_token='+CSRF; if(activeConvId)params+='&conversation_id='+encodeURIComponent(activeConvId); var xhr=new XMLHttpRequest();xhr.open('POST',API+'&ai_chat_stream=1',true); xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); curStream=xhr;var buf=''; xhr.onprogress=function(){ var nt=xhr.responseText.substring(buf.length);buf=xhr.responseText; nt.split('\n').forEach(function(line){ if(line.indexOf('data: ')!==0)return; try{var d=JSON.parse(line.substring(6)); if(d.text){ full+=d.text; if(!bubble){bubble=renderMsg({role:'assistant',content:'',parts:[]})} var mdDiv=bubble.querySelector('.oc-md'); if(!mdDiv){bubble.innerHTML='<div class="oc-md">'+md(full)+'<span class="oc-cursor"></span></div>';mdDiv=bubble.querySelector('.oc-md')} else mdDiv.innerHTML=md(full)+'<span class="oc-cursor"></span>'; document.getElementById('ocChat').scrollTop=1e9; } if(d.name&&d.input){ var toolDiv=document.createElement('div'); toolDiv.className='oc-tool'; toolDiv.innerHTML='<div class="oc-tool-hdr" onclick="this.parentElement.classList.toggle(\'open\')"><span class="oc-tool-dot '+(d.is_error?'err':'done')+'"></span><span class="oc-tool-name">'+esc(d.name)+'</span><span class="oc-tool-detail">'+esc(String(d.output||'').substring(0,80))+'</span></div><div class="oc-tool-body">'+esc(d.output||'')+'</div>'; if(!bubble){bubble=renderMsg({role:'assistant',content:'',parts:[]})} bubble.appendChild(toolDiv); } }catch(e){} }); }; xhr.onload=function(){ streaming=false;document.getElementById('ocSendBtn').disabled=false;curStream=null; if(bubble){var cur=bubble.querySelector('.oc-cursor');if(cur)cur.remove()} setStatus('Ready',true); document.getElementById('ocChat').scrollTop=1e9; loadSessions(); }; xhr.onerror=function(){ streaming=false;document.getElementById('ocSendBtn').disabled=false;curStream=null; if(bubble)bubble.innerHTML='<span style="color:var(--err)">Connection error.</span>'; setStatus('Error',false); }; xhr.send(params); }; var mv=document.getElementById('ocModel').value; if(mv){var pp=mv.split('/'),pr=pp[0],mo=pp.slice(1).join('/'); api('start',{provider:pr,model:mo,mode:document.getElementById('ocMode').value},function(){doSend()}); }else{doSend()} } function loadProviders(){ api('providers',null,function(e,d){ if(e||!d)return;providers=d; var ms=document.getElementById('ocModel');ms.innerHTML='<option value="">Select model</option>'; var g={};d.forEach(function(p){if(!p.connected)return;var m=p.models||{};for(var k in m){var v=typeof m[k]==='object'?m[k].name:m[k];if(!g[p.name])g[p.name]=[];g[p.name].push({id:k,name:v,provider:p.id})}}); for(var gn in g){var og=document.createElement('optgroup');og.label=gn;g[gn].forEach(function(m){var o=document.createElement('option');o.value=m.provider+'/'+m.id;o.textContent=m.name;og.appendChild(o)});ms.appendChild(og)} renderProviderList(d); }); } function renderProviderList(d){ var l=document.getElementById('ocProviderList');l.innerHTML=''; d.forEach(function(p){ var div=document.createElement('div');div.className='oc-pi'; var badge=p.connected?'<span class="oc-pi-badge">Connected</span>':'<span class="oc-pi-badge off">Not set</span>'; var btn=p.no_key?'':(p.connected?'<button class="oc-btn oc-btn-sm" data-a="dis" data-id="'+p.id+'">Remove</button>':'<button class="oc-btn oc-btn-sm" data-a="con" data-id="'+p.id+'">Connect</button>'); div.innerHTML='<span class="oc-pi-name">'+p.name+'</span>'+badge+btn;l.appendChild(div); }); } var cProv=null; document.getElementById('ocProviderList').addEventListener('click',function(e){ var b=e.target.closest('button');if(!b)return;var a=b.dataset.a,id=b.dataset.id; if(a==='con'){cProv=id;var p=providers.find(function(x){return x.id===id}); document.getElementById('ocConnectForm').style.display='block';document.getElementById('ocApiKey').value=''; document.getElementById('ocBaseUrlGroup').style.display=(id.indexOf('custom:')===0)?'block':'none'; }else if(a==='dis'){if(confirm('Disconnect?'))api('settings_delete',{provider_id:id},function(){loadProviders()})} }); document.getElementById('ocSaveConn').addEventListener('click',function(){ if(!cProv)return;var k=document.getElementById('ocApiKey').value.trim(),bu=document.getElementById('ocBaseUrl').value.trim(); var d={provider_id:cProv,api_key:k};if(bu)d.base_url=bu; api('settings_save',d,function(e,r){if(!e&&r&&r.success){document.getElementById('ocConnectForm').style.display='none';cProv=null;loadProviders()}else alert(e||(r&&r.error)||'Failed')}); }); document.getElementById('ocTestConn').addEventListener('click',function(){ if(!cProv)return;setStatus('Testing...',true); api('test_connection',{provider_id:cProv,api_key:document.getElementById('ocApiKey').value.trim()},function(e,r){ alert(!e&&r&&r.success?'OK':'Failed: '+(e||(r&&r.error)||''));setStatus('Ready',true); }); }); document.getElementById('ocCancelConn').addEventListener('click',function(){document.getElementById('ocConnectForm').style.display='none';cProv=null}); document.getElementById('ocSettingsBtn').addEventListener('click',function(){document.getElementById('ocSettingsModal').classList.add('open');loadProviders()}); document.getElementById('ocSettingsClose').addEventListener('click',function(){document.getElementById('ocSettingsModal').classList.remove('open')}); document.getElementById('ocSettingsModal').addEventListener('click',function(e){if(e.target===this)this.classList.remove('open')}); document.getElementById('ocSendBtn').addEventListener('click',sendMessage); document.getElementById('ocInput').addEventListener('keydown',function(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendMessage()}}); document.getElementById('ocInput').addEventListener('input',function(){this.style.height='44px';this.style.height=Math.min(this.scrollHeight,160)+'px'}); document.getElementById('ocModel').addEventListener('change',function(){ var v=this.value;if(!v)return;var p=v.split('/'),pr=p[0],mo=p.slice(1).join('/'); api('start',{provider:pr,model:mo,mode:document.getElementById('ocMode').value},function(){}); }); document.getElementById('ocMode').addEventListener('change',function(){api('set_mode',{mode:this.value},function(){})}); document.getElementById('ocNewChat').addEventListener('click',newSession); document.getElementById('ocToggleSb').addEventListener('click',function(){document.getElementById('ocSidebar').classList.toggle('collapsed')}); var theme=localStorage.getItem('oc-theme')||'dark'; function applyTheme(t){ document.documentElement.setAttribute('data-theme',t); document.getElementById('hljs-theme').href=t==='light'?'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github.min.css':'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css'; localStorage.setItem('oc-theme',t); } applyTheme(theme); document.getElementById('ocThemeBtn').addEventListener('click',function(){theme=theme==='dark'?'light':'dark';applyTheme(theme)}); api('status',null,function(e,d){ if(!e&&d){ if(d.session){ if(d.session.provider&&d.session.model)document.getElementById('ocModel').value=d.session.provider+'/'+d.session.model; if(d.session.mode)document.getElementById('ocMode').value=d.session.mode; if(d.session.active_conversation){ activeConvId=d.session.active_conversation; loadConversation(activeConvId); } } var hc=(d.providers||[]).some(function(p){return p.connected});setStatus(hc?'Ready':'No provider connected',hc); } }); loadProviders();loadSessions(); })(); </script> <?php } function ai_select_theme(){ global $user, $globals, $l, $theme, $softpanel, $error, $iscripts; softheader(__('$0 - Code with AI', array(APP))); $installations = array(); if(!empty($user['ins'])){ foreach($user['ins'] as $insid => $data){ $soft = get_sid_by_version($data['ver'], $data['sid']); $software = !empty($iscripts[$soft]) ? $iscripts[$soft] : array('name' => 'Software'); $installations[] = array( 'insid' => $insid, 'name' => $software['name'], 'url' => $data['softurl'], 'path' => $data['softpath'] ); } } echo '<style> .ai-select-container { max-width: 800px; margin: 50px auto; padding: 30px; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .ai-select-title { font-size: 24px; font-weight: 600; color: #333; margin-bottom: 20px; text-align: center; } .ai-select-subtitle { font-size: 14px; color: #666; margin-bottom: 30px; text-align: center; } .ai-install-list { margin-bottom: 30px; } .ai-install-item { display: flex; align-items: center; padding: 15px; border: 1px solid #ddd; border-radius: 6px; margin-bottom: 10px; cursor: pointer; transition: all 0.2s; } .ai-install-item:hover { border-color: #00A0D2; background: #f8fdff; } .ai-install-icon { width: 40px; height: 40px; background: #00A0D2; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; margin-right: 15px; } .ai-install-info { flex: 1; } .ai-install-name { font-weight: 600; color: #333; } .ai-install-url { font-size: 12px; color: #888; } .ai-install-path { font-size: 12px; color: #aaa; margin-top: 4px; } .ai-custom-path { margin-top: 30px; padding-top: 30px; border-top: 1px solid #eee; } .ai-custom-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 15px; } .ai-custom-input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; margin-bottom: 10px; } .ai-custom-btn { padding: 12px 24px; background: #00A0D2; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; } .ai-custom-btn:hover { background: #0088b2; } .ai-or-divider { text-align: center; margin: 20px 0; color: #999; font-size: 14px; } </style>'; echo '<div class="ai-select-container"> <div class="ai-select-title"><i class="fas fa-robot" style="color:#00A0D2;"></i> '.__('Code with AI').'</div> <div class="ai-select-subtitle">'.__('Select an installation or enter a custom path to start coding with AI').'</div>'; if(!empty($installations)){ echo '<div class="ai-install-list"><div style="font-weight:600;color:#333;margin-bottom:15px;">'.__('Select an Installation').'</div>'; foreach($installations as $ins){ echo '<a href="'.$globals['ind'].'act=ai&insid='.$ins['insid'].'" style="text-decoration:none;color:inherit;"> <div class="ai-install-item"> <div class="ai-install-icon"><i class="fas fa-globe"></i></div> <div class="ai-install-info"> <div class="ai-install-name">'.htmlspecialchars($ins['name']).'</div> <div class="ai-install-url">'.htmlspecialchars($ins['url']).'</div> <div class="ai-install-path">'.htmlspecialchars($ins['path']).'</div> </div> </div> </a>'; } echo '</div>'; } echo '<div class="ai-or-divider">'.__('OR').'</div>'; echo '<div class="ai-custom-path"> <div class="ai-custom-title">'.__('Enter Custom Path').'</div> <form method="get" action="'.$globals['index'].'"> <input type="hidden" name="act" value="ai" /> <input type="text" name="path" class="ai-custom-input" placeholder="'.__('Enter full path (e.g., /home/user/public_html)').'" /> <button type="submit" class="ai-custom-btn">'.__('Start AI Coding').'</button> </form> </div>'; echo '</div>'; softfooter(); }