From eac23047b831328ec21e1189f83f55499118ea92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Dias?= Date: Fri, 5 Jul 2024 12:11:10 +0100 Subject: [PATCH] Updated FCM to v1 from legacy and other small fixes --- appdashboard.js | 11 +- changes.json | 6 + index.html | 1 + ip | 0 package.json | 10 +- server/server.js | 13 +- server/servernotification.js | 10 +- v2/api/authTokenGetter.js | 131 ++++++++++++++++ v2/api/builder/apifield.js | 4 +- v2/api/fcmLegacyToV1Converter.js | 259 +++++++++++++++++++++++++++++++ v2/api/sender.js | 18 ++- v2/defineModule.js | 19 +++ v2/google/drive/googledrive.js | 2 +- v2/settings/setting.js | 16 ++ v2/util.js | 2 +- 15 files changed, 484 insertions(+), 18 deletions(-) create mode 100644 ip create mode 100644 v2/api/authTokenGetter.js create mode 100644 v2/api/fcmLegacyToV1Converter.js create mode 100644 v2/defineModule.js diff --git a/appdashboard.js b/appdashboard.js index 9f54611..5a756bf 100644 --- a/appdashboard.js +++ b/appdashboard.js @@ -6,7 +6,7 @@ import './v2/extensions.js'; import { App,RequestLoadDevicesFromServer } from "./v2/app.js"; import {AppHelperSettings} from "./v2/settings/apphelpersettings.js" import { ControlSettings } from "./v2/settings/controlsetting.js"; -import { SettingEncryptionPassword, SettingTheme, SettingThemeAccentColor,SettingCompanionAppPortToReceive, SettingKeyboardShortcutLastCommand, SettingKeyboardShortcutShowWindow, SettingEventGhostNodeRedPort, SettingClipboardSync, SettingCustomActions, SettingUseNativeNotifications, SettingNotificationTimeout, SettingRequireEncryptionForCommandLine, SettingKeyboardShortcutSkipSong, SettingKeyboardShortcutPreviousSong, SettingKeyboardShortcutPlayPause, SettingThemeBackgroundColor, SettingThemeBackgroundPanelColor, SettingThemeTextColor, SettingThemeTextColorOnAccent, SettingAutoLaunch, SettingLaunchMinimized, SettingNotificationsDisplay, SettingShowLinksAsNotificationsOnly, SettingHideTextInNotifications } from "./v2/settings/setting.js"; +import { SettingEncryptionPassword, SettingTheme, SettingThemeAccentColor,SettingCompanionAppPortToReceive, SettingKeyboardShortcutLastCommand, SettingKeyboardShortcutShowWindow, SettingEventGhostNodeRedPort, SettingClipboardSync, SettingClipboardCommand, SettingCustomActions, SettingUseNativeNotifications, SettingNotificationTimeout, SettingRequireEncryptionForCommandLine, SettingKeyboardShortcutSkipSong, SettingKeyboardShortcutPreviousSong, SettingKeyboardShortcutPlayPause, SettingThemeBackgroundColor, SettingThemeBackgroundPanelColor, SettingThemeTextColor, SettingThemeTextColorOnAccent, SettingAutoLaunch, SettingLaunchMinimized, SettingNotificationsDisplay, SettingShowLinksAsNotificationsOnly, SettingHideTextInNotifications } from "./v2/settings/setting.js"; import { AppGCMHandler } from "./v2/gcm/apphelpergcm.js"; import { ControlDialogInput, ControlDialogOk } from "./v2/dialog/controldialog.js"; import { AppContext } from "./v2/appcontext.js"; @@ -192,6 +192,7 @@ export class AppHelperSettingsDashboard extends AppHelperSettings{ ])}), new Tab({title:"Clipboard Sync",controlContent:new ControlSettings([ new SettingClipboardSync({devices}) + // new SettingClipboardCommand() ])}), new Tab({title:"Automation",controlContent:new ControlSettings([ new SettingEventGhostNodeRedPort(), @@ -337,7 +338,7 @@ export class AppDashboard extends App{ } async load(){ AppContext.context.allowUnsecureContent = true; - window.oncontextmenu = () => ServerEventBus.post(new RequestToggleDevOptions()) + window.oncontextmenu = () => ServerEventBus.post(new RequestToggleDevOptions()); // AppGCMHandler.handlePushUrl = (push)=> { // const url = push.url; // if(!url) return; @@ -630,6 +631,12 @@ export class AppDashboard extends App{ const devices = await this.getDevices(deviceIdsToSendTo); console.log("Sending auto clipboard", gcm, devices); await devices.send(gcm); + + // const settingClipboardCommand = new SettingClipboardCommand(); + // const clipboardCommand = await settingClipboardCommand.value; + // if(clipboardCommand){ + // await devices.sendPush({text:clipboardCommand}) + // } } async onRequestRunCommandLineCommand(request){ await ServerEventBus.post(request); diff --git a/changes.json b/changes.json index d88dfbc..600cbd8 100644 --- a/changes.json +++ b/changes.json @@ -1,5 +1,11 @@ { "changes":[ + { + "version": "1.1.3", + "log":[ + "Updated FCM to use v1 instead of legacy" + ] + } , { "version": "1.1.2", "log":[ diff --git a/index.html b/index.html index 6fd678c..427c86b 100644 --- a/index.html +++ b/index.html @@ -35,6 +35,7 @@ +