From 0af708f4baf5adeec8f86701ff453765979e6893 Mon Sep 17 00:00:00 2001 From: amass Date: Sun, 12 Jan 2025 14:18:06 +0800 Subject: [PATCH] optimize style. --- WebApplication/WebRTCClientPage.cpp | 7 ++++++- resources/webrtc.xml | 23 +++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/WebApplication/WebRTCClientPage.cpp b/WebApplication/WebRTCClientPage.cpp index 82df47a..d3903ab 100644 --- a/WebApplication/WebRTCClientPage.cpp +++ b/WebApplication/WebRTCClientPage.cpp @@ -21,18 +21,23 @@ WebRTCClientPage::WebRTCClientPage() : Wt::WTemplate(tr("Wt.WebRTC.Home")) { addStyleClass("bulma-is-flex-grow-1 bulma-is-flex bulma-is-flex-direction-column"); auto localId = randomId(4); bindNew("localId")->setText(localId); - auto offerId = bindNew("offerId"); auto textBrowser = bindNew("textBrowser"); textBrowser->setReadOnly(true); + auto offerId = bindNew("offerId"); + offerId->setDisabled(true); + auto offerBtn = bindNew("offerBtn"); offerBtn->setText("Offer"); + offerBtn->setDisabled(true); auto sendMsg = bindNew("sendMsg"); + sendMsg->setDisabled(true); auto sendBtn = bindNew("sendBtn"); sendBtn->setText("发送"); + sendBtn->setDisabled(true); std::string url = "ws://127.0.0.1:8081/api/v1/webrtc/signal"; diff --git a/resources/webrtc.xml b/resources/webrtc.xml index 75e0b58..618faa0 100644 --- a/resources/webrtc.xml +++ b/resources/webrtc.xml @@ -2,15 +2,22 @@

WebRTC 测试

- ID: ${localId} -
- ${textBrowser} -

通过信令服务器发送 offer

- ${offerId type="text" placeholder="remote ID" disabled="true" } - ${offerBtn disabled="true"} -
+
+ ID: ${localId} +
+ ${textBrowser class="bulma-textarea bulma-is-flex-grow-1"} +

通过信令服务器发送 offer

+ +
+
+ ${offerId class="bulma-input" type="text" placeholder="remote ID" disabled="true" } +
+
+ ${offerBtn class="bulma-button bulma-is-info" disabled="true"} +
+

通过 DataChannel 发送消息

-
+
${sendMsg class="bulma-input" type="text" placeholder="message" disabled="true" }