wenlele 2 years ago
parent
commit
40fd58d43d
  1. 2
      api/app/lib/controllers/project/group.js
  2. 172
      api/app/lib/models/app_inspection.js
  3. 2
      web/client/src/layout/components/header/components/customProjGroupModal.jsx

2
api/app/lib/controllers/project/group.js

@ -266,7 +266,7 @@ async function groupStatisticOnline (ctx) {
"range": { "range": {
"collect_time": { "collect_time": {
"gte": `${moment().subtract(24, 'hours').format('YYYY-MM-DDTHH:mm:ss.SSS')}Z`, "gte": `${moment().subtract(24, 'hours').format('YYYY-MM-DDTHH:mm:ss.SSS')}Z`,
"gte": "2023-08-24T08:00:00.000Z", // "gte": "2023-08-24T08:00:00.000Z",
} }
} }
}, },

172
api/app/lib/models/app_inspection.js

@ -2,91 +2,91 @@
'use strict'; 'use strict';
module.exports = dc => { module.exports = dc => {
const DataTypes = dc.ORM; const DataTypes = dc.ORM;
const sequelize = dc.orm; const sequelize = dc.orm;
const AppInspection = sequelize.define("appInspection", { const AppInspection = sequelize.define("appInspection", {
id: { id: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: false, allowNull: false,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: true, primaryKey: true,
field: "id", field: "id",
autoIncrement: true, autoIncrement: true,
unique: "app_inspection_id_uindex" unique: "app_inspection_id_uindex"
}, },
projectAppId: { projectAppId: {
type: DataTypes.INTEGER, type: DataTypes.INTEGER,
allowNull: true, allowNull: true,
defaultValue: null, defaultValue: null,
comment: null, comment: null,
primaryKey: false, primaryKey: false,
field: "project_app_id", field: "project_app_id",
autoIncrement: false, autoIncrement: false,
references: { references: {
key: "id", key: "id",
model: "app" model: "app"
}
},
createTime: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
comment: null,
primaryKey: false,
field: "create_time",
autoIncrement: false
},
screenshot: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "截图存储路径",
primaryKey: false,
field: "screenshot",
autoIncrement: false
},
notedPepUserId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "核验人员",
primaryKey: false,
field: "noted_pep_user_id",
autoIncrement: false
},
notedTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "noted_time",
autoIncrement: false
},
description: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "description",
autoIncrement: false
},
router: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "router",
autoIncrement: false
} }
}, }, {
createTime: { tableName: "app_inspection",
type: DataTypes.DATE, comment: "",
allowNull: false, indexes: []
defaultValue: null, });
comment: null, dc.models.AppInspection = AppInspection;
primaryKey: false, return AppInspection;
field: "create_time",
autoIncrement: false
},
screenshot: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: null,
comment: "截图存储路径",
primaryKey: false,
field: "screenshot",
autoIncrement: false
},
notedPepUserId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
comment: "核验人员",
primaryKey: false,
field: "noted_pep_user_id",
autoIncrement: false
},
notedTime: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "noted_time",
autoIncrement: false
},
description: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "description",
autoIncrement: false
},
router: {
type: DataTypes.STRING,
allowNull: true,
defaultValue: null,
comment: null,
primaryKey: false,
field: "router",
autoIncrement: false
}
}, {
tableName: "app_inspection",
comment: "",
indexes: []
});
dc.models.AppInspection = AppInspection;
return AppInspection;
}; };

2
web/client/src/layout/components/header/components/customProjGroupModal.jsx

@ -52,7 +52,7 @@ const CustomProjGroupModal = (props) => {
}}> }}>
{({ formState, values, formApi }) => ( {({ formState, values, formApi }) => (
<> <>
<Form.Input field='name' label='名称' rules={[{ required: true, message: '请填写自定义分组名称' }]} maxLength={20} /> <Form.Input field='name' label='名称' rules={[{ required: true, message: '请填写自定义分组名称' }]} maxLength={15} />
<Form.Select multiple field="pomsProjectIds" label={{ text: '运维项目' }} style={{ width: '100%' }} rules={[{ required: true, message: '请选择运维项目' }]} > <Form.Select multiple field="pomsProjectIds" label={{ text: '运维项目' }} style={{ width: '100%' }} rules={[{ required: true, message: '请选择运维项目' }]} >
{ {
pomsList.map((item, index) => { pomsList.map((item, index) => {

Loading…
Cancel
Save