( proDiv: HTMLDivElement, t: (x: TransItemType, vars?: any) => string, app: App, plugin: RemotelySavePlugin, saveUpdatedConfigFunc: () => Promise<any> | undefined, onedriveFullAllowedToUsedDiv: HTMLDivElement, onedriveFullNotShowUpHintSetting: Setting, googleDriveAllowedToUsedDiv: HTMLDivElement, googleDriveNotShowUpHintSetting: Setting, boxAllowedToUsedDiv: HTMLDivElement, boxNotShowUpHintSetting: Setting, pCloudAllowedToUsedDiv: HTMLDivElement, pCloudNotShowUpHintSetting: Setting, yandexDiskAllowedToUsedDiv: HTMLDivElement, yandexDiskNotShowUpHintSetting: Setting, koofrAllowedToUsedDiv: HTMLDivElement, koofrNotShowUpHintSetting: Setting, azureBlobStorageAllowedToUsedDiv: HTMLDivElement, azureBlobStorageNotShowUpHintSetting: Setting )
| 243 | }; |
| 244 | |
| 245 | export const generateProSettingsPart = ( |
| 246 | proDiv: HTMLDivElement, |
| 247 | t: (x: TransItemType, vars?: any) => string, |
| 248 | app: App, |
| 249 | plugin: RemotelySavePlugin, |
| 250 | saveUpdatedConfigFunc: () => Promise<any> | undefined, |
| 251 | onedriveFullAllowedToUsedDiv: HTMLDivElement, |
| 252 | onedriveFullNotShowUpHintSetting: Setting, |
| 253 | googleDriveAllowedToUsedDiv: HTMLDivElement, |
| 254 | googleDriveNotShowUpHintSetting: Setting, |
| 255 | boxAllowedToUsedDiv: HTMLDivElement, |
| 256 | boxNotShowUpHintSetting: Setting, |
| 257 | pCloudAllowedToUsedDiv: HTMLDivElement, |
| 258 | pCloudNotShowUpHintSetting: Setting, |
| 259 | yandexDiskAllowedToUsedDiv: HTMLDivElement, |
| 260 | yandexDiskNotShowUpHintSetting: Setting, |
| 261 | koofrAllowedToUsedDiv: HTMLDivElement, |
| 262 | koofrNotShowUpHintSetting: Setting, |
| 263 | azureBlobStorageAllowedToUsedDiv: HTMLDivElement, |
| 264 | azureBlobStorageNotShowUpHintSetting: Setting |
| 265 | ) => { |
| 266 | proDiv |
| 267 | .createEl("h2", { text: t("settings_pro") }) |
| 268 | .setAttribute("id", "settings-pro"); |
| 269 | |
| 270 | proDiv.createEl("div", { |
| 271 | text: stringToFragment(t("settings_pro_tutorial")), |
| 272 | }); |
| 273 | |
| 274 | const proSelectAuthDiv = proDiv.createDiv(); |
| 275 | const proAuthDiv = proSelectAuthDiv.createDiv({ |
| 276 | cls: "pro-auth-button-hide settings-auth-related", |
| 277 | }); |
| 278 | |
| 279 | const proRevokeAuthDiv = proSelectAuthDiv.createDiv({ |
| 280 | cls: "pro-revoke-auth-button-hide settings-auth-related", |
| 281 | }); |
| 282 | |
| 283 | const proFeaturesListSetting = new Setting(proRevokeAuthDiv) |
| 284 | .setName(t("settings_pro_features")) |
| 285 | .setDesc( |
| 286 | stringToFragment( |
| 287 | t("settings_pro_features_desc", { |
| 288 | features: featureListToText(plugin.settings.pro!.enabledProFeatures), |
| 289 | }) |
| 290 | ) |
| 291 | ); |
| 292 | proFeaturesListSetting.addButton(async (button) => { |
| 293 | button.setButtonText(t("settings_pro_features_refresh_button")); |
| 294 | button.onClick(async () => { |
| 295 | new Notice(t("settings_pro_features_refresh_fetch")); |
| 296 | await getAndSaveProFeatures( |
| 297 | plugin.settings.pro!, |
| 298 | plugin.manifest.version, |
| 299 | saveUpdatedConfigFunc |
| 300 | ); |
| 301 | proFeaturesListSetting.setDesc( |
| 302 | stringToFragment( |
no test coverage detected