mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-18 04:54:38 +03:00
refactor uot
This commit is contained in:
@@ -106,7 +106,16 @@ namespace NekoGui_fmt {
|
|||||||
outbound["server_port"] = serverPort;
|
outbound["server_port"] = serverPort;
|
||||||
outbound["method"] = method;
|
outbound["method"] = method;
|
||||||
outbound["password"] = password;
|
outbound["password"] = password;
|
||||||
outbound["udp_over_tcp"] = uot;
|
|
||||||
|
if (uot != 0) {
|
||||||
|
QJsonObject udp_over_tcp{
|
||||||
|
{"enabled", true},
|
||||||
|
{"version", uot},
|
||||||
|
};
|
||||||
|
outbound["udp_over_tcp"] = udp_over_tcp;
|
||||||
|
} else {
|
||||||
|
outbound["udp_over_tcp"] = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!plugin.trimmed().isEmpty()) {
|
if (!plugin.trimmed().isEmpty()) {
|
||||||
outbound["plugin"] = SubStrBefore(plugin, ";");
|
outbound["plugin"] = SubStrBefore(plugin, ";");
|
||||||
|
|||||||
@@ -116,7 +116,13 @@ namespace NekoGui_fmt {
|
|||||||
server["port"] = serverPort;
|
server["port"] = serverPort;
|
||||||
server["method"] = method;
|
server["method"] = method;
|
||||||
server["password"] = password;
|
server["password"] = password;
|
||||||
server["uot"] = uot;
|
|
||||||
|
if (uot != 0) {
|
||||||
|
server["uot"] = true;
|
||||||
|
server["UoTVersion"] = uot;
|
||||||
|
} else {
|
||||||
|
server["uot"] = false;
|
||||||
|
}
|
||||||
|
|
||||||
servers.push_back(server);
|
servers.push_back(server);
|
||||||
settings["servers"] = servers;
|
settings["servers"] = servers;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace NekoGui_fmt {
|
|||||||
QString method = "aes-128-gcm";
|
QString method = "aes-128-gcm";
|
||||||
QString password = "";
|
QString password = "";
|
||||||
QString plugin = "";
|
QString plugin = "";
|
||||||
bool uot = false;
|
int uot = 0;
|
||||||
|
|
||||||
std::shared_ptr<V2rayStreamSettings> stream = std::make_shared<V2rayStreamSettings>();
|
std::shared_ptr<V2rayStreamSettings> stream = std::make_shared<V2rayStreamSettings>();
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ namespace NekoGui_fmt {
|
|||||||
_add(new configItem("method", &method, itemType::string));
|
_add(new configItem("method", &method, itemType::string));
|
||||||
_add(new configItem("pass", &password, itemType::string));
|
_add(new configItem("pass", &password, itemType::string));
|
||||||
_add(new configItem("plugin", &plugin, itemType::string));
|
_add(new configItem("plugin", &plugin, itemType::string));
|
||||||
_add(new configItem("uot", &uot, itemType::boolean));
|
_add(new configItem("uot", &uot, itemType::integer));
|
||||||
_add(new configItem("stream", dynamic_cast<JsonStore *>(stream.get()), itemType::jsonStore));
|
_add(new configItem("stream", dynamic_cast<JsonStore *>(stream.get()), itemType::jsonStore));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ void EditShadowSocks::onStart(std::shared_ptr<NekoGui::ProxyEntity> _ent) {
|
|||||||
auto bean = this->ent->ShadowSocksBean();
|
auto bean = this->ent->ShadowSocksBean();
|
||||||
|
|
||||||
ui->method->setCurrentText(bean->method);
|
ui->method->setCurrentText(bean->method);
|
||||||
ui->uot->setChecked(bean->uot);
|
ui->uot->setCurrentText(Int2String(bean->uot));
|
||||||
ui->password->setText(bean->password);
|
ui->password->setText(bean->password);
|
||||||
auto ssPlugin = bean->plugin.split(";");
|
auto ssPlugin = bean->plugin.split(";");
|
||||||
if (!ssPlugin.empty()) {
|
if (!ssPlugin.empty()) {
|
||||||
@@ -33,7 +33,7 @@ bool EditShadowSocks::onEnd() {
|
|||||||
|
|
||||||
bean->method = ui->method->currentText();
|
bean->method = ui->method->currentText();
|
||||||
bean->password = ui->password->text();
|
bean->password = ui->password->text();
|
||||||
bean->uot = ui->uot->isChecked();
|
bean->uot = ui->uot->currentText().toInt();;
|
||||||
bean->plugin = ui->plugin->currentText();
|
bean->plugin = ui->plugin->currentText();
|
||||||
if (!bean->plugin.isEmpty()) {
|
if (!bean->plugin.isEmpty()) {
|
||||||
bean->plugin += ";" + ui->plugin_opts->text();
|
bean->plugin += ";" + ui->plugin_opts->text();
|
||||||
|
|||||||
@@ -14,10 +14,10 @@
|
|||||||
<string notr="true">Form</string>
|
<string notr="true">Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QComboBox" name="method">
|
||||||
<property name="text">
|
<property name="editable">
|
||||||
<string>Encryption</string>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -31,20 +31,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="0" column="0">
|
||||||
<widget class="MyLineEdit" name="plugin_opts"/>
|
<widget class="QLabel" name="label">
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Password</string>
|
<string>Encryption</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="method">
|
|
||||||
<property name="editable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -55,6 +45,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="MyLineEdit" name="plugin_opts"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Password</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QComboBox" name="plugin">
|
<widget class="QComboBox" name="plugin">
|
||||||
<item>
|
<item>
|
||||||
@@ -74,14 +74,36 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="uot">
|
<widget class="QLabel" name="uot_l">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Server support is required</string>
|
<string>Server support is required</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="locale">
|
||||||
<string notr="true">UDP over TCP</string>
|
<locale language="English" country="UnitedStates"/>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>UDP over TCP version</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QComboBox" name="uot">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>0</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>1</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>2</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -101,4 +123,4 @@
|
|||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
Reference in New Issue
Block a user