diff --git a/include/ui/profile/dialog_edit_profile.ui b/include/ui/profile/dialog_edit_profile.ui index 5fafe68..578b2f6 100644 --- a/include/ui/profile/dialog_edit_profile.ui +++ b/include/ui/profile/dialog_edit_profile.ui @@ -481,6 +481,16 @@ + + + + Service Name + + + + + + diff --git a/src/configs/common/transport.cpp b/src/configs/common/transport.cpp index 0decaac..9c80b4f 100644 --- a/src/configs/common/transport.cpp +++ b/src/configs/common/transport.cpp @@ -137,10 +137,7 @@ namespace Configs { QJsonObject object; if (type.isEmpty() || type == "tcp") return object; if (!type.isEmpty()) object["type"] = type; - if (!path.isEmpty()) { - if (type == "grpc") object["service_name"] = path; - else object["path"] = path; - } + if (!path.isEmpty()) object["path"] = path; if (!method.isEmpty()) object["method"] = method; if (!headers.isEmpty()) { object["headers"] = qStringListToJsonObject(headers); diff --git a/src/ui/profile/dialog_edit_profile.cpp b/src/ui/profile/dialog_edit_profile.cpp index 9400f2a..1cf5b0e 100644 --- a/src/ui/profile/dialog_edit_profile.cpp +++ b/src/ui/profile/dialog_edit_profile.cpp @@ -44,8 +44,8 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId, ui->headers_l->setVisible(false); ui->method->setVisible(false); ui->method_l->setVisible(false); - ui->path->setVisible(true); - ui->path_l->setVisible(true); + ui->path->setVisible(false); + ui->path_l->setVisible(false); ui->host->setVisible(false); ui->host_l->setVisible(false); } else if (txt == "ws" || txt == "httpupgrade") { @@ -85,6 +85,13 @@ DialogEditProfile::DialogEditProfile(const QString &_type, int profileOrGroupId, ui->host->setVisible(false); ui->host_l->setVisible(false); } + if (txt == "grpc") { + ui->service_name->setVisible(true); + ui->service_name_l->setVisible(true); + } else { + ui->service_name->setVisible(false); + ui->service_name_l->setVisible(false); + } if (txt == "ws") { ui->ws_early_data_length->setVisible(true); ui->ws_early_data_length_l->setVisible(true); @@ -327,6 +334,7 @@ void DialogEditProfile::typeSelected(const QString &newType) { ui->tls_rec_frag->setChecked(tls->record_fragment); ui->insecure->setChecked(tls->insecure); ui->headers->setText(transport->getHeadersString()); + ui->service_name->setText(transport->service_name); ui->ws_early_data_name->setText(transport->early_data_header_name); ui->ws_early_data_length->setText(Int2String(transport->max_early_data)); ui->xhttp_mode->setCurrentText(transport->xhttp_mode); @@ -446,6 +454,7 @@ bool DialogEditProfile::onEnd() { tls->insecure = ui->insecure->isChecked(); transport->headers = transport->getHeaderPairs(ui->headers->text()); transport->method = ui->method->text(); + transport->service_name = ui->service_name->text(); transport->early_data_header_name = ui->ws_early_data_name->text(); transport->max_early_data = ui->ws_early_data_length->text().toInt(); transport->xhttp_mode = ui->xhttp_mode->currentText();