├── .gitignore
├── LICENSE
├── README.md
├── asset
├── __init__.py
├── admin.py
├── asset_info.py
├── form.py
├── models.py
├── tests.py
└── views.py
├── demo
├── code_deploy.jpg
├── command_exec.jpg
├── data_center.jpg
├── device_asset.jpg
├── host_list.jpg
├── install.jpg
├── install_record.jpg
├── key.jpg
├── module.jpg
└── server_asset.jpg
├── deploy
├── __init__.py
├── admin.py
├── code.py
├── json_data.py
├── models.py
├── saltapi.py
├── tests.py
└── views.py
├── install.txt
├── installed
├── __init__.py
├── admin.py
├── cobbler_api.py
├── form.py
├── models.py
├── tests.py
└── views.py
├── manage.py
├── oms
├── .vimrc
├── __init__.py
├── models.py
├── mysql.py
├── settings.py
├── settings_local.py
├── urls.py
├── views.py
└── wsgi.py
├── requirements.txt
├── static
├── css
│ ├── animate.css
│ ├── font-awesome.min.css
│ ├── main.css
│ └── main.min.css
├── fonts
│ ├── fontawesome-webfont.eot-
│ ├── fontawesome-webfont.eot-v=4.0.3
│ ├── fontawesome-webfont.svg-v=4.0.3
│ ├── fontawesome-webfont.ttf-v=4.0.3
│ └── fontawesome-webfont.woff-v=4.0.3
├── img
│ ├── avatar.gif
│ ├── avatar.png
│ ├── avatar1.gif
│ ├── avatar2.gif
│ ├── avatar3.gif
│ ├── avatar4.gif
│ ├── avatar5.gif
│ ├── avatar6.gif
│ ├── favicon.ico
│ ├── logo.png
│ └── spaceship.gif
├── js
│ ├── application.js
│ ├── html5shiv.js
│ ├── jquery-1.10.2.min.js
│ ├── modernizr-2.6.2.min.js
│ └── respond.min.js
└── plugins
│ ├── bootstrap-slider
│ ├── css
│ │ └── slider.css
│ └── js
│ │ └── bootstrap-slider.js
│ ├── bootstrap-wysihtml5
│ ├── css
│ │ ├── bootstrap-wysihtml5.css
│ │ └── bootstrap3-wysiwyg5-color.css
│ └── js
│ │ ├── bootstrap3-wysihtml5.js
│ │ └── wysihtml5-0.3.0.js
│ ├── bootstrap
│ ├── css
│ │ └── bootstrap.min.css
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.eot-
│ │ ├── glyphicons-halflings-regular.eot~.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ └── js
│ │ └── bootstrap.min.js
│ ├── c3Chart
│ ├── css
│ │ └── c3.css
│ └── js
│ │ ├── c3-demo.js
│ │ ├── c3.js
│ │ └── d3.v3.min.js
│ ├── chartjs
│ ├── Chart.min.js
│ └── chartjs-demo.js
│ ├── ckeditor
│ ├── CHANGES.md
│ ├── LICENSE.md
│ ├── README.md
│ ├── adapters
│ │ └── jquery.js
│ ├── build-config.js
│ ├── ckeditor.js
│ ├── config.js
│ ├── contents.css
│ ├── lang
│ │ ├── af.js
│ │ ├── ar.js
│ │ ├── bg.js
│ │ ├── bn.js
│ │ ├── bs.js
│ │ ├── ca.js
│ │ ├── cs.js
│ │ ├── cy.js
│ │ ├── da.js
│ │ ├── de.js
│ │ ├── el.js
│ │ ├── en-au.js
│ │ ├── en-ca.js
│ │ ├── en-gb.js
│ │ ├── en.js
│ │ ├── eo.js
│ │ ├── es.js
│ │ ├── et.js
│ │ ├── eu.js
│ │ ├── fa.js
│ │ ├── fi.js
│ │ ├── fo.js
│ │ ├── fr-ca.js
│ │ ├── fr.js
│ │ ├── gl.js
│ │ ├── gu.js
│ │ ├── he.js
│ │ ├── hi.js
│ │ ├── hr.js
│ │ ├── hu.js
│ │ ├── id.js
│ │ ├── is.js
│ │ ├── it.js
│ │ ├── ja.js
│ │ ├── ka.js
│ │ ├── km.js
│ │ ├── ko.js
│ │ ├── ku.js
│ │ ├── lt.js
│ │ ├── lv.js
│ │ ├── mk.js
│ │ ├── mn.js
│ │ ├── ms.js
│ │ ├── nb.js
│ │ ├── nl.js
│ │ ├── no.js
│ │ ├── pl.js
│ │ ├── pt-br.js
│ │ ├── pt.js
│ │ ├── ro.js
│ │ ├── ru.js
│ │ ├── si.js
│ │ ├── sk.js
│ │ ├── sl.js
│ │ ├── sq.js
│ │ ├── sr-latn.js
│ │ ├── sr.js
│ │ ├── sv.js
│ │ ├── th.js
│ │ ├── tr.js
│ │ ├── ug.js
│ │ ├── uk.js
│ │ ├── vi.js
│ │ ├── zh-cn.js
│ │ └── zh.js
│ ├── plugins
│ │ ├── a11yhelp
│ │ │ └── dialogs
│ │ │ │ ├── a11yhelp.js
│ │ │ │ └── lang
│ │ │ │ ├── _translationstatus.txt
│ │ │ │ ├── ar.js
│ │ │ │ ├── bg.js
│ │ │ │ ├── ca.js
│ │ │ │ ├── cs.js
│ │ │ │ ├── cy.js
│ │ │ │ ├── da.js
│ │ │ │ ├── de.js
│ │ │ │ ├── el.js
│ │ │ │ ├── en.js
│ │ │ │ ├── eo.js
│ │ │ │ ├── es.js
│ │ │ │ ├── et.js
│ │ │ │ ├── fa.js
│ │ │ │ ├── fi.js
│ │ │ │ ├── fr-ca.js
│ │ │ │ ├── fr.js
│ │ │ │ ├── gl.js
│ │ │ │ ├── gu.js
│ │ │ │ ├── he.js
│ │ │ │ ├── hi.js
│ │ │ │ ├── hr.js
│ │ │ │ ├── hu.js
│ │ │ │ ├── id.js
│ │ │ │ ├── it.js
│ │ │ │ ├── ja.js
│ │ │ │ ├── km.js
│ │ │ │ ├── ko.js
│ │ │ │ ├── ku.js
│ │ │ │ ├── lt.js
│ │ │ │ ├── lv.js
│ │ │ │ ├── mk.js
│ │ │ │ ├── mn.js
│ │ │ │ ├── nb.js
│ │ │ │ ├── nl.js
│ │ │ │ ├── no.js
│ │ │ │ ├── pl.js
│ │ │ │ ├── pt-br.js
│ │ │ │ ├── pt.js
│ │ │ │ ├── ro.js
│ │ │ │ ├── ru.js
│ │ │ │ ├── si.js
│ │ │ │ ├── sk.js
│ │ │ │ ├── sl.js
│ │ │ │ ├── sq.js
│ │ │ │ ├── sr-latn.js
│ │ │ │ ├── sr.js
│ │ │ │ ├── sv.js
│ │ │ │ ├── th.js
│ │ │ │ ├── tr.js
│ │ │ │ ├── ug.js
│ │ │ │ ├── uk.js
│ │ │ │ ├── vi.js
│ │ │ │ ├── zh-cn.js
│ │ │ │ └── zh.js
│ │ ├── about
│ │ │ └── dialogs
│ │ │ │ ├── about.js
│ │ │ │ ├── hidpi
│ │ │ │ └── logo_ckeditor.png
│ │ │ │ └── logo_ckeditor.png
│ │ ├── clipboard
│ │ │ └── dialogs
│ │ │ │ └── paste.js
│ │ ├── dialog
│ │ │ └── dialogDefinition.js
│ │ ├── fakeobjects
│ │ │ └── images
│ │ │ │ └── spacer.gif
│ │ ├── icons.png
│ │ ├── icons_hidpi.png
│ │ ├── image
│ │ │ ├── dialogs
│ │ │ │ └── image.js
│ │ │ └── images
│ │ │ │ └── noimage.png
│ │ ├── link
│ │ │ ├── dialogs
│ │ │ │ ├── anchor.js
│ │ │ │ └── link.js
│ │ │ └── images
│ │ │ │ ├── anchor.png
│ │ │ │ └── hidpi
│ │ │ │ └── anchor.png
│ │ ├── magicline
│ │ │ └── images
│ │ │ │ ├── hidpi
│ │ │ │ └── icon.png
│ │ │ │ └── icon.png
│ │ ├── pastefromword
│ │ │ └── filter
│ │ │ │ └── default.js
│ │ ├── scayt
│ │ │ ├── LICENSE.md
│ │ │ ├── README.md
│ │ │ └── dialogs
│ │ │ │ ├── options.js
│ │ │ │ └── toolbar.css
│ │ ├── specialchar
│ │ │ └── dialogs
│ │ │ │ ├── lang
│ │ │ │ ├── _translationstatus.txt
│ │ │ │ ├── ar.js
│ │ │ │ ├── bg.js
│ │ │ │ ├── ca.js
│ │ │ │ ├── cs.js
│ │ │ │ ├── cy.js
│ │ │ │ ├── de.js
│ │ │ │ ├── el.js
│ │ │ │ ├── en.js
│ │ │ │ ├── eo.js
│ │ │ │ ├── es.js
│ │ │ │ ├── et.js
│ │ │ │ ├── fa.js
│ │ │ │ ├── fi.js
│ │ │ │ ├── fr-ca.js
│ │ │ │ ├── fr.js
│ │ │ │ ├── gl.js
│ │ │ │ ├── he.js
│ │ │ │ ├── hr.js
│ │ │ │ ├── hu.js
│ │ │ │ ├── id.js
│ │ │ │ ├── it.js
│ │ │ │ ├── ja.js
│ │ │ │ ├── km.js
│ │ │ │ ├── ku.js
│ │ │ │ ├── lv.js
│ │ │ │ ├── nb.js
│ │ │ │ ├── nl.js
│ │ │ │ ├── no.js
│ │ │ │ ├── pl.js
│ │ │ │ ├── pt-br.js
│ │ │ │ ├── pt.js
│ │ │ │ ├── ru.js
│ │ │ │ ├── si.js
│ │ │ │ ├── sk.js
│ │ │ │ ├── sl.js
│ │ │ │ ├── sq.js
│ │ │ │ ├── sv.js
│ │ │ │ ├── th.js
│ │ │ │ ├── tr.js
│ │ │ │ ├── ug.js
│ │ │ │ ├── uk.js
│ │ │ │ ├── vi.js
│ │ │ │ ├── zh-cn.js
│ │ │ │ └── zh.js
│ │ │ │ └── specialchar.js
│ │ ├── table
│ │ │ └── dialogs
│ │ │ │ └── table.js
│ │ ├── tabletools
│ │ │ └── dialogs
│ │ │ │ └── tableCell.js
│ │ └── wsc
│ │ │ ├── LICENSE.md
│ │ │ ├── README.md
│ │ │ └── dialogs
│ │ │ ├── ciframe.html
│ │ │ ├── tmp.html
│ │ │ ├── tmpFrameset.html
│ │ │ ├── wsc.css
│ │ │ ├── wsc.js
│ │ │ └── wsc_ie.js
│ ├── samples
│ │ ├── ajax.html
│ │ ├── api.html
│ │ ├── appendto.html
│ │ ├── assets
│ │ │ ├── inlineall
│ │ │ │ └── logo.png
│ │ │ ├── outputxhtml
│ │ │ │ └── outputxhtml.css
│ │ │ ├── posteddata.php
│ │ │ ├── sample.css
│ │ │ ├── sample.jpg
│ │ │ └── uilanguages
│ │ │ │ └── languages.js
│ │ ├── datafiltering.html
│ │ ├── divreplace.html
│ │ ├── index.html
│ │ ├── inlineall.html
│ │ ├── inlinebycode.html
│ │ ├── inlinetextarea.html
│ │ ├── jquery.html
│ │ ├── plugins
│ │ │ ├── dialog
│ │ │ │ ├── assets
│ │ │ │ │ └── my_dialog.js
│ │ │ │ └── dialog.html
│ │ │ ├── enterkey
│ │ │ │ └── enterkey.html
│ │ │ ├── htmlwriter
│ │ │ │ ├── assets
│ │ │ │ │ └── outputforflash
│ │ │ │ │ │ ├── outputforflash.fla
│ │ │ │ │ │ ├── outputforflash.swf
│ │ │ │ │ │ └── swfobject.js
│ │ │ │ ├── outputforflash.html
│ │ │ │ └── outputhtml.html
│ │ │ ├── magicline
│ │ │ │ └── magicline.html
│ │ │ ├── toolbar
│ │ │ │ └── toolbar.html
│ │ │ └── wysiwygarea
│ │ │ │ └── fullpage.html
│ │ ├── readonly.html
│ │ ├── replacebyclass.html
│ │ ├── replacebycode.html
│ │ ├── sample.css
│ │ ├── sample.js
│ │ ├── sample_posteddata.php
│ │ ├── tabindex.html
│ │ ├── uicolor.html
│ │ ├── uilanguages.html
│ │ └── xhtmlstyle.html
│ ├── skins
│ │ └── moono
│ │ │ ├── dialog.css
│ │ │ ├── dialog_ie.css
│ │ │ ├── dialog_ie7.css
│ │ │ ├── dialog_ie8.css
│ │ │ ├── dialog_iequirks.css
│ │ │ ├── dialog_opera.css
│ │ │ ├── editor.css
│ │ │ ├── editor_gecko.css
│ │ │ ├── editor_ie.css
│ │ │ ├── editor_ie7.css
│ │ │ ├── editor_ie8.css
│ │ │ ├── editor_iequirks.css
│ │ │ ├── icons.png
│ │ │ ├── icons_hidpi.png
│ │ │ ├── images
│ │ │ ├── arrow.png
│ │ │ ├── close.png
│ │ │ ├── hidpi
│ │ │ │ ├── close.png
│ │ │ │ ├── lock-open.png
│ │ │ │ ├── lock.png
│ │ │ │ └── refresh.png
│ │ │ ├── lock-open.png
│ │ │ ├── lock.png
│ │ │ └── refresh.png
│ │ │ └── readme.md
│ └── styles.js
│ ├── countTo
│ └── jquery.countTo.js
│ ├── dataTables
│ ├── css
│ │ └── dataTables.css
│ ├── images
│ │ ├── sort_asc.png
│ │ ├── sort_asc_disabled.png
│ │ ├── sort_both.png
│ │ ├── sort_desc.png
│ │ └── sort_desc_disabled.png
│ └── js
│ │ ├── dataTables.bootstrap.js
│ │ └── jquery.dataTables.js
│ ├── dropzone
│ ├── css
│ │ ├── basic.css
│ │ └── dropzone.css
│ ├── images
│ │ ├── spritemap.png
│ │ └── spritemap@2x.png
│ └── js
│ │ └── dropzone.min.js
│ ├── flot
│ └── js
│ │ ├── jquery.colorhelpers.min.js
│ │ ├── jquery.flot.canvas.min.js
│ │ ├── jquery.flot.categories.min.js
│ │ ├── jquery.flot.crosshair.min.js
│ │ ├── jquery.flot.errorbars.min.js
│ │ ├── jquery.flot.example.js
│ │ ├── jquery.flot.fillbetween.min.js
│ │ ├── jquery.flot.image.min.js
│ │ ├── jquery.flot.min.js
│ │ ├── jquery.flot.navigate.min.js
│ │ ├── jquery.flot.pie.min.js
│ │ ├── jquery.flot.resize.min.js
│ │ ├── jquery.flot.selection.min.js
│ │ ├── jquery.flot.stack.min.js
│ │ ├── jquery.flot.symbol.min.js
│ │ ├── jquery.flot.threshold.min.js
│ │ └── jquery.flot.time.min.js
│ ├── fullcalendar
│ ├── css
│ │ └── fullcalendar.css
│ └── js
│ │ ├── calendar.js
│ │ ├── fullcalendar.min.js
│ │ └── jquery-ui-1.10.1.custom.min.js
│ ├── gmaps
│ ├── gmaps-demo.js
│ └── gmaps.js
│ ├── icheck
│ ├── css
│ │ ├── _all.css
│ │ ├── aero.png
│ │ ├── aero@2x.png
│ │ ├── blue.png
│ │ ├── blue@2x.png
│ │ ├── flat.png
│ │ ├── flat@2x.png
│ │ ├── green.png
│ │ ├── green@2x.png
│ │ ├── grey.png
│ │ ├── grey@2x.png
│ │ ├── orange.png
│ │ ├── orange@2x.png
│ │ ├── pink.png
│ │ ├── pink@2x.png
│ │ ├── purple.png
│ │ ├── purple@2x.png
│ │ ├── red.png
│ │ ├── red@2x.png
│ │ ├── yellow.png
│ │ └── yellow@2x.png
│ └── js
│ │ └── icheck.min.js
│ ├── jvectormap
│ ├── css
│ │ └── jquery-jvectormap-1.2.2.css
│ └── js
│ │ ├── jquery-jvectormap-1.2.2.min.js
│ │ ├── jquery-jvectormap-ca-lcc-en.js
│ │ ├── jquery-jvectormap-demo.js
│ │ ├── jquery-jvectormap-europe-mill-en.js
│ │ ├── jquery-jvectormap-it-mill-en.js
│ │ ├── jquery-jvectormap-map.js
│ │ ├── jquery-jvectormap-uk-mill-en.js
│ │ ├── jquery-jvectormap-us-aea-en.js
│ │ ├── jquery-jvectormap-us-il-chicago-mill-en.js
│ │ ├── jquery-jvectormap-us-ny-newyork-mill-en.js
│ │ └── jquery-jvectormap-world-mill-en.js
│ ├── mask
│ └── js
│ │ └── jquery.maskedinput.min.js
│ ├── messenger
│ ├── css
│ │ ├── location-sel.css
│ │ ├── messenger-theme-flat.css
│ │ └── messenger.css
│ └── js
│ │ ├── demo
│ │ ├── demo-messages.js
│ │ ├── demo.js
│ │ ├── location-sel.js
│ │ └── theme-sel.js
│ │ ├── messenger-theme-future.js
│ │ └── messenger.min.js
│ ├── morris
│ ├── css
│ │ └── morris.css
│ └── js
│ │ ├── morris-example.js
│ │ ├── morris.min.js
│ │ └── raphael.2.1.0.min.js
│ ├── nanoScroller
│ └── jquery.nanoscroller.min.js
│ ├── sortNestable
│ └── js
│ │ └── jquery.nestable.js
│ ├── todo
│ ├── css
│ │ └── todos.css
│ ├── img
│ │ └── destroy.png
│ └── js
│ │ └── todos.js
│ ├── validation
│ └── js
│ │ └── jquery.validate.min.js
│ ├── waypoints
│ └── waypoints.min.js
│ ├── weather
│ └── js
│ │ └── skycons.js
│ └── wizard
│ └── js
│ └── loader.min.js
└── templates
├── 404.html
├── 500.html
├── code_deploy.html
├── device_list.html
├── device_manage.html
├── host_list.html
├── host_manage.html
├── idc_list.html
├── idc_manage.html
├── index.html
├── install_list.html
├── install_manage.html
├── install_record_list.html
├── login.html
├── salt_key_list.html
├── salt_module_deploy.html
├── salt_remote_execution.html
├── server_asset_list.html
└── sign-up.html
/.gitignore:
--------------------------------------------------------------------------------
1 | *.py[co]
2 | *.swp
3 | *.DS_Store
4 |
5 | # setuptools stuff
6 | *.egg-info
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | oms
2 | ===
3 |
4 | OMS运维管理平台
5 |
6 | 写在前言:
7 | 分享,平台里的东西是采用各家之精华,自己融合才有了那么个东西,发表OMS博客那天,答应过后续开源,那么今天就把它分享出来
8 | 学习,自我赶脚代码不是很好,分享出来; 希望得到学习,毕竟闭门造车不好嘛。希望得到反馈,谢谢~
9 | 总结,从13年底就想写这么个东西,刚好下半年有空,就利用9月份把这个写了,算是对自动化运维一个小小总结,里面还有不够好的地方,希望可以得到交流,毕竟每人角度不一,观点也不一样。
10 | 感谢蝴蝶运维老大支持,小马哥代码指点迷津,绿肥在OMS平台写的时候提供帮助~
11 |
12 | redhat.binbin@gmail.com //欢迎来件~,TKS ALL~
13 |
14 | 组件要求查看requirements.txt,安装查看install.txt
15 |
16 | OMS管理平台界面
17 | 
18 | 
19 | 
20 | 
21 | 
22 | 
23 | 
24 | 
25 | 
26 | 
27 |
28 |
--------------------------------------------------------------------------------
/asset/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/asset/__init__.py
--------------------------------------------------------------------------------
/asset/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/asset/asset_info.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from sys import path
3 | if 'deploy' not in path:
4 | path.append(r'deploy')
5 | from saltapi import SaltAPI
6 | from oms import settings
7 | import threading
8 |
9 | asset_info = []
10 |
11 | def get_server_asset_info(tgt):
12 | '''
13 | Salt API得到资产信息,进行格式化输出
14 | '''
15 | global asset_info
16 | info = []
17 | sapi = SaltAPI(url=settings.SALT_API['url'],username=settings.SALT_API['user'],password=settings.SALT_API['password'])
18 | ret = sapi.remote_noarg_execution(tgt,'grains.items')
19 | manufacturer = ret['manufacturer']
20 | info.append(manufacturer)
21 | productname = ret['productname']
22 | info.append(productname)
23 | serialnumber = ret['serialnumber']
24 | info.append(serialnumber)
25 | cpu_model = ret['cpu_model']
26 | info.append(cpu_model)
27 | num_cpus = int(ret['num_cpus'])
28 | info.append(num_cpus)
29 | num_gpus = int(ret['num_gpus'])
30 | info.append(num_gpus)
31 | mem_total = str(round(int(ret['mem_total'])/1000.0,))[:-2] + 'G'
32 | info.append(mem_total)
33 | disk_size = ret['disk_size']
34 | info.append(disk_size)
35 | raidlevel = ret['raidlevel']
36 | info.append(raidlevel)
37 | id = ret['id']
38 | info.append(id)
39 | lan_ip = ret['lan_ip'][0]
40 | info.append(lan_ip)
41 | lan_mac = ret['hwaddr_interfaces']['eth0']
42 | info.append(lan_mac)
43 | sys_ver = ret['os'] + ret['osrelease'] + '-' + ret['osarch']
44 | info.append(sys_ver)
45 | virtual = ret['virtual']
46 | info.append(virtual)
47 | idc_name = ret['idc_name']
48 | info.append(idc_name)
49 | asset_info.append(info)
50 |
51 |
52 | def multitle_collect(tgt):
53 | global asset_info
54 | #全局变量置空,避免多次请求的时候返回结果叠加
55 | aseet_info = []
56 | threads = []
57 | loop = 0
58 | numtgt = len(tgt)
59 | for i in range(0, numtgt, 2):
60 | nkeys = range(loop*2, (loop+1)*2, 1)
61 | #实例化线程
62 | for i in nkeys:
63 | if i >= numtgt:
64 | break
65 | else:
66 | t = threading.Thread(target=get_server_asset_info, args=(tgt[i],))
67 | threads.append(t)
68 | #启动线程
69 | for i in nkeys:
70 | if i >= numtgt:
71 | break
72 | else:
73 | threads[i].start()
74 | #等待并发线程结束
75 | for i in nkeys:
76 | if i >= numtgt:
77 | break
78 | else:
79 | threads[i].join()
80 | loop = loop + 1
81 | return asset_info
82 |
83 | '''
84 | if __name__ == '__main__':
85 | print multitle_collect(['test-02', 'test-01'])
86 | '''
87 |
--------------------------------------------------------------------------------
/asset/form.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from django import forms
3 | from asset.models import *
4 |
5 | class HostsListForm(forms.ModelForm):
6 | class Meta:
7 | model = HostList
8 | widgets = {
9 | 'ip': forms.TextInput(attrs={'class': 'form-control'}),
10 | 'hostname': forms.TextInput(attrs={'class': 'form-control'}),
11 | 'product': forms.TextInput(attrs={'class': 'form-control'}),
12 | 'application': forms.TextInput(attrs={'class': 'form-control'}),
13 | 'idc_jg': forms.TextInput(attrs={'class': 'form-control'}),
14 | 'status': forms.TextInput(attrs={'class': 'form-control'}),
15 | 'remark': forms.TextInput(attrs={'class': 'form-control'}),
16 | }
17 |
18 | class NetworkAssetForm(forms.ModelForm):
19 | class Meta:
20 | model = NetworkAsset
21 | widgets = {
22 | 'ip': forms.TextInput(attrs={'class': 'form-control'}),
23 | 'hostname': forms.TextInput(attrs={'class': 'form-control'}),
24 | 'manufacturer': forms.TextInput(attrs={'class': 'form-control'}),
25 | 'productname': forms.TextInput(attrs={'class': 'form-control'}),
26 | 'idc_jg': forms.TextInput(attrs={'class': 'form-control'}),
27 | 'service_tag': forms.TextInput(attrs={'class': 'form-control'}),
28 | 'remark': forms.TextInput(attrs={'class': 'form-control'}),
29 | }
30 |
31 | class IdcAssetForm(forms.ModelForm):
32 | class Meta:
33 | model = IdcAsset
34 | widgets = {
35 | 'idc_name': forms.TextInput(attrs={'class': 'form-control'}),
36 | 'idc_type': forms.TextInput(attrs={'class': 'form-control'}),
37 | 'idc_location': forms.TextInput(attrs={'class': 'form-control'}),
38 | 'contract_date': forms.TextInput(attrs={'class': 'form-control'}),
39 | 'idc_contacts': forms.TextInput(attrs={'class': 'form-control'}),
40 | 'remark': forms.TextInput(attrs={'class': 'form-control'}),
41 | }
42 |
--------------------------------------------------------------------------------
/asset/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/demo/code_deploy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/code_deploy.jpg
--------------------------------------------------------------------------------
/demo/command_exec.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/command_exec.jpg
--------------------------------------------------------------------------------
/demo/data_center.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/data_center.jpg
--------------------------------------------------------------------------------
/demo/device_asset.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/device_asset.jpg
--------------------------------------------------------------------------------
/demo/host_list.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/host_list.jpg
--------------------------------------------------------------------------------
/demo/install.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/install.jpg
--------------------------------------------------------------------------------
/demo/install_record.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/install_record.jpg
--------------------------------------------------------------------------------
/demo/key.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/key.jpg
--------------------------------------------------------------------------------
/demo/module.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/module.jpg
--------------------------------------------------------------------------------
/demo/server_asset.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/demo/server_asset.jpg
--------------------------------------------------------------------------------
/deploy/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/deploy/__init__.py
--------------------------------------------------------------------------------
/deploy/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/deploy/code.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | from subprocess import Popen,PIPE,STDOUT,call
3 | import os
4 |
5 | class Code_Work(object):
6 | def __init__(self,pro,url,ver):
7 | self.__pro = pro
8 | self.__url = url
9 | self.__ver = ver
10 | path = {'tg': 'opt/www/v', 'hdworkers': 'home/hpn'}
11 | self.__tgt = path[self.__pro]
12 |
13 | def pull_code(self):
14 | '''
15 | From the pull of gitlab project code
16 | '''
17 | ret = {
18 | 'result': True,
19 | 'comment': [],
20 | }
21 | if os.path.isdir('/home/work'):
22 | os.system('rm -rf /home/work/*') #每次拉取,work都是干净目录
23 | os.chdir('/home/work')
24 | else:
25 | os.mkdir('/home/work')
26 | os.chdir('/home/work')
27 | args = 'git clone %s %s' % (self.__url,self.__tgt)
28 | try:
29 | obj = Popen(args, shell=True, stdout=PIPE, stderr=STDOUT)
30 | ret['comment'].append(obj.stdout.readlines())
31 | except Exception, e:
32 | ret['result'] = False
33 | ret['comment'].append(str(e))
34 | return ret
35 |
36 | def build_rpm(self):
37 | '''
38 | Project of the latest code into the RPM
39 | '''
40 | ret = {
41 | 'result': True,
42 | 'comment': [],
43 | }
44 | f_args = 'fpm -s dir -t rpm -n %s --epoch 0 -v %s -C /home/work -p /mirros/package %s' % (self.__pro,self.__ver,self.__tgt)
45 | try:
46 | obj = Popen(f_args, shell=True, stdout=PIPE, stderr=STDOUT)
47 | ret['comment'].append(obj.stdout.readlines())
48 | except Exception, e:
49 | ret['result'] = False
50 | ret['comment'].append(str(e))
51 | return ret
52 |
53 | def push_repo(self):
54 | '''
55 | push to yum warehouse
56 | '''
57 | ret = {
58 | 'result': True,
59 | 'comment': [],
60 | }
61 | c_args = 'createrepo /mirros/package'
62 | try:
63 | obj = Popen(c_args, shell=True, stdout=PIPE, stderr=STDOUT)
64 | ret['comment'].append(obj.stdout.readlines())
65 | except Exception, e:
66 | ret['result'] = False
67 | ret['comment'].append(str(e))
68 | return ret
69 |
70 | def work(self):
71 | ret = {
72 | 'comment': [],
73 | }
74 | ret['comment'].append(self.pull_code())
75 | ret['comment'].append(self.build_rpm())
76 | ret['comment'].append(self.push_repo())
77 | return ret
78 |
79 | def main():
80 | capi = Code_Work(pro=,url=,ver=)
81 | print capi.work()
82 | #print capi.pull_code()
83 | #print capi.build_rpm()
84 | #print capi.push_repo()
85 |
86 | if __name__ == '__main__':
87 | main()
88 |
--------------------------------------------------------------------------------
/deploy/json_data.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | import json
3 | import os
4 |
5 | class BuildJson(object):
6 | '''
7 | Build JSON data(base and minion_id etc..)
8 | '''
9 | def base_data(self,args):
10 | '''
11 | build base data
12 | '''
13 | info = {}
14 | ret = dict(info,**args)
15 | self.write_data('base',ret)
16 |
17 | def build_data(self,id,args):
18 | if not os.path.exists('/home/api/pillar/%s' % (id)):
19 | with open('/home/api/pillar/base') as f:
20 | obj = f.readlines()[0]
21 | ret = eval(obj)
22 | self.write_data(id,ret)
23 | with open('/home/api/pillar/%s' % (id)) as f:
24 | data = f.readlines()[0]
25 | cov_data = eval(data)
26 | if not cov_data.has_key(args.keys()[0]):
27 | ret = dict(cov_data,**args)
28 | self.write_data(id,ret)
29 | else:
30 | cov_data.update(args)
31 | self.write_data(id,cov_data)
32 |
33 | def write_data(self,file,ret):
34 | f = open('/home/api/pillar/%s' % (file),'w+')
35 | f.write(str(ret))
36 | f.close()
37 |
38 |
--------------------------------------------------------------------------------
/deploy/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 |
--------------------------------------------------------------------------------
/deploy/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/install.txt:
--------------------------------------------------------------------------------
1 | 功能简介:
2 | installed App: 系统安装、安装记录
3 | deploy App: Salt Key管理、模块部署、远程管理、代码发布
4 | asset App: 主机列表、服务器软硬资产、网络设备资产、数据中心资产
5 |
6 | 设计流程:
7 | 传送门:http://binbin158.blog.51cto.com/2659767/1561175
8 |
9 | 安装
10 | 1.Cobbler(OMS需要调用cobbler代码模块)
11 | yum localinstall /tmp/cobbler-2.6.3-1.el6.noarch.rpm // yum install cobbler
12 |
13 | 2.Saltstack
14 | rpm -ivh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
15 | yum install salt-master //最近epel源有问题,可以上官网直接下载代码install
16 |
17 | 3.Saltstack API、配置
18 | 传送门:http://pengyao.org/salt-api-deploy-and-use.html
19 |
20 | 4.MySQL-python
21 | yum install MySQL-python
22 |
23 | 5.MySQL安装配置(OMS数据模型、APP代码需要调用),只要python manage.py validate没问题就OK
24 | 1.新装一个MySQL
25 | 2.使用现用滴, 这个环节我就略了~
26 |
27 | 6.salt_event_to_mysql.py
28 | 传送门:http://pengyao.org/saltstack_master_retuner_over_event_system.html
29 |
30 | 7.ext_pillar(oms.py)
31 | 传送门:http://binbin158.blog.51cto.com/2659767/1570433
32 |
33 | 配置(根据环境自行配置):
34 | settings.py 数据库信息
35 | settings_local.py API接口信息,数据库信息
36 | cobble_api.py 连接信息
37 |
38 | 启动
39 | 1.导入数据类型
40 | mysql -uroot -p -e 'create database oms;'
41 | python manage.py validate
42 | python manage.py syncdb
43 |
44 | 2.启动程序
45 | a#直接启动, python manage.py runserver 0.0.0.0:8000
46 | b#nginx + uwsgin,参考链接:http://binbin158.blog.51cto.com/2659767/1569298
47 |
--------------------------------------------------------------------------------
/installed/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/installed/__init__.py
--------------------------------------------------------------------------------
/installed/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 |
3 | # Register your models here.
4 |
--------------------------------------------------------------------------------
/installed/cobbler_api.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | # -*- coding: utf-8 -*-
3 | #
4 | # @author: binbin CKEditor '+CKEDITOR.version+" (revision "+CKEDITOR.revision+') '+a.help.replace("$1",''+
7 | a.userGuide+"")+" "+a.moreInfo+' '+a.copy.replace("$1",'CKSource - Frederico Knabben')+" '+a.lang.wsc.errorLoading.replace(/%s/g,a.config.wsc_customLoaderScript)+"
47 | This sample shows how to create and destroy CKEditor instances on the fly. After the removal of CKEditor the content created inside the editing
48 | area will be displayed in a
51 | For details of how to create this setup check the source code of this sample page
52 | for JavaScript code responsible for the creation and destruction of a CKEditor instance.
53 | Click the buttons to create and remove a CKEditor instance.
57 |
58 |
59 |
20 |
45 | This sample shows how to use the
46 |
50 | For details on how to create this setup check the source code of this sample page.
51 | %1
%2
".replace("%1",b.name).replace("%2",h.join("")))}return e.replace("%1",
9 | g.join(""))}()+''}]}],
10 | buttons:[CKEDITOR.dialog.cancelButton]}});
--------------------------------------------------------------------------------
/static/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/_translationstatus.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
2 | For licensing, see LICENSE.md or http://ckeditor.com/license
3 |
4 | cs.js Found: 30 Missing: 0
5 | cy.js Found: 30 Missing: 0
6 | da.js Found: 12 Missing: 18
7 | de.js Found: 30 Missing: 0
8 | el.js Found: 25 Missing: 5
9 | eo.js Found: 30 Missing: 0
10 | fa.js Found: 30 Missing: 0
11 | fi.js Found: 30 Missing: 0
12 | fr.js Found: 30 Missing: 0
13 | gu.js Found: 12 Missing: 18
14 | he.js Found: 30 Missing: 0
15 | it.js Found: 30 Missing: 0
16 | mk.js Found: 5 Missing: 25
17 | nb.js Found: 30 Missing: 0
18 | nl.js Found: 30 Missing: 0
19 | no.js Found: 30 Missing: 0
20 | pt-br.js Found: 30 Missing: 0
21 | ro.js Found: 6 Missing: 24
22 | tr.js Found: 30 Missing: 0
23 | ug.js Found: 27 Missing: 3
24 | vi.js Found: 6 Missing: 24
25 | zh-cn.js Found: 30 Missing: 0
26 |
--------------------------------------------------------------------------------
/static/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/ja.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3 | For licensing, see LICENSE.md or http://ckeditor.com/license
4 | */
5 | CKEDITOR.plugins.setLang("a11yhelp","ja",{title:"ユーザー補助の説明",contents:"ヘルプ このダイアログを閉じるには ESCを押してください。",legend:[{name:"全般",items:[{name:"エディターツールバー",legend:"${toolbarFocus} を押すとツールバーのオン/オフ操作ができます。カーソルをツールバーのグループで移動させるにはTabかSHIFT+Tabを押します。グループ内でカーソルを移動させるには、右カーソルか左カーソルを押します。スペースキーやエンターを押すとボタンを有効/無効にすることができます。"},{name:"編集ダイアログ",legend:"ダイヤログ内では、ダイアログの次の選択肢に移動するにはTabを押します。前の選択肢に移動するには、SHIFT+Tabを押します。ダイアログを決定するには、ENTERを押します。ESCでダイアログをキャンセルできます。複数のタブがあるダイアログではタブリストを操作するにはALT+F10を押します。次のタブに移動するにはTabか右カーソル、前のタブに戻るにはSHIFT+Tabか左カーソルです。タブページを決定するにはスペースもしくは、ENTERキーを押してください。"},
6 | {name:"エディターのメニュー",legend:"${contextMenu} キーかAPPLICATION KEYを押すとコンテキストメニューが開きます。Tabか下カーソルでメニューのオプション選択が下に移動します。戻るには、SHIFT+Tabか上カーソルです。スペースもしくはENTERキーでメニューオプションを決定できます。現在選んでいるオプションのサブメニューを開くには、スペース、もしくは右カーソルを押します。サブメニューから親メニューに戻るには、ESCか左カーソルを押してください。ESCでコンテキストメニュー自体をキャンセルできます。"},{name:"エディターリストボックス",legend:"リストボックス内で移動するには、Tabか下カーソルで次のアイテムへ移動します。SHIFT+Tabで前のアイテムに戻ります。リストのオプションを選択するには、スペースもしくは、ENTERを押してください。リストボックスを閉じるには、ESCを押してください。"},{name:"エディター要素パスバー",legend:"${elementsPathFocus} を押すとエレメントパスバーを操作出来ます。Tabか右カーソルで次のエレメントを選択できます。前のエレメントを選択するには、SHIFT+Tabか左カーソルです。スペースもしくは、ENTERでエディタ内の対象エレメントを選択出来ます。"}]},
7 | {name:"コマンド",items:[{name:"元に戻す",legend:"${undo} をクリック"},{name:"やり直し",legend:"${redo} をクリック"},{name:"太字",legend:"${bold} をクリック"},{name:"斜体 ",legend:"${italic} をクリック"},{name:"下線",legend:"${underline} をクリック"},{name:"リンク",legend:"${link} をクリック"},{name:"ツールバーを縮める",legend:"${toolbarCollapse} をクリック"},{name:"前のカーソル移動のできないポイントへ",legend:"${accessPreviousSpace} を押すとカーソルより前にあるカーソルキーで入り込めないスペースへ移動できます。例えば、HRエレメントが2つ接している場合などです。離れた場所へは、複数回キーを押します。"},{name:"次のカーソル移動のできないポイントへ",legend:"${accessNextSpace} を押すとカーソルより後ろにあるカーソルキーで入り込めないスペースへ移動できます。例えば、HRエレメントが2つ接している場合などです。離れた場所へは、複数回キーを押します。"},
8 | {name:"ユーザー補助ヘルプ",legend:"${a11yHelp} をクリック"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"左矢印",upArrow:"上矢印",rightArrow:"右矢印",downArrow:"下矢印",insert:"Insert","delete":"Delete",leftWindowKey:"左Windowキー",rightWindowKey:"右のWindowキー",selectKey:"Select",numpad0:"Num 0",numpad1:"Num 1",numpad2:"Num 2",numpad3:"Num 3",numpad4:"Num 4",numpad5:"Num 5",
9 | numpad6:"Num 6",numpad7:"Num 7",numpad8:"Num 8",numpad9:"Num 9",multiply:"掛ける",add:"足す",subtract:"引く",decimalPoint:"小数点",divide:"割る",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"セミコロン",equalSign:"イコール記号",comma:"カンマ",dash:"ダッシュ",period:"ピリオド",forwardSlash:"フォワードスラッシュ",graveAccent:"グレイヴアクセント",openBracket:"開きカッコ",backSlash:"バックスラッシュ",closeBracket:"閉じカッコ",singleQuote:"シングルクォート"});
--------------------------------------------------------------------------------
/static/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/zh-cn.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3 | For licensing, see LICENSE.md or http://ckeditor.com/license
4 | */
5 | CKEDITOR.plugins.setLang("a11yhelp","zh-cn",{title:"辅助功能说明",contents:"帮助内容。要关闭此对话框请按 ESC 键。",legend:[{name:"常规",items:[{name:"编辑器工具栏",legend:"按 ${toolbarFocus} 导航到工具栏,使用 TAB 键和 SHIFT+TAB 组合键移动到上一个和下一个工具栏组。使用左右箭头键移动到上一个和下一个工具栏按钮。按空格键或回车键以选中工具栏按钮。"},{name:"编辑器对话框",legend:"在对话框内,TAB 键移动到下一个字段,SHIFT + TAB 组合键移动到上一个字段,ENTER 键提交对话框,ESC 键取消对话框。对于有多选项卡的对话框,用ALT + F10来移到选项卡列表。然后用 TAB 键或者向右箭头来移动到下一个选项卡;SHIFT + TAB 组合键或者向左箭头移动到上一个选项卡。用 SPACE 键或者 ENTER 键选择选项卡。"},{name:"编辑器上下文菜单",legend:"用 ${contextMenu} 或者“应用程序键”打开上下文菜单。然后用 TAB 键或者下箭头键来移动到下一个菜单项;SHIFT + TAB 组合键或者上箭头键移动到上一个菜单项。用 SPACE 键或者 ENTER 键选择菜单项。用 SPACE 键,ENTER 键或者右箭头键打开子菜单。返回菜单用 ESC 键或者左箭头键。用 ESC 键关闭上下文菜单。"},
6 | {name:"编辑器列表框",legend:"在列表框中,移到下一列表项用 TAB 键或者下箭头键。移到上一列表项用SHIFT + TAB 组合键或者上箭头键,用 SPACE 键或者 ENTER 键选择列表项。用 ESC 键收起列表框。"},{name:"编辑器元素路径栏",legend:"按 ${elementsPathFocus} 以导航到元素路径栏,使用 TAB 键或右箭头键选择下一个元素,使用 SHIFT+TAB 组合键或左箭头键选择上一个元素,按空格键或回车键以选定编辑器里的元素。"}]},{name:"命令",items:[{name:" 撤消命令",legend:"按 ${undo}"},{name:" 重做命令",legend:"按 ${redo}"},{name:" 加粗命令",legend:"按 ${bold}"},{name:" 倾斜命令",legend:"按 ${italic}"},{name:" 下划线命令",legend:"按 ${underline}"},{name:" 链接命令",legend:"按 ${link}"},{name:" 工具栏折叠命令",legend:"按 ${toolbarCollapse}"},
7 | {name:"访问前一个焦点区域的命令",legend:"按 ${accessPreviousSpace} 访问^符号前最近的不可访问的焦点区域,例如:两个相邻的 HR 元素。重复此组合按键可以到达远处的焦点区域。"},{name:"访问下一个焦点区域命令",legend:"按 ${accessNextSpace} 以访问^符号后最近的不可访问的焦点区域。例如:两个相邻的 HR 元素。重复此组合按键可以到达远处的焦点区域。"},{name:"辅助功能帮助",legend:"按 ${a11yHelp}"}]}],backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",upArrow:"Up Arrow",rightArrow:"Right Arrow",
8 | downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"Left Windows key",rightWindowKey:"Right Windows key",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Multiply",add:"Add",subtract:"Subtract",decimalPoint:"Decimal Point",divide:"Divide",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",
9 | f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Equal Sign",comma:"Comma",dash:"Dash",period:"Period",forwardSlash:"Forward Slash",graveAccent:"Grave Accent",openBracket:"Open Bracket",backSlash:"Backslash",closeBracket:"Close Bracket",singleQuote:"Single Quote"});
--------------------------------------------------------------------------------
/static/plugins/ckeditor/plugins/a11yhelp/dialogs/lang/zh.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3 | For licensing, see LICENSE.md or http://ckeditor.com/license
4 | */
5 | CKEDITOR.plugins.setLang("a11yhelp","zh",{title:"輔助工具指南",contents:"說明內容。若要關閉此對話框請按「ESC」。",legend:[{name:"一般",items:[{name:"編輯器工具列",legend:"請按「${toolbarFocus}」以瀏覽工具列。\r\n利用「TAB」或「SHIFT+TAB」以便移動到下一個或前一個工具列群組。\r\n利用「→」或「←」以便移動到下一個或前一個工具列按鈕。\r\n請按下「空白鍵」或「ENTER」鍵啟動工具列按鈕。"},{name:"編輯器對話方塊",legend:"在對話框中,請按 TAB 鍵以便移動到下個欄位,請按 SHIFT + TAB 以便移動到前個欄位;請按 ENTER 以提交對話框資料,或按下 ESC 取消對話框。\r\n若是有多個頁框的對話框,請按 ALT + F10 以移動到頁框列表,並以 TAB 或是 → 方向鍵移動到下個頁框。以 SHIFT + TAB 或是 ← 方向鍵移動到前個頁框。按下 空白鍵 或是 ENTER 以選取頁框。"},{name:"編輯器內容功能表",
6 | legend:"請按下「${contextMenu}」或是「應用程式鍵」以開啟內容選單。以「TAB」或是「↓」鍵移動到下一個選單選項。以「SHIFT + TAB」或是「↑」鍵移動到上一個選單選項。按下「空白鍵」或是「ENTER」鍵以選取選單選項。以「空白鍵」或「ENTER」或「→」開啟目前選項之子選單。以「ESC」或「←」回到父選單。以「ESC」鍵關閉內容選單」。"},{name:"編輯器清單方塊",legend:"在列表中,請利用 TAB 或 ↓ 方向鍵以移動到下一個項目;或利用 SHIFT + TAB 或 ↑ 方向鍵移動到前一個項目。請按下 空白鍵 或是 ENTER 以選取項目。請按 ESC 關閉列表。"},{name:"編輯器元件路徑工具列",legend:"請按「${elementsPathFocus}」以瀏覽元素路徑工具列。\r\n利用「TAB」或「→」以便移動到下一個元素按鈕。\r\n利用「SHIFT+TAB」或「←」以便移動到前一個元素按鈕。\r\n請按下「空白鍵」或「ENTER」鍵選擇編輯器中的元素。"}]},{name:"命令",items:[{name:"復原命令",
7 | legend:"請按下「${undo}」"},{name:"重複命令",legend:"請按下「 ${redo}」"},{name:"粗體命令",legend:"請按下「${bold}」"},{name:"斜體",legend:"請按下「${italic}」"},{name:"底線命令",legend:"請按下「${underline}」"},{name:"連結",legend:"請按下「${link}」"},{name:"隱藏工具列",legend:"請按下「${toolbarCollapse}」"},{name:"存取前一個焦點空間命令",legend:"請按下 ${accessPreviousSpace} 以存取最近但無法靠近之插字符號前的焦點空間。舉例:二個相鄰的 HR 元素。\r\n重複按鍵以存取較遠的焦點空間。"},{name:"存取下一個焦點空間命令",legend:"請按下 ${accessNextSpace} 以存取最近但無法靠近之插字符號後的焦點空間。舉例:二個相鄰的 HR 元素。\r\n重複按鍵以存取較遠的焦點空間。"},{name:"協助工具說明",legend:"請按下「${a11yHelp}」"}]}],
8 | backspace:"Backspace",tab:"Tab",enter:"Enter",shift:"Shift",ctrl:"Ctrl",alt:"Alt",pause:"Pause",capslock:"Caps Lock",escape:"Escape",pageUp:"Page Up",pageDown:"Page Down",end:"End",home:"Home",leftArrow:"Left Arrow",upArrow:"Up Arrow",rightArrow:"Right Arrow",downArrow:"Down Arrow",insert:"Insert","delete":"Delete",leftWindowKey:"Left Windows key",rightWindowKey:"Right Windows key",selectKey:"Select key",numpad0:"Numpad 0",numpad1:"Numpad 1",numpad2:"Numpad 2",numpad3:"Numpad 3",numpad4:"Numpad 4",
9 | numpad5:"Numpad 5",numpad6:"Numpad 6",numpad7:"Numpad 7",numpad8:"Numpad 8",numpad9:"Numpad 9",multiply:"Multiply",add:"Add",subtract:"Subtract",decimalPoint:"Decimal Point",divide:"Divide",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",numLock:"Num Lock",scrollLock:"Scroll Lock",semiColon:"Semicolon",equalSign:"Equal Sign",comma:"Comma",dash:"Dash",period:"Period",forwardSlash:"Forward Slash",graveAccent:"Grave Accent",openBracket:"Open Bracket",
10 | backSlash:"Backslash",closeBracket:"Close Bracket",singleQuote:"Single Quote"});
--------------------------------------------------------------------------------
/static/plugins/ckeditor/plugins/about/dialogs/about.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3 | For licensing, see LICENSE.md or http://ckeditor.com/license
4 | */
5 | CKEDITOR.dialog.add("about",function(a){var a=a.lang.about,b=CKEDITOR.plugins.get("about").path+"dialogs/"+(CKEDITOR.env.hidpi?"hidpi/":"")+"logo_ckeditor.png";return{title:CKEDITOR.env.ie?a.dlgTitle:a.title,minWidth:390,minHeight:230,contents:[{id:"tab1",label:"",title:"",expand:!0,padding:0,elements:[{type:"html",html:'
http://ckeditor.com
http://ckeditor.com/about/license
43 | CKEditor Samples » Create and Destroy Editor Instances for Ajax Applications
44 |
45 | <div>
element.
49 |
15 | CKEditor Samples » Append To Page Element Using JavaScript Code
16 |
17 | CKEDITOR.appendTo
is basically to place editors
21 | inside existing DOM elements. Unlike CKEDITOR.replace
,
22 | a target container to be replaced is no longer necessary. A new editor
23 | instance is inserted directly wherever it is desired.
24 | CKEDITOR.appendTo( 'container_id',
26 | { /* Configuration options to be used. */ }
27 | 'Editor content to be used.'
28 | );
29 |
46 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/static/plugins/ckeditor/samples/assets/inlineall/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/static/plugins/ckeditor/samples/assets/inlineall/logo.png
--------------------------------------------------------------------------------
/static/plugins/ckeditor/samples/assets/outputxhtml/outputxhtml.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license
4 | *
5 | * Styles used by the XHTML 1.1 sample page (xhtml.html).
6 | */
7 |
8 | /**
9 | * Basic definitions for the editing area.
10 | */
11 | body
12 | {
13 | font-family: Arial, Verdana, sans-serif;
14 | font-size: 80%;
15 | color: #000000;
16 | background-color: #ffffff;
17 | padding: 5px;
18 | margin: 0px;
19 | }
20 |
21 | /**
22 | * Core styles.
23 | */
24 |
25 | .Bold
26 | {
27 | font-weight: bold;
28 | }
29 |
30 | .Italic
31 | {
32 | font-style: italic;
33 | }
34 |
35 | .Underline
36 | {
37 | text-decoration: underline;
38 | }
39 |
40 | .StrikeThrough
41 | {
42 | text-decoration: line-through;
43 | }
44 |
45 | .Subscript
46 | {
47 | vertical-align: sub;
48 | font-size: smaller;
49 | }
50 |
51 | .Superscript
52 | {
53 | vertical-align: super;
54 | font-size: smaller;
55 | }
56 |
57 | /**
58 | * Font faces.
59 | */
60 |
61 | .FontComic
62 | {
63 | font-family: 'Comic Sans MS';
64 | }
65 |
66 | .FontCourier
67 | {
68 | font-family: 'Courier New';
69 | }
70 |
71 | .FontTimes
72 | {
73 | font-family: 'Times New Roman';
74 | }
75 |
76 | /**
77 | * Font sizes.
78 | */
79 |
80 | .FontSmaller
81 | {
82 | font-size: smaller;
83 | }
84 |
85 | .FontLarger
86 | {
87 | font-size: larger;
88 | }
89 |
90 | .FontSmall
91 | {
92 | font-size: 8pt;
93 | }
94 |
95 | .FontBig
96 | {
97 | font-size: 14pt;
98 | }
99 |
100 | .FontDouble
101 | {
102 | font-size: 200%;
103 | }
104 |
105 | /**
106 | * Font colors.
107 | */
108 | .FontColor1
109 | {
110 | color: #ff9900;
111 | }
112 |
113 | .FontColor2
114 | {
115 | color: #0066cc;
116 | }
117 |
118 | .FontColor3
119 | {
120 | color: #ff0000;
121 | }
122 |
123 | .FontColor1BG
124 | {
125 | background-color: #ff9900;
126 | }
127 |
128 | .FontColor2BG
129 | {
130 | background-color: #0066cc;
131 | }
132 |
133 | .FontColor3BG
134 | {
135 | background-color: #ff0000;
136 | }
137 |
138 | /**
139 | * Indentation.
140 | */
141 |
142 | .Indent1
143 | {
144 | margin-left: 40px;
145 | }
146 |
147 | .Indent2
148 | {
149 | margin-left: 80px;
150 | }
151 |
152 | .Indent3
153 | {
154 | margin-left: 120px;
155 | }
156 |
157 | /**
158 | * Alignment.
159 | */
160 |
161 | .JustifyLeft
162 | {
163 | text-align: left;
164 | }
165 |
166 | .JustifyRight
167 | {
168 | text-align: right;
169 | }
170 |
171 | .JustifyCenter
172 | {
173 | text-align: center;
174 | }
175 |
176 | .JustifyFull
177 | {
178 | text-align: justify;
179 | }
180 |
181 | /**
182 | * Other.
183 | */
184 |
185 | code
186 | {
187 | font-family: courier, monospace;
188 | background-color: #eeeeee;
189 | padding-left: 1px;
190 | padding-right: 1px;
191 | border: #c0c0c0 1px solid;
192 | }
193 |
194 | kbd
195 | {
196 | padding: 0px 1px 0px 1px;
197 | border-width: 1px 2px 2px 1px;
198 | border-style: solid;
199 | }
200 |
201 | blockquote
202 | {
203 | color: #808080;
204 | }
205 |
--------------------------------------------------------------------------------
/static/plugins/ckeditor/samples/assets/posteddata.php:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
16 | CKEditor — Posted Data
17 |
18 |
19 |
49 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/static/plugins/ckeditor/samples/assets/sample.css:
--------------------------------------------------------------------------------
1 | /**
2 | * Required by tests (dom/document.html).
3 | */
4 |
--------------------------------------------------------------------------------
/static/plugins/ckeditor/samples/assets/sample.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/binbin91/oms/a99edc4873c0207a6fd20e60bc616c87d4fd2db8/static/plugins/ckeditor/samples/assets/sample.jpg
--------------------------------------------------------------------------------
/static/plugins/ckeditor/samples/assets/uilanguages/languages.js:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
3 | For licensing, see LICENSE.md or http://ckeditor.com/license
4 | */
5 | var CKEDITOR_LANGS=function(){var c={af:"Afrikaans",ar:"Arabic",bg:"Bulgarian",bn:"Bengali/Bangla",bs:"Bosnian",ca:"Catalan",cs:"Czech",cy:"Welsh",da:"Danish",de:"German",el:"Greek",en:"English","en-au":"English (Australia)","en-ca":"English (Canadian)","en-gb":"English (United Kingdom)",eo:"Esperanto",es:"Spanish",et:"Estonian",eu:"Basque",fa:"Persian",fi:"Finnish",fo:"Faroese",fr:"French","fr-ca":"French (Canada)",gl:"Galician",gu:"Gujarati",he:"Hebrew",hi:"Hindi",hr:"Croatian",hu:"Hungarian",id:"Indonesian",
6 | is:"Icelandic",it:"Italian",ja:"Japanese",ka:"Georgian",km:"Khmer",ko:"Korean",ku:"Kurdish",lt:"Lithuanian",lv:"Latvian",mk:"Macedonian",mn:"Mongolian",ms:"Malay",nb:"Norwegian Bokmal",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese (Portugal)","pt-br":"Portuguese (Brazil)",ro:"Romanian",ru:"Russian",si:"Sinhala",sk:"Slovak",sq:"Albanian",sl:"Slovenian",sr:"Serbian (Cyrillic)","sr-latn":"Serbian (Latin)",sv:"Swedish",th:"Thai",tr:"Turkish",ug:"Uighur",uk:"Ukrainian",vi:"Vietnamese",zh:"Chinese Traditional",
7 | "zh-cn":"Chinese Simplified"},b=[],a;for(a in CKEDITOR.lang.languages)b.push({code:a,name:c[a]||a});b.sort(function(a,b){return a.name
22 |
25 |
26 | $value )
31 | {
32 | if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) )
33 | continue;
34 |
35 | if ( get_magic_quotes_gpc() )
36 | $value = htmlspecialchars( stripslashes((string)$value) );
37 | else
38 | $value = htmlspecialchars( (string)$value );
39 | ?>
40 | Field Name
23 | Value
24 |
41 |
44 |
48 |
42 |
43 |
41 | CKEditor Samples » Using the CKEditor Read-Only API
42 |
43 | setReadOnly
47 | API to put editor into the read-only state that makes it impossible for users to change the editor contents.
48 | ' + requires[ i ] + '
' );
22 | }
23 |
24 | if ( missing.length ) {
25 | var warn = CKEDITOR.dom.element.createFromHtml(
26 | '
2 |
3 | -------------------------------------------------------------------------------------------
4 | CKEditor - Posted Data
5 |
6 | We are sorry, but your Web server does not support the PHP language used in this script.
7 |
8 | Please note that CKEditor can be used with any other server-side language than just PHP.
9 | To save the content created with CKEditor you need to read the POST data on the server
10 | side and write it to a file or the database.
11 |
12 | Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
13 | For licensing, see LICENSE.md or http://ckeditor.com/license
14 | -------------------------------------------------------------------------------------------
15 |
16 |
49 | This sample shows how tab key navigation among editor instances is
50 | affected by the tabIndex
attribute from
51 | the original page element. Use TAB key to move between the editors.
52 |
55 | 56 |
57 | 58 |59 | 60 |
61 |62 | 63 |
64 | 74 |*/ include "assets/posteddata.php"; ?> 17 | -------------------------------------------------------------------------------- /static/plugins/ckeditor/samples/tabindex.html: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 |
8 | 9 |
10 | 11 | 12 | 22 | 42 | 43 |
75 |