|
|
@@ -3,6 +3,7 @@ import * as os from 'node:os';
|
|
|
|
|
|
import { IUserHasId } from '~/interfaces/user';
|
|
|
import { ObjectIdLike } from '~/server/interfaces/mongoose-utils';
|
|
|
+import Config from '~/server/models/config';
|
|
|
import { aclService } from '~/server/service/acl';
|
|
|
|
|
|
import {
|
|
|
@@ -13,6 +14,7 @@ import { IUserInfo, UserType } from '../../interfaces/user-info';
|
|
|
import QuestionnaireAnswerStatus from '../models/questionnaire-answer-status';
|
|
|
import QuestionnaireOrder, { QuestionnaireOrderDocument } from '../models/questionnaire-order';
|
|
|
import { isShowableCondition } from '../util/condition';
|
|
|
+import { getOrCreateModel } from '~/server/util/mongoose-utils';
|
|
|
|
|
|
class QuestionnaireService {
|
|
|
|
|
|
@@ -25,13 +27,15 @@ class QuestionnaireService {
|
|
|
|
|
|
async getGrowiInfo(): Promise<IGrowiInfo> {
|
|
|
const User = this.crowi.model('User');
|
|
|
+ const Config = getOrCreateModel('Config', );
|
|
|
|
|
|
const appSiteUrl = this.crowi.appService.getSiteUrl();
|
|
|
const hasher = crypto.createHash('sha256');
|
|
|
hasher.update(appSiteUrl);
|
|
|
const appSiteUrlHashed = hasher.digest('hex');
|
|
|
|
|
|
- const installedAt = this.crowi.configManager.getConfig('crowi', 'app:installed');
|
|
|
+ const appInstalledConfig = await Config.findOne({ ns: 'crowi', key: 'app:installed' });
|
|
|
+ const installedAt = appInstalledConfig != null ? appInstalledConfig.createdAt;
|
|
|
|
|
|
const currentUsersCount = await User.countDocuments();
|
|
|
const currentActiveUsersCount = await User.countActiveUsers();
|