feat :
- Added tunnel - Removed cloud feature
This commit is contained in:
1 parent
adf57aa0c9
commit
0baa299722
37 files changed
+858
-933
No files matched your search
@@ -14,6 +14,8 @@ export default function CLIToolsPageClient({ machineId }) {
|
||||
const [expandedTool, setExpandedTool] = useState(null);
|
||||
const [modelMappings, setModelMappings] = useState({});
|
||||
const [cloudEnabled, setCloudEnabled] = useState(false);
|
||||
const [tunnelEnabled, setTunnelEnabled] = useState(false);
|
||||
const [tunnelUrl, setTunnelUrl] = useState("");
|
||||
const [apiKeys, setApiKeys] = useState([]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -24,13 +26,21 @@ export default function CLIToolsPageClient({ machineId }) {
|
||||
|
||||
const loadCloudSettings = async () => {
|
||||
try {
|
||||
const res = await fetch("/api/settings");
|
||||
if (res.ok) {
|
||||
const data = await res.json();
|
||||
const [settingsRes, tunnelRes] = await Promise.all([
|
||||
fetch("/api/settings"),
|
||||
fetch("/api/tunnel/status"),
|
||||
]);
|
||||
if (settingsRes.ok) {
|
||||
const data = await settingsRes.json();
|
||||
setCloudEnabled(data.cloudEnabled || false);
|
||||
}
|
||||
if (tunnelRes.ok) {
|
||||
const data = await tunnelRes.json();
|
||||
setTunnelEnabled(data.enabled || false);
|
||||
setTunnelUrl(data.tunnelUrl || "");
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("Error loading cloud settings:", error);
|
||||
console.log("Error loading settings:", error);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -108,6 +118,9 @@ export default function CLIToolsPageClient({ machineId }) {
|
||||
}, []);
|
||||
|
||||
const getBaseUrl = () => {
|
||||
if (tunnelEnabled && tunnelUrl) {
|
||||
return tunnelUrl;
|
||||
}
|
||||
if (cloudEnabled && CLOUD_URL) {
|
||||
return CLOUD_URL;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@ export default function ClaudeToolCard({
|
||||
if (!currentUrl) return "not_configured";
|
||||
const localMatch = currentUrl.includes("localhost") || currentUrl.includes("127.0.0.1");
|
||||
const cloudMatch = cloudEnabled && CLOUD_URL && currentUrl.startsWith(CLOUD_URL);
|
||||
if (localMatch || cloudMatch) return "configured";
|
||||
const tunnelMatch = baseUrl && currentUrl.startsWith(baseUrl);
|
||||
if (localMatch || cloudMatch || tunnelMatch) return "configured";
|
||||
return "other";
|
||||
};
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ export default function DroidToolCard({
|
||||
if (!currentConfig) return "not_configured";
|
||||
const localMatch = currentConfig.baseUrl?.includes("localhost") || currentConfig.baseUrl?.includes("127.0.0.1");
|
||||
const cloudMatch = cloudEnabled && CLOUD_URL && currentConfig.baseUrl?.startsWith(CLOUD_URL);
|
||||
if (localMatch || cloudMatch) return "configured";
|
||||
const tunnelMatch = baseUrl && currentConfig.baseUrl?.startsWith(baseUrl);
|
||||
if (localMatch || cloudMatch || tunnelMatch) return "configured";
|
||||
return "other";
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ export default function OpenClawToolCard({
|
||||
const currentProvider = openclawStatus.settings?.models?.providers?.["9router"];
|
||||
if (!currentProvider) return "not_configured";
|
||||
const localMatch = currentProvider.baseUrl?.includes("localhost") || currentProvider.baseUrl?.includes("127.0.0.1") || currentProvider.baseUrl?.includes("0.0.0.0");
|
||||
if (localMatch) return "configured";
|
||||
const tunnelMatch = baseUrl && currentProvider.baseUrl?.startsWith(baseUrl);
|
||||
if (localMatch || tunnelMatch) return "configured";
|
||||
return "other";
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user