Code Monkey home page Code Monkey logo

Comments (3)

TianPangJi avatar TianPangJi commented on May 24, 2024

资产管理好像添加是成功的,获取全部服务器的时候是失效的

资产管理这部分, 目前只有服务器管理是完成的, 目前我本地没有出现您提出的问题. 方便的话可提供一些错误详情, 方便定位

from drf_admin.

godzeo avatar godzeo commented on May 24, 2024
[2021-02-02 11:20:35,689][INFO][middleware.py:62]==>[[zy [Request: GET /api/oauth/info/ {}] [Response: 200 OK {'msg': '成功', 'errors': '', 'code': 200, 'data': {'id': 1, 'username': 'zy', 'name': '', 'avatar': 'http://127.0.0.1:8769/media/avatar/default.png', 'email': '[email protected]', 'permissions': [], 'department': '', 'mobile': ''}}]]]
HTTP GET /api/oauth/info/ 200 [0.04, 127.0.0.1:51406]
[2021-02-02 11:20:35,979][INFO][middleware.py:62]==>[[zy [Request: GET /api/cmdb/assets/status/ {}] [Response: 200 OK {'msg': '成功', 'errors': '', 'code': 200, 'data': {'results': [{'value': 0, 'label': '在线'}, {'value': 1, 'label': '下线'}, {'value': 2, 'label': '未知'}, {'value': 3, 'label': '故障'}, {'value': 4, 'label': '备用'}]}}]]]
[2021-02-02 11:20:35,982][INFO][middleware.py:62]==>[[zy [Request: GET /api/cmdb/servers/ {'page': ['1'], 'size': ['10'], 'search': [''], 'ordering': [''], 'asset_status': ['']}] [Response: 200 OK {'msg': '成功', 'errors': '', 'code': 200, 'data': OrderedDict([('count', 0), ('next', None), ('previous', None), ('results', [])])}]]]
HTTP GET /api/cmdb/assets/status/ 200 [0.03, 127.0.0.1:51409]
HTTP GET /api/cmdb/servers/?page=1&size=10&search=&ordering=&asset_status= 200 [0.03, 127.0.0.1:51406]

image

数据库也成功添加了,但是你的接口取不到servers的数据,显示不出来

下面的网络设备/api/monitor/ip/接口就是正常的

from drf_admin.

TianPangJi avatar TianPangJi commented on May 24, 2024
[2021-02-02 11:20:35,689][INFO][middleware.py:62]==>[[zy [Request: GET /api/oauth/info/ {}] [Response: 200 OK {'msg': '成功', 'errors': '', 'code': 200, 'data': {'id': 1, 'username': 'zy', 'name': '', 'avatar': 'http://127.0.0.1:8769/media/avatar/default.png', 'email': '[email protected]', 'permissions': [], 'department': '', 'mobile': ''}}]]]
HTTP GET /api/oauth/info/ 200 [0.04, 127.0.0.1:51406]
[2021-02-02 11:20:35,979][INFO][middleware.py:62]==>[[zy [Request: GET /api/cmdb/assets/status/ {}] [Response: 200 OK {'msg': '成功', 'errors': '', 'code': 200, 'data': {'results': [{'value': 0, 'label': '在线'}, {'value': 1, 'label': '下线'}, {'value': 2, 'label': '未知'}, {'value': 3, 'label': '故障'}, {'value': 4, 'label': '备用'}]}}]]]
[2021-02-02 11:20:35,982][INFO][middleware.py:62]==>[[zy [Request: GET /api/cmdb/servers/ {'page': ['1'], 'size': ['10'], 'search': [''], 'ordering': [''], 'asset_status': ['']}] [Response: 200 OK {'msg': '成功', 'errors': '', 'code': 200, 'data': OrderedDict([('count', 0), ('next', None), ('previous', None), ('results', [])])}]]]
HTTP GET /api/cmdb/assets/status/ 200 [0.03, 127.0.0.1:51409]
HTTP GET /api/cmdb/servers/?page=1&size=10&search=&ordering=&asset_status= 200 [0.03, 127.0.0.1:51406]

图片

数据库也成功添加了,但是你的接口取不到服务器的数据,显示不出来

下面的网络设备/ api / monitor / ip /接口就是正常的

查看了您的问题,但是我这边并没有遇到这样的情况,您可以通过debug加断点的方式,查询下queryset是否有值,并查看下序列化器中的返回值。

from drf_admin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.