mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-15 18:02:58 +08:00
chore: improve code
This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
||||
|
||||
|
||||
|
||||
project.version = "0.0.3"
|
||||
project.version = "0.0.4"
|
||||
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -97,7 +97,11 @@ class AccountOption : JPanel(BorderLayout()), OptionsPane.Option, Disposable {
|
||||
planBox.add(Box.createHorizontalStrut(16))
|
||||
val upgrade = JXHyperlink(object : AnAction(I18n.getString("termora.settings.account.upgrade")) {
|
||||
override fun actionPerformed(evt: AnActionEvent) {
|
||||
Application.browse(URI.create("https://www.termora.app/pricing"))
|
||||
if (I18n.isChinaMainland()) {
|
||||
Application.browse(URI.create("https://www.termora.cn/pricing"))
|
||||
} else {
|
||||
Application.browse(URI.create("https://www.termora.app/pricing"))
|
||||
}
|
||||
}
|
||||
})
|
||||
upgrade.isFocusable = false
|
||||
|
||||
@@ -77,13 +77,8 @@ class LoginServerDialog(owner: Window) : DialogWrapper(owner) {
|
||||
var rows = 1
|
||||
val step = 2
|
||||
|
||||
|
||||
if (Application.isUnknownVersion()) {
|
||||
serverComboBox.addItem(Server("Localhost", "http://127.0.0.1:8080"))
|
||||
}
|
||||
|
||||
// serverComboBox.addItem(singaporeServer)
|
||||
// serverComboBox.addItem(chinaServer)
|
||||
serverComboBox.addItem(chinaServer)
|
||||
|
||||
val properties = DatabaseManager.getInstance().properties
|
||||
val servers = (runCatching {
|
||||
@@ -288,8 +283,8 @@ class LoginServerDialog(owner: Window) : DialogWrapper(owner) {
|
||||
.add("${I18n.getString("termora.new-host.general.name")}:").xy(1, rows)
|
||||
.add(nameTextField).xyw(3, rows, 3).apply { rows += step }
|
||||
.add("${I18n.getString("termora.settings.account.server")}:").xy(1, rows)
|
||||
.add(serverTextField).xy(3, rows)
|
||||
.add(deploy).xy(5, rows).apply { rows += step }
|
||||
.add(serverTextField).xyw(3, rows, 3)
|
||||
// .add(deploy).xy(5, rows).apply { rows += step }
|
||||
.build()
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ class ServerManager private constructor() {
|
||||
|
||||
// 解密
|
||||
val salt = "${serverInfo.salt}:${username}".toByteArray()
|
||||
val privateKeySecureKey = PBKDF2.hash(salt, username.toCharArray(), 1024, 256)
|
||||
val privateKeySecureIv = PBKDF2.hash(salt, username.toCharArray(), 1024, 128)
|
||||
val privateKeySecureKey = PBKDF2.hash(salt, password.toCharArray(), 1024, 256)
|
||||
val privateKeySecureIv = PBKDF2.hash(salt, password.toCharArray(), 1024, 128)
|
||||
val privateKeyEncoded = AES.CBC.decrypt(
|
||||
privateKeySecureKey, privateKeySecureIv,
|
||||
Base64.decodeBase64(meResponse.privateKey)
|
||||
|
||||
Reference in New Issue
Block a user