mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-04-19 14:33:04 +03:00
OAuth Launcher Impl
This commit is contained in:
parent
4d9684cc03
commit
afffa5f98e
6 changed files with 31 additions and 2 deletions
|
@ -298,6 +298,16 @@ function doAuth(login, rsaPassword, auth_type) {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
function goOAuth(event) {
|
||||||
|
processing.resetOverlay();
|
||||||
|
overlay.show(processing.overlay, function (event) {
|
||||||
|
FunctionalBridge.getHWID.join();
|
||||||
|
makeOAuthRequest(function (result) {
|
||||||
|
openURL(result);
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function doUpdate(profile, pp, accessToken) {
|
function doUpdate(profile, pp, accessToken) {
|
||||||
var digest = profile.isUpdateFastCheck();
|
var digest = profile.isUpdateFastCheck();
|
||||||
|
|
BIN
Launcher/runtime/dialog/images/icons/vk.png
Normal file
BIN
Launcher/runtime/dialog/images/icons/vk.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
|
@ -121,6 +121,12 @@ function makeAuthRequest(login, rsaPassword, auth_type, callback) {
|
||||||
task.updateMessage("Авторизация на сервере");
|
task.updateMessage("Авторизация на сервере");
|
||||||
startTask(task);
|
startTask(task);
|
||||||
}
|
}
|
||||||
|
function makeOAuthRequest(callback) {
|
||||||
|
newRequestTask(new OAuthRequest(FunctionalBridge.getHWID()));
|
||||||
|
processing.setTaskProperties(task, callback, null, true);
|
||||||
|
task.updateMessage("Ожидание авторизации");
|
||||||
|
startTask(task);
|
||||||
|
}
|
||||||
|
|
||||||
function launchClient(assetHDir, clientHDir, profile, params, callback) {
|
function launchClient(assetHDir, clientHDir, profile, params, callback) {
|
||||||
var task = newTask(function() ClientLauncher.launch(assetHDir, clientHDir,
|
var task = newTask(function() ClientLauncher.launch(assetHDir, clientHDir,
|
||||||
|
|
|
@ -24,7 +24,8 @@
|
||||||
</Pane>
|
</Pane>
|
||||||
<JFXTextField id="login" alignment="CENTER" focusColor="#5fd97a" layoutX="34.0" layoutY="196.0" promptText="Логин" unFocusColor="#dadada" />
|
<JFXTextField id="login" alignment="CENTER" focusColor="#5fd97a" layoutX="34.0" layoutY="196.0" promptText="Логин" unFocusColor="#dadada" />
|
||||||
<JFXPasswordField id="password" alignment="CENTER" focusColor="#5fd97a" layoutX="34.0" layoutY="249.0" promptText="Пароль" unFocusColor="#dadada" />
|
<JFXPasswordField id="password" alignment="CENTER" focusColor="#5fd97a" layoutX="34.0" layoutY="249.0" promptText="Пароль" unFocusColor="#dadada" />
|
||||||
<JFXButton id="goAuth" layoutX="34.0" layoutY="370.0" styleClass="auth" text="ВОЙТИ" />
|
<JFXButton id="goAuth" layoutX="34.0" layoutY="370.0" prefWidth="145.0" styleClass="auth" text="ВОЙТИ" />
|
||||||
|
<JFXButton id="goOAuth" layoutX="197.0" layoutY="365.0" prefHeight="56.0" prefWidth="57.0" styleClass="vkauth" text=" " />
|
||||||
<JFXCheckBox id="rememberchb" fx:id="savePassword" checkedColor="#5fd97a" contentDisplay="CENTER" layoutX="63.0" layoutY="297.0" prefWidth="144.0" text="Сохранить пароль" textFill="#dadada" unCheckedColor="#909090" />
|
<JFXCheckBox id="rememberchb" fx:id="savePassword" checkedColor="#5fd97a" contentDisplay="CENTER" layoutX="63.0" layoutY="297.0" prefWidth="144.0" text="Сохранить пароль" textFill="#dadada" unCheckedColor="#909090" />
|
||||||
<JFXComboBox id="authOptions" fx:id="authOptions" focusColor="#5fd97a" layoutX="34.0" layoutY="341.0" prefHeight="25.0" prefWidth="200.0" promptText="Способ авторизации" unFocusColor="#70666600">
|
<JFXComboBox id="authOptions" fx:id="authOptions" focusColor="#5fd97a" layoutX="34.0" layoutY="341.0" prefHeight="25.0" prefWidth="200.0" promptText="Способ авторизации" unFocusColor="#70666600">
|
||||||
<styleClass>
|
<styleClass>
|
||||||
|
|
|
@ -121,12 +121,23 @@ .auth {
|
||||||
-fx-background-radius: 0;
|
-fx-background-radius: 0;
|
||||||
-fx-background-color: #5fd97a;
|
-fx-background-color: #5fd97a;
|
||||||
-fx-text-fill: #ffffff;
|
-fx-text-fill: #ffffff;
|
||||||
-fx-pref-width: 200px;
|
-fx-pref-width: 145px;
|
||||||
-fx-pref-height: 45px;
|
-fx-pref-height: 45px;
|
||||||
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15,0,0,3);
|
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15,0,0,3);
|
||||||
}
|
}
|
||||||
|
.vkauth {
|
||||||
|
-jfx-button-type: FLAT;
|
||||||
|
-fx-background-radius: 0;
|
||||||
|
-fx-font-size: 0pt;
|
||||||
|
-fx-background-image: url('images/icons/vk.png');
|
||||||
|
-fx-background-repeat: no-repeat;
|
||||||
|
-fx-pref-width: 55px;
|
||||||
|
-fx-pref-height: 55px;
|
||||||
|
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15,0,0,3);
|
||||||
|
}
|
||||||
|
|
||||||
.auth:hover, .auth:pressed { -fx-background-color: #75e18c; }
|
.auth:hover, .auth:pressed { -fx-background-color: #75e18c; }
|
||||||
|
.vkauth:hover, .vkauth:pressed { -fx-background-color: #75e18c; }
|
||||||
|
|
||||||
#password, #login {
|
#password, #login {
|
||||||
-fx-background-radius: 0;
|
-fx-background-radius: 0;
|
||||||
|
|
|
@ -19,6 +19,7 @@ var RequestType = RequestTypeClass.static;
|
||||||
var RequestException = RequestExceptionClass.static;
|
var RequestException = RequestExceptionClass.static;
|
||||||
//var PingRequest = PingRequestClass.static;
|
//var PingRequest = PingRequestClass.static;
|
||||||
var AuthRequest = AuthRequestClass.static;
|
var AuthRequest = AuthRequestClass.static;
|
||||||
|
var OAuthRequest = OAuthRequestClass.static;
|
||||||
var JoinServerRequest = JoinServerRequestClass.static;
|
var JoinServerRequest = JoinServerRequestClass.static;
|
||||||
var CheckServerRequest = CheckServerRequestClass.static;
|
var CheckServerRequest = CheckServerRequestClass.static;
|
||||||
var UpdateRequest = UpdateRequestClass.static;
|
var UpdateRequest = UpdateRequestClass.static;
|
||||||
|
|
Loading…
Reference in a new issue