Moved getting firebase config to API method /api/2.0/settings.json
This commit is contained in:
parent
1c0e201c2c
commit
b4c4625f3f
@ -1,60 +1,60 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft": "Warning",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
},
|
||||
"EventLog": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
},
|
||||
"EventLog": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.Hosting.Lifetime": "Information"
|
||||
}
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*",
|
||||
"core": {
|
||||
"base-domain": "",
|
||||
"machinekey": "1123askdasjklasbnd",
|
||||
"notify": {
|
||||
"postman": "log"
|
||||
"AllowedHosts": "*",
|
||||
"core": {
|
||||
"base-domain": "",
|
||||
"machinekey": "1123askdasjklasbnd",
|
||||
"notify": {
|
||||
"postman": "log"
|
||||
},
|
||||
"payment": {
|
||||
"delay": "10",
|
||||
"partners": "https://partners.teamlab.info/api",
|
||||
"region": "test",
|
||||
"test": true
|
||||
},
|
||||
"personal": true,
|
||||
"products": {
|
||||
"folder": "../../products",
|
||||
"subfolder": "Server"
|
||||
}
|
||||
},
|
||||
"payment": {
|
||||
"delay": "10",
|
||||
"partners": "https://partners.teamlab.info/api",
|
||||
"region": "test",
|
||||
"test": true
|
||||
"license": {
|
||||
"file": {
|
||||
"path": ""
|
||||
}
|
||||
},
|
||||
"personal": true,
|
||||
"products": {
|
||||
"folder": "../../products",
|
||||
"subfolder": "Server"
|
||||
}
|
||||
},
|
||||
"license": {
|
||||
"file": {
|
||||
"path": ""
|
||||
}
|
||||
},
|
||||
"mail": {
|
||||
"certificate-permit": false,
|
||||
"daemon-email": "mail-daemon@onlyoffice.com",
|
||||
"server-mailbox-limit-per-user": 2
|
||||
},
|
||||
"messaging": {
|
||||
"enabled": "enabled"
|
||||
},
|
||||
"version": {
|
||||
"release": {
|
||||
"date": "",
|
||||
"sign": ""
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"thirdparty": {
|
||||
"mail": {
|
||||
"certificate-permit": false,
|
||||
"daemon-email": "mail-daemon@onlyoffice.com",
|
||||
"server-mailbox-limit-per-user": 2
|
||||
},
|
||||
"messaging": {
|
||||
"enabled": "enabled"
|
||||
},
|
||||
"version": {
|
||||
"release": {
|
||||
"date": "",
|
||||
"sign": ""
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"thirdparty": {
|
||||
"enable": [ "box", "dropboxv2", "docusign", "google", "onedrive", "sharepoint", "nextcloud", "owncloud", "webdav", "kdrive", "yandex" ]
|
||||
},
|
||||
"docservice": {
|
||||
},
|
||||
"docservice": {
|
||||
"coauthor-docs": [ ".pptx", ".ppsx", ".xlsx", ".csv", ".docx", ".txt" ],
|
||||
"commented-docs": [ ".docx", ".xlsx", ".pptx" ],
|
||||
"convert-docs": [ ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".rtf" ],
|
||||
@ -64,85 +64,94 @@
|
||||
"customfilter-docs": [ ".xlsx" ],
|
||||
"reviewed-docs": [ ".docx" ],
|
||||
"viewed-docs": [ ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".gslides", ".xlsx", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".gsheet", ".csv", ".docx", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".gdoc", ".txt", ".rtf", ".mht", ".html", ".htm", ".epub", ".pdf", ".djvu", ".xps" ],
|
||||
"secret": {
|
||||
"value": "",
|
||||
"header": ""
|
||||
},
|
||||
"url": {
|
||||
"public": "http://localhost:8085/",
|
||||
"internal": "",
|
||||
"portal": ""
|
||||
}
|
||||
},
|
||||
"ffmpeg": {
|
||||
"value": "",
|
||||
"secret": {
|
||||
"value": "",
|
||||
"header": ""
|
||||
},
|
||||
"url": {
|
||||
"public": "http://localhost:8085/",
|
||||
"internal": "",
|
||||
"portal": ""
|
||||
}
|
||||
},
|
||||
"ffmpeg": {
|
||||
"value": "",
|
||||
"exts": [ "avi", "mpeg", "mpg", "wmv" ]
|
||||
},
|
||||
"uploader": {
|
||||
"chunk-size": 10485760,
|
||||
"url": "products/files/"
|
||||
},
|
||||
},
|
||||
"uploader": {
|
||||
"chunk-size": 10485760,
|
||||
"url": "products/files/"
|
||||
},
|
||||
"viewed-images": [ ".bmp", ".gif", ".jpeg", ".jpg", ".png", ".ico", ".tif", ".tiff", ".webp" ],
|
||||
"viewed-media": [ ".aac", ".flac", ".m4a", ".mp3", ".oga", ".ogg", ".wav", ".f4v", ".m4v", ".mov", ".mp4", ".ogv", ".webm" ],
|
||||
"index": [ ".pptx", ".xlsx", ".docx" ]
|
||||
},
|
||||
"web": {
|
||||
"api": "api/2.0",
|
||||
"alias": {
|
||||
"min": ""
|
||||
},
|
||||
"images": "images",
|
||||
"hide-settings": "Monitoring,LdapSettings,DocService,MailService,PublicPortal,ProxyHttpContent,SpamSubscription,FullTextSearch",
|
||||
"hub": {
|
||||
"url": "/socketio/socket.io/",
|
||||
"internal": "http://localhost:9899/"
|
||||
"web": {
|
||||
"api": "api/2.0",
|
||||
"alias": {
|
||||
"min": ""
|
||||
},
|
||||
"images": "images",
|
||||
"hide-settings": "Monitoring,LdapSettings,DocService,MailService,PublicPortal,ProxyHttpContent,SpamSubscription,FullTextSearch",
|
||||
"hub": {
|
||||
"url": "/socketio/socket.io/",
|
||||
"internal": "http://localhost:9899/"
|
||||
},
|
||||
"cultures": "en-US,ru-RU,de-DE,it-IT,fr-FR,pt-BR",
|
||||
"url-shortener": {
|
||||
"value": "/sh/",
|
||||
"internal": "http://localhost:9999/"
|
||||
},
|
||||
"controlpanel": {
|
||||
"url": ""
|
||||
},
|
||||
"support-feedback": "https://helpdesk.onlyoffice.com",
|
||||
"teamlab-site": "http://www.onlyoffice.com"
|
||||
},
|
||||
"cultures": "en-US,ru-RU,de-DE,it-IT,fr-FR,pt-BR",
|
||||
"url-shortener": {
|
||||
"value": "/sh/",
|
||||
"internal": "http://localhost:9999/"
|
||||
"ConnectionStrings": {
|
||||
"default": {
|
||||
"name": "default",
|
||||
"connectionString": "Server=localhost;Database=onlyoffice;User ID=dev;Password=dev;Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=True",
|
||||
"providerName": "MySql.Data.MySqlClient"
|
||||
},
|
||||
"postgre": {
|
||||
"name": "postgre",
|
||||
"connectionString": "Host=localhost;Port=5432;Database=onlyoffice;Username=postgres;Password=dev;",
|
||||
"providerName": "Npgsql"
|
||||
},
|
||||
"mysql": {
|
||||
"name": "mysql",
|
||||
"connectionString": "Server=localhost;Database=onlyoffice;User ID=dev;Password=dev;Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=True",
|
||||
"providerName": "MySql.Data.MySqlClient"
|
||||
}
|
||||
},
|
||||
"controlpanel": {
|
||||
"url": ""
|
||||
"migration": {
|
||||
"enabled": "false"
|
||||
},
|
||||
"support-feedback": "https://helpdesk.onlyoffice.com",
|
||||
"teamlab-site": "http://www.onlyoffice.com"
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"default": {
|
||||
"name": "default",
|
||||
"connectionString": "Server=localhost;Database=onlyoffice;User ID=dev;Password=dev;Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=True",
|
||||
"providerName": "MySql.Data.MySqlClient"
|
||||
"DbProviderFactories": {
|
||||
"mysql": {
|
||||
"name": "MySQL Data Provider",
|
||||
"invariant": "MySql.Data.MySqlClient",
|
||||
"description": ".Net Framework Data Provider for MySQL",
|
||||
"type": "MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data"
|
||||
}
|
||||
},
|
||||
"postgre": {
|
||||
"name": "postgre",
|
||||
"connectionString": "Host=localhost;Port=5432;Database=onlyoffice;Username=postgres;Password=dev;",
|
||||
"providerName": "Npgsql"
|
||||
"bookmarking": {
|
||||
"thumbnail-url": "http://localhost:9800/?url={0}"
|
||||
},
|
||||
"mysql": {
|
||||
"name": "mysql",
|
||||
"connectionString": "Server=localhost;Database=onlyoffice;User ID=dev;Password=dev;Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=True",
|
||||
"providerName": "MySql.Data.MySqlClient"
|
||||
"storage": {
|
||||
"encryption": {
|
||||
"progressfile": "false",
|
||||
"tempdir": ""
|
||||
}
|
||||
},
|
||||
"firebase": {
|
||||
"apiKey": "",
|
||||
"authDomain": "",
|
||||
"projectId": "",
|
||||
"storageBucket": "",
|
||||
"messagingSenderId": "",
|
||||
"appId": "",
|
||||
"measurementId": ""
|
||||
}
|
||||
},
|
||||
"migration": {
|
||||
"enabled": "false"
|
||||
},
|
||||
"DbProviderFactories": {
|
||||
"mysql": {
|
||||
"name": "MySQL Data Provider",
|
||||
"invariant": "MySql.Data.MySqlClient",
|
||||
"description": ".Net Framework Data Provider for MySQL",
|
||||
"type": "MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data"
|
||||
}
|
||||
},
|
||||
"bookmarking": {
|
||||
"thumbnail-url": "http://localhost:9800/?url={0}"
|
||||
},
|
||||
"storage": {
|
||||
"encryption": {
|
||||
"progressfile": "false",
|
||||
"tempdir": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@ import { makeAutoObservable } from "mobx";
|
||||
import api from "../api";
|
||||
import { ARTICLE_PINNED_KEY, LANGUAGE } from "../constants";
|
||||
import { combineUrl } from "../utils";
|
||||
import FirebaseHelper from "../utils/firebase";
|
||||
import { AppServerConfig } from "../constants";
|
||||
const { proxyURL } = AppServerConfig;
|
||||
|
||||
@ -72,6 +73,15 @@ class SettingsStore {
|
||||
hasShortenService = false;
|
||||
|
||||
customSchemaList = [];
|
||||
firebase = {
|
||||
apiKey: "",
|
||||
authDomain: "",
|
||||
projectId: "",
|
||||
storageBucket: "",
|
||||
messagingSenderId: "",
|
||||
appId: "",
|
||||
measurementId: "",
|
||||
};
|
||||
|
||||
constructor() {
|
||||
makeAutoObservable(this);
|
||||
@ -292,6 +302,10 @@ class SettingsStore {
|
||||
setArticleVisibleOnUnpin = (visible) => {
|
||||
this.isArticleVisibleOnUnpin = visible;
|
||||
};
|
||||
|
||||
get firebaseHelper() {
|
||||
return new FirebaseHelper(this.firebase);
|
||||
}
|
||||
}
|
||||
|
||||
export default SettingsStore;
|
||||
|
@ -1,10 +1,12 @@
|
||||
import firebase from "firebase/app";
|
||||
import "firebase/remote-config";
|
||||
import firebaseConfig from "../../firebase.json";
|
||||
|
||||
class FirebaseHelper {
|
||||
remoteConfig = null;
|
||||
constructor() {
|
||||
firebaseConfig = null;
|
||||
constructor(settings) {
|
||||
this.firebaseConfig = settings;
|
||||
|
||||
if (!this.isEnabled) return;
|
||||
firebase.initializeApp(this.config);
|
||||
|
||||
@ -30,7 +32,7 @@ class FirebaseHelper {
|
||||
}
|
||||
|
||||
get config() {
|
||||
return firebaseConfig;
|
||||
return this.firebaseConfig;
|
||||
}
|
||||
|
||||
get isEnabled() {
|
||||
@ -82,4 +84,4 @@ class FirebaseHelper {
|
||||
}
|
||||
}
|
||||
|
||||
export default new FirebaseHelper();
|
||||
export default FirebaseHelper;
|
@ -313,6 +313,17 @@ namespace ASC.Api.Settings
|
||||
settings.UtcHoursOffset = settings.UtcOffset.TotalHours;
|
||||
settings.OwnerId = Tenant.OwnerId;
|
||||
settings.NameSchemaId = CustomNamingPeople.Current.Id;
|
||||
|
||||
settings.Firebase = new FirebaseWrapper
|
||||
{
|
||||
ApiKey = Configuration["firebase:apiKey"] ?? "",
|
||||
AuthDomain = Configuration["firebase:authDomain"] ?? "",
|
||||
ProjectId = Configuration["firebase:projectId"] ?? "",
|
||||
StorageBucket = Configuration["firebase:storageBucket"] ?? "",
|
||||
MessagingSenderId = Configuration["firebase:messagingSenderId"] ?? "",
|
||||
AppId = Configuration["firebase:appId"] ?? "",
|
||||
MeasurementId = Configuration["firebase:measurementId"] ?? ""
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -345,7 +356,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Create("messagesettings")]
|
||||
public object EnableAdminMessageSettingsFromBody([FromBody]AdminMessageSettingsModel model)
|
||||
public object EnableAdminMessageSettingsFromBody([FromBody] AdminMessageSettingsModel model)
|
||||
{
|
||||
return EnableAdminMessageSettings(model);
|
||||
}
|
||||
@ -370,7 +381,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
[AllowAnonymous]
|
||||
[Create("sendadmmail")]
|
||||
public object SendAdmMailFromBody([FromBody]AdminMessageSettingsModel model)
|
||||
public object SendAdmMailFromBody([FromBody] AdminMessageSettingsModel model)
|
||||
{
|
||||
return SendAdmMail(model);
|
||||
}
|
||||
@ -450,7 +461,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
[AllowAnonymous]
|
||||
[Create("sendjoininvite")]
|
||||
public object SendJoinInviteMailFromBody([FromBody]AdminMessageSettingsModel model)
|
||||
public object SendJoinInviteMailFromBody([FromBody] AdminMessageSettingsModel model)
|
||||
{
|
||||
return SendJoinInviteMail(model);
|
||||
}
|
||||
@ -575,9 +586,9 @@ namespace ASC.Api.Settings
|
||||
{
|
||||
PermissionContext.DemandPermissions(SecutiryConstants.EditPortalSettings);
|
||||
|
||||
var usrCaption = (model.UserCaption ?? "").Trim();
|
||||
var usrCaption = (model.UserCaption ?? "").Trim();
|
||||
var usrsCaption = (model.UsersCaption ?? "").Trim();
|
||||
var grpCaption = (model.GroupCaption ?? "").Trim();
|
||||
var grpCaption = (model.GroupCaption ?? "").Trim();
|
||||
var grpsCaption = (model.GroupsCaption ?? "").Trim();
|
||||
var usrStatusCaption = (model.UserPostCaption ?? "").Trim();
|
||||
var regDateCaption = (model.RegDateCaption ?? "").Trim();
|
||||
@ -695,14 +706,14 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Create("greetingsettings")]
|
||||
public ContentResult SaveGreetingSettingsFromBody([FromBody]GreetingSettingsModel model)
|
||||
public ContentResult SaveGreetingSettingsFromBody([FromBody] GreetingSettingsModel model)
|
||||
{
|
||||
return SaveGreetingSettings(model);
|
||||
}
|
||||
|
||||
[Create("greetingsettings")]
|
||||
[Consumes("application/x-www-form-urlencoded")]
|
||||
public ContentResult SaveGreetingSettingsFromForm([FromForm]GreetingSettingsModel model)
|
||||
public ContentResult SaveGreetingSettingsFromForm([FromForm] GreetingSettingsModel model)
|
||||
{
|
||||
return SaveGreetingSettings(model);
|
||||
}
|
||||
@ -780,7 +791,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("version")]
|
||||
public TenantVersionWrapper SetVersionFromBody([FromBody]SettingsModel model)
|
||||
public TenantVersionWrapper SetVersionFromBody([FromBody] SettingsModel model)
|
||||
{
|
||||
return SetVersion(model);
|
||||
}
|
||||
@ -803,7 +814,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Read("security")]
|
||||
public IEnumerable<SecurityWrapper> GetWebItemSecurityInfo([FromQuery]IEnumerable<string> ids)
|
||||
public IEnumerable<SecurityWrapper> GetWebItemSecurityInfo([FromQuery] IEnumerable<string> ids)
|
||||
{
|
||||
if (ids == null || !ids.Any())
|
||||
{
|
||||
@ -856,7 +867,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("security")]
|
||||
public IEnumerable<SecurityWrapper> SetWebItemSecurityFromBody([FromBody]WebItemSecurityModel model)
|
||||
public IEnumerable<SecurityWrapper> SetWebItemSecurityFromBody([FromBody] WebItemSecurityModel model)
|
||||
{
|
||||
return SetWebItemSecurity(model);
|
||||
}
|
||||
@ -902,7 +913,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("security/access")]
|
||||
public IEnumerable<SecurityWrapper> SetAccessToWebItemsFromBody([FromBody]WebItemSecurityModel model)
|
||||
public IEnumerable<SecurityWrapper> SetAccessToWebItemsFromBody([FromBody] WebItemSecurityModel model)
|
||||
{
|
||||
return SetAccessToWebItems(model);
|
||||
}
|
||||
@ -976,7 +987,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("security/administrator")]
|
||||
public object SetProductAdministratorFromBody([FromBody]SecurityModel model)
|
||||
public object SetProductAdministratorFromBody([FromBody] SecurityModel model)
|
||||
{
|
||||
return SetProductAdministrator(model);
|
||||
}
|
||||
@ -1270,7 +1281,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("iprestrictions")]
|
||||
public IEnumerable<string> SaveIpRestrictionsFromBody([FromBody]IpRestrictionsModel model)
|
||||
public IEnumerable<string> SaveIpRestrictionsFromBody([FromBody] IpRestrictionsModel model)
|
||||
{
|
||||
return SaveIpRestrictions(model);
|
||||
}
|
||||
@ -1289,7 +1300,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("iprestrictions/settings")]
|
||||
public IPRestrictionsSettings UpdateIpRestrictionsSettingsFromBody([FromBody]IpRestrictionsModel model)
|
||||
public IPRestrictionsSettings UpdateIpRestrictionsSettingsFromBody([FromBody] IpRestrictionsModel model)
|
||||
{
|
||||
return UpdateIpRestrictionsSettings(model);
|
||||
}
|
||||
@ -1312,7 +1323,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("tips")]
|
||||
public TipsSettings UpdateTipsSettingsFromBody([FromBody]SettingsModel model)
|
||||
public TipsSettings UpdateTipsSettingsFromBody([FromBody] SettingsModel model)
|
||||
{
|
||||
return UpdateTipsSettings(model);
|
||||
}
|
||||
@ -1323,7 +1334,7 @@ namespace ASC.Api.Settings
|
||||
{
|
||||
return UpdateTipsSettings(model);
|
||||
}
|
||||
|
||||
|
||||
private TipsSettings UpdateTipsSettings(SettingsModel model)
|
||||
{
|
||||
var settings = new TipsSettings { Show = model.Show };
|
||||
@ -1359,7 +1370,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
[Update("wizard/complete", Check = false)]
|
||||
[Authorize(AuthenticationSchemes = "confirm", Roles = "Wizard")]
|
||||
public WizardSettings CompleteWizardFromBody([FromBody]WizardModel wizardModel)
|
||||
public WizardSettings CompleteWizardFromBody([FromBody] WizardModel wizardModel)
|
||||
{
|
||||
return CompleteWizard(wizardModel);
|
||||
}
|
||||
@ -1451,7 +1462,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("tfaapp")]
|
||||
public bool TfaSettingsFromBody([FromBody]TfaModel model)
|
||||
public bool TfaSettingsFromBody([FromBody] TfaModel model)
|
||||
{
|
||||
return TfaSettingsUpdate(model);
|
||||
}
|
||||
@ -1462,7 +1473,7 @@ namespace ASC.Api.Settings
|
||||
{
|
||||
return TfaSettingsUpdate(model);
|
||||
}
|
||||
|
||||
|
||||
private bool TfaSettingsUpdate(TfaModel model)
|
||||
{
|
||||
PermissionContext.DemandPermissions(SecutiryConstants.EditPortalSettings);
|
||||
@ -1547,7 +1558,7 @@ namespace ASC.Api.Settings
|
||||
ApiContext.AuthByClaim();
|
||||
var currentUser = UserManager.GetUsers(AuthContext.CurrentAccount.ID);
|
||||
|
||||
if (!TfaAppAuthSettings.IsVisibleSettings ||
|
||||
if (!TfaAppAuthSettings.IsVisibleSettings ||
|
||||
!SettingsManager.Load<TfaAppAuthSettings>().EnableSetting ||
|
||||
TfaAppUserSettings.EnableForUser(SettingsManager, currentUser.ID))
|
||||
throw new Exception(Resource.TfaAppNotAvailable);
|
||||
@ -1589,7 +1600,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("tfaappnewapp")]
|
||||
public object TfaAppNewAppFromBody([FromBody(EmptyBodyBehavior = EmptyBodyBehavior.Allow)]TfaModel model)
|
||||
public object TfaAppNewAppFromBody([FromBody(EmptyBodyBehavior = EmptyBodyBehavior.Allow)] TfaModel model)
|
||||
{
|
||||
return TfaAppNewApp(model);
|
||||
}
|
||||
@ -1646,7 +1657,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
///<visible>false</visible>
|
||||
[Update("colortheme")]
|
||||
public void SaveColorThemeFromBody([FromBody]SettingsModel model)
|
||||
public void SaveColorThemeFromBody([FromBody] SettingsModel model)
|
||||
{
|
||||
SaveColorTheme(model);
|
||||
}
|
||||
@ -1667,7 +1678,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
///<visible>false</visible>
|
||||
[Update("timeandlanguage")]
|
||||
public object TimaAndLanguageFromBody([FromBody]SettingsModel model)
|
||||
public object TimaAndLanguageFromBody([FromBody] SettingsModel model)
|
||||
{
|
||||
return TimaAndLanguage(model);
|
||||
}
|
||||
@ -1721,7 +1732,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Create("owner")]
|
||||
public object SendOwnerChangeInstructionsFromBody([FromBody]SettingsModel model)
|
||||
public object SendOwnerChangeInstructionsFromBody([FromBody] SettingsModel model)
|
||||
{
|
||||
return SendOwnerChangeInstructions(model);
|
||||
}
|
||||
@ -1759,7 +1770,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
[Update("owner")]
|
||||
[Authorize(AuthenticationSchemes = "confirm", Roles = "PortalOwnerChange")]
|
||||
public void OwnerFromBody([FromBody]SettingsModel model)
|
||||
public void OwnerFromBody([FromBody] SettingsModel model)
|
||||
{
|
||||
Owner(model);
|
||||
}
|
||||
@ -1801,7 +1812,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
///<visible>false</visible>
|
||||
[Update("defaultpage")]
|
||||
public object SaveDefaultPageSettingsFromBody([FromBody]SettingsModel model)
|
||||
public object SaveDefaultPageSettingsFromBody([FromBody] SettingsModel model)
|
||||
{
|
||||
return SaveDefaultPageSettings(model);
|
||||
}
|
||||
@ -1987,7 +1998,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Create("customnavigation/create")]
|
||||
public CustomNavigationItem CreateCustomNavigationItemFromBody([FromBody]CustomNavigationItem item)
|
||||
public CustomNavigationItem CreateCustomNavigationItemFromBody([FromBody] CustomNavigationItem item)
|
||||
{
|
||||
return CreateCustomNavigationItem(item);
|
||||
}
|
||||
@ -2069,7 +2080,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("emailactivation")]
|
||||
public EmailActivationSettings UpdateEmailActivationSettingsFromBody([FromBody]EmailActivationSettings settings)
|
||||
public EmailActivationSettings UpdateEmailActivationSettingsFromBody([FromBody] EmailActivationSettings settings)
|
||||
{
|
||||
SettingsManager.SaveForCurrentUser(settings);
|
||||
return settings;
|
||||
@ -2077,7 +2088,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
[Update("emailactivation")]
|
||||
[Consumes("application/x-www-form-urlencoded")]
|
||||
public EmailActivationSettings UpdateEmailActivationSettingsFromForm([FromForm]EmailActivationSettings settings)
|
||||
public EmailActivationSettings UpdateEmailActivationSettingsFromForm([FromForm] EmailActivationSettings settings)
|
||||
{
|
||||
SettingsManager.SaveForCurrentUser(settings);
|
||||
return settings;
|
||||
@ -2199,7 +2210,7 @@ namespace ASC.Api.Settings
|
||||
public readonly object Locker = new object();
|
||||
|
||||
[Create("encryption/start")]
|
||||
public bool StartStorageEncryptionFromBody([FromBody]StorageEncryptionModel storageEncryption)
|
||||
public bool StartStorageEncryptionFromBody([FromBody] StorageEncryptionModel storageEncryption)
|
||||
{
|
||||
return StartStorageEncryption(storageEncryption);
|
||||
}
|
||||
@ -2405,7 +2416,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("storage")]
|
||||
public StorageSettings UpdateStorageFromBody([FromBody]StorageModel model)
|
||||
public StorageSettings UpdateStorageFromBody([FromBody] StorageModel model)
|
||||
{
|
||||
return UpdateStorage(model);
|
||||
}
|
||||
@ -2485,7 +2496,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Update("storage/cdn")]
|
||||
public CdnStorageSettings UpdateCdnFromBody([FromBody]StorageModel model)
|
||||
public CdnStorageSettings UpdateCdnFromBody([FromBody] StorageModel model)
|
||||
{
|
||||
return UpdateCdn(model);
|
||||
}
|
||||
@ -2603,7 +2614,7 @@ namespace ASC.Api.Settings
|
||||
[Consumes("application/x-www-form-urlencoded")]
|
||||
public bool SaveCompanyWhiteLabelSettingsFromForm([FromForm] CompanyWhiteLabelSettingsWrapper companyWhiteLabelSettingsWrapper)
|
||||
{
|
||||
return SaveCompanyWhiteLabelSettings(companyWhiteLabelSettingsWrapper);
|
||||
return SaveCompanyWhiteLabelSettings(companyWhiteLabelSettingsWrapper);
|
||||
}
|
||||
|
||||
private bool SaveCompanyWhiteLabelSettings(CompanyWhiteLabelSettingsWrapper companyWhiteLabelSettingsWrapper)
|
||||
@ -2640,7 +2651,7 @@ namespace ASC.Api.Settings
|
||||
|
||||
///<visible>false</visible>
|
||||
[Create("rebranding/additional")]
|
||||
public bool SaveAdditionalWhiteLabelSettingsFromBody([FromBody]AdditionalWhiteLabelSettingsWrapper wrapper)
|
||||
public bool SaveAdditionalWhiteLabelSettingsFromBody([FromBody] AdditionalWhiteLabelSettingsWrapper wrapper)
|
||||
{
|
||||
return SaveAdditionalWhiteLabelSettings(wrapper);
|
||||
}
|
||||
@ -2649,7 +2660,7 @@ namespace ASC.Api.Settings
|
||||
[Consumes("application/x-www-form-urlencoded")]
|
||||
public bool SaveAdditionalWhiteLabelSettingsFromForm([FromForm] AdditionalWhiteLabelSettingsWrapper wrapper)
|
||||
{
|
||||
return SaveAdditionalWhiteLabelSettings(wrapper);
|
||||
return SaveAdditionalWhiteLabelSettings(wrapper);
|
||||
}
|
||||
|
||||
private bool SaveAdditionalWhiteLabelSettings(AdditionalWhiteLabelSettingsWrapper wrapper)
|
||||
@ -2708,14 +2719,14 @@ namespace ASC.Api.Settings
|
||||
|
||||
///<visible>false</visible>
|
||||
[Update("rebranding/mail")]
|
||||
public bool UpdateMailWhiteLabelSettingsFromBody([FromBody]MailWhiteLabelSettingsModel model)
|
||||
public bool UpdateMailWhiteLabelSettingsFromBody([FromBody] MailWhiteLabelSettingsModel model)
|
||||
{
|
||||
return UpdateMailWhiteLabelSettings(model);
|
||||
}
|
||||
|
||||
[Update("rebranding/mail")]
|
||||
[Consumes("application/x-www-form-urlencoded")]
|
||||
public bool UpdateMailWhiteLabelSettingsFromForm([FromForm]MailWhiteLabelSettingsModel model)
|
||||
public bool UpdateMailWhiteLabelSettingsFromForm([FromForm] MailWhiteLabelSettingsModel model)
|
||||
{
|
||||
return UpdateMailWhiteLabelSettings(model);
|
||||
}
|
||||
@ -2779,7 +2790,7 @@ namespace ASC.Api.Settings
|
||||
}
|
||||
|
||||
[Create("authservice")]
|
||||
public bool SaveAuthKeysFromBody([FromBody]AuthServiceModel model)
|
||||
public bool SaveAuthKeysFromBody([FromBody] AuthServiceModel model)
|
||||
{
|
||||
return SaveAuthKeys(model);
|
||||
}
|
||||
|
21
web/ASC.Web.Api/Models/FirebaseWrapper.cs
Normal file
21
web/ASC.Web.Api/Models/FirebaseWrapper.cs
Normal file
@ -0,0 +1,21 @@
|
||||
|
||||
namespace ASC.Web.Api.Models
|
||||
{
|
||||
public class FirebaseWrapper
|
||||
{
|
||||
public string ApiKey { get; set; }
|
||||
|
||||
public string AuthDomain { get; set; }
|
||||
|
||||
public string ProjectId { get; set; }
|
||||
|
||||
public string StorageBucket { get; set; }
|
||||
|
||||
public string MessagingSenderId { get; set; }
|
||||
|
||||
public string AppId { get; set; }
|
||||
|
||||
public string MeasurementId { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -29,6 +29,7 @@ using System.Collections.Generic;
|
||||
|
||||
using ASC.Core.Tenants;
|
||||
using ASC.Security.Cryptography;
|
||||
using ASC.Web.Api.Models;
|
||||
|
||||
namespace ASC.Api.Settings
|
||||
{
|
||||
@ -64,6 +65,8 @@ namespace ASC.Api.Settings
|
||||
|
||||
public PasswordHasher PasswordHash { get; set; }
|
||||
|
||||
public FirebaseWrapper Firebase { get; set; }
|
||||
|
||||
public static SettingsWrapper GetSample()
|
||||
{
|
||||
return new SettingsWrapper
|
||||
|
@ -1,10 +0,0 @@
|
||||
{
|
||||
"apiKey": "",
|
||||
"authDomain": "",
|
||||
"databaseURL": "",
|
||||
"projectId": "",
|
||||
"storageBucket": "",
|
||||
"messagingSenderId": "",
|
||||
"appId": "",
|
||||
"measurementId": ""
|
||||
}
|
@ -21,10 +21,8 @@ import i18n from "./i18n";
|
||||
import AppLoader from "@appserver/common/components/AppLoader";
|
||||
import System from "./components/System";
|
||||
import { AppServerConfig } from "@appserver/common/constants";
|
||||
import FirebaseHelper from "./helpers/firebase";
|
||||
import { Snackbar } from "@appserver/components/snackbar";
|
||||
import moment from "moment";
|
||||
import { isMobile } from "react-device-detect";
|
||||
|
||||
const { proxyURL } = AppServerConfig;
|
||||
const homepage = config.homepage;
|
||||
@ -148,7 +146,14 @@ const MyProfileRoute = (props) => (
|
||||
);
|
||||
|
||||
const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
const { isLoaded, loadBaseInfo, modules, isDesktop, language } = rest;
|
||||
const {
|
||||
isLoaded,
|
||||
loadBaseInfo,
|
||||
modules,
|
||||
isDesktop,
|
||||
language,
|
||||
FirebaseHelper,
|
||||
} = rest;
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
@ -243,6 +248,8 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
|
||||
setSnackBarTimer(campaign);
|
||||
|
||||
if (!document.getElementById("main-bar")) return;
|
||||
|
||||
const campaignStr = JSON.stringify(campaign);
|
||||
let skipRender = lastCampaignStr === campaignStr;
|
||||
|
||||
@ -431,6 +438,7 @@ const ShellWrapper = inject(({ auth }) => {
|
||||
isLoaded,
|
||||
modules: auth.moduleStore.modules,
|
||||
isDesktop: auth.settingsStore.isDesktopClient,
|
||||
FirebaseHelper: auth.settingsStore.firebaseHelper,
|
||||
};
|
||||
})(observer(Shell));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user