├── cmdb
├── __init__.py
├── templatetags
│ ├── __init__.py
│ └── cmdb_tags.py
├── tests.py
├── context_processors.py
├── cmdb_menu.py
├── model_form.py
├── models.py
└── base_admin.py
├── myproject
├── __init__.py
├── wsgi.py
├── urls.py
├── api.py
└── settings.py
├── echelon
├── templatetags
│ ├── __init__.py
│ └── echelon_changelog.py
├── __init__.py
├── urls.py
├── middleware.py
├── fields.py
└── views.py
├── static
├── plugins
│ ├── fuelux-3.11.0
│ │ ├── CNAME
│ │ ├── markup
│ │ │ ├── infinite-scroll.html
│ │ │ ├── loader.html
│ │ │ ├── combobox-variations.txt
│ │ │ ├── pillbox-variations.txt
│ │ │ ├── wizard-variations.txt
│ │ │ ├── spinbox-variations.txt
│ │ │ ├── placard.html
│ │ │ ├── repeater-variations.txt
│ │ │ ├── checkbox-inline.html
│ │ │ ├── radio-inline.html
│ │ │ ├── selectlist-variations.txt
│ │ │ ├── radio.html
│ │ │ ├── checkbox.html
│ │ │ ├── placard-variations.txt
│ │ │ ├── radio-no-js.html
│ │ │ ├── checkbox-no-js.html
│ │ │ ├── radio-inline-no-js.html
│ │ │ ├── checkbox-inline-no-js.html
│ │ │ ├── search.html
│ │ │ ├── placard-header-footer.html
│ │ │ ├── loader-variations.txt
│ │ │ ├── radio-variations.txt
│ │ │ ├── checkbox-variations.txt
│ │ │ ├── spinbox.html
│ │ │ ├── checkbox-no-js-variations.txt
│ │ │ ├── pillbox.html
│ │ │ ├── radio-no-js-variations.txt
│ │ │ ├── combobox.html
│ │ │ ├── selectlist.html
│ │ │ ├── tree.html
│ │ │ ├── tree-folders-selectable.html
│ │ │ ├── pillbox-with-pills.html
│ │ │ └── datepicker.html
│ │ ├── test
│ │ │ ├── markup
│ │ │ │ ├── loader-markup.html
│ │ │ │ ├── infinite-scroll-markup.html
│ │ │ │ ├── search-markup.html
│ │ │ │ ├── placard-markup.html
│ │ │ │ ├── checkbox-markup.html
│ │ │ │ ├── radio-markup.html
│ │ │ │ ├── pillbox-markup.html
│ │ │ │ ├── spinbox-markup.html
│ │ │ │ ├── tree-markup.html
│ │ │ │ ├── combobox-markup.html
│ │ │ │ └── datepicker-markup.html
│ │ │ ├── commonjs.html
│ │ │ ├── tests-no-moment.js
│ │ │ ├── browser-globals.html
│ │ │ ├── tests.js
│ │ │ ├── commonjs-test.js
│ │ │ ├── loader-test.js
│ │ │ └── browser-globals.js
│ │ ├── Procfile
│ │ ├── dist
│ │ │ ├── fuelux.zip
│ │ │ ├── fonts
│ │ │ │ ├── fuelux.eot
│ │ │ │ ├── fuelux.ttf
│ │ │ │ ├── fuelux.woff
│ │ │ │ └── fuelux.svg
│ │ │ └── js
│ │ │ │ └── npm.js
│ │ ├── fonts
│ │ │ ├── fuelux.eot
│ │ │ ├── fuelux.ttf
│ │ │ ├── fuelux.woff
│ │ │ ├── src
│ │ │ │ ├── bullet.svg
│ │ │ │ ├── loader_full.svg
│ │ │ │ ├── loader_7.svg
│ │ │ │ ├── loader_1.svg
│ │ │ │ ├── loader_5.svg
│ │ │ │ ├── loader_8.svg
│ │ │ │ ├── loader_3.svg
│ │ │ │ ├── loader_4.svg
│ │ │ │ ├── loader_6.svg
│ │ │ │ └── loader_2.svg
│ │ │ └── fuelux.svg
│ │ ├── postinstall.sh
│ │ ├── less
│ │ │ ├── intelligent-dropdown.less
│ │ │ ├── search.less
│ │ │ ├── combobox.less
│ │ │ ├── infinite-scroll.less
│ │ │ ├── checkbox-no-js.less
│ │ │ ├── loader.less
│ │ │ ├── selectlist.less
│ │ │ ├── fuelux.less
│ │ │ ├── spinbox.less
│ │ │ ├── repeater-thumbnail.less
│ │ │ ├── radio-no-js.less
│ │ │ ├── repeater.less
│ │ │ ├── checkbox.less
│ │ │ ├── pillbox.less
│ │ │ ├── icons.less
│ │ │ ├── radio.less
│ │ │ ├── placard.less
│ │ │ ├── mixins.less
│ │ │ ├── tree.less
│ │ │ └── utility.less
│ │ ├── BACKLOG.md
│ │ ├── devserver.js
│ │ ├── .travis.yml
│ │ ├── index.css
│ │ ├── .gitignore
│ │ ├── grunt
│ │ │ └── commonjs-reference-module.js
│ │ ├── .bithoundrc
│ │ ├── bower.json
│ │ ├── js
│ │ │ └── all.js
│ │ ├── sauce_browsers.yml
│ │ ├── LICENSE
│ │ ├── sauce_browsers_tricky.yml
│ │ ├── dev
│ │ │ └── dev.html.example
│ │ └── package.json
│ └── datetimepicker
│ │ └── js
│ │ └── locales
│ │ ├── bootstrap-datetimepicker.zh-CN.js
│ │ ├── bootstrap-datetimepicker.zh-TW.js
│ │ ├── bootstrap-datetimepicker.ua.js
│ │ └── bootstrap-datetimepicker.uk.js
└── bootstrap-3.3.5-dist
│ ├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
│ └── js
│ └── npm.js
├── utils
├── __init__.py
└── constant.py
├── templates
├── home.html
├── logout.html
├── 404.html
├── echelon
│ └── changelog_detail.html
├── cmdb
│ └── widgets
│ │ ├── checkbox.html
│ │ ├── div.html
│ │ ├── pre.html
│ │ ├── json.html
│ │ ├── password.html
│ │ ├── textarea.html
│ │ ├── typeahead.html
│ │ ├── editor.html
│ │ ├── revenumerate.html
│ │ ├── input.html
│ │ ├── enumerate_read_only.html
│ │ ├── enumerate.html
│ │ ├── multiselect2.html
│ │ ├── datetime.html
│ │ └── file.html
├── base
│ ├── base.html
│ └── base_bootstrap.html
├── rest_framework
│ └── api.html
├── login.html
└── add_modify.html
├── requirements.txt
├── manage.py
├── README.md
└── local_settings.py
/cmdb/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/myproject/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cmdb/templatetags/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/echelon/templatetags/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/echelon/__init__.py:
--------------------------------------------------------------------------------
1 | __version__= (1,1)
2 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/CNAME:
--------------------------------------------------------------------------------
1 | getfuelux.com
2 |
--------------------------------------------------------------------------------
/cmdb/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/utils/__init__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | # 把所有框架代码都移到utils中, 用户拿到代码后不必关心utils中的实现
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/infinite-scroll.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/loader.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/markup/loader-markup.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/Procfile:
--------------------------------------------------------------------------------
1 | web: tar -zcf dev/node_modules.tar.gz node_modules/ && grunt dist && node devserver.js
--------------------------------------------------------------------------------
/echelon/urls.py:
--------------------------------------------------------------------------------
1 | from django.conf.urls import patterns
2 |
3 | urlpatterns = patterns('echelon.views', ('^$', 'changelog'), )
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/dist/fuelux.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/plugins/fuelux-3.11.0/dist/fuelux.zip
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/fuelux.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/plugins/fuelux-3.11.0/fonts/fuelux.eot
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/fuelux.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/plugins/fuelux-3.11.0/fonts/fuelux.ttf
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/fuelux.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/plugins/fuelux-3.11.0/fonts/fuelux.woff
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/dist/fonts/fuelux.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/plugins/fuelux-3.11.0/dist/fonts/fuelux.eot
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/dist/fonts/fuelux.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/plugins/fuelux-3.11.0/dist/fonts/fuelux.ttf
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/dist/fonts/fuelux.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/plugins/fuelux-3.11.0/dist/fonts/fuelux.woff
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/markup/infinite-scroll-markup.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/home.html:
--------------------------------------------------------------------------------
1 | {% extends "base/base.html" %}
2 | {% block title %}
3 | Home
4 | {% endblock %}
5 | {% block content %}
6 | {% endblock %}
7 |
8 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | Django==1.7.1
2 | MySQL-python>=1.2.5
3 | PyYAML>=3.12
4 | IPy
5 | djangorestframework==3.3.1
6 | markdown==2.6.7
7 | django-filter==0.11.0
8 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/postinstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ "$INSTALL_BOWER" = "true" ]; then
4 | node ./node_modules/bower/bin/bower install
5 | fi
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/combobox-variations.txt:
--------------------------------------------------------------------------------
1 | //Has selected item upon initialization
2 | - add 'data-selected="true"' to desired 'ul.dropdown-menu li' tag
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/pillbox-variations.txt:
--------------------------------------------------------------------------------
1 | //Read Only
2 | - can be set via options, or by adding 'data-readonly="readonly"' to 'pillbox' classed div
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/wizard-variations.txt:
--------------------------------------------------------------------------------
1 | //Active step
2 | - add class 'active' to 'ul.steps li' element of choice to make that step active upon initialization
--------------------------------------------------------------------------------
/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/spinbox-variations.txt:
--------------------------------------------------------------------------------
1 | //Has default value to begin with
2 | - add 'value="{{string}}"' to input classed 'spinbox-input'
3 | (ex: 'value="10"')
--------------------------------------------------------------------------------
/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuyu/open-cmdb/HEAD/static/bootstrap-3.3.5-dist/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/placard.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/templates/logout.html:
--------------------------------------------------------------------------------
1 | {% load i18n %}
2 | {% block title %}{% trans "Sign Out" %}{% endblock %}
3 | {% block content %}
4 |
5 |
{% trans "Successful log out" %}
6 |
7 | {% endblock %}
8 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/repeater-variations.txt:
--------------------------------------------------------------------------------
1 | //Static height
2 | - add 'data-staticheight="{{string}}"' to element classed '.repeater' to set the repeater's height
3 | (ex: 'data-staticheight="400"' or 'data-staticheight="true")
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/checkbox-inline.html:
--------------------------------------------------------------------------------
1 |
2 | 1
3 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/radio-inline.html:
--------------------------------------------------------------------------------
1 |
2 | 1
3 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/selectlist-variations.txt:
--------------------------------------------------------------------------------
1 | //Has selected item upon initialization
2 | - add 'data-selected="true"' to desired 'ul.dropdown-menu li' tag
3 |
4 | //Auto resizing
5 | - add 'data-resize="auto"' to 'selectlist' classed element
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/intelligent-dropdown.less:
--------------------------------------------------------------------------------
1 | .fuelux {
2 |
3 | .dropUp {
4 | -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
5 | -moz-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
6 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
7 | }
8 |
9 | }
--------------------------------------------------------------------------------
/templates/404.html:
--------------------------------------------------------------------------------
1 | {% extends "base/base.html" %}
2 | {% block title %}
3 | Not Found
4 | {% endblock %}
5 |
6 | {% block content %}
7 | Page not found
8 |
9 | Sorry, but the requested page could not be found.
10 | {% endblock %}
11 |
--------------------------------------------------------------------------------
/echelon/templatetags/echelon_changelog.py:
--------------------------------------------------------------------------------
1 | from django.template import Library
2 | register = Library()
3 |
4 | @register.inclusion_tag('echelon/changelog_detail.html')
5 | def changelog_detail(changes):
6 | changes = changes.items()
7 | return {'changes': changes}
8 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/search.less:
--------------------------------------------------------------------------------
1 | .fuelux {
2 |
3 | .search {
4 | &.disabled {
5 | .input-group-btn {
6 | cursor: not-allowed;
7 | }
8 | }
9 | input {
10 | &::-ms-clear {
11 | display:none;
12 | }
13 | }
14 | }
15 |
16 | }
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/combobox.less:
--------------------------------------------------------------------------------
1 | .fuelux {
2 |
3 | .combobox {
4 | &.disabled {
5 | .input-group-btn {
6 | cursor: not-allowed;
7 | }
8 | }
9 | input {
10 | &::-ms-clear {
11 | display:none;
12 | }
13 | }
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/radio.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Custom radio unchecked on page load
5 |
6 |
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | import os
3 | import sys
4 |
5 | if __name__ == "__main__":
6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
7 |
8 | from django.core.management import execute_from_command_line
9 |
10 | execute_from_command_line(sys.argv)
11 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/checkbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Custom checkbox unchecked on page load
5 |
6 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/placard-variations.txt:
--------------------------------------------------------------------------------
1 | //Text area placard
2 | - replace input element classed '.placard-field' with the following:
3 | ''
4 |
5 | //Glass styling
6 | - add the class 'glass' to the '.placard-field' element
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/radio-no-js.html:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | Radio Button: unchecked on page load
10 |
11 |
12 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/checkbox-no-js.html:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | Checkbox: unchecked on page load
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/radio-inline-no-js.html:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 | Inline Radio Button
11 |
12 |
13 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/checkbox-inline-no-js.html:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 | Inline Checkbox
11 |
12 |
13 |
--------------------------------------------------------------------------------
/templates/echelon/changelog_detail.html:
--------------------------------------------------------------------------------
1 |
2 | {% for item in changes %}
3 |
4 | {{ item.0 }}
5 | {{ item.1.0 }}
6 | {{ item.1.1 }}
7 |
8 | {% endfor %}
9 |
10 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/markup/search-markup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Search
7 |
8 |
9 |
--------------------------------------------------------------------------------
/cmdb/context_processors.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding:utf8
3 |
4 | from django.conf import settings
5 | from cmdb_menu import CMDB_TOP_MENU
6 | import base_admin
7 |
8 | def menu(request):
9 | return {
10 | 'cmdb_menu': CMDB_TOP_MENU,
11 | 'cmdb_name': settings.CMDB_NAME,
12 | 'cmdb_verison': settings.CMDB_VERSION,
13 | 'base_admin': base_admin.BASE_ADMIN
14 | }
15 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/search.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Search
7 |
8 |
9 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/BACKLOG.md:
--------------------------------------------------------------------------------
1 | BACKLOG
2 | =======
3 |
4 | This is a summary of changes under consideration. Please also review the Roadmap at https://github.com/ExactTarget/fuelux/issues?milestone=3&page=1&state=open
5 |
6 |
7 | Under consideration
8 | -------------------
9 |
10 | * **Colorpicker** - Choose a HEX color from possibly a list or a hue/saturation map
11 | * **"SuperTabs"** - Tab navigation with dynamic description/status on each tab
--------------------------------------------------------------------------------
/myproject/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for myproject project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
12 |
13 | from django.core.wsgi import get_wsgi_application
14 | application = get_wsgi_application()
15 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/placard-header-footer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/devserver.js:
--------------------------------------------------------------------------------
1 | var util = require('util');
2 | var connect = require('connect');
3 | var serveStatic = require('serve-static');
4 | var path = require('path');
5 |
6 | var port = 9000;
7 | var app = connect();
8 |
9 | // parent folder
10 | app.use(serveStatic(path.resolve(__dirname)));
11 |
12 | // Listen
13 | app.listen(process.env.PORT || port);
14 | util.puts('Listening on ' + (process.env.PORT || port) + '...');
15 | util.puts('Press Ctrl + C to stop.');
--------------------------------------------------------------------------------
/static/bootstrap-3.3.5-dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('../../js/transition.js')
3 | require('../../js/alert.js')
4 | require('../../js/button.js')
5 | require('../../js/carousel.js')
6 | require('../../js/collapse.js')
7 | require('../../js/dropdown.js')
8 | require('../../js/modal.js')
9 | require('../../js/tooltip.js')
10 | require('../../js/popover.js')
11 | require('../../js/scrollspy.js')
12 | require('../../js/tab.js')
13 | require('../../js/affix.js')
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/loader-variations.txt:
--------------------------------------------------------------------------------
1 | //Starting frame
2 | - add 'data-frame="{{number}}"' to 'loader' classed div.
3 | (ex: 'data-frame="5"')
4 |
5 | //Controlling speed (default is 150)
6 | - add 'data-delay="{{milliseconds}}"' to 'loader' classed div
7 | (ex: 'data-delay="500"')
8 |
9 | //Animation range
10 | - add 'data-begin="{{number}}"' to 'loader' classed div to specify beginning frame
11 | (ex: 'data-begin="3"')
12 | - add 'data-end="{{number}}"' to 'loader' classed div to specify ending frame
13 | (ex: 'data-end="6"')
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/infinite-scroll.less:
--------------------------------------------------------------------------------
1 | .fuelux {
2 |
3 | .infinitescroll {
4 | overflow-y: auto;
5 |
6 | .infinitescroll-end {
7 | clear: both;
8 | font-style: italic;
9 | padding: 6px;
10 | text-align: center;
11 | }
12 |
13 | .infinitescroll-load {
14 | clear: both;
15 | padding: 6px;
16 |
17 | button {
18 | padding: 5px 12px;
19 | width: 100%;
20 | }
21 |
22 | .loader {
23 | font-size: 32px;
24 | height: 32px;
25 | margin: 0 auto;
26 | width: 32px;
27 | }
28 | }
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/bullet.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/radio-variations.txt:
--------------------------------------------------------------------------------
1 | //Checked when initialized:
2 | - add 'checked' class to input
3 | - add 'checked="checked"' attribute to input
4 |
5 | //Disabled when initialized:
6 | - add 'disabled="disabled"' attribute to input
7 |
8 | //Toggling radios:
9 | - add 'data-toggle="{{selector}}"' attribute to input. This will toggle the matching selector's visibility on check / uncheck
10 | (ex: 'data-toggle="#myTogglingBox"')
11 |
12 | //Highlighting radios:
13 | - add 'highlight' class to block wrapper or label for inline. This will highlight the radio on check / uncheck.
--------------------------------------------------------------------------------
/templates/cmdb/widgets/checkbox.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
14 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/checkbox-variations.txt:
--------------------------------------------------------------------------------
1 | //Checked when initialized:
2 | - add 'checked' class to input
3 | - add 'checked="checked"' attribute to input
4 |
5 | //Disabled when initialized:
6 | - add 'disabled="disabled"' attribute to input
7 |
8 | //Toggling checkboxes:
9 | - add 'data-toggle="{{selector}}"' attribute to input. This will toggle the matching selector's visibility on check / uncheck
10 | (ex: 'data-toggle="#myTogglingBox"')
11 |
12 | //Highlighting checkboxes:
13 | - add 'highlight' class to block wrapper or label for inline. This will highlight the checkbox on check / uncheck.
--------------------------------------------------------------------------------
/cmdb/cmdb_menu.py:
--------------------------------------------------------------------------------
1 | #encoding:utf8
2 | # 菜单配置
3 | CMDB_TOP_MENU = [
4 | [u'主机管理', '/cmdb/server_device/show/', 'globe', []],
5 | [u'IDC管理', '/cmdb/idc/show/', 'th-list', []],
6 | [u'项目管理', '/cmdb/project/show/', 'credit-card', []],
7 | [u'项目组管理', '/cmdb/server_group/show/', 'tasks', []],
8 | [u'角色管理', '/cmdb/server_role/show/', 'home', []],
9 | [u'用户管理', '/cmdb/user/show/', 'user', []],
10 | [u'用户组管理', '/cmdb/group/show/', 'list', []],
11 | [u'权限管理', '/cmdb/permission/show/', 'asterisk', []],
12 | [u'操作历史', '/cmdb/changelog/', 'time', []],
13 | [u'API文档', '/api/', 'book', []],
14 | ]
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 简介
2 |
3 | Open-cmdb是基于Python2.7、Django1.7、Puppet开发的一套快速将服务器软硬件等信息集中化展示的系统。
4 |
5 | 代码比较简单,开发初衷主要是为了方便快速展示Puppet收集上来的所有服务器信息。
6 |
7 | > 主要功能有:
8 | > * 快速展示服务器信息
9 | > * 支持服务器信息录入
10 |
11 | 如果环境中已有Puppet,此系统能快速接入,否则需要自行配置Puppet环境。目前暂时不支持Ansible的YAML格式。
12 |
13 | ## 环境依赖
14 |
15 | * Python2.7
16 | * Django1.7
17 |
18 | 你可以通过此[手册](https://github.com/oysterclub/open-cmdb/wiki/Cetnos6-Installing-Python2.7)完成基础环境配置
19 |
20 | 你可以通过[官方手册](https://github.com/oysterclub/open-cmdb/wiki)快速构建此系统
21 |
22 | 关于此系统更详细的介绍,可以参考书籍:《运维前线》[豆瓣介绍](https://read.douban.com/ebook/30348001/)
23 |
24 | ## 讨论
25 |
26 | 如果大家有什么疑问,欢迎提 #issue
27 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/commonjs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | FuelUX Component Initialization (via CommonJS)
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/spinbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Increase
6 |
7 |
8 | Decrease
9 |
10 |
11 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/checkbox-no-js-variations.txt:
--------------------------------------------------------------------------------
1 | // Checked on page load:
2 | - add 'checked="checked"' attribute to input
3 |
4 | // Disabled on page load:
5 | - add 'disabled="disabled"' attribute to input
6 |
7 | // Toggling with checkboxes uses plain old Bootstrap Collapse:
8 | - See: http://getbootstrap.com/javascript/#collapse
9 | - add `data-toggle="collapse"`
10 | - add `data-target="{{selector}}"`
11 | - optionally consider adding aria attributes `aria-expanded` and `aria-controls`
12 |
13 | // Highlighting checkboxes:
14 | - add 'highlight' class to the `.checkbox` or `.checkbox-inline` wrapper. This will highlight the checkbox on check / uncheck.
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/pillbox.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/radio-no-js-variations.txt:
--------------------------------------------------------------------------------
1 | // Checked on page load:
2 | - add 'checked="checked"' attribute to input
3 |
4 | // Disabled on page load:
5 | - add 'disabled="disabled"' attribute to input
6 |
7 | // Toggling with radio buttons uses plain old Bootstrap Collapse:
8 | - See: http://getbootstrap.com/javascript/#collapse
9 | - add `data-toggle="collapse"`
10 | - add `data-target="{{selector}}"`
11 | - optionally consider adding aria attributes `aria-expanded` and `aria-controls`
12 |
13 | // Highlighting radio buttons:
14 | - add 'highlight' class to the `.radio` or `.radio-inline` wrapper. This will highlight the radio buttons on check / uncheck.
15 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/div.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
16 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/pre.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
17 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/json.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
16 |
--------------------------------------------------------------------------------
/static/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Simplified Chinese translation for bootstrap-datetimepicker
3 | * Yuan Cheung
4 | */
5 | ;(function($){
6 | $.fn.datetimepicker.dates['zh-CN'] = {
7 | days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
8 | daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
9 | daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
10 | months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
11 | monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
12 | today: "今天",
13 | suffix: [],
14 | meridiem: ["上午", "下午"]
15 | };
16 | }(jQuery));
--------------------------------------------------------------------------------
/static/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.zh-TW.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Traditional Chinese translation for bootstrap-datetimepicker
3 | * Rung-Sheng Jang
4 | */
5 | ;(function($){
6 | $.fn.datetimepicker.dates['zh-TW'] = {
7 | days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
8 | daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
9 | daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
10 | months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
11 | monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
12 | today: "今天",
13 | suffix: [],
14 | meridiem: ["上午", "下午"]
15 | };
16 | }(jQuery));
17 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/combobox.html:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/utils/constant.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 |
3 | # 字段类型与HTML控件的对应关系; 注意,如果model中有用到到新的类型,此处必须添加对应项
4 | FIELD_WIDGETS = {
5 | "ForeignKey": "enumerate",
6 | "OneToOneField": "enumerate",
7 | "ManyToManyField": "multiselect2",
8 |
9 | "CharField": "input",
10 | "SlugField": "input",
11 | "TextField": "textarea",
12 | "GenericIPAddressField": "input",
13 |
14 | "AutoField": "input",
15 | "BooleanField": "checkbox",
16 | "SmallIntegerField": "input",
17 | "BigIntegerField": "input",
18 | "DecimalField": "input",
19 | "EmailField": "input",
20 | "DateField": "datetime",
21 | "DateTimeField": "datetime",
22 |
23 | }
24 |
25 | FOREIGNKEY_FUNCS = ['__foreign_unicode__',
26 | '__unicode__']
--------------------------------------------------------------------------------
/static/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.ua.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Ukrainian translation for bootstrap-datepicker
3 | * Igor Polynets
4 | */
5 | ;(function($){
6 | $.fn.datetimepicker.dates['ua'] = {
7 | days: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четверг", "П'ятниця", "Субота", "Неділя"],
8 | daysShort: ["Нед", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Нед"],
9 | daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"],
10 | months: ["Cічень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"],
11 | monthsShort: ["Січ", "Лют", "Бер", "Квт", "Трв", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Грд"],
12 | today: "Сьогодні",
13 | weekStart: 1
14 | };
15 | }(jQuery));
16 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.1
4 | before_install:
5 | - time wget http://fuelux-dev.herokuapp.com/dev/node_modules.tar.gz
6 | - time tar -zxf node_modules.tar.gz
7 | - chmod +x ./node_modules
8 | install:
9 | - time ./node_modules/bower/bin/bower update
10 | env:
11 | global:
12 | - secure: |-
13 | ZK8M500JH/siU5p6jt2XRhBLV9e3N+qjicz59i6Bvkl4X4klUoGV1dMT3kb/
14 | Li3c7lrU8Liw/dHr+a5kY5XdgCOPjOeMqZ0VRZzH0PqSyRz0Hf2AYDO5mrhX
15 | Mj/zz/CiaE82MIPlJk9Q27LheVpbCOL7q/aBakriCTJIcIxqbig=
16 | - secure: |-
17 | rrbobgc5ZJnt9NnILcJs5CNFQf/fVBGOuFDo8UqSOxNtqmpHeuLTTTqKgvdo
18 | sHZL3GDo5ujm/pPvrKv41BGi81rPPLMnQyGdmTDRgW5/F5BaKbKoOvK8opuP
19 | +M1cvJ2Cq14pEK6y2OMAooY2TY4p8MynxsqoKUGOYjmKXsLp1ZE=
20 | matrix:
21 | fast_finish: true
--------------------------------------------------------------------------------
/templates/cmdb/widgets/password.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
21 |
--------------------------------------------------------------------------------
/local_settings.py:
--------------------------------------------------------------------------------
1 | LOCAL_SETTINGS = True
2 | from base.settings import *
3 |
4 | DEBUG = True
5 | TEMPLATE_DEBUG = DEBUG
6 | DATABASES.update({
7 | 'default': {
8 | 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
9 | 'NAME': 'opencmdb', # Or path to database file if using sqlite3.
10 | 'USER': 'opencmdb', # Not used with sqlite3.
11 | 'PASSWORD': 'opencmdb', # Not used with sqlite3.
12 | 'HOST': '127.0.0.1', # Set to empty string for localhost. Not used with sqlite3.
13 | 'PORT': '3306', # Set to empty string for default. Not used with sqlite3.
14 | 'OPTIONS':{'charset': 'utf8', }
15 | },
16 | })
17 |
--------------------------------------------------------------------------------
/static/plugins/datetimepicker/js/locales/bootstrap-datetimepicker.uk.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Ukrainian translation for bootstrap-datetimepicker
3 | * Andrey Vityuk
4 | */
5 | ;(function($){
6 | $.fn.datetimepicker.dates['uk'] = {
7 | days: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота", "Неділя"],
8 | daysShort: ["Нед", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Нед"],
9 | daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"],
10 | months: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"],
11 | monthsShort: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"],
12 | today: "Сьогодні",
13 | suffix: [],
14 | meridiem: []
15 | };
16 | }(jQuery));
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/dist/js/npm.js:
--------------------------------------------------------------------------------
1 | // This file has been created by the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
2 | require('jquery');
3 | require('bootstrap');
4 |
5 | require('../../js/checkbox');
6 | require('../../js/combobox');
7 | require('../../js/datepicker');
8 | require('../../js/dropdown-autoflip');
9 | require('../../js/loader');
10 | require('../../js/placard');
11 | require('../../js/radio');
12 | require('../../js/search');
13 | require('../../js/selectlist');
14 | require('../../js/spinbox');
15 | require('../../js/tree');
16 | require('../../js/wizard');
17 | require('../../js/infinite-scroll');
18 | require('../../js/pillbox');
19 | require('../../js/repeater');
20 | require('../../js/repeater-list');
21 | require('../../js/repeater-thumbnail');
22 | require('../../js/scheduler');
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/selectlist.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Toggle Dropdown
6 |
7 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/textarea.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
22 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/tree.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 | Loading...
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/index.css:
--------------------------------------------------------------------------------
1 | .btn-panel {
2 | border: 1px solid #ddd;
3 | border-top: none;
4 | background: #f6f6f6;
5 | padding: 20px;
6 | }
7 |
8 | .thin-box {
9 | border: 1px solid #ddd;
10 | padding: 20px 20px;
11 | }
12 |
13 | #loaderWrapper .loader {
14 | float: left;
15 | margin-right: 20px;
16 | }
17 |
18 | #mainWrapper {
19 | padding-bottom: 1.5rem;
20 | }
21 |
22 | #mainWrapper section {
23 | padding-bottom: 1.5rem;
24 | }
25 |
26 | #mainWrapper section section {
27 | padding-bottom: 1.5rem;
28 | }
29 |
30 | #myInfiniteScroll1, #myInfiniteScroll2 {
31 | border: 1px solid #ddd;
32 | float: left;
33 | height: 200px;
34 | width: 45%;
35 | }
36 |
37 | #myInfiniteScroll2 {
38 | float: right;
39 | }
40 |
41 | #myPlacard1, #myPlacard2, #myPlacard3 {
42 | width: 300px;
43 | }
44 |
45 | .example-pill-class {
46 | font-style: italic;
47 | font-weight: bold;
48 | }
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/markup/placard-markup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/typeahead.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
21 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/checkbox-no-js.less:
--------------------------------------------------------------------------------
1 | @import "forms.less";
2 |
3 | .fuelux {
4 | .checkbox, .checkbox-inline {
5 |
6 | input[type="checkbox"]:not(.sr-only) {
7 | & ~ label {
8 | &:before {
9 | border-radius: 4px;
10 | z-index: 1;
11 | }
12 | }
13 |
14 | &:checked {
15 | & ~ label {
16 | &:before {
17 | color: white;
18 | content: "\e013";
19 | line-height: 1em;
20 | padding-left: 1px;
21 | font-size: 8px;
22 | padding-top: 2px;
23 | }
24 | }
25 | }
26 | }
27 |
28 | &.hightlight {
29 | & + .checkbox-inline.highlight {
30 | margin-left: -14px;
31 | &.checkbox-custom {
32 | margin-left: 0px;
33 | }
34 | }
35 | }
36 | }
37 |
38 | .checkbox {
39 |
40 | &.highlight {
41 | input[type="checkbox"]:not(.sr-only) {
42 | & ~ label {
43 | left: -4px;
44 | }
45 | }
46 | }
47 |
48 | }
49 | }
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/tree-folders-selectable.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 | Loading...
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/editor.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
25 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/revenumerate.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
24 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/.gitignore:
--------------------------------------------------------------------------------
1 | # filesystem
2 | .DS_Store
3 |
4 | # dependencies
5 | node_modules
6 | bower_components
7 |
8 | # gh-pages
9 | _site/*
10 |
11 | # logs
12 | *.log
13 | validation-status.json
14 |
15 | # Sauce Labs. because it's classified...
16 | SAUCE_API_KEY.yml
17 |
18 | # Fuel CDN Login. because it's classified...
19 | FUEL_CDN.yml
20 |
21 | # Generated file from commonjs-test.js
22 | test/commonjs-bundle.js
23 |
24 | # Editors / IDEs
25 | .idea
26 |
27 | # node_module cache for TravisCI, etc.
28 | node_modules.tar.gz
29 |
30 | # Temp file created in the LESS build
31 | less/fuelux-no-namespace.less
32 |
33 | # sandbox
34 | dev/dev.html
35 |
36 | # screenshots
37 | page-at-timeout-*
38 |
39 | # dev css and maps
40 | dist/css/fuelux-dev.css
41 | dist/css/fuelux-dev.css.map
42 | dist/css/fuelux-fuelux-no-namespace.css.map
43 |
44 | # generate release notes
45 | notes.sh
46 |
47 | # release task and commit
48 | stage.sh
49 |
50 | # push major branch, the version tag, and SFTP upload to CDN
51 | publish.sh
52 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/input.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
25 |
--------------------------------------------------------------------------------
/cmdb/templatetags/cmdb_tags.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | #encoding:utf8
3 | from django import template
4 | import re
5 |
6 | register = template.Library()
7 |
8 | @register.simple_tag
9 | def menu_active(request, pattern):
10 | if re.search(r'^'+pattern, request.path):
11 | return 'active'
12 | return ''
13 |
14 |
15 | @register.simple_tag
16 | def get_field_name(table_field, key, attr):
17 | if not attr:
18 | attr = 'verbose_name'
19 | if table_field.get(key, ''):
20 | return table_field[key][attr]
21 | return ''
22 |
23 |
24 | @register.simple_tag
25 | def get_field_value(one_data, field, attr):
26 | if one_data.get(field, ''):
27 | return one_data[field][attr]
28 | return ''
29 |
30 |
31 | @register.filter('getitem')
32 | def getitem(item, string):
33 | try:
34 | return item.get(string, '')
35 | except :
36 | return ''
37 |
38 |
39 | @register.filter("tostring")
40 | def tostring(value):
41 | try:
42 | return str(value)
43 | except:
44 | return ''
45 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/enumerate_read_only.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
23 |
28 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/loader.less:
--------------------------------------------------------------------------------
1 | .fuelux {
2 |
3 | .loader {
4 | height: 64px;
5 | font-size: 64px;
6 | position: relative;
7 | width: 64px;
8 |
9 | &:after, &:before {
10 | #fuelux > .icon-base-styles();
11 |
12 | bottom: 0;
13 | display: block;
14 | left: 0;
15 | position: absolute;
16 | right: 0;
17 | top: 0;
18 | }
19 |
20 | &:before {
21 | content: '\e000';
22 | opacity: 0.33;
23 | }
24 |
25 | &.iefix:before{
26 | color: @gray74;
27 | opacity: 1;
28 | }
29 |
30 | &[data-frame="1"]:after {
31 | content: '\e001';
32 | }
33 |
34 | &[data-frame="2"]:after {
35 | content: '\e002';
36 | }
37 |
38 | &[data-frame="3"]:after {
39 | content: '\e003';
40 | }
41 |
42 | &[data-frame="4"]:after {
43 | content: '\e004';
44 | }
45 |
46 | &[data-frame="5"]:after {
47 | content: '\e005';
48 | }
49 |
50 | &[data-frame="6"]:after {
51 | content: '\e006';
52 | }
53 |
54 | &[data-frame="7"]:after {
55 | content: '\e007';
56 | }
57 |
58 | &[data-frame="8"]:after {
59 | content: '\e008';
60 | }
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/selectlist.less:
--------------------------------------------------------------------------------
1 | // TODO use bs base variables if possible
2 | @selectlist-horizontal-padding: 12px;
3 | @selectlist-caret-width: 4px;
4 |
5 | .fuelux {
6 |
7 | .selectlist {
8 |
9 | &.disabled {
10 | cursor: not-allowed;
11 | }
12 |
13 | .selected-label {
14 | overflow: hidden; // helps with text flow on small screens
15 | min-width: 2em;
16 | }
17 |
18 | .dropdown-menu {
19 | min-width: inherit;
20 | overflow-y: auto;
21 | }
22 | .btn.dropdown-toggle {
23 | text-align: left;
24 | padding-right: unit((2 * @selectlist-horizontal-padding + @selectlist-caret-width), px);
25 |
26 | .caret {
27 | #fuelux > .vertical-align();
28 | right: @selectlist-horizontal-padding;
29 |
30 | }
31 | }
32 |
33 | }
34 |
35 | .button-sizer, .selectlist-sizer{
36 | display: inline-block;
37 | position: absolute;
38 | visibility: hidden;
39 | top: 0;
40 | float: left;
41 | .selectlist {
42 | display: block !important;
43 | }
44 | .dropdown-menu {
45 | display: block;
46 | min-width: inherit;
47 | }
48 | .selected-label {
49 | width: auto !important;
50 | }
51 | }
52 |
53 | }
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/fuelux.less:
--------------------------------------------------------------------------------
1 | @charset "UTF-8";
2 |
3 |
4 | // Core variables, mixins, and icons
5 | @import "variables.less"; // Modify this for custom colors, font-sizes, etc
6 | @import "mixins.less";
7 | @import "icons.less";
8 |
9 | // Fuel UX controls
10 | @import "forms.less"; // forms.less contains code shared between form elements.
11 | @import "checkbox.less"; // Checkbox styles that will be deprecated.
12 | @import "checkbox-no-js.less"; // Checkbox styles that are not dependant upon custom javascript controls.
13 | @import "radio.less"; // Radio styles that will be deprecated.
14 | @import "radio-no-js.less"; // Radio styles that are not dependant upon custom javascript controls.
15 | @import "combobox.less";
16 | @import "datepicker.less";
17 | @import "infinite-scroll.less";
18 | @import "intelligent-dropdown.less";
19 | @import "loader.less";
20 | @import "pillbox.less";
21 | @import "placard.less";
22 | @import "repeater.less";
23 | @import "repeater-list.less";
24 | @import "repeater-thumbnail.less";
25 | @import "spinbox.less";
26 | @import "scheduler.less";
27 | @import "search.less";
28 | @import "selectlist.less";
29 | @import "tree.less";
30 | @import "wizard.less";
31 | @import "utility.less";
32 |
33 |
34 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/grunt/commonjs-reference-module.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap Grunt task for the CommonJS module generation
3 | * http://getbootstrap.com
4 | * Copyright 2014-2015 Twitter, Inc.
5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 | */
7 |
8 | 'use strict';
9 |
10 | var fs = require('fs');
11 | var path = require('path');
12 |
13 | var banner = '// This file has been created by the `commonjs` Grunt task.' +
14 | ' You can require() this file in a CommonJS environment.\n' +
15 | 'require(\'jquery\');\n' +
16 | 'require(\'bootstrap\');\n\n';
17 | 'require(\'moment\');\n\n';
18 |
19 | module.exports = function createBundledReferenceModule(grunt, files, destFile) {
20 | var destDir = path.dirname(destFile);
21 |
22 | function srcPathToDestRequire(files) {
23 | var requirePath = path.relative(destDir, files).replace(/\\/g, '/').replace(/\.js$/g, '');
24 | return 'require(\'' + requirePath + '\');';
25 | }
26 |
27 | var moduleOutputJs = banner + files.map(srcPathToDestRequire).join('\n');
28 | try {
29 | fs.writeFileSync(destFile, moduleOutputJs);
30 | } catch (err) {
31 | grunt.fail.warn(err);
32 | }
33 | grunt.log.writeln('CommonJS Bundled Reference file created: ' + destFile.cyan);
34 | };
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/.bithoundrc:
--------------------------------------------------------------------------------
1 | {
2 | "ignore": [
3 | "**/deps/**",
4 | "**/node_modules/**",
5 | "**/thirdparty/**",
6 | "**/vendor/**",
7 | "**/**-min-**",
8 | "**/**-min.**",
9 | "**/**.min.**",
10 | "**/**jquery.?(ui|effects)-*.*.?(*).?(cs|j)s",
11 | "**/**jquery-*.*.?(*).?(cs|j)s",
12 | "**/prototype?(*).js",
13 | "**/**?(*).ts",
14 | "**/mootools*.*.*.js",
15 | "**/dojo.js",
16 | "**/MochiKit.js",
17 | "**/yahoo-*.js",
18 | "**/yui*.js",
19 | "**/ckeditor*.js",
20 | "**/tiny_mce*.js",
21 | "**/tiny_mce/?(langs|plugins|themes|utils)/**",
22 | "**/MathJax/**",
23 | "**/shBrush*.js",
24 | "**/shCore.js",
25 | "**/shLegacy.js",
26 | "**/modernizr.custom.?(*).js",
27 | "**/knockout-*.*.*.debug.js",
28 | "**/extjs/*.js",
29 | "**/extjs/*.xml",
30 | "**/extjs/*.txt",
31 | "**/extjs/*.html",
32 | "**/extjs/*.properties",
33 | "**/extjs/.sencha",
34 | "**/extjs/docs/**",
35 | "**/extjs/builds/**",
36 | "**/extjs/cmd/**",
37 | "**/extjs/examples/**",
38 | "**/extjs/locale/**",
39 | "**/extjs/packages/**",
40 | "**/extjs/plugins/**",
41 | "**/extjs/resources/**",
42 | "**/extjs/src/**",
43 | "**/extjs/welcome/**",
44 | "bower_components/**",
45 | "**/dist/**"
46 | ]
47 | }
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "fuelux",
3 | "description": "Extending Bootstrap with additional lightweight JavaScript controls.",
4 | "keywords": [
5 | "application",
6 | "bootstrap",
7 | "controls",
8 | "css",
9 | "exacttarget",
10 | "front-end",
11 | "fuelux",
12 | "fuel ux",
13 | "js",
14 | "salesforce",
15 | "user interface",
16 | "web"
17 | ],
18 | "homepage": "http://getfuelux.com",
19 | "dependencies": {
20 | "jquery": "latest",
21 | "requirejs": "2.x",
22 | "bootstrap": "3.x",
23 | "moment": "2.x"
24 | },
25 | "devDependencies": {
26 | "jquery": null,
27 | "jquery-1.9.1": "jquery#1.9.1",
28 | "qunit": "~1.14.0",
29 | "requirejs-text": "2.x",
30 | "underscore": "1.x",
31 | "blanket": "1.x"
32 | },
33 | "ignore": [
34 | "**/.*",
35 | "_*",
36 | "*.yml",
37 | "BACKLOG.md",
38 | "data.js",
39 | "dev",
40 | "devserver.js",
41 | "dist/fuelux.zip",
42 | "Gruntfile.js",
43 | "index.css",
44 | "index.html",
45 | "index.js",
46 | "node_modules",
47 | "Procfile",
48 | "test"
49 | ],
50 | "license": "BSD-3-Clause",
51 | "main": [
52 | "dist/css/fuelux.css",
53 | "dist/js/fuelux.js",
54 | "dist/fonts/fuelux.eot",
55 | "dist/fonts/fuelux.svg",
56 | "dist/fonts/fuelux.ttf",
57 | "dist/fonts/fuelux.woff"
58 | ]
59 | }
60 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/js/all.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Fuel UX All
3 | * https://github.com/ExactTarget/fuelux
4 | *
5 | * Copyright (c) 2014 ExactTarget
6 | * Licensed under the BSD New license.
7 | *
8 | * NOTE: This file works with AMD only.
9 | */
10 |
11 | (function (factory) {
12 | if (typeof define === 'function' && define.amd) {
13 | // if AMD loader is available, register as an anonymous module.
14 | define(factory);
15 | } else {
16 | // OR print to the console that this file is AMD only, if possible
17 | if(window && window.console && window.console.log){
18 | window.console.log('WARNING: The all.js file in the Fuel UX src directory is for use with AMD only.');
19 | }
20 | }
21 | }(function (require) {
22 |
23 | require('jquery');
24 | require('bootstrap');
25 |
26 | require('fuelux/checkbox');
27 | require('fuelux/combobox');
28 | require('fuelux/datepicker');
29 | require('fuelux/dropdown-autoflip');
30 | require('fuelux/infinite-scroll');
31 | require('fuelux/loader');
32 | require('fuelux/pillbox');
33 | require('fuelux/placard');
34 | require('fuelux/radio');
35 | require('fuelux/repeater');
36 | require('fuelux/repeater-list');
37 | require('fuelux/repeater-thumbnail');
38 | require('fuelux/scheduler');
39 | require('fuelux/search');
40 | require('fuelux/spinbox');
41 | require('fuelux/selectlist');
42 | require('fuelux/tree');
43 | require('fuelux/wizard');
44 |
45 | }));
46 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/tests-no-moment.js:
--------------------------------------------------------------------------------
1 | /*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
2 | /*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
3 | /*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
4 |
5 | define(function(require){
6 | var $ = require('jquery');
7 |
8 | QUnit.start(); // starting qunit, or phantom js will have a problem
9 |
10 | // Needed for saucelab testing
11 | var log = [];
12 | var testName;
13 |
14 | QUnit.done(function (test_results) {
15 | var tests = [];
16 | for(var i = 0, len = log.length; i < len; i++) {
17 | var details = log[i];
18 | tests.push({
19 | name: details.name,
20 | result: details.result,
21 | expected: details.expected,
22 | actual: details.actual,
23 | source: details.source
24 | });
25 | }
26 | test_results.tests = tests;
27 |
28 | window.global_test_results = test_results;
29 |
30 | // hide passed tests, helps with VM testing screencasts
31 | if (!$('#qunit-filter-pass').is(':checked')) {
32 | $('#qunit-filter-pass').click();
33 | }
34 |
35 | });
36 | QUnit.testStart(function(testDetails){
37 | QUnit.log = function(details){
38 | if (!details.result) {
39 | details.name = testDetails.name;
40 | log.push(details);
41 | }
42 | };
43 | });
44 |
45 | require('test/datepicker-test');
46 |
47 | });
48 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/spinbox.less:
--------------------------------------------------------------------------------
1 | .fuelux {
2 |
3 | .spinbox {
4 | display: inline-block;
5 | position: relative;
6 |
7 | &.digits-3 {
8 | width: 60px;
9 | }
10 |
11 | &.disabled {
12 | .spinbox-buttons {
13 | cursor: not-allowed;
14 | }
15 | }
16 |
17 | .spinbox-input {
18 | float: left;
19 | padding-bottom: 3px; /* Magic number */
20 | padding: 0px 25px 0px 7px;
21 |
22 | &::-ms-clear {
23 | display:none;
24 | }
25 | }
26 |
27 | .btn {
28 | position: relative;
29 | width: 20px;
30 | height: 13px;
31 | padding-top: 0;
32 | padding-right: 9px;
33 | padding-left: 9px;
34 |
35 | &.disabled {
36 | cursor: not-allowed;
37 | }
38 | }
39 |
40 | .spinbox-buttons {
41 | position: absolute;
42 | height: 28px;
43 | width: 20px;
44 | right: 2px;
45 | }
46 |
47 | .spinbox-up {
48 | padding: 0 0 14px 1px;
49 | top: 2px;
50 |
51 | .glyphicon-chevron-up {
52 | position:relative;
53 | top: 0px;
54 | }
55 | }
56 |
57 | // fix radius from BS btn-group
58 | .btn-group > .btn.spinbox-up {
59 | border-top-right-radius: 4px;
60 | }
61 |
62 | .spinbox-down {
63 | padding: 0 0 8px 1px;
64 | top: 2px;
65 | height: 15px;
66 | border-bottom-left-radius: 4px;
67 |
68 | .glyphicon-chevron-down {
69 | position: relative;
70 | left: -1px;
71 | top: 0px;
72 | }
73 | }
74 | input {
75 | &::-ms-clear {
76 | display:none;
77 | }
78 | }
79 | }
80 |
81 | }
--------------------------------------------------------------------------------
/templates/cmdb/widgets/enumerate.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
34 |
41 |
--------------------------------------------------------------------------------
/templates/base/base.html:
--------------------------------------------------------------------------------
1 | {% extends "base/base_bootstrap.html" %}
2 |
3 | {% load cmdb_tags %}
4 |
5 | {% block title %}
6 | {% endblock %}
7 |
8 | {% block body %}
9 |
10 |
11 |
14 |
15 |
16 |
17 | {% for menu in cmdb_menu %}
18 |
21 | {% endfor %}
22 |
23 |
24 |
25 | {% if request.user.is_authenticated or user.is_authenticated %}
26 | {{ request.user }}
27 | 登出
28 | {% endif %}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | {% block content %}
38 | {% endblock %}
39 |
40 | {% endblock %}
41 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/markup/checkbox-markup.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Checked/Enabled
7 |
8 |
9 |
10 |
11 |
12 |
13 | Checked/Disabled
14 |
15 |
16 |
17 |
18 |
19 |
20 | Unchecked/Enabled
21 |
22 |
23 |
24 |
25 |
26 |
27 | Unchecked/Disabled
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | Custom checkbox toggles by class
37 |
38 |
39 |
This message's visibility toggles by class with a checkbox above.
40 |
41 |
42 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/multiselect2.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
38 |
44 |
--------------------------------------------------------------------------------
/templates/cmdb/widgets/datetime.html:
--------------------------------------------------------------------------------
1 | {% load cmdb_tags %}
2 |
3 |
38 |
39 |
48 |
--------------------------------------------------------------------------------
/myproject/urls.py:
--------------------------------------------------------------------------------
1 | # encoding:utf8
2 | from django.conf.urls import patterns, include, url
3 | from django.contrib import admin
4 | from django.http import HttpResponseRedirect
5 | import myproject.api
6 |
7 | urlpatterns = patterns('',
8 | url(r'^$', lambda x: HttpResponseRedirect('/login/')),
9 | url(r'^logout/$', 'cmdb.views.logout_view', name='cmdb_logout'),
10 | url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'},
11 | name='cmdb_login'),
12 | url(r'^home/$', 'cmdb.views.home', name='home'),
13 |
14 | # 主机管理
15 | url(r'cmdb/(?P\w+)/show/$', 'cmdb.views.show_all'),
16 | url(r'cmdb/(?P\w+)/delete/(?P\d+)/$', 'cmdb.views.delete'),
17 | url(r'cmdb/(?P\w+)/add/(?P\d+)/$', 'cmdb.views.add_modify'),
18 | url(r'cmdb/(?P\w+)/modify/(?P\d+)/$', 'cmdb.views.add_modify'),
19 | url(r'cmdb/(?P\w+)/import/$', 'cmdb.views.import_data'),
20 |
21 | # 操作历史
22 | url(r'^cmdb/changelog/', include('echelon.urls')),
23 | )
24 |
25 | # Wire up our API using automatic URL routing.
26 | # Additionally, we include login URLs for the browsable API.
27 |
28 | urlpatterns += patterns(
29 | '',
30 | url(r'^api/', include(myproject.api.router.urls)),
31 | url(r'^api-auth/', include('rest_framework.urls',
32 | namespace='rest_framework')),
33 | )
34 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/sauce_browsers.yml:
--------------------------------------------------------------------------------
1 | [
2 | # Docs: https://saucelabs.com/docs/platforms/webdriver
3 |
4 | {
5 | browserName: "safari",
6 | platform: "OS X 10.9"
7 | },
8 | {
9 | browserName: "chrome",
10 | platform: "OS X 10.9"
11 | },
12 | {
13 | browserName: "firefox",
14 | platform: "OS X 10.9"
15 | },
16 |
17 | # Mac Opera not currently supported by Sauce Labs
18 |
19 | {
20 | browserName: "internet explorer",
21 | version: "11",
22 | platform: "Windows 8.1"
23 | },
24 | {
25 | browserName: "internet explorer",
26 | version: "10",
27 | platform: "Windows 8"
28 | },
29 | {
30 | browserName: "internet explorer",
31 | version: "9",
32 | platform: "Windows 7"
33 | },
34 |
35 | # Not Supported by MC
36 | # {
37 | # browserName: "internet explorer",
38 | # version: "8",
39 | # platform: "Windows 7"
40 | # },
41 |
42 | {
43 | browserName: "chrome",
44 | platform: "Windows 8.1"
45 | },
46 | {
47 | browserName: "firefox",
48 | platform: "Windows 8.1"
49 | },
50 |
51 | # Win Opera 15+ not currently supported by Sauce Labs
52 |
53 | {
54 | browserName: "iphone",
55 | platform: "OS X 10.9",
56 | version: "7.1"
57 | },
58 |
59 | # iOS Chrome not currently supported by Sauce Labs
60 |
61 | # Linux (unofficial)
62 | {
63 | browserName: "chrome",
64 | platform: "Linux"
65 | },
66 | {
67 | browserName: "firefox",
68 | platform: "Linux"
69 | }
70 |
71 | # Android Chrome not currently supported by Sauce Labs
72 |
73 | # { # Android Browser (super-unofficial)
74 | # browserName: "android",
75 | # version: "4.0",
76 | # platform: "Linux"
77 | # }
78 | ]
79 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/markup/pillbox-with-pills.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2012-2014 ExactTarget, Inc.
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
5 | following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
8 | disclaimer.
9 |
10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
11 | following disclaimer in the documentation and/or other materials provided with the distribution.
12 |
13 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
14 | products derived from this software without specific prior written permission.
15 |
16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
17 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
24 | ====================================================================
25 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/less/repeater-thumbnail.less:
--------------------------------------------------------------------------------
1 | .fuelux {
2 |
3 | .repeater-thumbnail {
4 | border: 1px solid @gray87;
5 | color: @gray40;
6 | float: left;
7 | font-size: 14px;
8 | min-height: 110px;
9 | min-width: 100px;
10 | margin: 8px 7px;
11 | text-align: center;
12 |
13 | img {
14 | display: block;
15 | margin-top: 10px;
16 | margin-bottom: 3px;
17 | }
18 |
19 | &-cont {
20 | height: 100%;
21 | overflow-y: auto;
22 | padding: 6px;
23 | width: 100%;
24 |
25 | &.align-center, &.align-justify, &.align-left, &.align-right {
26 | position: relative;
27 | font-size: 0.1px;
28 |
29 | &:after {
30 | display: inline-block;
31 | width: 100%;
32 | content: '';
33 | }
34 |
35 | .infinitescroll {
36 | &-end, &-load {
37 | display: inline-block;
38 | width: 100%;
39 | }
40 | }
41 |
42 | .repeater-thumbnail {
43 | display: inline-block;
44 | float: none;
45 | font-size: 14px;
46 |
47 | &:after {
48 | content: ' ';
49 | }
50 | }
51 | }
52 | &.align-center { text-align: center; }
53 | &.align-justify { text-align: justify; }
54 | &.align-left { text-align: left; }
55 | &.align-right { text-align: right; }
56 |
57 | div.empty {
58 | font-size: 14px;
59 | font-style: italic;
60 | padding: 14px 10px 20px;
61 | text-align: center;
62 | }
63 |
64 | .selectable {
65 | &:hover {
66 | background: @selectableHover;
67 | cursor: pointer;
68 | }
69 |
70 | &.selected {
71 | background: @selected;
72 |
73 | &:hover {
74 | background: @selectedHover;
75 | }
76 | }
77 | }
78 | }
79 | }
80 |
81 | }
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/fuelux.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Generated by Fontastic.me
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/sauce_browsers_tricky.yml:
--------------------------------------------------------------------------------
1 | [
2 | # Docs: https://saucelabs.com/docs/platforms/webdriver
3 |
4 | # {
5 | # browserName: "internet explorer",
6 | # version: "8",
7 | # platform: "Windows XP"
8 | # },
9 |
10 | # {
11 | # browserName: "googlechrome",
12 | # version: "31",
13 | # platform: "Windows 7"
14 | # },
15 |
16 | {
17 | browserName: "internet explorer",
18 | version: "9",
19 | platform: "Windows 7"
20 | },
21 |
22 | # Linux (unofficial)
23 | # {
24 | # browserName: "googlechrome",
25 | # platform: "Linux",
26 | # version: "31"
27 | # },
28 | {
29 | browserName: "firefox",
30 | platform: "Linux"
31 | },
32 |
33 | #{
34 | # browserName: "firefox",
35 | # version: "28",
36 | # platform: "Windows 7"
37 | #},
38 |
39 | {
40 | browserName: "internet explorer",
41 | version: "10",
42 | platform: "Windows 8"
43 | },
44 |
45 | {
46 | browserName: "internet explorer",
47 | version: "11",
48 | platform: "Windows 8.1"
49 | },
50 |
51 | # {
52 | # browserName: "safari",
53 | # version: "6",
54 | # platform: "OS X 10.8"
55 | # },
56 |
57 | {
58 | browserName: "iphone",
59 | version: "7",
60 | platform: "OS X 10.9"
61 | },
62 |
63 | {
64 | browserName: "internet explorer",
65 | version: "8",
66 | platform: "Windows 7"
67 | }
68 |
69 | # # this was probably what it was built on, no?
70 | # # {
71 | # # browserName: "googlechrome",
72 | # # platform: "OS X 10.9",
73 | # # },
74 |
75 | # Mac Opera not currently supported by Sauce Labs
76 |
77 | # { # Unofficial
78 | # browserName: "internet explorer",
79 | # version: "7",
80 | # platform: "Windows XP"
81 | # },
82 |
83 | # {
84 | # browserName: "firefox",
85 | # platform: "OS X 10.9",
86 | # version: "28"
87 | # },
88 | ]
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/dist/fonts/fuelux.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Generated by Fontastic.me
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_full.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/cmdb/model_form.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # encoding:utf8
3 |
4 | from django.forms import ModelForm
5 | from models import *
6 | from django.contrib.auth.models import User, Permission, Group
7 | from django.contrib.auth.hashers import make_password
8 |
9 |
10 | class Server_Group_CheckForm(ModelForm):
11 | class Meta:
12 | model = Server_Group
13 | fields = '__all__'
14 |
15 |
16 | class IDC_CheckForm(ModelForm):
17 | class Meta:
18 | model = IDC
19 | fields = '__all__'
20 |
21 |
22 | class Project_CheckForm(ModelForm):
23 | class Meta:
24 | model = Project
25 | fields = '__all__'
26 |
27 |
28 | class Server_Role_CheckForm(ModelForm):
29 | class Meta:
30 | model = Server_Role
31 | fields = '__all__'
32 |
33 |
34 | class Server_Device_CheckForm(ModelForm):
35 | class Meta:
36 | model = Server_Device
37 | fields = '__all__'
38 |
39 |
40 |
41 | class User_CheckFrom(ModelForm):
42 | class Meta:
43 | model = User
44 | fields = ['username',
45 | 'password',
46 | 'email',
47 | 'is_superuser',
48 | 'is_active',
49 | 'is_staff',
50 | 'user_permissions']
51 |
52 | def save(self):
53 | # 如果密码不是以pbkdf加密字符串开头的, 表示用户输入了自己的密码, 需要重新加密
54 | if not self.instance.password.startswith("pbkdf2_sha256$"):
55 | print self.instance.password
56 | self.instance.password = make_password(self.instance.password)
57 | super(User_CheckFrom, self).save()
58 |
59 | class Group_CheckFrom(ModelForm):
60 | class Meta:
61 | model = Group
62 | fields = '__all__'
63 |
64 | class Permission_CheckFrom(ModelForm):
65 | class Meta:
66 | model = Permission
67 | fields = '__all__'
68 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/markup/radio-markup.html:
--------------------------------------------------------------------------------
1 |
58 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/browser-globals.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | FuelUX Component Initialization (via Browser Globals)
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/templates/rest_framework/api.html:
--------------------------------------------------------------------------------
1 | {% extends "rest_framework/base.html" %}
2 |
3 | {% block head %}
4 | {% if not request.user.is_authenticated and not user.is_authenticated %}
5 |
8 | {% endif %}
9 |
10 | {{ block.super }}
11 | {% endblock %}
12 |
13 | {% load cmdb_tags %}
14 |
15 | {% block title %}CMDB SYSTEM{% endblock %}
16 |
17 | {% block style %}
18 |
19 | {{ block.super }}
20 |
31 |
32 | {% endblock %}
33 |
34 | {% block navbar %}
35 |
36 |
37 |
40 |
41 |
42 |
43 | {% for menu in cmdb_menu %}
44 |
47 | {% endfor %}
48 |
49 |
50 |
51 | {% if request.user.is_authenticated or user.is_authenticated %}
52 | {{ request.user }}
53 | 登出
54 | {% endif %}
55 |
56 |
57 |
58 |
59 | {% endblock %}
--------------------------------------------------------------------------------
/templates/base/base_bootstrap.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CMDB SYSTEM
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {% block css %}
19 | {% endblock %}
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {% block js %}
34 | {% endblock %}
35 |
36 |
37 | {% block body %}
38 | {% endblock %}
39 |
40 |
41 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/test/tests.js:
--------------------------------------------------------------------------------
1 | /*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
2 | /*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
3 | /*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
4 |
5 | define(function(require){
6 | var $ = require('jquery');
7 |
8 | QUnit.start(); // starting qunit, or phantom js will have a problem
9 |
10 | // Needed for saucelab testing
11 | var log = [];
12 | var testName;
13 |
14 | QUnit.done(function (test_results) {
15 | var tests = [];
16 | for(var i = 0, len = log.length; i < len; i++) {
17 | var details = log[i];
18 | tests.push({
19 | name: details.name,
20 | result: details.result,
21 | expected: details.expected,
22 | actual: details.actual,
23 | source: details.source
24 | });
25 | }
26 | test_results.tests = tests;
27 |
28 | window.global_test_results = test_results;
29 |
30 | // hide passed tests, helps with VM testing screencasts
31 | if (!$('#qunit-filter-pass').is(':checked')) {
32 | $('#qunit-filter-pass').click();
33 | }
34 |
35 | });
36 | QUnit.testStart(function(testDetails){
37 | QUnit.log = function(details){
38 | if (!details.result) {
39 | details.name = testDetails.name;
40 | log.push(details);
41 | }
42 | };
43 | });
44 |
45 | require('moment');
46 | require('./test/checkbox-test');
47 | require('./test/combobox-test');
48 | require('./test/datepicker-moment-test');
49 | require('./test/infinite-scroll-test');
50 | require('./test/loader-test');
51 | require('./test/pillbox-test');
52 | require('./test/placard-test');
53 | require('./test/radio-test');
54 | require('./test/repeater-test');
55 | require('./test/repeater-list-test');
56 | require('./test/repeater-thumbnail-test');
57 | require('./test/scheduler-test');
58 | require('./test/search-test');
59 | require('./test/selectlist-test');
60 | require('./test/spinbox-test');
61 | require('./test/tree-test');
62 | require('./test/wizard-test');
63 |
64 | });
65 |
--------------------------------------------------------------------------------
/templates/login.html:
--------------------------------------------------------------------------------
1 | {% extends "base/base_bootstrap.html" %}
2 | {% block body %}
3 |
4 |
5 |
6 |
{{ cmdb_name }}登录
7 |
8 |
35 |
36 |
37 |
38 |
39 | {% endblock %}
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_7.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_1.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_5.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_8.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_3.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_4.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_6.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/fonts/src/loader_2.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
9 |
11 |
13 |
15 |
17 |
19 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/static/plugins/fuelux-3.11.0/dev/dev.html.example:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | dev.html
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
72 |
73 |
74 |