diff --git a/src/main/java/org/traccar/web/client/i18n/Messages.java b/src/main/java/org/traccar/web/client/i18n/Messages.java index 59385e68..209e0747 100644 --- a/src/main/java/org/traccar/web/client/i18n/Messages.java +++ b/src/main/java/org/traccar/web/client/i18n/Messages.java @@ -289,5 +289,5 @@ public interface Messages extends com.google.gwt.i18n.client.Messages { String event(); - String apiKey(); + String accessToken(); } diff --git a/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.java b/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.java index f5f915b2..652bbe6b 100644 --- a/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.java +++ b/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.java @@ -85,7 +85,7 @@ public interface NotificationSettingsHandler { PasswordField password; @UiField - TextField pushbulletApiKey; + TextField pushbulletAccessToken; @UiField(provided = true) Messages i18n = GWT.create(Messages.class); diff --git a/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.ui.xml b/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.ui.xml index 64f50ccf..02b126be 100644 --- a/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.ui.xml +++ b/src/main/java/org/traccar/web/client/view/NotificationSettingsDialog.ui.xml @@ -19,7 +19,7 @@ - + @@ -87,9 +87,9 @@ - + - + diff --git a/src/main/java/org/traccar/web/server/model/NotificationServiceImpl.java b/src/main/java/org/traccar/web/server/model/NotificationServiceImpl.java index 4ebb0c17..10e56fe6 100644 --- a/src/main/java/org/traccar/web/server/model/NotificationServiceImpl.java +++ b/src/main/java/org/traccar/web/server/model/NotificationServiceImpl.java @@ -320,7 +320,7 @@ private boolean sendEmail(NotificationSettings settings, User user, String subje private boolean sendPushbullet(NotificationSettings settings, User user, String subject, String body) { // perform some validation of Pushbullet settings - if (settings.getPushbulletApiKey() == null || settings.getPushbulletApiKey().trim().isEmpty()) { + if (settings.getPushbulletAccessToken() == null || settings.getPushbulletAccessToken().trim().isEmpty()) { return false; } logger.info("Sending Pushbullet notification to '" + user.getEmail() + "'..."); @@ -331,7 +331,7 @@ private boolean sendPushbullet(NotificationSettings settings, User user, String URL url = new URL("https://api.pushbullet.com/v2/pushes"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); - conn.setRequestProperty("Authorization", "Bearer " + settings.getPushbulletApiKey()); + conn.setRequestProperty("Authorization", "Bearer " + settings.getPushbulletAccessToken()); conn.setRequestProperty("Content-Type", "application/json"); conn.setDoOutput(true); os = conn.getOutputStream(); @@ -450,7 +450,7 @@ public void checkPushbulletSettings(NotificationSettings settings) { URL url = new URL("https://api.pushbullet.com/v2/users/me"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); - conn.setRequestProperty("Authorization", "Bearer " + settings.getPushbulletApiKey()); + conn.setRequestProperty("Authorization", "Bearer " + settings.getPushbulletAccessToken()); is = conn.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is)); try { diff --git a/src/main/java/org/traccar/web/shared/model/NotificationSettings.java b/src/main/java/org/traccar/web/shared/model/NotificationSettings.java index 0fd9df47..2ad0ee4b 100644 --- a/src/main/java/org/traccar/web/shared/model/NotificationSettings.java +++ b/src/main/java/org/traccar/web/shared/model/NotificationSettings.java @@ -153,14 +153,14 @@ public void setSecureConnectionType(SecureConnectionType secureConnectionType) { this.secureConnectionType = secureConnectionType; } - private String pushbulletApiKey; + private String pushbulletAccessToken; - public String getPushbulletApiKey() { - return pushbulletApiKey; + public String getPushbulletAccessToken() { + return pushbulletAccessToken; } - public void setPushbulletApiKey(String pushbulletApiKey) { - this.pushbulletApiKey = pushbulletApiKey; + public void setPushbulletAccessToken(String pushbulletApiKey) { + this.pushbulletAccessToken = pushbulletApiKey; } public void copyFrom(NotificationSettings s) { @@ -171,6 +171,6 @@ public void copyFrom(NotificationSettings s) { setUsername(s.getUsername()); setPassword(s.getPassword()); setSecureConnectionType(s.getSecureConnectionType()); - setPushbulletApiKey(s.getPushbulletApiKey()); + setPushbulletAccessToken(s.getPushbulletAccessToken()); } } diff --git a/src/main/resources/org/traccar/web/client/i18n/Messages.properties b/src/main/resources/org/traccar/web/client/i18n/Messages.properties index 2f8d217d..b0d72074 100644 --- a/src/main/resources/org/traccar/web/client/i18n/Messages.properties +++ b/src/main/resources/org/traccar/web/client/i18n/Messages.properties @@ -133,7 +133,7 @@ testFailed = Test failed. Please check settings. testSucceeded = Test succeeded. email = Email invalidEmail = Invalid Email address -apiKey = API Key +accessToken = Access Token # Archive style menu style = Style fullPalette = Full palette diff --git a/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties b/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties index 6ff1c89e..a8d07445 100644 --- a/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties +++ b/src/main/resources/org/traccar/web/client/i18n/Messages_ru.properties @@ -133,7 +133,7 @@ testFailed = Тест провалился. Проверьте пожалуйс testSucceeded = Тест прошел успешно. email = Эл. почта invalidEmail = Некорректный адрес электронной почты -apiKey = Ключ API +accessToken = Ключ Доступа # Archive style menu style = Стиль fullPalette = Вся палитра