@@ -715,6 +715,58 @@ export class InteractiveServer {
715715 font-size: 14px;
716716 }
717717
718+ .empty-state {
719+ display: flex;
720+ flex-direction: column;
721+ align-items: center;
722+ justify-content: center;
723+ padding: 60px 20px;
724+ text-align: center;
725+ animation: fadeIn 0.8s ease-out;
726+ }
727+
728+ .empty-icon {
729+ margin-bottom: 24px;
730+ color: var(--text-secondary);
731+ opacity: 0.6;
732+ }
733+
734+ .empty-title {
735+ font-size: 20px;
736+ font-weight: 600;
737+ color: var(--text-primary);
738+ margin-bottom: 12px;
739+ }
740+
741+ .empty-message {
742+ font-size: 14px;
743+ color: var(--text-secondary);
744+ line-height: 1.6;
745+ margin-bottom: 32px;
746+ max-width: 400px;
747+ }
748+
749+ .create-env-btn {
750+ padding: 14px 24px;
751+ font-size: 15px;
752+ background: var(--primary-color);
753+ color: var(--text-primary);
754+ border: 1px solid var(--border-color);
755+ border-radius: 8px;
756+ cursor: pointer;
757+ transition: all 0.3s ease;
758+ display: flex;
759+ align-items: center;
760+ gap: 8px;
761+ font-weight: 600;
762+ }
763+
764+ .create-env-btn:hover {
765+ background: var(--primary-hover);
766+ transform: translateY(-2px);
767+ box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
768+ }
769+
718770 .actions {
719771 display: flex;
720772 gap: 12px;
@@ -891,17 +943,37 @@ export class InteractiveServer {
891943 <p class="content-subtitle">请选择您要使用的云开发环境</p>
892944
893945 <div class="env-list" id="envList">
894- ${ ( envs || [ ] ) . map ( ( env , index ) => `
895- <div class="env-item" onclick="selectEnv('${ env . EnvId } ', this)" style="animation-delay: ${ index * 0.1 } s;">
896- <svg class="env-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
897- <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
898- </svg>
899- <div class="env-info">
900- <div class="env-name">${ env . EnvId } </div>
901- <div class="env-alias">${ env . Alias || '无别名' } </div>
946+ ${ ( envs || [ ] ) . length > 0 ?
947+ ( envs || [ ] ) . map ( ( env , index ) => `
948+ <div class="env-item" onclick="selectEnv('${ env . EnvId } ', this)" style="animation-delay: ${ index * 0.1 } s;">
949+ <svg class="env-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
950+ <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
951+ </svg>
952+ <div class="env-info">
953+ <div class="env-name">${ env . EnvId } </div>
954+ <div class="env-alias">${ env . Alias || '无别名' } </div>
955+ </div>
956+ </div>
957+ ` ) . join ( '' ) :
958+ `
959+ <div class="empty-state">
960+ <div class="empty-icon">
961+ <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
962+ <path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
963+ <path d="M20 6L9 17l-5-5"/>
964+ </svg>
902965 </div>
966+ <h3 class="empty-title">暂无云开发环境</h3>
967+ <p class="empty-message">当前没有可用的云开发 CloudBase 环境,请新建后重新在 AI 对话中重试</p>
968+ <button class="btn btn-primary create-env-btn" onclick="createNewEnv()">
969+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
970+ <path d="M12 5v14M5 12h14"/>
971+ </svg>
972+ 新建环境
973+ </button>
903974 </div>
904- ` ) . join ( '' ) }
975+ `
976+ }
905977 </div>
906978
907979 <div class="actions">
@@ -1033,6 +1105,13 @@ export class InteractiveServer {
10331105 });
10341106 }
10351107
1108+ function createNewEnv() {
1109+ const integrationIde = '${ process . env . INTEGRATION_IDE || "AI Toolkit" } ';
1110+ const url = \`http://tcb.cloud.tencent.com/dev?from=\${encodeURIComponent(integrationIde)}\`;
1111+ console.log('🚀 打开新建环境页面:', url);
1112+ window.open(url, '_blank');
1113+ }
1114+
10361115 function cancel() {
10371116 fetch('/api/cancel', {
10381117 method: 'POST',
0 commit comments