Shun Miyazawa 3 лет назад
Родитель
Сommit
12f823d636

+ 2 - 0
packages/app/src/interfaces/activity.ts

@@ -70,6 +70,8 @@ export type ISnapshot = Partial<Pick<IUser, 'username'>>
 
 export type IActivity = {
   user?: IUser
+  ip: string
+  path: string
   targetModel?: SupportedTargetModelType
   target?: string
   action?: SupportedActionType

+ 10 - 0
packages/app/src/server/models/activity.ts

@@ -16,6 +16,8 @@ const logger = loggerFactory('growi:models:activity');
 export interface ActivityDocument extends Document {
   _id: Types.ObjectId
   user: Types.ObjectId | any
+  ip: string
+  path: string
   targetModel: string
   target: Types.ObjectId
   action: string
@@ -40,6 +42,14 @@ const activitySchema = new Schema<ActivityDocument, ActivityModel>({
     ref: 'User',
     index: true,
   },
+  ip: {
+    type: String,
+    required: true,
+  },
+  path: {
+    type: String,
+    required: true,
+  },
   targetModel: {
     type: String,
     enum: AllSupportedTargetModelType,