Compare commits

...

110 Commits

Author SHA1 Message Date
Gogs f90aac19b7 updates with layout
6 years ago
Steve L. Nyemba 27160d0a8e bug fix
6 years ago
Steve L. Nyemba 950cf5a4de html display of the new dashboard
6 years ago
Steve L. Nyemba b290632391 New dashboard implementation, reusable and more verbose
6 years ago
Steve L. Nyemba b74c752d53 clean up ...
6 years ago
Steve L. Nyemba bbca190ba4 developing scalable models
6 years ago
Steve L. Nyemba a975202693 making free models accessible
6 years ago
Steve L. Nyemba 98f92d35b3 layout bug fix
6 years ago
Steve L. Nyemba 20f1f74ff3 dependency virtuenv
6 years ago
Steve L. Nyemba b0c6cb31fb layout bug fix (responsie text size)
6 years ago
Steve L. Nyemba c25fcd5de5 Updates with logout and data management
6 years ago
Steve L. Nyemba 57cab8b854 formalizing models
6 years ago
Steve L. Nyemba f47b1cc50f bug fix and layout fix
6 years ago
Steve L. Nyemba 9d61485274 removed more print statements
6 years ago
Steve L. Nyemba 58e675c789 fix with subscription and removed print statements
6 years ago
Gogs c2d188d556 layout fix
6 years ago
Gogs 64911f6e83 bug fix, new bug with session and dashboard
6 years ago
Gogs 8bca478a6b layout fix with large displays @TODO: Fix sequencing with clients/team
6 years ago
Gogs f6c961de63 bug fix with layout extra large
6 years ago
Steve L. Nyemba 41e74c4cd0 bug fix with responsive layout
6 years ago
Steve L. Nyemba 0043f33c83 bug fix
6 years ago
Steve L. Nyemba 37f0ea7de7 bug fix with layout
6 years ago
Gogs 368c73a120 layout fix, need to be checked with lower screen resolutions
6 years ago
Steve L. Nyemba aefe6917b1 bug
6 years ago
Steve L. Nyemba 117cd3840f Bug fix, layout and charting improvements
6 years ago
Steve L. Nyemba 407eb6f8ca layout bug fix @TODO: app-grid
6 years ago
Gogs d3da714b32 bug fix with shop endpoint
6 years ago
Steve L. Nyemba e9a26521bb bug fix with graphical layout
6 years ago
Steve L. Nyemba e81835d919 removing unused files
6 years ago
Steve L. Nyemba e9c7b3e9e3 bug fix with layout
6 years ago
Steve L. Nyemba f07611d141 Bug fix with data and layout
6 years ago
Gogs 0a0de5a0a4 bug fix layout for large displays
6 years ago
Steve L. Nyemba 86faac9ed0 bug fix layout
6 years ago
Steve L. Nyemba 7f858fc505 bug fix
6 years ago
Gogs 805df9bdc9 requirements ...
6 years ago
Gogs a46a664fcf requirements ...
6 years ago
Steve L. Nyemba 4fdd527ffe bug fix
6 years ago
Steve Nyemba ab374a320d clean up ...
6 years ago
Steve L. Nyemba 61153a6988 bug fix
6 years ago
Steve L. Nyemba 4de3914ca1 bug fix
6 years ago
Steve L. Nyemba 48beabec0d bug fix on chart (wrong labels)
6 years ago
Steve L. Nyemba e368f3df8a jx update
6 years ago
Steve L. Nyemba b3036c05b1 handling stuff
6 years ago
Steve L. Nyemba 7ffe564d8c merge and other house keeping work
6 years ago
Steve L. Nyemba 31f5317430 basic changes
6 years ago
Steve L. Nyemba f48d4decfd new changes, with key generation and configuration handling via web
6 years ago
Steve L. Nyemba d4a3c36b60 removing backup files
6 years ago
Steve L. Nyemba 7ad518d1e5 Merge branch 'mike/test_values' of steve/monitor into community
7 years ago
michael.mead ba2cffd038 created function that return array of three arrays with 24 values between 0 and 100 for testing dashboard
7 years ago
michael.mead 9f9ab8dd39 bug fix ...
7 years ago
michael.mead 21a84c029b some fix
7 years ago
michael.mead 8a937a61f8 start reset
7 years ago
Steve Nyemba 0ec0c84117 bug fix
7 years ago
Steve Nyemba 54648a7f15 CO: queue/message processing
7 years ago
Steve Nyemba 26be112e31 CO - Bug fix, sort of data dump
7 years ago
Steve Nyemba 9e7fd0b974 updates (missing)
7 years ago
Steve Nyemba e67af962a7 bug fix (merge)
7 years ago
Steve Nyemba ae94d3e6d0 new feature with most of the data compiled (single call)
7 years ago
Steve Nyemba 3d56fc734d misc bug fix & file permission fix
7 years ago
Steve Nyemba 73556f1d3e bug fix and registration process streamlined
7 years ago
Steve Nyemba 833407dd4c changes with utils
7 years ago
Steve Nyemba 52af677bf5 removing intellij reference
7 years ago
Steve Nyemba abd212e9c3 jsgrid
7 years ago
Steve L. Nyemba d72aa6e6f0 registration process and abstraction
7 years ago
Steve L. Nyemba ab7f312ea2 CO - bug fix and updates
7 years ago
Steve L. Nyemba 6c0442d664 CO - Bug fix/optimization
7 years ago
Steve L. Nyemba cbd8bd2f4d CO - Update transport, registration with stripe, @TODO: Need to update other modules
7 years ago
Steve L. Nyemba 6edc69b805 CO - removing .DStore files
7 years ago
Steve L. Nyemba 03535d0070 CO - Bug fix with trends,
7 years ago
Steve L. Nyemba 1dae493121 CO - Bug fix with api
7 years ago
Gogs a453d9d2aa CO - Bug fix with empty records (not allowed)
7 years ago
Steve L. Nyemba ad2c911c0a Bug fix with folder handling and API enhancement
7 years ago
Gogs ce08f55f81 CO - Bug found with folder initialization
7 years ago
Gogs e8dce098ec CO - bug fix folders actor
7 years ago
Steve L. Nyemba 6ba4f52c35 CO - polishing bug fix
7 years ago
Steve L. Nyemba a5f9e0f516 CO - bug fixed (import)
7 years ago
Gogs 6d8ab4e412 CO - removing old/unused file (confusing)
7 years ago
Steve L. Nyemba 024ee9550f CO - Bug found and fixed
7 years ago
Gogs f2d1e0501a CO - Bug found not fixed
7 years ago
Gogs c94ef4eb67 Merge branch 'community' of http://localhost/git/steve/monitor into community
7 years ago
Gogs cc36e0f85a CO - fixing typographic errors
7 years ago
Steve L. Nyemba ac287bbcca Merge branch 'nodeTemplate' of steve/monitor into community
7 years ago
michael mead 36b00103c3 start getting node name and see the config['id'] in index.py Steve
7 years ago
Gogs 2bf25b653b CO - Bug fix
7 years ago
Steve L. Nyemba 8493dcaaf2 CO - Bug fix
7 years ago
Steve L. Nyemba 0b68b813af CO - Bug fix attempt with filter
7 years ago
michael mead cab04dd652 fix format
7 years ago
michael mead 1bb7f05e0a fix that stupid column issue, I know it doesnt match the branch name but I got sick of it
7 years ago
Gogs bcb3a87777 CO - bug fix filter agents/actors
7 years ago
Gogs dabf772217 CO - Bug fix on assignment and missing values
7 years ago
Steve L. Nyemba cf843c16bd CO - bug fix
7 years ago
Steve L. Nyemba 7711472513 CO - Enabled configuration of actors and agents tied to plan
7 years ago
Steve L. Nyemba e696cf1aac CO - bug fix & enhancements
7 years ago
Steve L. Nyemba 677f037adf CO - Bug fixed, kill application
7 years ago
Steve L. Nyemba b831586a97 CO - Kill does quite work
7 years ago
Steve L. Nyemba 12ab751efd CO - couchdb map/reduce view
7 years ago
Steve L. Nyemba 793cb78cf0 CO - application killing
7 years ago
Steve L. Nyemba 2a3a0fcb96 CO - actor refactor for killing and starting an application
7 years ago
Gogs 31ff495f74 CO - Insured data is logged in database specified by plan
7 years ago
Gogs 46bdb4d197 CO - directing logs to dbase specified by plan
7 years ago
Gogs 8340864fcc CO - init script
7 years ago
Gogs 00aeade567 CO - Setup remote object and tied to service. @TODO: insure that monitor-logs is tied to the plan-id
7 years ago
Steve L. Nyemba fc0ec65d01 Update 'src/utils/agents/manager.py'
7 years ago
Steve L. Nyemba 37ad580c69 Add 'src/utils/agents/data-manager.py'
7 years ago
Steve L. Nyemba 74c613d06e CO - object registry/service
7 years ago
Steve L. Nyemba efd7b16a9e Merge branch 'nodeTemplate' of steve/monitor into community
7 years ago
michael mead 5630d7383c some bugs here, and we probably want to refactor but you can select nodes from dropdown, a couple things return undefined, but I don't know if thats just old stuff
7 years ago
michael mead 11aaab210f start getting nodename passed to init function
7 years ago
michael mead 9b25ed97b0 start template
7 years ago
Steve L. Nyemba c94cd8cef4 Merge branch 'graphs' of steve/monitor into community
7 years ago

Binary file not shown.

3
.gitignore vendored

@ -1,3 +1,6 @@
sandbox
*.pyc
.DS_Store
.settings.json
.vscode

@ -1,7 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="useProjectProfile" value="false" />
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.7.10 virtualenv at ~/Documents/Programming/monitor/sandbox" project-jdk-type="Python SDK" />
</project>

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/monitor.iml" filepath="$PROJECT_DIR$/.idea/monitor.iml" />
</modules>
</component>
</project>

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/src/api/templates" />
</list>
</option>
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

@ -1,583 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="834735bc-31bd-474a-9b31-c9bb58743d7d" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/config.json" afterPath="$PROJECT_DIR$/config.json" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FileEditorManager">
<splitter split-orientation="horizontal" split-proportion="0.54361874">
<split-first>
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="dashboard.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/api/templates/dashboard.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="65" column="5" lean-forward="true" selection-start-line="65" selection-start-column="5" selection-end-line="65" selection-end-column="5" />
<folding>
<element signature="e#2414#2713#0#HTML" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="dashboard.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/api/static/js/dashboard.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="226">
<caret line="26" column="0" lean-forward="true" selection-start-line="26" selection-start-column="0" selection-end-line="26" selection-end-column="0" />
<folding>
<marker date="1499136933000" expanded="true" signature="63:670" ph="{...}" />
<marker date="1499136933000" expanded="true" signature="638:670" ph="{...}" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</split-first>
<split-second>
<leaf>
<file leaf-file-name="index.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/api/index.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="259">
<caret line="81" column="15" lean-forward="false" selection-start-line="81" selection-start-column="14" selection-end-line="81" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="config.json" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="18" column="0" lean-forward="true" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</split-second>
</splitter>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>nodes</find>
<find>console.log</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/api/index.py" />
<option value="$PROJECT_DIR$/config.json" />
<option value="$PROJECT_DIR$/src/api/templates/dashboard.html" />
<option value="$PROJECT_DIR$/src/api/static/js/dashboard.js" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="ProjectFrameBounds">
<option name="y" value="22" />
<option name="width" value="1280" />
<option name="height" value="774" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="api" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="api" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="templates" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="api" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="static" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="js" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="monitor" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="src" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="api" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="static" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="settings.editor.selected.configurable" value="vcs.Git" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager">
<configuration default="true" type="BashConfigurationType" factoryName="Bash">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="INTERPRETER_PATH" value="/bin/bash" />
<option name="WORKING_DIRECTORY" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SCRIPT_NAME" value="" />
<option name="PARAMETERS" value="" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="DjangoTestsConfigurationType" factoryName="Django tests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="monitor" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="TARGET" value="" />
<option name="SETTINGS_FILE" value="" />
<option name="CUSTOM_SETTINGS" value="false" />
<option name="USE_OPTIONS" value="false" />
<option name="OPTIONS" value="" />
<method />
</configuration>
<configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
<node-interpreter value="project" />
<working-dir value="" />
<envs />
<scope-kind value="ALL" />
<method />
</configuration>
<configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
<config-file value="" />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
<method />
</configuration>
<configuration default="true" type="PyBehaveRunConfigurationType" factoryName="Behave">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="monitor" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="ADDITIONAL_ARGS" value="" />
<method />
</configuration>
<configuration default="true" type="PyLettuceRunConfigurationType" factoryName="Lettuce">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="monitor" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="ADDITIONAL_ARGS" value="" />
<method />
</configuration>
<configuration default="true" type="PythonConfigurationType" factoryName="Python">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="monitor" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<method />
</configuration>
<configuration default="true" type="Tox" factoryName="Tox">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<module name="monitor" />
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
<command value="run" />
<scripts />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="tests" factoryName="Doctests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="monitor" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="SCRIPT_NAME" value="" />
<option name="CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="FOLDER_NAME" value="" />
<option name="TEST_TYPE" value="TEST_SCRIPT" />
<option name="PATTERN" value="" />
<option name="USE_PATTERN" value="false" />
<method />
</configuration>
<configuration default="true" type="tests" factoryName="Unittests">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="monitor" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;.&quot;" />
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method />
</configuration>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="834735bc-31bd-474a-9b31-c9bb58743d7d" name="Default" comment="" />
<created>1499042529793</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1499042529793</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="0" y="22" width="1280" height="774" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32991204" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32991204" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.15347335" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32991204" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Data View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="processedProjectFiles" value="true" />
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager />
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/api/index.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/api/templates/dashboard.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="855">
<caret line="57" column="17" lean-forward="false" selection-start-line="57" selection-start-column="16" selection-end-line="57" selection-end-column="17" />
<folding>
<element signature="e#2414#2713#0#HTML" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/start.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/start.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/start.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/start.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/start.sh">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="8" column="0" lean-forward="false" selection-start-line="8" selection-start-column="0" selection-end-line="8" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/config.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="18" column="0" lean-forward="true" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/api/index.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="259">
<caret line="81" column="15" lean-forward="false" selection-start-line="81" selection-start-column="14" selection-end-line="81" selection-end-column="15" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/api/templates/dashboard.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="65" column="5" lean-forward="true" selection-start-line="65" selection-start-column="5" selection-end-line="65" selection-end-column="5" />
<folding>
<element signature="e#2414#2713#0#HTML" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/api/static/js/dashboard.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="226">
<caret line="26" column="0" lean-forward="true" selection-start-line="26" selection-start-column="0" selection-end-line="26" selection-end-column="0" />
<folding>
<marker date="1499136933000" expanded="true" signature="63:670" ph="{...}" />
<marker date="1499136933000" expanded="true" signature="638:670" ph="{...}" />
</folding>
</state>
</provider>
</entry>
</component>
</project>

@ -1,18 +1,11 @@
{
"id":"michaels-MBP",
"key":"4q-h8r5-247&!570p=[0v8]x360",
"api":"dev.the-phi.com",
"delay":10.0,
"protocol":"http",
"api":"localhost:8084",
"default_plan":"plan_D57KqIeZc7vYFo",
"store":{
"class":{"read":"CouchdbReader","write":"CouchdbWriter"},
"args":{"uri":"http://dev.the-phi.com:5984","dbname":"mike-db","uid":"logs"}
},
"procs":["mail","safari", "chrome", "terminal"],
"folders":["/Users/michaelmead/Downloads"],
"actions":{
"folders":{"threshold":"10mb","action":"archive","key":""},
"apps":{"mail":"","safari":"","chrome":"" }
"args":{"uri":"http://admin:@dm1n@dev.the-phi.com:5985","dbname":"smart-top","uid":"logs"}
}
}

@ -1,15 +0,0 @@
{
"virtual-env":{
"class":"Sandbox",
"config":{
"3-launchpad":{"requirements":"/Users/michaelmead/Documents/git/repair-file/required.txt","sandbox":"/Users/michaelmead/Documents/git/sandbox"}
}
},
"processes":{
"class":"DetailProcess",
"config":{
"system":["postgresql","couchdb","httpd"]
}
}
}

@ -0,0 +1,12 @@
{
"_id": "_design/config",
"language": "javascript",
"views": {
"apps": {
"map": "function(doc) {\n\tif(doc.config != null){\n\t\tif(doc.config.apps != null){\n\t\t\temit(doc._id,doc.config.apps)\n\t\t}\n\t}else{\n\t\t\temit(doc._id,{})\n\t\t}\n}"
},
"folders": {
"map": "function(doc) {\n\tthreshold = null\n\tif(doc.config != null){\n\t\tif(doc.config.folders != null){\n\t\t\tfolders = doc.config.folders ;\n\t\t\tif (folders.threshold != null){ \n\t\t\t\tthreshold = folders.threshold\n\t\t\t}\n\t\t}\n\t}\n\tthreshold = (threshold == null)?\"5 MB\" : threshold ;\n\tr = {threshold:threshold}\n\temit(doc._id,r)\n}"
}
}
}

@ -0,0 +1,38 @@
{
"_id": "_design/summary",
"language": "javascript",
"views": {
"app_resources": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar logs = doc[id][index]\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\temit(doc._id,logs[i])\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\n\tfor(i in values){\n\t\trow = values[i]\n\t\tmem_avail \t= (mem_avail < row.memory_available)?row.memory_available:mem_avail\n\t\tmem_used \t+= (row.memory_available*row.memory_usage/100)\n\t\tcpu\t\t+= row.cpu_usage\n\t}\n\n\tif(mem_avail > 999 && mem_avail < 999999){\n\t\tunits=\"MB\"\n\t}else {\n\t\tunits=\"GB\"\n\t}\n\tmem_avail = parseFloat(mem_avail.toFixed(2))\n\tmem_used = parseFloat(mem_used.toFixed(2))\n\n\treturn {\"app_count\":values.length,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu,\"units\":units}\n}"
},
"app_names": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar size = doc[id].length\n\t\t\tvar offset = 25\n\t\t\t//\n\t\t\t// We get the last 25 rows ( a days worth of observations\n\t\t\t//\n\t\t\tvar rows = doc[id].slice(size-offset,size)\n\t\t\tfor(var i=0; i < rows.length; i++){\n\t\t\t\tfor(var j=0; j < rows[i].length; j++){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id]=rows[i][j]\n\t\t\t\t\t\n\t\t\t\t\temit(doc._id,info)\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar m = {} ;\n\tvar r = {}\n\tfor (var i =0; i < values.length; i++){\n\t\tvar rows = values[i]\n\t\tfor (node in rows){\n\t\t\tvar log = rows[node]\n\t\t\tif(m[node] == null){\n\t\t\t\tm[node]={}\n\t\t\t\tr[node]=[]\n\t\t\t}\n\t\t\tvar app = log.label.toLowerCase()\n\t\t\tif(m[node][app] == null){\n\t\t\t\tm[node][app] = 1\n\t\t\t\tr[node].push(app)\n\t\t\t}\n\t\t}\n\t}\n\treturn r\n\t\n}"
},
"folder_size": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^folder.+/) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar logs = doc[id][index]\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\temit(doc._id,logs[i])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar size=0\n\tvar units = {\"MB\":1000,\"GB\":1000000,\"TB\":1000000000}\n\tfor(i in values){\n\t\trow = values[i]\n\t\tsvalue = row.size.match(/^[\\d,.]+/i)\n\t\tukey \t= row.size.match(/[a-z]+$/i)\n\t\tsize\t+= parseFloat(svalue*units[ukey])\n\t}\n\tif (size > 999 && size < 999999){\n\t\tunits=\"MB\"\n\t\tsize /=1000\n\t}else if(size > 999999 && 999999999){\n\t\tunits=\"GB\"\n\t\tsize /=1000000\n\t}else{ \n\t\tunits = \"TB\"\n\t\tsize /=1000000000\n\t}\n\tsize = parseFloat(size.toFixed(2))\n\treturn {\"folder_count\":values.length,\"size\":size,\"units\":units} //parseFloat(values[0].size.match(/^[\\d,.]+/))\n}"
},
"app_status": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\n\t\t\tif(doc[id][index].length > 0){\n\t\t\t\temit(doc._id,doc[id][index])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar status = {\"crash\":0,\"idle\":0,\"running\":0}\n\tfor(i in values){\n\t\tfor(ii in values[i]){\n\t\t\trow = values[i][ii]\n\t\t\tid = row.status\n\t\t\tif(status[id] != null){\n\t\t\t\tstatus[id] += 1\n\t\t\t}\n\n\t\t}\n\t}\n\treturn status\n}"
},
"resource_usage_trend": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tend = doc[id].length -1\n\t\t\tbeg = (doc[id].length > 25 )?doc[id].length - 25:0\n\t\t\tfor(var i = end; i > beg ; --i){\n\t\t\t\temit(doc._id,doc[id][i])//doc[id][index])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = [] ;\n\tvar mem_avail = [] ;\n\tvar mem_used = []\n\tvar size = 20\n\tvar beg = null\n\tvar end = null\n\tapps = {}\n\tapp_count = 0\n\tfor(i in values){\n\t\t//end = values[i].length -1\n\t\t//beg = end - size\n\t\tfor(ii in values[i]){\n\t\t\trow = values[i][ii]\n\t\t\tapps[row.label] = 1\n\t\t\tif(beg == null){\n\t\t\t\tbeg = ([row.year,row.month,row.day]).join('/')+' ' +([row.hour,row.minute]).join(':')\n\t\t\t}\n\t\t\tmem_avail.push( parseFloat(row.memory_available.toFixed(2)))\n\t\t\tmem_used.push(row.memory_available*row.memory_usage/100)\n\t\t\tcpu.push(row.cpu_usage)\n\t\t\t\n\t\t}\n\t\tend = ([row.year,row.month,row.day]).join('/')+' ' +([row.hour,row.minute]).join(':')\n\t\n\t\t\n\t}\n\t//\n\t// counting applications found in the logs\n\t// There is no requirement on consistency of the logs\n\t//\n\tfor(i in apps){\n\t\tapp_count += 1\n\t}\n\t\n\t//return row\t//return values[0].slice(beg,end)\n\treturn {\"app_count\":app_count,\"beg\":beg,\"end\":end,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu}\n}"
},
"app_status_details": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tindex = doc[id].length -1 \n\t\t\tbeg = (doc[id].length > 0)?doc[id].length -13 : 0\n\t\t\tvar logs = doc[id].slice(beg,index);//[index]\n\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\tvar rec = logs[i]\n\t\t\t\tfor (ii in rec){\n\t\t\t\t\tr = {}\n\t\t\t\t\tr[id] = rec[ii]\n\t\t\t\t\temit(doc._id,r)\n\t\t\t\t}\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\tr = {}\n\t//\n\t// retrieving the memory available\n\n\tfor(i in values){\n\t\trow = values[i]\n\t\tfor(id in row){\n\t\t\tmem_avail = (mem_avail < row[id].memory_available)?row[id].memory_available:mem_avail \n\t\t}\n\t}\n\t//\n\t// Determining appropriate units of measurement\n\t//\n\t\t\n\tif(mem_avail > 999 && mem_avail < 999999){\n\t\tunits=\"MB\"\n\t}else {\n\t\tunits=\"GB\"\n\t}\n\n\n\tfor(i in values){\n\n\t\trec = values[i]\n\t\tfor(key in rec){\n\t\t\trow = rec[key]\n\t\t\tvar id = row.label\n\t\t\tif(r[key] == null){ r[key] = {} }\n\t\t\tif (r[key][id] == null){\n\t\t\t\tr[key][id] = {\"beg\":null,\"end\":null,\"crash\":0,\"idle\":0,\"running\":0}\n\t\t\t}\n\t\t\tr[key][id][row.status] += 1\n\t\t\tif(r[key][id].beg == null){\n\t\t\t\tr[key][id].beg = ([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t\t}\n\t\t\tr[key][id].end = ([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t}\n\t}\n\n\n\t//mem_avail = parseFloat(mem_avail.toFixed(2))\n\t//mem_used = parseFloat(mem_used.toFixed(2))\n\n\treturn r //{\"app_count\":values.length,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu,\"units\":units}\n}"
},
"app_resource_usage_details": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tindex = doc[id].length -1 \n\t\t\tbeg = (doc[id].length > 25)?doc[id].length -25 :0\n\t\t\tvar logs = doc[id].slice(beg,index);//[index]\n\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\tvar rec = logs[i]\n\t\t\t\tfor (ii in rec){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id] = rec[ii]\n\t\t\t\t\temit(doc._id,info)//rec[ii])\n\t\t\t\t}\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\tr = {}\n\t//\n\t// retrieving the memory available\n\tfor(i in values){\n\t\tvar rvalues = values[i]\n\t\tfor(id in rvalues){\n\t\t\trow = rvalues[id]\n\t\t\tmem_avail = parseFloat(row.memory_available) ;//mem_avail < row.memory_available)?row.memory_available:mem_avail \n\t\t\tapp_id = row.label.toLowerCase()\n\t\t\tif(r[id] == null){\n\t\t\t\t\n\t\t\t\tr[id] = {}\n\t\t\t}\n\t\t\tif(r[id][app_id] == null){\n\t\t\t\tr[id][app_id] = {memory_available:0,cpu:[],memory_used:[],dates:[]}\n\t\t\t}\n\n\t\t\tr[id][app_id].memory_available += mem_avail\n\t\t\t//app_id = row.label.toLowerCase()\n\n\t\t\tif(mem_avail > 999 && mem_avail < 999999){\n\t\t\t\tunits=\"MB\"\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tunits=\"GB\"\n\t\t\t}\t\n\t\t\tr[id][app_id].units = units\n\t\t}\n\t\tfor(var id in rvalues){\n\t\t\trow = rvalues[id]\n\t\t\tapp_id = row.label.toLowerCase()\n\t\t\tif(r[id][app_id].units == 'MB'){\t\t\t\t\n\t\t\t\tr[id][app_id].memory_available = parseFloat((r[id][app_id].memory_available/ 1000).toFixed(2))\n\t\t\t}else{\n\t\t\t\t//\n\t\t\t\t// assuming we have GB\n\t\t\t\tr[id][app_id].memory_available = parseFloat((r[id][app_id].memory_available/ 1000000).toFixed(2))\n\t\t\t}\n\t\t\tdate = new Date(row.year,row.month,row.day,row.hour,row.minute)\n\t\t\tdate = ([row.hour,row.minute]).join('H:')//{month:row.month,year:row.year,day:row.day,hour:row.hour,minute:row.minute}\n\t\t\tr[id][app_id].dates.push(date)\t\t\t\t\t\n\t\t\t//r[id][app_id].end = \t([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t\tmem_avail = r[id][app_id].memory_available == 0?1:r[id][app_id].memory_available\n\t\t\t//r[id][app_id].memory_used.push(parseFloat((mem_avail*row.memory_usage).toFixed(2)))\n\t\t\tr[id][app_id].memory_used.push(parseFloat(row.memory_usage.toFixed(2)))\n\t\t\tr[id][app_id].cpu.push(row.cpu_usage)\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\treturn r\n}"
},
"nodes": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar size = doc[id].length\n\t\t\tvar offset = 25\n\t\t\t//\n\t\t\t// We get the last 25 rows ( a days worth of observations\n\t\t\t//\n\t\t\tvar rows = doc[id].slice(size-offset,size)\n\t\t\tfor(var i=0; i < rows.length; i++){\n\t\t\t\tfor(var j=0; j < rows[i].length; j++){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id]=rows[i][j]\n\t\t\t\t\t\n\t\t\t\t\temit(doc._id,id)\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar m = {}\n\tfor(var i in values){\n\t\tvar id = values[i]\n\t\tif(m[id] == null){\n\t\t\tm[id] = 0;\n\t\t}\n\t\tm[id] += 1\n\t}\n\treturn Object.keys(m)\n}"
}
}
}

@ -0,0 +1,10 @@
{
"_id": "_design/federation",
"_rev": "1-e3073f79279708acb28ee569d7ff208e",
"language": "javascript",
"views": {
"uid_map": {
"map": "function(doc) {\n\tfor (var i in doc.emails){\n\t\temit(doc.emails[i],doc._id)\n\t}\n}"
}
}
}

@ -1,35 +1,38 @@
{
"_id": "_design/summary",
"_rev": "29-38cc3d8e8351778b31ad280af5f517c7",
"language": "javascript",
"views": {
"app_resources": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar logs = doc[id][index]\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\temit(doc._id,logs[i])\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\n\tfor(i in values){\n\t\trow = values[i]\n\t\tmem_avail \t= (mem_avail < row.memory_available)?row.memory_available:mem_avail\n\t\tmem_used \t+= (row.memory_available*row.memory_usage/100)\n\t\tcpu\t\t+= row.cpu_usage\n\t}\n\n\tif(mem_avail > 999 && mem_avail < 999999){\n\t\tunits=\"MB\"\n\t}else {\n\t\tunits=\"GB\"\n\t}\n\tmem_avail = parseFloat(mem_avail.toFixed(2))\n\tmem_used = parseFloat(mem_used.toFixed(2))\n\n\treturn {\"app_count\":values.length,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu,\"units\":units}\n}"
},
"app_names": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar size = doc[id].length\n\t\t\tvar offset = 25\n\t\t\t//\n\t\t\t// We get the last 25 rows ( a days worth of observations\n\t\t\t//\n\t\t\tvar rows = doc[id].slice(size-offset,size)\n\t\t\tfor(var i=0; i < rows.length; i++){\n\t\t\t\tfor(var j=0; j < rows[i].length; j++){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id]=rows[i][j]\n\t\t\t\t\t\n\t\t\t\t\temit(doc._id,info)\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar m = {} ;\n\tvar r = {}\n\tfor (var i =0; i < values.length; i++){\n\t\tvar rows = values[i]\n\t\tfor (node in rows){\n\t\t\tvar log = rows[node]\n\t\t\tif(m[node] == null){\n\t\t\t\tm[node]={}\n\t\t\t\tr[node]=[]\n\t\t\t}\n\t\t\tvar app = log.label.toLowerCase()\n\t\t\tif(m[node][app] == null){\n\t\t\t\tm[node][app] = 1\n\t\t\t\tr[node].push(app)\n\t\t\t}\n\t\t}\n\t}\n\treturn r\n\t\n}"
},
"folder_size": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^folder.+/) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar logs = doc[id][index]\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\temit(doc._id,logs[i])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar size=0\n\tvar units = {\"MB\":1000,\"GB\":1000000,\"TB\":1000000000}\n\tfor(i in values){\n\t\trow = values[i]\n\t\tsvalue = row.size.match(/^[\\d,.]+/i)\n\t\tukey \t= row.size.match(/[a-z]+$/i)\n\t\tsize\t+= parseFloat(svalue*units[ukey])\n\t}\n\tif (size > 999 && size < 999999){\n\t\tunits=\"MB\"\n\t\tsize /=1000\n\t}else if(size > 999999 && 999999999){\n\t\tunits=\"GB\"\n\t\tsize /=1000000\n\t}else{ \n\t\tunits = \"TB\"\n\t\tsize /=1000000000\n\t}\n\tsize = parseFloat(size.toFixed(2))\n\treturn {\"folder_count\":values.length,\"size\":size,\"units\":units} //parseFloat(values[0].size.match(/^[\\d,.]+/))\n}"
},
"app_status": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\n\t\t\tif(doc[id][index].length > 0){\n\t\t\t\temit(doc._id,doc[id][index])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar status = {\"crash\":0,\"idle\":0,\"running\":0}\n\tfor(i in values){\n\t\tfor(ii in values[i]){\n\t\t\trow = values[i][ii]\n\t\t\tid = row.status\n\t\t\tif(status[id] != null){\n\t\t\t\tstatus[id] += 1\n\t\t\t}\n\n\t\t}\n\t}\n\treturn status\n}"
},
"resource_usage_trend": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tend = doc[id].length -1\n\t\t\tbeg = (doc[id].length > 25 )?doc[id].length - 25:0\n\t\t\tfor(var i = end; i > beg ; --i){\n\t\t\t\temit(doc._id,doc[id][i])//doc[id][index])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = [] ;\n\tvar mem_avail = [] ;\n\tvar mem_used = []\n\tvar size = 20\n\tvar beg = null\n\tvar end = null\n\tapps = {}\n\tapp_count = 0\n\tfor(i in values){\n\t\t//end = values[i].length -1\n\t\t//beg = end - size\n\t\tfor(ii in values[i]){\n\t\t\trow = values[i][ii]\n\t\t\tapps[row.label] = 1\n\t\t\tif(beg == null){\n\t\t\t\tbeg = ([row.year,row.month,row.day]).join('/')+' ' +([row.hour,row.minute]).join(':')\n\t\t\t}\n\t\t\tmem_avail.push( parseFloat(row.memory_available.toFixed(2)))\n\t\t\tmem_used.push(row.memory_available*row.memory_usage/100)\n\t\t\tcpu.push(row.cpu_usage)\n\t\t\t\n\t\t}\n\t\tend = ([row.year,row.month,row.day]).join('/')+' ' +([row.hour,row.minute]).join(':')\n\t\n\t\t\n\t}\n\t//\n\t// counting applications found in the logs\n\t// There is no requirement on consistency of the logs\n\t//\n\tfor(i in apps){\n\t\tapp_count += 1\n\t}\n\t\n\t//return row\t//return values[0].slice(beg,end)\n\treturn {\"app_count\":app_count,\"beg\":beg,\"end\":end,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu}\n}"
},
"app_status_details": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tindex = doc[id].length -1 \n\t\t\tbeg = (doc[id].length > 0)?doc[id].length -25 : 0\n\t\t\tvar logs = doc[id].slice(beg,index);//[index]\n\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\tvar rec = logs[i]\n\t\t\t\tfor (ii in rec){\n\t\t\t\t\tr = {}\n\t\t\t\t\tr[id] = rec[ii]\n\t\t\t\t\temit(doc._id,r)\n\t\t\t\t}\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\tr = {}\n\t//\n\t// retrieving the memory available\n\n\tfor(i in values){\n\t\trow = values[i]\n\t\tfor(id in row){\n\t\t\tmem_avail = (mem_avail < row[id].memory_available)?row[id].memory_available:mem_avail \n\t\t}\n\t}\n\t//\n\t// Determining appropriate units of measurement\n\t//\n\t\t\n\tif(mem_avail > 999 && mem_avail < 999999){\n\t\tunits=\"MB\"\n\t}else {\n\t\tunits=\"GB\"\n\t}\n\n\n\tfor(i in values){\n\n\t\trec = values[i]\n\t\tfor(key in rec){\n\t\t\trow = rec[key]\n\t\t\tvar id = row.label\n\t\t\tif(r[key] == null){ r[key] = {} }\n\t\t\tif (r[key][id] == null){\n\t\t\t\tr[key][id] = {\"beg\":null,\"end\":null,\"crash\":0,\"idle\":0,\"running\":0}\n\t\t\t}\n\t\t\tr[key][id][row.status] += 1\n\t\t\tif(r[key][id].beg == null){\n\t\t\t\tr[key][id].beg = ([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t\t}\n\t\t\tr[key][id].end = ([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t}\n\t}\n\n\n\t//mem_avail = parseFloat(mem_avail.toFixed(2))\n\t//mem_used = parseFloat(mem_used.toFixed(2))\n\n\treturn r //{\"app_count\":values.length,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu,\"units\":units}\n}"
},
"app_resource_usage_details": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tindex = doc[id].length -1 \n\t\t\tbeg = (doc[id].length > 25)?doc[id].length -25 :0\n\t\t\tvar logs = doc[id].slice(beg,index);//[index]\n\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\tvar rec = logs[i]\n\t\t\t\tfor (ii in rec){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id] = rec[ii]\n\t\t\t\t\temit(doc._id,info)//rec[ii])\n\t\t\t\t}\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\tr = {}\n\t//\n\t// retrieving the memory available\n\tfor(i in values){\n\t\tvar rvalues = values[i]\n\t\tfor(id in rvalues){\n\t\t\trow = rvalues[id]\n\t\t\tmem_avail = parseFloat(row.memory_available) ;//mem_avail < row.memory_available)?row.memory_available:mem_avail \n\t\t\tapp_id = row.label.toLowerCase()\n\t\t\tif(r[id] == null){\n\t\t\t\t\n\t\t\t\tr[id] = {}\n\t\t\t}\n\t\t\tif(r[id][app_id] == null){\n\t\t\t\tr[id][app_id] = {memory_available:0,cpu:[],memory_used:[],dates:[]}\n\t\t\t}\n\n\t\t\tr[id][app_id].memory_available += mem_avail\n\t\t\t//app_id = row.label.toLowerCase()\n\n\t\t\tif(mem_avail > 999 && mem_avail < 999999){\n\t\t\t\tunits=\"MB\"\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tunits=\"GB\"\n\t\t\t}\t\n\t\t\tr[id][app_id].units = units\n\t\t}\n\t\tfor(var id in rvalues){\n\t\t\trow = rvalues[id]\n\t\t\tapp_id = row.label.toLowerCase()\n\t\t\tif(r[id][app_id].units == 'MB'){\n\t\t\t\tr[id][app_id].memory_available = parseFloat((r[id][app_id].memory_available/ 1000).toFixed(2))\n\t\t\t}else{\n\t\t\t\t//\n\t\t\t\t// assuming we have GB\n\t\t\t\tr[id][app_id].memory_available = parseFloat((r[id][app_id].memory_available/ 1000000).toFixed(2))\n\t\t\t}\n\t\t\tdate = new Date(row.year,row.month,row.day,row.hour,row.minute)\n\t\t\tdate = ([row.hour,row.minute]).join('H:')//{month:row.month,year:row.year,day:row.day,hour:row.hour,minute:row.minute}\n\t\t\tr[id][app_id].dates.push(date)\t\t\t\t\t\n\t\t\t//r[id][app_id].end = \t([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t\tmem_avail = r[id][app_id].memory_available == 0?1:r[id][app_id].memory_available\n\t\t\tr[id][app_id].memory_used.push(parseFloat((mem_avail*row.memory_usage).toFixed(2)))\n\t\t\tr[id][app_id].cpu.push(row.cpu_usage)\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\treturn r\n}"
}
}
}
"_id": "_design/summary",
"language": "javascript",
"views": {
"app_resources": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar logs = doc[id][index]\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\temit(doc._id,logs[i])\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\n\tfor(i in values){\n\t\trow = values[i]\n\t\tmem_avail \t= (mem_avail < row.memory_available)?row.memory_available:mem_avail\n\t\tmem_used \t+= (row.memory_available*row.memory_usage/100)\n\t\tcpu\t\t+= row.cpu_usage\n\t}\n\n\tif(mem_avail > 999 && mem_avail < 999999){\n\t\tunits=\"MB\"\n\t}else {\n\t\tunits=\"GB\"\n\t}\n\tmem_avail = parseFloat(mem_avail.toFixed(2))\n\tmem_used = parseFloat(mem_used.toFixed(2))\n\n\treturn {\"app_count\":values.length,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu,\"units\":units}\n}"
},
"app_names": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar size = doc[id].length\n\t\t\tvar offset = 25\n\t\t\t//\n\t\t\t// We get the last 25 rows ( a days worth of observations\n\t\t\t//\n\t\t\tvar rows = doc[id].slice(size-offset,size)\n\t\t\tfor(var i=0; i < rows.length; i++){\n\t\t\t\tfor(var j=0; j < rows[i].length; j++){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id]=rows[i][j]\n\t\t\t\t\t\n\t\t\t\t\temit(doc._id,info)\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar m = {} ;\n\tvar r = {}\n\tfor (var i =0; i < values.length; i++){\n\t\tvar rows = values[i]\n\t\tfor (node in rows){\n\t\t\tvar log = rows[node]\n\t\t\tif(m[node] == null){\n\t\t\t\tm[node]={}\n\t\t\t\tr[node]=[]\n\t\t\t}\n\t\t\tvar app = log.label.toLowerCase()\n\t\t\tif(m[node][app] == null){\n\t\t\t\tm[node][app] = 1\n\t\t\t\tr[node].push(app)\n\t\t\t}\n\t\t}\n\t}\n\treturn r\n\t\n}"
},
"folder_size": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^folder.+/) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar logs = doc[id][index]\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\temit(doc._id,logs[i])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar size=0\n\tvar units = {\"MB\":1000,\"GB\":1000000,\"TB\":1000000000}\n\tfor(i in values){\n\t\trow = values[i]\n\t\tsvalue = row.size.match(/^[\\d,.]+/i)\n\t\tukey \t= row.size.match(/[a-z]+$/i)\n\t\tsize\t+= parseFloat(svalue*units[ukey])\n\t}\n\tif (size > 999 && size < 999999){\n\t\tunits=\"MB\"\n\t\tsize /=1000\n\t}else if(size > 999999 && 999999999){\n\t\tunits=\"GB\"\n\t\tsize /=1000000\n\t}else{ \n\t\tunits = \"TB\"\n\t\tsize /=1000000000\n\t}\n\tsize = parseFloat(size.toFixed(2))\n\treturn {\"folder_count\":values.length,\"size\":size,\"units\":units} //parseFloat(values[0].size.match(/^[\\d,.]+/))\n}"
},
"app_status": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\n\t\t\tif(doc[id][index].length > 0){\n\t\t\t\temit(doc._id,doc[id][index])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar status = {\"crash\":0,\"idle\":0,\"running\":0}\n\tfor(i in values){\n\t\tfor(ii in values[i]){\n\t\t\trow = values[i][ii]\n\t\t\tid = row.status\n\t\t\tif(status[id] != null){\n\t\t\t\tstatus[id] += 1\n\t\t\t}\n\n\t\t}\n\t}\n\treturn status\n}"
},
"resource_usage_trend": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tend = doc[id].length -1\n\t\t\tbeg = (doc[id].length > 25 )?doc[id].length - 25:0\n\t\t\tfor(var i = end; i > beg ; --i){\n\t\t\t\temit(doc._id,doc[id][i])//doc[id][index])\n\t\t\t}\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = [] ;\n\tvar mem_avail = [] ;\n\tvar mem_used = []\n\tvar size = 20\n\tvar beg = null\n\tvar end = null\n\tapps = {}\n\tapp_count = 0\n\tfor(i in values){\n\t\t//end = values[i].length -1\n\t\t//beg = end - size\n\t\tfor(ii in values[i]){\n\t\t\trow = values[i][ii]\n\t\t\tapps[row.label] = 1\n\t\t\tif(beg == null){\n\t\t\t\tbeg = ([row.year,row.month,row.day]).join('/')+' ' +([row.hour,row.minute]).join(':')\n\t\t\t}\n\t\t\tmem_avail.push( parseFloat(row.memory_available.toFixed(2)))\n\t\t\tmem_used.push(row.memory_available*row.memory_usage/100)\n\t\t\tcpu.push(row.cpu_usage)\n\t\t\t\n\t\t}\n\t\tend = ([row.year,row.month,row.day]).join('/')+' ' +([row.hour,row.minute]).join(':')\n\t\n\t\t\n\t}\n\t//\n\t// counting applications found in the logs\n\t// There is no requirement on consistency of the logs\n\t//\n\tfor(i in apps){\n\t\tapp_count += 1\n\t}\n\t\n\t//return row\t//return values[0].slice(beg,end)\n\treturn {\"app_count\":app_count,\"beg\":beg,\"end\":end,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu}\n}"
},
"app_status_details": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tindex = doc[id].length -1 \n\t\t\tbeg = (doc[id].length > 0)?doc[id].length -13 : 0\n\t\t\tvar logs = doc[id].slice(beg,index);//[index]\n\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\tvar rec = logs[i]\n\t\t\t\tfor (ii in rec){\n\t\t\t\t\tr = {}\n\t\t\t\t\tr[id] = rec[ii]\n\t\t\t\t\temit(doc._id,r)\n\t\t\t\t}\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\tr = {}\n\t//\n\t// retrieving the memory available\n\n\tfor(i in values){\n\t\trow = values[i]\n\t\tfor(id in row){\n\t\t\tmem_avail = (mem_avail < row[id].memory_available)?row[id].memory_available:mem_avail \n\t\t}\n\t}\n\t//\n\t// Determining appropriate units of measurement\n\t//\n\t\t\n\tif(mem_avail > 999 && mem_avail < 999999){\n\t\tunits=\"MB\"\n\t}else {\n\t\tunits=\"GB\"\n\t}\n\n\n\tfor(i in values){\n\n\t\trec = values[i]\n\t\tfor(key in rec){\n\t\t\trow = rec[key]\n\t\t\tvar id = row.label\n\t\t\tif(r[key] == null){ r[key] = {} }\n\t\t\tif (r[key][id] == null){\n\t\t\t\tr[key][id] = {\"beg\":null,\"end\":null,\"crash\":0,\"idle\":0,\"running\":0}\n\t\t\t}\n\t\t\tr[key][id][row.status] += 1\n\t\t\tif(r[key][id].beg == null){\n\t\t\t\tr[key][id].beg = ([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t\t}\n\t\t\tr[key][id].end = ([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t}\n\t}\n\n\n\t//mem_avail = parseFloat(mem_avail.toFixed(2))\n\t//mem_used = parseFloat(mem_used.toFixed(2))\n\n\treturn r //{\"app_count\":values.length,\"memory_available\":mem_avail,\"memory_usage\":mem_used,\"cpu_usage\":cpu,\"units\":units}\n}"
},
"app_resource_usage_details": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i)){\n\t\t\tindex = doc[id].length -1 \n\t\t\tbeg = (doc[id].length > 25)?doc[id].length -25 :0\n\t\t\tvar logs = doc[id].slice(beg,index);//[index]\n\n\t\t\tfor(var i=0; i < logs.length; i++){\n\t\t\t\tvar rec = logs[i]\n\t\t\t\tfor (ii in rec){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id] = rec[ii]\n\t\t\t\t\temit(doc._id,info)//rec[ii])\n\t\t\t\t}\n\t\t\t}\n\t\t\t//emit(doc._id,doc[id][index][0])//doc[id][index])\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar cpu = 0 ;\n\tvar mem_avail = 0 ;\n\tvar mem_used = 0\n\tr = {}\n\t//\n\t// retrieving the memory available\n\tfor(i in values){\n\t\tvar rvalues = values[i]\n\t\tfor(id in rvalues){\n\t\t\trow = rvalues[id]\n\t\t\tmem_avail = parseFloat(row.memory_available) ;//mem_avail < row.memory_available)?row.memory_available:mem_avail \n\t\t\tapp_id = row.label.toLowerCase()\n\t\t\tif(r[id] == null){\n\t\t\t\t\n\t\t\t\tr[id] = {}\n\t\t\t}\n\t\t\tif(r[id][app_id] == null){\n\t\t\t\tr[id][app_id] = {memory_available:0,cpu:[],memory_used:[],dates:[]}\n\t\t\t}\n\n\t\t\tr[id][app_id].memory_available += mem_avail\n\t\t\t//app_id = row.label.toLowerCase()\n\n\t\t\tif(mem_avail > 999 && mem_avail < 999999){\n\t\t\t\tunits=\"MB\"\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tunits=\"GB\"\n\t\t\t}\t\n\t\t\tr[id][app_id].units = units\n\t\t}\n\t\tfor(var id in rvalues){\n\t\t\trow = rvalues[id]\n\t\t\tapp_id = row.label.toLowerCase()\n\t\t\tif(r[id][app_id].units == 'MB'){\t\t\t\t\n\t\t\t\tr[id][app_id].memory_available = parseFloat((r[id][app_id].memory_available/ 1000).toFixed(2))\n\t\t\t}else{\n\t\t\t\t//\n\t\t\t\t// assuming we have GB\n\t\t\t\tr[id][app_id].memory_available = parseFloat((r[id][app_id].memory_available/ 1000000).toFixed(2))\n\t\t\t}\n\t\t\tdate = new Date(row.year,row.month,row.day,row.hour,row.minute)\n\t\t\tdate = ([row.hour,row.minute]).join('H:')//{month:row.month,year:row.year,day:row.day,hour:row.hour,minute:row.minute}\n\t\t\tr[id][app_id].dates.push(date)\t\t\t\t\t\n\t\t\t//r[id][app_id].end = \t([row.year,row.month,row.day]).join('/')+' '+([row.hour,row.minute]).join(':')\n\t\t\tmem_avail = r[id][app_id].memory_available == 0?1:r[id][app_id].memory_available\n\t\t\t//r[id][app_id].memory_used.push(parseFloat((mem_avail*row.memory_usage).toFixed(2)))\n\t\t\tr[id][app_id].memory_used.push(parseFloat(row.memory_usage.toFixed(2)))\n\t\t\tr[id][app_id].cpu.push(row.cpu_usage)\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}\n\treturn r\n}"
},
"nodes": {
"map": "function(doc) {\n\tfor(id in doc){\n\t\tif(id.match(/^apps.+$/i) && doc[id].length > 0){\n\t\t\tindex = doc[id].length -1 \n\t\t\tvar size = doc[id].length\n\t\t\tvar offset = 25\n\t\t\t//\n\t\t\t// We get the last 25 rows ( a days worth of observations\n\t\t\t//\n\t\t\tvar rows = doc[id].slice(size-offset,size)\n\t\t\tfor(var i=0; i < rows.length; i++){\n\t\t\t\tfor(var j=0; j < rows[i].length; j++){\n\t\t\t\t\tvar info = {}\n\t\t\t\t\tinfo[id]=rows[i][j]\n\t\t\t\t\t\n\t\t\t\t\temit(doc._id,id)\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}",
"reduce": "function(keys,values){\n\tvar m = {}\n\tfor(var i in values){\n\t\tvar id = values[i]\n\t\tif(m[id] == null){\n\t\t\tm[id] = 0;\n\t\t}\n\t\tm[id] += 1\n\t}\n\treturn Object.keys(m)\n}"
}
}
}

@ -26,31 +26,19 @@ upgrade(){
}
start(){
if [ "$1" = "collector" ]; then
sandbox/bin/python src/utils/agents/data-collector.py --path $PWD/config.json
else
sandbox/bin/python src/api/index.py --path $PWD/config.json &
fi
sandbox/bin/python src/api/index.py --path $PWD/config.json --context monitor &
}
stop(){
ps -eo pid,command|grep python|grep -E "$PWD"|grep index.py|grep -E "^ {0,}[0-9]+" -o |xargs kill -9
ps -eo pid,command|grep python|grep -E "$PWD"|grep data-collector|grep -E "^ {0,}[0-9]+" -o |xargs kill -9
}
status(){
pid=`ps -eo pid,command|grep python|grep -E "$PWD"|grep index.py|grep -E "^ {0,}[0-9]+" -m 1 -o`
if [ "$pid" = "" ]; then
echo "API IS OFFLINE"
else
echo "API IS ONLINE $pid"
fi
pid=`ps -eo pid,command|grep python|grep -E "$PWD"|grep data-collector|grep -E "^ {0,}[0-9]+" -m 1 -o`
if [ "$pid" = "" ]; then
echo "DATA-COLLECTOR IS OFFLINE"
echo "Smart-Top API is Offline"
else
echo "DATA-COLLECTOR IS ONLINE $pid"
echo "Smart-Top API is Online $pid"
fi
}

@ -1,23 +1,34 @@
Flask==0.11.1
Flask-Session==0.3.0
Flask-SocketIO==2.8.2
Jinja2==2.8
MarkupSafe==0.23
Werkzeug==0.11.11
aniso8601==1.2.0
argparse==1.2.1
backports.functools-lru-cache==1.5
certifi==2018.8.24
chardet==3.0.4
click==6.6
couchdbkit==0.6.5
cycler==0.10.0
Flask==0.11.1
Flask-Session==0.3.0
Flask-SocketIO==2.8.2
http-parser==0.8.3
idna==2.7
itsdangerous==0.24
Jinja2==2.8
kiwisolver==1.0.1
MarkupSafe==0.23
matplotlib==2.2.3
ngram==3.3.0
numpy==1.11.3
pandas==0.23.4
pika==0.10.0
pyparsing==2.2.1
python-dateutil==2.6.0
python-engineio==1.1.0
python-socketio==1.6.2
pytz==2016.10
requests==2.19.1
restkit==4.2.2
six==1.10.0
socketpool==0.5.3
wsgiref==0.1.2
subprocess32==3.5.2
urllib3==1.23
Werkzeug==0.11.11
XlsxWriter==1.1.2

BIN
src/.DS_Store vendored

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

@ -0,0 +1,81 @@
<div id="dialog" class="input-dialog border-round">
<input id="server_name" type="text" placeholder="Node/Computer name"/>
<div class="cols">
<div class="menu border-right" style="margin-right:4px">
<div class="border-round"><i class="fa fa-bars"></i> Setup</div>
<div id="menu-items" class="items" >
<div class="item active" onclick="jx.dom.hide('folder_input'); jx.dom.show('app_input'); jx.dom.set.focus('apps') ">
<i class="fa fa-cog"></i>
Apps</div>
<div class="item active" onclick="jx.dom.hide('app_input'); jx.dom.show('folder_input'); jx.dom.set.focus('folders') ">
<i class="fa fa-folder-open"></i> Folders
</div>
</div>
</div>
<div>
<div id="app_input">
<div class="caption" style="display:grid; grid-template-columns: 32px auto">
<i class="fa fa-cog"></i>
Apps to Monitor</div>
<input id="apps" type="text" placeholder="app_1, app_2"/>
<div class="option">
<input type="checkbox" id="reboot" style="display:none"/>
<label for="reboot" class="active">
<div class="" align="center">
<i id="check_reboot" class="fa fa-times" onclick="$('#reboot').prop('checked',false)"></i>
<i class="fa fa-check" onclick="$('#reboot').prop('checked',true)"></i>
</div>
<div>Reboot Apps on this node/computer</div>
</label>
</div>
</div>
<div id="folder_input" style="display:grid; grid-template-columns: 32px auto; display:none;">
<div class="caption" >
<i class="fa fa-folder-open"></i> Folders to Monitor</div>
<input id="folders" type="text" placeholder="path_1, path_2"/>
<div class="option">
<input type="checkbox" id="archive" style="display:none"/>
<label for="archive" class="active">
<div class="" align="center">
<i id="check_archive" class="fa fa-times" onclick="$('#archive').prop('checked',false)"></i>
<i class="fa fa-check" onclick="$('#archive').prop('checked',true)"></i>
</div>
<div>Archive to the cloud</div>
</label>
</div>
</div>
</div>
</div>
<p>
<div style="display:grid; grid-template-columns: auto 105px 105px 105px; grid-gap:2px;">
<div></div>
<div >
<div id="download_config" class="button border-round border" onclick="downloadConfig()">
<div><i class="fa fa-download"></i></div>
<div>Config</div>
</div>
</div>
<div class="button border-round border" onclick="jx.modal.close('dialog')">
<div><i class="fa fa-times"></i></div>
<div>Cancel</div>
</div>
<div class="border-round border button" onclick="save()">
<div><i class="fa fa-check"></i></div>
<div align="center">Save</div>
</div>
</div>
</p>
</div>

File diff suppressed because one or more lines are too long

@ -0,0 +1,78 @@
body {
}
.models {
}
.footer {
display:none;
text-align:center;
}
.folders {
display:grid;
grid-template-columns:50% 50%;
grid-gap:4px;
}
.folders .pane_1 {
display:grid;
grid-template-rows: 50% 50%;
grid-gap:2px;
padding:2px;
}
.folders .pane_2 {display:grid; padding:2px; grid-gap:2px;}
.graph {padding:8px; border:1px solid #CAD5E0; border-radius:8px;}
.chart {display:grid; grid-template-columns: 60% 40%; grid-gap:2px; margin-top:10px;}
.chart .info {padding-left:10px; display:block;}
.chart div:first-child {
padding:4px;
background-color:#f3f3f3;
}
/* .folders .pane_1 .graph {width:50%; margin:4px; border:1px solid #CAD5E0}
.folders .pane_2 .graph {width:60%; margin:4px; border:1px solid #CAD5E0} */
.apps {
display:grid;
grid-template-columns: 60% 40%;
grid-gap:4px;
}
.apps .pane_1 {
display:grid;
padding:2px;
grid-gap:2px;}
.apps .pane_2 {display:block; padding:2px;}
.apps .pane_2 .status{
border:1px solid #CAD5E0;
border-radius:8px;
padding:8px;
}
.apps .pane_2 .status .chart {display:block;}
/* .apps .pane_1 .model {padding:2px;}
.apps .pane_1 .resource { padding:2px} */
/*
.folders_0 .model { grid-row:1; grid-column:1}
.folders_0 .rank { grid-row:1; grid-column:2 / span 2;}
.folders_0 .size { grid-row:2; grid-column:1}
.folders_0 .age { grid-row:2; grid-column:2}
.folders_0 .files { grid-row:2; grid-column:3 }
.folders_0 .chart { padding:8px;}
.apps_0{
margin:2px;
padding:2px;
grid-gap:2px;
grid-template-columns: 50% 50% ;
display:grid;
}
.apps_0 .model {grid-row:2; grid-column:1/span 2}
.apps_0 .status{grid-row:1; grid-column:1}
.apps_0 .resource{grid-row:1; grid-column:2} */

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -0,0 +1,114 @@
@media only screen and (min-width: 1024px){
body {font-size:18px; font-weight:lighter}
.small {font-size:14px;}
}
@media only screen and (max-width: 1024px){
body {font-size:14px; font-weight:lighter;}
}
body {
/* margin-left:1%; */
/* margin-right:1%; */
margin:1%;
font-family:sans-serif;
font-weight: lighter;
font-size:14px;
}
.small {font-size:12px;}
.bold {font-weight:bold}
.no-border{border:1px solid transparent}
.border {border: 1px solid #CAD5E0}
.border-top {border-top: 1px solid #CAD5E0}
.border-right {border-right: 1px solid #CAD5E0}
.border-left {border-left: 1px solid #CAD5E0}
.border-bottom {border-bottom: 1px solid #CAD5E0}
.left {float:left}
.right{float:right}
.no-float{float:none}
.maroon {color:maroon}
.title-bar {padding:4px; margin:4px}
.title-bar .title {font-size:18px;}
.jsgrid-edit-row > .jsgrid-cell {
background: #ffffff;
}
.active { border:2px solid transparent; cursor:pointer; margin:4px;}
.active:hover {border-bottom:2px solid #4682b4}
.edit-grid input[type=text]{
font-family:sans-serif;
font-weight:lighter;
border:0px;
border-left:2px solid transparent;
background-color:#f3f3f3;
font-size:14px;
margin:0px;
padding:4px;
outline:0px;
}
.edit-grid input[type=text]:focus {
outline:0px;
border-left:2px solid #4682b4;
}
.fa-times {color:maroon}
.fa-check {color:green}
.search-box{}
.search-box input[type=text] {font-size:13px;
padding-left:4px;
font-weight: lighter;
background-color:#f3f3f3;
border:4px solid transparent;
outline:none}
.search-box input[type=text]:focus{
outline:none;
border-left:4px solid #4682b4;
}
.button {
padding:4px;
cursor:pointer;
font-family:arial;
}
.button:hover{
background-color:#4682B4 ;
color:#ffffff;
}
.data-frame {
display:grid;
margin-left:4px;
padding:4px;
grid-template-rows: 80% 20%;
grid-gap:2px;
height:85%;
overflow:hidden;
}
.data-frame .comment {
grid-row: 2;
padding:4px;
font-size:12px;
color:gray;
font-weight: lighter;
font-family: verdana;
}
.data-frame .grid {
grid-row:1;
width:100%;
padding:4px;
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -1,248 +0,0 @@
!function ($) {
/* CHECKBOX PUBLIC CLASS DEFINITION
* ============================== */
var Checkbox = function (element, options) {
this.init(element, options);
}
Checkbox.prototype = {
constructor: Checkbox
, init: function (element, options) {
var $el = this.$element = $(element)
this.options = $.extend({}, $.fn.checkbox.defaults, options);
$el.before(this.options.template);
this.setState();
}
, setState: function () {
var $el = this.$element
, $parent = $el.closest('.checkbox');
$el.prop('disabled') && $parent.addClass('disabled');
$el.prop('checked') && $parent.addClass('checked');
}
, toggle: function () {
var ch = 'checked'
, $el = this.$element
, $parent = $el.closest('.checkbox')
, checked = $el.prop(ch)
, e = $.Event('toggle')
if ($el.prop('disabled') == false) {
$parent.toggleClass(ch) && checked ? $el.removeAttr(ch) : $el.prop(ch, ch);
$el.trigger(e).trigger('change');
}
}
, setCheck: function (option) {
var d = 'disabled'
, ch = 'checked'
, $el = this.$element
, $parent = $el.closest('.checkbox')
, checkAction = option == 'check' ? true : false
, e = $.Event(option)
$parent[checkAction ? 'addClass' : 'removeClass' ](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
$el.trigger(e).trigger('change');
}
}
/* CHECKBOX PLUGIN DEFINITION
* ======================== */
var old = $.fn.checkbox
$.fn.checkbox = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('checkbox')
, options = $.extend({}, $.fn.checkbox.defaults, $this.data(), typeof option == 'object' && option);
if (!data) $this.data('checkbox', (data = new Checkbox(this, options)));
if (option == 'toggle') data.toggle()
if (option == 'check' || option == 'uncheck') data.setCheck(option)
else if (option) data.setState();
});
}
$.fn.checkbox.defaults = {
template: '<span class="icons"><span class="first-icon fa fa-square fa-base"></span><span class="second-icon fa fa-check-square fa-base"></span></span>'
}
/* CHECKBOX NO CONFLICT
* ================== */
$.fn.checkbox.noConflict = function () {
$.fn.checkbox = old;
return this;
}
/* CHECKBOX DATA-API
* =============== */
$(document).on('click.checkbox.data-api', '[data-toggle^=checkbox], .checkbox', function (e) {
var $checkbox = $(e.target);
if (e.target.tagName != "A") {
e && e.preventDefault() && e.stopPropagation();
if (!$checkbox.hasClass('checkbox')) $checkbox = $checkbox.closest('.checkbox');
$checkbox.find(':checkbox').checkbox('toggle');
}
});
$(function () {
$('input[type="checkbox"]').each(function () {
var $checkbox = $(this);
$checkbox.checkbox();
});
});
}(window.jQuery);
/* =============================================================
* flatui-radio v0.0.3
* ============================================================ */
!function ($) {
/* RADIO PUBLIC CLASS DEFINITION
* ============================== */
var Radio = function (element, options) {
this.init(element, options);
}
Radio.prototype = {
constructor: Radio
, init: function (element, options) {
var $el = this.$element = $(element)
this.options = $.extend({}, $.fn.radio.defaults, options);
$el.before(this.options.template);
this.setState();
}
, setState: function () {
var $el = this.$element
, $parent = $el.closest('.radio');
$el.prop('disabled') && $parent.addClass('disabled');
$el.prop('checked') && $parent.addClass('checked');
}
, toggle: function () {
var d = 'disabled'
, ch = 'checked'
, $el = this.$element
, checked = $el.prop(ch)
, $parent = $el.closest('.radio')
, $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
, $elemGroup = $parentWrap.find(':radio[name="' + $el.attr('name') + '"]')
, e = $.Event('toggle')
if ($el.prop(d) == false) {
$elemGroup.not($el).each(function () {
var $el = $(this)
, $parent = $(this).closest('.radio');
if ($el.prop(d) == false) {
$parent.removeClass(ch) && $el.removeAttr(ch).trigger('change');
}
});
if (checked == false) $parent.addClass(ch) && $el.prop(ch, true);
$el.trigger(e);
if (checked !== $el.prop(ch)) {
$el.trigger('change');
}
}
}
, setCheck: function (option) {
var ch = 'checked'
, $el = this.$element
, $parent = $el.closest('.radio')
, checkAction = option == 'check' ? true : false
, checked = $el.prop(ch)
, $parentWrap = $el.closest('form').length ? $el.closest('form') : $el.closest('body')
, $elemGroup = $parentWrap.find(':radio[name="' + $el['attr']('name') + '"]')
, e = $.Event(option)
$elemGroup.not($el).each(function () {
var $el = $(this)
, $parent = $(this).closest('.radio');
$parent.removeClass(ch) && $el.removeAttr(ch);
});
$parent[checkAction ? 'addClass' : 'removeClass'](ch) && checkAction ? $el.prop(ch, ch) : $el.removeAttr(ch);
$el.trigger(e);
if (checked !== $el.prop(ch)) {
$el.trigger('change');
}
}
}
/* RADIO PLUGIN DEFINITION
* ======================== */
var old = $.fn.radio
$.fn.radio = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('radio')
, options = $.extend({}, $.fn.radio.defaults, $this.data(), typeof option == 'object' && option);
if (!data) $this.data('radio', (data = new Radio(this, options)));
if (option == 'toggle') data.toggle()
if (option == 'check' || option == 'uncheck') data.setCheck(option)
else if (option) data.setState();
});
}
$.fn.radio.defaults = {
template: '<span class="icons"><span class="first-icon fa fa-circle-o fa-base"></span><span class="second-icon fa fa-dot-circle-o fa-base"></span></span>'
}
/* RADIO NO CONFLICT
* ================== */
$.fn.radio.noConflict = function () {
$.fn.radio = old;
return this;
}
/* RADIO DATA-API
* =============== */
$(document).on('click.radio.data-api', '[data-toggle^=radio], .radio', function (e) {
var $radio = $(e.target);
e && e.preventDefault() && e.stopPropagation();
if (!$radio.hasClass('radio')) $radio = $radio.closest('.radio');
$radio.find(':radio').radio('toggle');
});
$(function () {
$('input[type="radio"]').each(function () {
var $radio = $(this);
$radio.radio();
});
});
}(window.jQuery);

@ -1,404 +0,0 @@
/*
Creative Tim Modifications
Lines: 239, 240 was changed from top: 5px to top: 50% and we added margin-top: -13px. In this way the close button will be aligned vertically
Line:242 - modified when the icon is set, we add the class "alert-with-icon", so there will be enough space for the icon.
*/
/*
* Project: Bootstrap Notify = v3.1.5
* Description: Turns standard Bootstrap alerts into "Growl-like" notifications.
* Author: Mouse0270 aka Robert McIntosh
* License: MIT License
* Website: https://github.com/mouse0270/bootstrap-growl
*/
/* global define:false, require: false, jQuery:false */
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
// Create the defaults once
var defaults = {
element: 'body',
position: null,
type: "info",
allow_dismiss: true,
allow_duplicates: true,
newest_on_top: false,
showProgressbar: false,
placement: {
from: "top",
align: "right"
},
offset: 20,
spacing: 10,
z_index: 1031,
delay: 5000,
timer: 1000,
url_target: '_blank',
mouse_over: null,
animate: {
enter: 'animated fadeInDown',
exit: 'animated fadeOutUp'
},
onShow: null,
onShown: null,
onClose: null,
onClosed: null,
icon_type: 'class',
template: '<div data-notify="container" class="col-xs-11 col-sm-4 alert alert-{0}" role="alert"><button type="button" aria-hidden="true" class="close" data-notify="dismiss">&times;</button><span data-notify="icon"></span> <span data-notify="title">{1}</span> <span data-notify="message">{2}</span><div class="progress" data-notify="progressbar"><div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div></div><a href="{3}" target="{4}" data-notify="url"></a></div>'
};
String.format = function () {
var str = arguments[0];
for (var i = 1; i < arguments.length; i++) {
str = str.replace(RegExp("\\{" + (i - 1) + "\\}", "gm"), arguments[i]);
}
return str;
};
function isDuplicateNotification(notification) {
var isDupe = false;
$('[data-notify="container"]').each(function (i, el) {
var $el = $(el);
var title = $el.find('[data-notify="title"]').text().trim();
var message = $el.find('[data-notify="message"]').html().trim();
// The input string might be different than the actual parsed HTML string!
// (<br> vs <br /> for example)
// So we have to force-parse this as HTML here!
var isSameTitle = title === $("<div>" + notification.settings.content.title + "</div>").html().trim();
var isSameMsg = message === $("<div>" + notification.settings.content.message + "</div>").html().trim();
var isSameType = $el.hasClass('alert-' + notification.settings.type);
if (isSameTitle && isSameMsg && isSameType) {
//we found the dupe. Set the var and stop checking.
isDupe = true;
}
return !isDupe;
});
return isDupe;
}
function Notify(element, content, options) {
// Setup Content of Notify
var contentObj = {
content: {
message: typeof content === 'object' ? content.message : content,
title: content.title ? content.title : '',
icon: content.icon ? content.icon : '',
url: content.url ? content.url : '#',
target: content.target ? content.target : '-'
}
};
options = $.extend(true, {}, contentObj, options);
this.settings = $.extend(true, {}, defaults, options);
this._defaults = defaults;
if (this.settings.content.target === "-") {
this.settings.content.target = this.settings.url_target;
}
this.animations = {
start: 'webkitAnimationStart oanimationstart MSAnimationStart animationstart',
end: 'webkitAnimationEnd oanimationend MSAnimationEnd animationend'
};
if (typeof this.settings.offset === 'number') {
this.settings.offset = {
x: this.settings.offset,
y: this.settings.offset
};
}
//if duplicate messages are not allowed, then only continue if this new message is not a duplicate of one that it already showing
if (this.settings.allow_duplicates || (!this.settings.allow_duplicates && !isDuplicateNotification(this))) {
this.init();
}
}
$.extend(Notify.prototype, {
init: function () {
var self = this;
this.buildNotify();
if (this.settings.content.icon) {
this.setIcon();
}
if (this.settings.content.url != "#") {
this.styleURL();
}
this.styleDismiss();
this.placement();
this.bind();
this.notify = {
$ele: this.$ele,
update: function (command, update) {
var commands = {};
if (typeof command === "string") {
commands[command] = update;
} else {
commands = command;
}
for (var cmd in commands) {
switch (cmd) {
case "type":
this.$ele.removeClass('alert-' + self.settings.type);
this.$ele.find('[data-notify="progressbar"] > .progress-bar').removeClass('progress-bar-' + self.settings.type);
self.settings.type = commands[cmd];
this.$ele.addClass('alert-' + commands[cmd]).find('[data-notify="progressbar"] > .progress-bar').addClass('progress-bar-' + commands[cmd]);
break;
case "icon":
var $icon = this.$ele.find('[data-notify="icon"]');
if (self.settings.icon_type.toLowerCase() === 'class') {
$icon.removeClass(self.settings.content.icon).addClass(commands[cmd]);
} else {
if (!$icon.is('img')) {
$icon.find('img');
}
$icon.attr('src', commands[cmd]);
}
break;
case "progress":
var newDelay = self.settings.delay - (self.settings.delay * (commands[cmd] / 100));
this.$ele.data('notify-delay', newDelay);
this.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', commands[cmd]).css('width', commands[cmd] + '%');
break;
case "url":
this.$ele.find('[data-notify="url"]').attr('href', commands[cmd]);
break;
case "target":
this.$ele.find('[data-notify="url"]').attr('target', commands[cmd]);
break;
default:
this.$ele.find('[data-notify="' + cmd + '"]').html(commands[cmd]);
}
}
var posX = this.$ele.outerHeight() + parseInt(self.settings.spacing) + parseInt(self.settings.offset.y);
self.reposition(posX);
},
close: function () {
self.close();
}
};
},
buildNotify: function () {
var content = this.settings.content;
this.$ele = $(String.format(this.settings.template, this.settings.type, content.title, content.message, content.url, content.target));
this.$ele.attr('data-notify-position', this.settings.placement.from + '-' + this.settings.placement.align);
if (!this.settings.allow_dismiss) {
this.$ele.find('[data-notify="dismiss"]').css('display', 'none');
}
if ((this.settings.delay <= 0 && !this.settings.showProgressbar) || !this.settings.showProgressbar) {
this.$ele.find('[data-notify="progressbar"]').remove();
}
},
setIcon: function () {
this.$ele.addClass('alert-with-icon');
if (this.settings.icon_type.toLowerCase() === 'class') {
this.$ele.find('[data-notify="icon"]').addClass(this.settings.content.icon);
} else {
if (this.$ele.find('[data-notify="icon"]').is('img')) {
this.$ele.find('[data-notify="icon"]').attr('src', this.settings.content.icon);
} else {
this.$ele.find('[data-notify="icon"]').append('<img src="' + this.settings.content.icon + '" alt="Notify Icon" />');
}
}
},
styleDismiss: function () {
this.$ele.find('[data-notify="dismiss"]').css({
position: 'absolute',
right: '10px',
top: '50%',
marginTop: '-13px',
zIndex: this.settings.z_index + 2
});
},
styleURL: function () {
this.$ele.find('[data-notify="url"]').css({
backgroundImage: 'url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)',
height: '100%',
left: 0,
position: 'absolute',
top: 0,
width: '100%',
zIndex: this.settings.z_index + 1
});
},
placement: function () {
var self = this,
offsetAmt = this.settings.offset.y,
css = {
display: 'inline-block',
margin: '0px auto',
position: this.settings.position ? this.settings.position : (this.settings.element === 'body' ? 'fixed' : 'absolute'),
transition: 'all .5s ease-in-out',
zIndex: this.settings.z_index
},
hasAnimation = false,
settings = this.settings;
$('[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])').each(function () {
offsetAmt = Math.max(offsetAmt, parseInt($(this).css(settings.placement.from)) + parseInt($(this).outerHeight()) + parseInt(settings.spacing));
});
if (this.settings.newest_on_top === true) {
offsetAmt = this.settings.offset.y;
}
css[this.settings.placement.from] = offsetAmt + 'px';
switch (this.settings.placement.align) {
case "left":
case "right":
css[this.settings.placement.align] = this.settings.offset.x + 'px';
break;
case "center":
css.left = 0;
css.right = 0;
break;
}
this.$ele.css(css).addClass(this.settings.animate.enter);
$.each(Array('webkit-', 'moz-', 'o-', 'ms-', ''), function (index, prefix) {
self.$ele[0].style[prefix + 'AnimationIterationCount'] = 1;
});
$(this.settings.element).append(this.$ele);
if (this.settings.newest_on_top === true) {
offsetAmt = (parseInt(offsetAmt) + parseInt(this.settings.spacing)) + this.$ele.outerHeight();
this.reposition(offsetAmt);
}
if ($.isFunction(self.settings.onShow)) {
self.settings.onShow.call(this.$ele);
}
this.$ele.one(this.animations.start, function () {
hasAnimation = true;
}).one(this.animations.end, function () {
if ($.isFunction(self.settings.onShown)) {
self.settings.onShown.call(this);
}
});
setTimeout(function () {
if (!hasAnimation) {
if ($.isFunction(self.settings.onShown)) {
self.settings.onShown.call(this);
}
}
}, 600);
},
bind: function () {
var self = this;
this.$ele.find('[data-notify="dismiss"]').on('click', function () {
self.close();
});
this.$ele.mouseover(function () {
$(this).data('data-hover', "true");
}).mouseout(function () {
$(this).data('data-hover', "false");
});
this.$ele.data('data-hover', "false");
if (this.settings.delay > 0) {
self.$ele.data('notify-delay', self.settings.delay);
var timer = setInterval(function () {
var delay = parseInt(self.$ele.data('notify-delay')) - self.settings.timer;
if ((self.$ele.data('data-hover') === 'false' && self.settings.mouse_over === "pause") || self.settings.mouse_over != "pause") {
var percent = ((self.settings.delay - delay) / self.settings.delay) * 100;
self.$ele.data('notify-delay', delay);
self.$ele.find('[data-notify="progressbar"] > div').attr('aria-valuenow', percent).css('width', percent + '%');
}
if (delay <= -(self.settings.timer)) {
clearInterval(timer);
self.close();
}
}, self.settings.timer);
}
},
close: function () {
var self = this,
posX = parseInt(this.$ele.css(this.settings.placement.from)),
hasAnimation = false;
this.$ele.data('closing', 'true').addClass(this.settings.animate.exit);
self.reposition(posX);
if ($.isFunction(self.settings.onClose)) {
self.settings.onClose.call(this.$ele);
}
this.$ele.one(this.animations.start, function () {
hasAnimation = true;
}).one(this.animations.end, function () {
$(this).remove();
if ($.isFunction(self.settings.onClosed)) {
self.settings.onClosed.call(this);
}
});
setTimeout(function () {
if (!hasAnimation) {
self.$ele.remove();
if (self.settings.onClosed) {
self.settings.onClosed(self.$ele);
}
}
}, 600);
},
reposition: function (posX) {
var self = this,
notifies = '[data-notify-position="' + this.settings.placement.from + '-' + this.settings.placement.align + '"]:not([data-closing="true"])',
$elements = this.$ele.nextAll(notifies);
if (this.settings.newest_on_top === true) {
$elements = this.$ele.prevAll(notifies);
}
$elements.each(function () {
$(this).css(self.settings.placement.from, posX);
posX = (parseInt(posX) + parseInt(self.settings.spacing)) + $(this).outerHeight();
});
}
});
$.notify = function (content, options) {
var plugin = new Notify(this, content, options);
return plugin.notify;
};
$.notifyDefaults = function (options) {
defaults = $.extend(true, {}, defaults, options);
return defaults;
};
$.notifyClose = function (command) {
if (typeof command === "undefined" || command === "all") {
$('[data-notify]').find('[data-notify="dismiss"]').trigger('click');
} else {
$('[data-notify-position="' + command + '"]').find('[data-notify="dismiss"]').trigger('click');
}
};
}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,216 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="origin" name="referrer" />
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/frameworks-d48d0c441ed0ab66aa7d582c5aaf762f4a1eef9a915871a36ddb07e71b01ffb2.css" media="all" rel="stylesheet" />
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/github-eceee2011dedd755b4dda5f1d5d1e21b21898ea894ef433b5ac3113bbae89a6e.css" media="all" rel="stylesheet" />
<link crossorigin="anonymous" href="https://assets-cdn.github.com/assets/site-7f1a41ba2b363d8328a1603010c1c34aa7da36bd92ed8693a262fc5b703f2b10.css" media="all" rel="stylesheet" />
<meta name="viewport" content="width=device-width">
<title>Sign in to GitHub · GitHub</title>
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub">
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<meta property="fb:app_id" content="1401488693436528">
<meta property="og:url" content="https://github.com">
<meta property="og:site_name" content="GitHub">
<meta property="og:title" content="Build software better, together">
<meta property="og:description" content="GitHub is where people build software. More than 22 million people use GitHub to discover, fork, and contribute to over 60 million projects.">
<meta property="og:image" content="https://assets-cdn.github.com/images/modules/open_graph/github-logo.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="1200">
<meta property="og:image" content="https://assets-cdn.github.com/images/modules/open_graph/github-mark.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="620">
<meta property="og:image" content="https://assets-cdn.github.com/images/modules/open_graph/github-octocat.png">
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="620">
<link rel="assets" href="https://assets-cdn.github.com/">
<meta name="pjax-timeout" content="1000">
<meta name="request-id" content="F4D1:0758:104FC4A:1870ADF:5939D212" data-pjax-transient>
<meta name="selected-link" value="/login" data-pjax-transient>
<meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU">
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
<meta name="google-analytics" content="UA-3769691-2">
<meta content="collector.githubapp.com" name="octolytics-host" /><meta content="github" name="octolytics-app-id" /><meta content="https://collector.githubapp.com/github-external/browser_event" name="octolytics-event-url" /><meta content="F4D1:0758:104FC4A:1870ADF:5939D212" name="octolytics-dimension-request_id" /><meta content="iad" name="octolytics-dimension-region_edge" /><meta content="iad" name="octolytics-dimension-region_render" />
<meta content="true" data-pjax-transient="true" name="analytics-location-query-strip" />
<meta class="js-ga-set" name="dimension1" content="Logged Out">
<meta name="hostname" content="github.com">
<meta name="user-login" content="">
<meta name="expected-hostname" content="github.com">
<meta name="js-proxy-site-detection-payload" content="YzUxN2E0MzU5NThkYzJjMzJhNmI3MTRlYzg4M2NmNzMxOGNlYmY4OWRmZGExNjAwZWQwYjVhZTQ4OGZhZTgxY3x7InJlbW90ZV9hZGRyZXNzIjoiNzUuMTQ5LjEwMC4yNTIiLCJyZXF1ZXN0X2lkIjoiRjREMTowNzU4OjEwNEZDNEE6MTg3MEFERjo1OTM5RDIxMiIsInRpbWVzdGFtcCI6MTQ5Njk2MTU1NCwiaG9zdCI6ImdpdGh1Yi5jb20ifQ==">
<meta name="html-safe-nonce" content="f53b182df68775bfd599d2db2b3644f6f57f3d6c">
<meta http-equiv="x-pjax-version" content="4b86b6b789ca74deb1b3578459c44709">
<meta name="description" content="GitHub is where people build software. More than 22 million people use GitHub to discover, fork, and contribute to over 60 million projects.">
<link rel="canonical" href="https://github.com/login" data-pjax-transient>
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#000000">
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
<meta name="theme-color" content="#1e2327">
</head>
<body class="logged-out env-production session-authentication page-responsive min-width-0">
<div class="position-relative js-header-wrapper ">
<a href="#start-of-content" tabindex="1" class="accessibility-aid js-skip-to-content">Skip to content</a>
<div id="js-pjax-loader-bar" class="pjax-loader-bar"><div class="progress"></div></div>
<div class="header header-logged-out width-full pt-5 pb-4" role="banner">
<div class="container clearfix width-full">
<a class="header-logo" href="https://github.com/" aria-label="Homepage" data-ga-click="(Logged out) Header, go to homepage, icon:logo-wordmark">
<svg aria-hidden="true" class="octicon octicon-mark-github" height="48" version="1.1" viewBox="0 0 16 16" width="48"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/></svg>
</a>
</div>
</div>
</div>
<div id="start-of-content" class="accessibility-aid"></div>
<div role="main">
<div id="js-pjax-container" data-pjax-container>
<div class="auth-form px-3" id="login">
<!-- '"` --><!-- </textarea></xmp> --></option></form><form accept-charset="UTF-8" action="/session" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="7XZSonP0W9pDyZpVrbdXWHCiRNfnCXldeVF5M83at4CARFuqW64xs69pW4t4+L8Uumbz21TkBxVMPfv/xF3/aw==" /></div> <div class="auth-form-header p-0">
<h1>Sign in to GitHub</h1>
</div>
<div id="js-flash-container">
</div>
<div class="auth-form-body mt-3">
<label for="login_field">
Username or email address
</label>
<input autocapitalize="off" autocorrect="off" autofocus="autofocus" class="form-control input-block" id="login_field" name="login" tabindex="1" type="text" />
<label for="password">
Password <a href="/password_reset" class="label-link">Forgot password?</a>
</label>
<input class="form-control form-control input-block" id="password" name="password" tabindex="2" type="password" />
<input class="btn btn-primary btn-block" data-disable-with="Signing in…" name="commit" tabindex="3" type="submit" value="Sign in" />
</div>
</form>
<p class="create-account-callout mt-3">
New to GitHub?
<a href="/join?return_to=https%3A%2F%2Fgithub.com%2Fgionkunz%2Fchartist-js%2Fedit%2Fdevelop%2Fdist%2Fchartist.min.js.map&amp;source=login" data-ga-click="Sign in, switch to sign up">Create an account</a>.
</p>
</div>
</div>
<div class="modal-backdrop js-touch-events"></div>
</div>
<div class="site-footer" role="contentinfo">
<ul class="site-footer-links">
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
<li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact GitHub</a></li>
</ul>
</div>
<div id="ajax-error-message" class="ajax-error-message flash flash-error">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
<svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
</button>
You can't perform that action at this time.
</div>
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/compat-8a4318ffea09a0cdb8214b76cf2926b9f6a0ced318a317bed419db19214c690d.js"></script>
<script crossorigin="anonymous" src="https://assets-cdn.github.com/assets/frameworks-73720f027bb317fceb118c259275da4be5efa344c246a12341a68c3168ceeaa7.js"></script>
<script async="async" crossorigin="anonymous" src="https://assets-cdn.github.com/assets/github-3ad5579f0af51ee1adcb93de64d25ce6771132f49f8044580b60743ec58d520c.js"></script>
<div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner d-none">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/></svg>
<span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
<span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
</div>
<div class="facebox" id="facebox" style="display:none;">
<div class="facebox-popup">
<div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description">
</div>
<button type="button" class="facebox-close js-facebox-close" aria-label="Close modal">
<svg aria-hidden="true" class="octicon octicon-x" height="16" version="1.1" viewBox="0 0 12 16" width="12"><path fill-rule="evenodd" d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
</button>
</div>
</div>
</body>
</html>

@ -1,192 +0,0 @@
type = ['','info','success','warning','danger'];
dashboard = {
initPickColor: function(){
$('.pick-class-label').click(function(){
var new_class = $(this).attr('new-class');
var old_class = $('#display-buttons').attr('data-class');
var display_div = $('#display-buttons');
if(display_div.length) {
var display_buttons = display_div.find('.btn');
display_buttons.removeClass(old_class);
display_buttons.addClass(new_class);
display_div.attr('data-class', new_class);
}
});
},
initChartist: function(){
var getData = $.get('/1/app/usage/trend');
getData.done(function(results) {
var data = JSON.parse(results)
var node = data['apps@michaels-MBP'];
var app = node['chrome'];
var cpu = app['cpu'];
var memory_used = app['memory_used'];
console.log('data...',data)
console.log('node...',node)
console.log('app...',app)
console.log('cpu...',cpu)
console.log('memory_used...', memory_used)
// monitoring apps chart
var dataChart = {
labels: ['24','23','22','21','20','19','18','17','16','15','14','13','12','11','10','9','8','7','6','5','4','3','2','1' ],
series: [cpu, memory_used, [1,2,3,5], ] // TODO: Check the order, the graph is by index not name.
};
dataChartArray = dataChart.series
var maxlist = dataChartArray.map(dataChartArray => Math.max.apply(null, dataChartArray));
maxNum = Math.max.apply(null, maxlist)
var optionsChart = {
lineSmooth: false,
low: 0,
high: maxNum + 1,
showArea: true,
height: "245px",
axisX: {
showGrid: false,
},
lineSmooth: Chartist.Interpolation.simple({
divisor: 1
}),
showLine: true,
showPoint: false,
};
var responsiveChart = [
['screen and (max-width: 640px)', {
axisX: {
labelInterpolationFnc: function (value) {
return value[0];
}
}
}]
];
Chartist.Line('#chartHours', dataChart, optionsChart, responsiveChart);
// cpu and memory --------------------------
var data = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
series: [cpu, memory_used]
};
var options = {
seriesBarDistance: 10,
axisX: {
showGrid: false
},
height: "245px"
};
var responsiveOptions = [
['screen and (max-width: 640px)', {
seriesBarDistance: 5,
axisX: {
labelInterpolationFnc: function (value) {
return value[0];
}
}
}]
];
Chartist.Line('#chartActivity', data, options, responsiveOptions);
var getStatus = $.get('1/get/summary/app_status');
getStatus.done(function(results) {
var data = JSON.parse(results)
let getStatusList = []
getStatusList.push(data.idle)
getStatusList.push(data.crash)
getStatusList.push(data.running)
Chartist.Pie('#chartPreferences', {
labels: getStatusList,
series: getStatusList
},{donut:true});
}) /// end getStatus
})
},
// End chartist function
initGoogleMaps: function(){
var myLatlng = new google.maps.LatLng(40.748817, -73.985428);
var mapOptions = {
zoom: 13,
center: myLatlng,
scrollwheel: false, //we disable de scroll over the map, it is a really annoing when you scroll through page
styles: [{"featureType":"water","stylers":[{"saturation":43},{"lightness":-11},{"hue":"#0088ff"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"hue":"#ff0000"},{"saturation":-100},{"lightness":99}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#808080"},{"lightness":54}]},{"featureType":"landscape.man_made","elementType":"geometry.fill","stylers":[{"color":"#ece2d9"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#ccdca1"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#767676"}]},{"featureType":"road","elementType":"labels.text.stroke","stylers":[{"color":"#ffffff"}]},{"featureType":"poi","stylers":[{"visibility":"off"}]},{"featureType":"landscape.natural","elementType":"geometry.fill","stylers":[{"visibility":"on"},{"color":"#b8cb93"}]},{"featureType":"poi.park","stylers":[{"visibility":"on"}]},{"featureType":"poi.sports_complex","stylers":[{"visibility":"on"}]},{"featureType":"poi.medical","stylers":[{"visibility":"on"}]},{"featureType":"poi.business","stylers":[{"visibility":"simplified"}]}]
}
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
title:"Hello World!"
});
// To add the marker to the map, call setMap();
marker.setMap(map);
},
showNotification: function(from, align){
color = Math.floor((Math.random() * 4) + 1);
$.notify({
icon: "ti-comment",
message: "Message."
},{
type: type[color],
timer: 4000,
placement: {
from: from,
align: align
}
});
},
}
/**
* Global information about the dashboard
* @TODO: Add socket handling ... it would make non-blocking updating information
*/
var g = {}
g.summary = {}
/**
* Initializing the top section of the dashboard (apps and folders)
*/
g.summary.factory = function (url,pointer) {
var object = {}
object.url = url
var observer = null
var TIME_ELLAPSED = 2000 ;
object.callback = function (r) {
r = JSON.parse(r.responseText)
pointer(r)
//observer.notify()
}
object.init = function (observer) {
observer = observer
var httpclient = HttpClient.instance()
//httpclient.setAsync(false)
httpclient.get(this.url, this.callback)
setTimeout(function(){
observer.notify()
},TIME_ELLAPSED) ;
//observer.notify()
}
return object
}

@ -1,140 +0,0 @@
var fixedTop = false;
var transparent = true;
var navbar_initialized = false;
$(document).ready(function(){
window_width = $(window).width();
// Init navigation toggle for small screens
if(window_width <= 991){
pd.initRightMenu();
}
// Activate the tooltips
$('[rel="tooltip"]').tooltip();
});
// activate collapse right menu when the windows is resized
$(window).resize(function(){
if($(window).width() <= 991){
pd.initRightMenu();
}
});
pd = {
misc:{
navbar_menu_visible: 0
},
checkScrollForTransparentNavbar: debounce(function() {
if($(document).scrollTop() > 381 ) {
if(transparent) {
transparent = false;
$('.navbar-color-on-scroll').removeClass('navbar-transparent');
$('.navbar-title').removeClass('hidden');
}
} else {
if( !transparent ) {
transparent = true;
$('.navbar-color-on-scroll').addClass('navbar-transparent');
$('.navbar-title').addClass('hidden');
}
}
}),
initRightMenu: function(){
if(!navbar_initialized){
$off_canvas_sidebar = $('nav').find('.navbar-collapse').first().clone(true);
$sidebar = $('.sidebar');
sidebar_bg_color = $sidebar.data('background-color');
sidebar_active_color = $sidebar.data('active-color');
$logo = $sidebar.find('.logo').first();
logo_content = $logo[0].outerHTML;
ul_content = '';
// set the bg color and active color from the default sidebar to the off canvas sidebar;
$off_canvas_sidebar.attr('data-background-color',sidebar_bg_color);
$off_canvas_sidebar.attr('data-active-color',sidebar_active_color);
$off_canvas_sidebar.addClass('off-canvas-sidebar');
//add the content from the regular header to the right menu
$off_canvas_sidebar.children('ul').each(function(){
content_buff = $(this).html();
ul_content = ul_content + content_buff;
});
// add the content from the sidebar to the right menu
content_buff = $sidebar.find('.nav').html();
ul_content = ul_content + '<li class="divider"></li>'+ content_buff;
ul_content = '<ul class="nav navbar-nav">' + ul_content + '</ul>';
navbar_content = logo_content + ul_content;
navbar_content = '<div class="sidebar-wrapper">' + navbar_content + '</div>';
$off_canvas_sidebar.html(navbar_content);
$('body').append($off_canvas_sidebar);
$toggle = $('.navbar-toggle');
$off_canvas_sidebar.find('a').removeClass('btn btn-round btn-default');
$off_canvas_sidebar.find('button').removeClass('btn-round btn-fill btn-info btn-primary btn-success btn-danger btn-warning btn-neutral');
$off_canvas_sidebar.find('button').addClass('btn-simple btn-block');
$toggle.click(function (){
if(pd.misc.navbar_menu_visible == 1) {
$('html').removeClass('nav-open');
pd.misc.navbar_menu_visible = 0;
$('#bodyClick').remove();
setTimeout(function(){
$toggle.removeClass('toggled');
}, 400);
} else {
setTimeout(function(){
$toggle.addClass('toggled');
}, 430);
div = '<div id="bodyClick"></div>';
$(div).appendTo("body").click(function() {
$('html').removeClass('nav-open');
pd.misc.navbar_menu_visible = 0;
$('#bodyClick').remove();
setTimeout(function(){
$toggle.removeClass('toggled');
}, 400);
});
$('html').addClass('nav-open');
pd.misc.navbar_menu_visible = 1;
}
});
navbar_initialized = true;
}
}
}
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
timeout = setTimeout(function() {
timeout = null;
if (!immediate) func.apply(context, args);
}, wait);
if (immediate && !timeout) func.apply(context, args);
};
};

File diff suppressed because it is too large Load Diff

@ -1,130 +0,0 @@
module.exports = function(grunt) {
"use strict"
var banner =
"/*\n" +
" * jsGrid v<%= pkg.version %> (<%= pkg.homepage %>)\n" +
" * (c) <%= grunt.template.today('yyyy') %> <%= pkg.author %>\n" +
" * Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n" +
" */\n";
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
copy: {
imgs: {
expand: true,
cwd: "css/",
src: "*.png",
dest: "dist/"
},
i18n: {
expand: true,
cwd: "src/i18n/",
src: "*.js",
dest: "dist/i18n/",
rename: function(dest, src) {
return dest + "jsgrid-" + src;
}
}
},
concat: {
options: {
banner: banner + "\n",
separator: "\n"
},
js: {
src: [
"src/jsgrid.core.js",
"src/jsgrid.load-indicator.js",
"src/jsgrid.load-strategies.js",
"src/jsgrid.sort-strategies.js",
"src/jsgrid.validation.js",
"src/jsgrid.field.js",
"src/fields/jsgrid.field.text.js",
"src/fields/jsgrid.field.number.js",
"src/fields/jsgrid.field.textarea.js",
"src/fields/jsgrid.field.select.js",
"src/fields/jsgrid.field.checkbox.js",
"src/fields/jsgrid.field.control.js"
],
dest: "dist/<%= pkg.name %>.js"
},
css: {
src: "css/jsgrid.css",
dest: "dist/<%= pkg.name %>.css"
},
theme: {
src: "css/theme.css",
dest: "dist/<%= pkg.name %>-theme.css"
}
},
"string-replace": {
version: {
files: [{
src: "<%= concat.js.dest %>",
dest: "<%= concat.js.dest %>"
}],
options: {
replacements: [{
pattern: /"@VERSION"/g,
replacement: "'<%= pkg.version %>'"
}]
}
}
},
imageEmbed: {
options: {
deleteAfterEncoding : true
},
theme: {
src: "<%= concat.theme.dest %>",
dest: "<%= concat.theme.dest %>"
}
},
uglify: {
options : {
banner: banner + "\n"
},
js: {
src: "<%= concat.js.dest %>",
dest: "dist/<%= pkg.name %>.min.js"
}
},
cssmin: {
options : {
banner: banner
},
css: {
src: "<%= concat.css.dest %>",
dest: "dist/<%= pkg.name %>.min.css"
},
theme: {
src: "<%= concat.theme.dest %>",
dest: "dist/<%= pkg.name %>-theme.min.css"
}
},
qunit: {
files: ["tests/index.html"]
}
});
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-image-embed");
grunt.loadNpmTasks("grunt-contrib-cssmin");
grunt.loadNpmTasks("grunt-contrib-qunit");
grunt.loadNpmTasks('grunt-string-replace');
grunt.registerTask("default", ["copy", "concat", "string-replace", "imageEmbed", "uglify", "cssmin"]);
grunt.registerTask("test", "qunit");
};

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014 Artem Tabalin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

@ -1,28 +0,0 @@
{
"name": "jsgrid",
"version": "1.5.3",
"main": [
"dist/jsgrid.js",
"dist/jsgrid.css",
"dist/jsgrid-theme.css"
],
"ignore": [
"demos",
"external",
"tests",
".editorconfig",
".gitignore",
".travis.yml",
"bower.json",
"Gruntfile.js",
"LICENSE",
"package.json",
"README.md"
],
"dependencies": {
"jquery": ">=1.8.3"
},
"devDependencies": {
"qunit": ">=1.10.0"
}
}

After

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

@ -1,59 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Basic Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Basic Scenario</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
deleteConfirm: "Do you really want to delete the client?",
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{ type: "control" }
]
});
});
</script>
</body>
</html>

@ -1,102 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Batch Delete</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Batch Delete</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "50%",
width: "100%",
autoload: true,
confirmDeleting: false,
paging: true,
controller: {
loadData: function() {
return db.clients;
}
},
fields: [
{
headerTemplate: function() {
return $("<button>").attr("type", "button").text("Delete")
.on("click", function () {
deleteSelectedItems();
});
},
itemTemplate: function(_, item) {
return $("<input>").attr("type", "checkbox")
.prop("checked", $.inArray(item, selectedItems) > -1)
.on("change", function () {
$(this).is(":checked") ? selectItem(item) : unselectItem(item);
});
},
align: "center",
width: 50
},
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 }
]
});
var selectedItems = [];
var selectItem = function(item) {
selectedItems.push(item);
};
var unselectItem = function(item) {
selectedItems = $.grep(selectedItems, function(i) {
return i !== item;
});
};
var deleteSelectedItems = function() {
if(!selectedItems.length || !confirm("Are you sure?"))
return;
deleteClientsFromDb(selectedItems);
var $grid = $("#jsGrid");
$grid.jsGrid("option", "pageIndex", 1);
$grid.jsGrid("loadData");
selectedItems = [];
};
var deleteClientsFromDb = function(deletingClients) {
db.clients = $.map(db.clients, function(client) {
return ($.inArray(client, deletingClients) > -1) ? null : client;
});
};
});
</script>
</body>
</html>

@ -1,97 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom Grid Field Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css' />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/cupertino/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<style>
.hasDatepicker {
width: 100px;
text-align: center;
}
.ui-datepicker * {
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-size: 14px;
font-weight: 300 !important;
}
</style>
</head>
<body>
<h1>Custom Grid DateField</h1>
<div id="jsGrid"></div>
<script>
$(function() {
var MyDateField = function(config) {
jsGrid.Field.call(this, config);
};
MyDateField.prototype = new jsGrid.Field({
sorter: function(date1, date2) {
return new Date(date1) - new Date(date2);
},
itemTemplate: function(value) {
return new Date(value).toDateString();
},
insertTemplate: function(value) {
return this._insertPicker = $("<input>").datepicker({ defaultDate: new Date() });
},
editTemplate: function(value) {
return this._editPicker = $("<input>").datepicker().datepicker("setDate", new Date(value));
},
insertValue: function() {
return this._insertPicker.datepicker("getDate").toISOString();
},
editValue: function() {
return this._editPicker.datepicker("getDate").toISOString();
}
});
jsGrid.fields.myDateField = MyDateField;
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
inserting: true,
editing: true,
sorting: true,
paging: true,
fields: [
{ name: "Account", width: 150, align: "center" },
{ name: "Name", type: "text" },
{ name: "RegisterDate", type: "myDateField", width: 100, align: "center" },
{ type: "control", editButton: false, modeSwitchButton: false }
],
data: db.users
});
});
</script>
</body>
</html>

@ -1,90 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom Load Indicator</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.1/spin.min.js"></script>
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.textarea.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<style>
.rating {
color: #F8CA03;
}
</style>
</head>
<body>
<h1>Custom Load Indicator</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "50%",
width: "100%",
sorting: true,
paging: false,
autoload: true,
controller: {
loadData: function() {
var d = $.Deferred();
$.ajax({
url: "http://services.odata.org/V3/(S(3mnweai3qldmghnzfshavfok))/OData/OData.svc/Products",
dataType: "json"
}).done(function(response) {
setTimeout(function() {
d.resolve(response.value);
}, 2000);
});
return d.promise();
}
},
loadIndicator: function(config) {
var container = config.container[0];
var spinner = new Spinner();
return {
show: function() {
spinner.spin(container);
},
hide: function() {
spinner.stop();
}
};
},
fields: [
{ name: "Name", type: "text" },
{ name: "Description", type: "textarea", width: 150 },
{ name: "Rating", type: "number", width: 50, align: "center",
itemTemplate: function(value) {
return $("<div>").addClass("rating").append(Array(value + 1).join("&#9733;"));
}
},
{ name: "Price", type: "number", width: 50,
itemTemplate: function(value) {
return value.toFixed(2) + "$"; }
}
]
});
});
</script>
</body>
</html>

@ -1,79 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom Row Renderer</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<style>
.client-photo { float: left; margin: 0 20px 0 10px; }
.client-photo img { border-radius: 50%; border: 1px solid #ddd; }
.client-info { margin-top: 10px; }
.client-info p { line-height: 25px; }
</style>
</head>
<body>
<h1>Custom Row Renderer</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "80%",
width: "50%",
autoload: true,
paging: true,
controller: {
loadData: function() {
var deferred = $.Deferred();
$.ajax({
url: 'http://api.randomuser.me/?results=40',
dataType: 'jsonp',
success: function(data){
deferred.resolve(data.results);
}
});
return deferred.promise();
}
},
rowRenderer: function(item) {
var user = item;
var $photo = $("<div>").addClass("client-photo").append($("<img>").attr("src", user.picture.large));
var $info = $("<div>").addClass("client-info")
.append($("<p>").append($("<strong>").text(user.name.first.capitalize() + " " + user.name.last.capitalize())))
.append($("<p>").text("Location: " + user.location.city.capitalize() + ", " + user.location.street))
.append($("<p>").text("Email: " + user.email))
.append($("<p>").text("Phone: " + user.phone))
.append($("<p>").text("Cell: " + user.cell));
return $("<tr>").append($("<td>").append($photo).append($info));
},
fields: [
{ title: "Clients" }
]
});
String.prototype.capitalize = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
};
});
</script>
</body>
</html>

@ -1,85 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Custom View Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<style>
.config-panel {
padding: 10px;
margin: 10px 0;
background: #fcfcfc;
border: 1px solid #e9e9e9;
display: inline-block;
}
.config-panel label {
margin-right: 10px;
}
</style>
</head>
<body>
<h1>Custom View</h1>
<div class="config-panel">
<label><input id="heading" type="checkbox" checked /> Heading</label>
<label><input id="filtering" type="checkbox" checked /> Filtering</label>
<label><input id="inserting" type="checkbox" /> Inserting</label>
<label><input id="editing" type="checkbox" checked /> Editing</label>
<label><input id="paging" type="checkbox" checked /> Paging</label>
<label><input id="sorting" type="checkbox" checked /> Sorting</label>
<label><input id="selecting" type="checkbox" checked /> Selecting</label>
</div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{ type: "control", modeSwitchButton: false, editButton: false }
]
});
$(".config-panel input[type=checkbox]").on("click", function() {
var $cb = $(this);
$("#jsGrid").jsGrid("option", $cb.attr("id"), $cb.is(":checked"));
});
});
</script>
</body>
</html>

@ -1,212 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Data Manipulation</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/cupertino/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<style>
.ui-widget *, .ui-widget input, .ui-widget select, .ui-widget button {
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-size: 14px;
font-weight: 300 !important;
}
.details-form-field input,
.details-form-field select {
width: 250px;
float: right;
}
.details-form-field {
margin: 30px 0;
}
.details-form-field:first-child {
margin-top: 10px;
}
.details-form-field:last-child {
margin-bottom: 10px;
}
.details-form-field button {
display: block;
width: 100px;
margin: 0 auto;
}
input.error, select.error {
border: 1px solid #ff9999;
background: #ffeeee;
}
label.error {
float: right;
margin-left: 100px;
font-size: .8em;
color: #ff6666;
}
</style>
</head>
<body>
<h1>Data Manipulation</h1>
<div id="jsGrid"></div>
<div id="detailsDialog">
<form id="detailsForm">
<div class="details-form-field">
<label for="name">Name:</label>
<input id="name" name="name" type="text" />
</div>
<div class="details-form-field">
<label for="age">Age:</label>
<input id="age" name="age" type="number" />
</div>
<div class="details-form-field">
<label for="address">Address:</label>
<input id="address" name="address" type="text" />
</div>
<div class="details-form-field">
<label for="country">Country:</label>
<select id="country" name="country">
<option value="">(Select)</option>
<option value="1">United States</option>
<option value="2">Canada</option>
<option value="3">United Kingdom</option>
<option value="4">France</option>
<option value="5">Brazil</option>
<option value="6">China</option>
<option value="7">Russia</option>
</select>
</div>
<div class="details-form-field">
<label for="married">Is Married</label>
<input id="married" name="married" type="checkbox" />
</div>
<div class="details-form-field">
<button type="submit" id="save">Save</button>
</div>
</form>
</div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
editing: true,
autoload: true,
paging: true,
deleteConfirm: function(item) {
return "The client \"" + item.Name + "\" will be removed. Are you sure?";
},
rowClick: function(args) {
showDetailsDialog("Edit", args.item);
},
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{
type: "control",
modeSwitchButton: false,
editButton: false,
headerTemplate: function() {
return $("<button>").attr("type", "button").text("Add")
.on("click", function () {
showDetailsDialog("Add", {});
});
}
}
]
});
$("#detailsDialog").dialog({
autoOpen: false,
width: 400,
close: function() {
$("#detailsForm").validate().resetForm();
$("#detailsForm").find(".error").removeClass("error");
}
});
$("#detailsForm").validate({
rules: {
name: "required",
age: { required: true, range: [18, 150] },
address: { required: true, minlength: 10 },
country: "required"
},
messages: {
name: "Please enter name",
age: "Please enter valid age",
address: "Please enter address (more than 10 chars)",
country: "Please select country"
},
submitHandler: function() {
formSubmitHandler();
}
});
var formSubmitHandler = $.noop;
var showDetailsDialog = function(dialogType, client) {
$("#name").val(client.Name);
$("#age").val(client.Age);
$("#address").val(client.Address);
$("#country").val(client.Country);
$("#married").prop("checked", client.Married);
formSubmitHandler = function() {
saveClient(client, dialogType === "Add");
};
$("#detailsDialog").dialog("option", "title", dialogType + " Client")
.dialog("open");
};
var saveClient = function(client, isNew) {
$.extend(client, {
Name: $("#name").val(),
Age: parseInt($("#age").val(), 10),
Address: $("#address").val(),
Country: parseInt($("#country").val(), 10),
Married: $("#married").is(":checked")
});
$("#jsGrid").jsGrid(isNew ? "insertItem" : "updateItem", client);
$("#detailsDialog").dialog("close");
};
});
</script>
</body>
</html>

@ -1,884 +0,0 @@
(function() {
var db = {
loadData: function(filter) {
return $.grep(this.clients, function(client) {
return (!filter.Name || client.Name.indexOf(filter.Name) > -1)
&& (filter.Age === undefined || client.Age === filter.Age)
&& (!filter.Address || client.Address.indexOf(filter.Address) > -1)
&& (!filter.Country || client.Country === filter.Country)
&& (filter.Married === undefined || client.Married === filter.Married);
});
},
insertItem: function(insertingClient) {
this.clients.push(insertingClient);
},
updateItem: function(updatingClient) { },
deleteItem: function(deletingClient) {
var clientIndex = $.inArray(deletingClient, this.clients);
this.clients.splice(clientIndex, 1);
}
};
window.db = db;
db.countries = [
{ Name: "", Id: 0 },
{ Name: "United States", Id: 1 },
{ Name: "Canada", Id: 2 },
{ Name: "United Kingdom", Id: 3 },
{ Name: "France", Id: 4 },
{ Name: "Brazil", Id: 5 },
{ Name: "China", Id: 6 },
{ Name: "Russia", Id: 7 }
];
db.clients = [
{
"Name": "Otto Clay",
"Age": 61,
"Country": 6,
"Address": "Ap #897-1459 Quam Avenue",
"Married": false
},
{
"Name": "Connor Johnston",
"Age": 73,
"Country": 7,
"Address": "Ap #370-4647 Dis Av.",
"Married": false
},
{
"Name": "Lacey Hess",
"Age": 29,
"Country": 7,
"Address": "Ap #365-8835 Integer St.",
"Married": false
},
{
"Name": "Timothy Henson",
"Age": 78,
"Country": 1,
"Address": "911-5143 Luctus Ave",
"Married": false
},
{
"Name": "Ramona Benton",
"Age": 43,
"Country": 5,
"Address": "Ap #614-689 Vehicula Street",
"Married": true
},
{
"Name": "Ezra Tillman",
"Age": 51,
"Country": 1,
"Address": "P.O. Box 738, 7583 Quisque St.",
"Married": true
},
{
"Name": "Dante Carter",
"Age": 59,
"Country": 1,
"Address": "P.O. Box 976, 6316 Lorem, St.",
"Married": false
},
{
"Name": "Christopher Mcclure",
"Age": 58,
"Country": 1,
"Address": "847-4303 Dictum Av.",
"Married": true
},
{
"Name": "Ruby Rocha",
"Age": 62,
"Country": 2,
"Address": "5212 Sagittis Ave",
"Married": false
},
{
"Name": "Imelda Hardin",
"Age": 39,
"Country": 5,
"Address": "719-7009 Auctor Av.",
"Married": false
},
{
"Name": "Jonah Johns",
"Age": 28,
"Country": 5,
"Address": "P.O. Box 939, 9310 A Ave",
"Married": false
},
{
"Name": "Herman Rosa",
"Age": 49,
"Country": 7,
"Address": "718-7162 Molestie Av.",
"Married": true
},
{
"Name": "Arthur Gay",
"Age": 20,
"Country": 7,
"Address": "5497 Neque Street",
"Married": false
},
{
"Name": "Xena Wilkerson",
"Age": 63,
"Country": 1,
"Address": "Ap #303-6974 Proin Street",
"Married": true
},
{
"Name": "Lilah Atkins",
"Age": 33,
"Country": 5,
"Address": "622-8602 Gravida Ave",
"Married": true
},
{
"Name": "Malik Shepard",
"Age": 59,
"Country": 1,
"Address": "967-5176 Tincidunt Av.",
"Married": false
},
{
"Name": "Keely Silva",
"Age": 24,
"Country": 1,
"Address": "P.O. Box 153, 8995 Praesent Ave",
"Married": false
},
{
"Name": "Hunter Pate",
"Age": 73,
"Country": 7,
"Address": "P.O. Box 771, 7599 Ante, Road",
"Married": false
},
{
"Name": "Mikayla Roach",
"Age": 55,
"Country": 5,
"Address": "Ap #438-9886 Donec Rd.",
"Married": true
},
{
"Name": "Upton Joseph",
"Age": 48,
"Country": 4,
"Address": "Ap #896-7592 Habitant St.",
"Married": true
},
{
"Name": "Jeanette Pate",
"Age": 59,
"Country": 2,
"Address": "P.O. Box 177, 7584 Amet, St.",
"Married": false
},
{
"Name": "Kaden Hernandez",
"Age": 79,
"Country": 3,
"Address": "366 Ut St.",
"Married": true
},
{
"Name": "Kenyon Stevens",
"Age": 20,
"Country": 3,
"Address": "P.O. Box 704, 4580 Gravida Rd.",
"Married": false
},
{
"Name": "Jerome Harper",
"Age": 31,
"Country": 5,
"Address": "2464 Porttitor Road",
"Married": false
},
{
"Name": "Jelani Patel",
"Age": 36,
"Country": 2,
"Address": "P.O. Box 541, 5805 Nec Av.",
"Married": true
},
{
"Name": "Keaton Oconnor",
"Age": 21,
"Country": 1,
"Address": "Ap #657-1093 Nec, Street",
"Married": false
},
{
"Name": "Bree Johnston",
"Age": 31,
"Country": 2,
"Address": "372-5942 Vulputate Avenue",
"Married": false
},
{
"Name": "Maisie Hodges",
"Age": 70,
"Country": 7,
"Address": "P.O. Box 445, 3880 Odio, Rd.",
"Married": false
},
{
"Name": "Kuame Calhoun",
"Age": 39,
"Country": 2,
"Address": "P.O. Box 609, 4105 Rutrum St.",
"Married": true
},
{
"Name": "Carlos Cameron",
"Age": 38,
"Country": 5,
"Address": "Ap #215-5386 A, Avenue",
"Married": false
},
{
"Name": "Fulton Parsons",
"Age": 25,
"Country": 7,
"Address": "P.O. Box 523, 3705 Sed Rd.",
"Married": false
},
{
"Name": "Wallace Christian",
"Age": 43,
"Country": 3,
"Address": "416-8816 Mauris Avenue",
"Married": true
},
{
"Name": "Caryn Maldonado",
"Age": 40,
"Country": 1,
"Address": "108-282 Nonummy Ave",
"Married": false
},
{
"Name": "Whilemina Frank",
"Age": 20,
"Country": 7,
"Address": "P.O. Box 681, 3938 Egestas. Av.",
"Married": true
},
{
"Name": "Emery Moon",
"Age": 41,
"Country": 4,
"Address": "Ap #717-8556 Non Road",
"Married": true
},
{
"Name": "Price Watkins",
"Age": 35,
"Country": 4,
"Address": "832-7810 Nunc Rd.",
"Married": false
},
{
"Name": "Lydia Castillo",
"Age": 59,
"Country": 7,
"Address": "5280 Placerat, Ave",
"Married": true
},
{
"Name": "Lawrence Conway",
"Age": 53,
"Country": 1,
"Address": "Ap #452-2808 Imperdiet St.",
"Married": false
},
{
"Name": "Kalia Nicholson",
"Age": 67,
"Country": 5,
"Address": "P.O. Box 871, 3023 Tellus Road",
"Married": true
},
{
"Name": "Brielle Baxter",
"Age": 45,
"Country": 3,
"Address": "Ap #822-9526 Ut, Road",
"Married": true
},
{
"Name": "Valentine Brady",
"Age": 72,
"Country": 7,
"Address": "8014 Enim. Road",
"Married": true
},
{
"Name": "Rebecca Gardner",
"Age": 57,
"Country": 4,
"Address": "8655 Arcu. Road",
"Married": true
},
{
"Name": "Vladimir Tate",
"Age": 26,
"Country": 1,
"Address": "130-1291 Non, Rd.",
"Married": true
},
{
"Name": "Vernon Hays",
"Age": 56,
"Country": 4,
"Address": "964-5552 In Rd.",
"Married": true
},
{
"Name": "Allegra Hull",
"Age": 22,
"Country": 4,
"Address": "245-8891 Donec St.",
"Married": true
},
{
"Name": "Hu Hendrix",
"Age": 65,
"Country": 7,
"Address": "428-5404 Tempus Ave",
"Married": true
},
{
"Name": "Kenyon Battle",
"Age": 32,
"Country": 2,
"Address": "921-6804 Lectus St.",
"Married": false
},
{
"Name": "Gloria Nielsen",
"Age": 24,
"Country": 4,
"Address": "Ap #275-4345 Lorem, Street",
"Married": true
},
{
"Name": "Illiana Kidd",
"Age": 59,
"Country": 2,
"Address": "7618 Lacus. Av.",
"Married": false
},
{
"Name": "Adria Todd",
"Age": 68,
"Country": 6,
"Address": "1889 Tincidunt Road",
"Married": false
},
{
"Name": "Kirsten Mayo",
"Age": 71,
"Country": 1,
"Address": "100-8640 Orci, Avenue",
"Married": false
},
{
"Name": "Willa Hobbs",
"Age": 60,
"Country": 6,
"Address": "P.O. Box 323, 158 Tristique St.",
"Married": false
},
{
"Name": "Alexis Clements",
"Age": 69,
"Country": 5,
"Address": "P.O. Box 176, 5107 Proin Rd.",
"Married": false
},
{
"Name": "Akeem Conrad",
"Age": 60,
"Country": 2,
"Address": "282-495 Sed Ave",
"Married": true
},
{
"Name": "Montana Silva",
"Age": 79,
"Country": 6,
"Address": "P.O. Box 120, 9766 Consectetuer St.",
"Married": false
},
{
"Name": "Kaseem Hensley",
"Age": 77,
"Country": 6,
"Address": "Ap #510-8903 Mauris. Av.",
"Married": true
},
{
"Name": "Christopher Morton",
"Age": 35,
"Country": 5,
"Address": "P.O. Box 234, 3651 Sodales Avenue",
"Married": false
},
{
"Name": "Wade Fernandez",
"Age": 49,
"Country": 6,
"Address": "740-5059 Dolor. Road",
"Married": true
},
{
"Name": "Illiana Kirby",
"Age": 31,
"Country": 2,
"Address": "527-3553 Mi Ave",
"Married": false
},
{
"Name": "Kimberley Hurley",
"Age": 65,
"Country": 5,
"Address": "P.O. Box 637, 9915 Dictum St.",
"Married": false
},
{
"Name": "Arthur Olsen",
"Age": 74,
"Country": 5,
"Address": "887-5080 Eget St.",
"Married": false
},
{
"Name": "Brody Potts",
"Age": 59,
"Country": 2,
"Address": "Ap #577-7690 Sem Road",
"Married": false
},
{
"Name": "Dillon Ford",
"Age": 60,
"Country": 1,
"Address": "Ap #885-9289 A, Av.",
"Married": true
},
{
"Name": "Hannah Juarez",
"Age": 61,
"Country": 2,
"Address": "4744 Sapien, Rd.",
"Married": true
},
{
"Name": "Vincent Shaffer",
"Age": 25,
"Country": 2,
"Address": "9203 Nunc St.",
"Married": true
},
{
"Name": "George Holt",
"Age": 27,
"Country": 6,
"Address": "4162 Cras Rd.",
"Married": false
},
{
"Name": "Tobias Bartlett",
"Age": 74,
"Country": 4,
"Address": "792-6145 Mauris St.",
"Married": true
},
{
"Name": "Xavier Hooper",
"Age": 35,
"Country": 1,
"Address": "879-5026 Interdum. Rd.",
"Married": false
},
{
"Name": "Declan Dorsey",
"Age": 31,
"Country": 2,
"Address": "Ap #926-4171 Aenean Road",
"Married": true
},
{
"Name": "Clementine Tran",
"Age": 43,
"Country": 4,
"Address": "P.O. Box 176, 9865 Eu Rd.",
"Married": true
},
{
"Name": "Pamela Moody",
"Age": 55,
"Country": 6,
"Address": "622-6233 Luctus Rd.",
"Married": true
},
{
"Name": "Julie Leon",
"Age": 43,
"Country": 6,
"Address": "Ap #915-6782 Sem Av.",
"Married": true
},
{
"Name": "Shana Nolan",
"Age": 79,
"Country": 5,
"Address": "P.O. Box 603, 899 Eu St.",
"Married": false
},
{
"Name": "Vaughan Moody",
"Age": 37,
"Country": 5,
"Address": "880 Erat Rd.",
"Married": false
},
{
"Name": "Randall Reeves",
"Age": 44,
"Country": 3,
"Address": "1819 Non Street",
"Married": false
},
{
"Name": "Dominic Raymond",
"Age": 68,
"Country": 1,
"Address": "Ap #689-4874 Nisi Rd.",
"Married": true
},
{
"Name": "Lev Pugh",
"Age": 69,
"Country": 5,
"Address": "Ap #433-6844 Auctor Avenue",
"Married": true
},
{
"Name": "Desiree Hughes",
"Age": 80,
"Country": 4,
"Address": "605-6645 Fermentum Avenue",
"Married": true
},
{
"Name": "Idona Oneill",
"Age": 23,
"Country": 7,
"Address": "751-8148 Aliquam Avenue",
"Married": true
},
{
"Name": "Lani Mayo",
"Age": 76,
"Country": 1,
"Address": "635-2704 Tristique St.",
"Married": true
},
{
"Name": "Cathleen Bonner",
"Age": 40,
"Country": 1,
"Address": "916-2910 Dolor Av.",
"Married": false
},
{
"Name": "Sydney Murray",
"Age": 44,
"Country": 5,
"Address": "835-2330 Fringilla St.",
"Married": false
},
{
"Name": "Brenna Rodriguez",
"Age": 77,
"Country": 6,
"Address": "3687 Imperdiet Av.",
"Married": true
},
{
"Name": "Alfreda Mcdaniel",
"Age": 38,
"Country": 7,
"Address": "745-8221 Aliquet Rd.",
"Married": true
},
{
"Name": "Zachery Atkins",
"Age": 30,
"Country": 1,
"Address": "549-2208 Auctor. Road",
"Married": true
},
{
"Name": "Amelia Rich",
"Age": 56,
"Country": 4,
"Address": "P.O. Box 734, 4717 Nunc Rd.",
"Married": false
},
{
"Name": "Kiayada Witt",
"Age": 62,
"Country": 3,
"Address": "Ap #735-3421 Malesuada Avenue",
"Married": false
},
{
"Name": "Lysandra Pierce",
"Age": 36,
"Country": 1,
"Address": "Ap #146-2835 Curabitur St.",
"Married": true
},
{
"Name": "Cara Rios",
"Age": 58,
"Country": 4,
"Address": "Ap #562-7811 Quam. Ave",
"Married": true
},
{
"Name": "Austin Andrews",
"Age": 55,
"Country": 7,
"Address": "P.O. Box 274, 5505 Sociis Rd.",
"Married": false
},
{
"Name": "Lillian Peterson",
"Age": 39,
"Country": 2,
"Address": "6212 A Avenue",
"Married": false
},
{
"Name": "Adria Beach",
"Age": 29,
"Country": 2,
"Address": "P.O. Box 183, 2717 Nunc Avenue",
"Married": true
},
{
"Name": "Oleg Durham",
"Age": 80,
"Country": 4,
"Address": "931-3208 Nunc Rd.",
"Married": false
},
{
"Name": "Casey Reese",
"Age": 60,
"Country": 4,
"Address": "383-3675 Ultrices, St.",
"Married": false
},
{
"Name": "Kane Burnett",
"Age": 80,
"Country": 1,
"Address": "759-8212 Dolor. Ave",
"Married": false
},
{
"Name": "Stewart Wilson",
"Age": 46,
"Country": 7,
"Address": "718-7845 Sagittis. Av.",
"Married": false
},
{
"Name": "Charity Holcomb",
"Age": 31,
"Country": 6,
"Address": "641-7892 Enim. Ave",
"Married": false
},
{
"Name": "Kyra Cummings",
"Age": 43,
"Country": 4,
"Address": "P.O. Box 702, 6621 Mus. Av.",
"Married": false
},
{
"Name": "Stuart Wallace",
"Age": 25,
"Country": 7,
"Address": "648-4990 Sed Rd.",
"Married": true
},
{
"Name": "Carter Clarke",
"Age": 59,
"Country": 6,
"Address": "Ap #547-2921 A Street",
"Married": false
}
];
db.users = [
{
"ID": "x",
"Account": "A758A693-0302-03D1-AE53-EEFE22855556",
"Name": "Carson Kelley",
"RegisterDate": "2002-04-20T22:55:52-07:00"
},
{
"Account": "D89FF524-1233-0CE7-C9E1-56EFF017A321",
"Name": "Prescott Griffin",
"RegisterDate": "2011-02-22T05:59:55-08:00"
},
{
"Account": "06FAAD9A-5114-08F6-D60C-961B2528B4F0",
"Name": "Amir Saunders",
"RegisterDate": "2014-08-13T09:17:49-07:00"
},
{
"Account": "EED7653D-7DD9-A722-64A8-36A55ECDBE77",
"Name": "Derek Thornton",
"RegisterDate": "2012-02-27T01:31:07-08:00"
},
{
"Account": "2A2E6D40-FEBD-C643-A751-9AB4CAF1E2F6",
"Name": "Fletcher Romero",
"RegisterDate": "2010-06-25T15:49:54-07:00"
},
{
"Account": "3978F8FA-DFF0-DA0E-0A5D-EB9D281A3286",
"Name": "Thaddeus Stein",
"RegisterDate": "2013-11-10T07:29:41-08:00"
},
{
"Account": "658DBF5A-176E-569A-9273-74FB5F69FA42",
"Name": "Nash Knapp",
"RegisterDate": "2005-06-24T09:11:19-07:00"
},
{
"Account": "76D2EE4B-7A73-1212-F6F2-957EF8C1F907",
"Name": "Quamar Vega",
"RegisterDate": "2011-04-13T20:06:29-07:00"
},
{
"Account": "00E46809-A595-CE82-C5B4-D1CAEB7E3E58",
"Name": "Philip Galloway",
"RegisterDate": "2008-08-21T18:59:38-07:00"
},
{
"Account": "C196781C-DDCC-AF83-DDC2-CA3E851A47A0",
"Name": "Mason French",
"RegisterDate": "2000-11-15T00:38:37-08:00"
},
{
"Account": "5911F201-818A-B393-5888-13157CE0D63F",
"Name": "Ross Cortez",
"RegisterDate": "2010-05-27T17:35:32-07:00"
},
{
"Account": "B8BB78F9-E1A1-A956-086F-E12B6FE168B6",
"Name": "Logan King",
"RegisterDate": "2003-07-08T16:58:06-07:00"
},
{
"Account": "06F636C3-9599-1A2D-5FD5-86B24ADDE626",
"Name": "Cedric Leblanc",
"RegisterDate": "2011-06-30T14:30:10-07:00"
},
{
"Account": "FE880CDD-F6E7-75CB-743C-64C6DE192412",
"Name": "Simon Sullivan",
"RegisterDate": "2013-06-11T16:35:07-07:00"
},
{
"Account": "BBEDD673-E2C1-4872-A5D3-C4EBD4BE0A12",
"Name": "Jamal West",
"RegisterDate": "2001-03-16T20:18:29-08:00"
},
{
"Account": "19BC22FA-C52E-0CC6-9552-10365C755FAC",
"Name": "Hector Morales",
"RegisterDate": "2012-11-01T01:56:34-07:00"
},
{
"Account": "A8292214-2C13-5989-3419-6B83DD637D6C",
"Name": "Herrod Hart",
"RegisterDate": "2008-03-13T19:21:04-07:00"
},
{
"Account": "0285564B-F447-0E7F-EAA1-7FB8F9C453C8",
"Name": "Clark Maxwell",
"RegisterDate": "2004-08-05T08:22:24-07:00"
},
{
"Account": "EA78F076-4F6E-4228-268C-1F51272498AE",
"Name": "Reuben Walter",
"RegisterDate": "2011-01-23T01:55:59-08:00"
},
{
"Account": "6A88C194-EA21-426F-4FE2-F2AE33F51793",
"Name": "Ira Ingram",
"RegisterDate": "2008-08-15T05:57:46-07:00"
},
{
"Account": "4275E873-439C-AD26-56B3-8715E336508E",
"Name": "Damian Morrow",
"RegisterDate": "2015-09-13T01:50:55-07:00"
},
{
"Account": "A0D733C4-9070-B8D6-4387-D44F0BA515BE",
"Name": "Macon Farrell",
"RegisterDate": "2011-03-14T05:41:40-07:00"
},
{
"Account": "B3683DE8-C2FA-7CA0-A8A6-8FA7E954F90A",
"Name": "Joel Galloway",
"RegisterDate": "2003-02-03T04:19:01-08:00"
},
{
"Account": "01D95A8E-91BC-2050-F5D0-4437AAFFD11F",
"Name": "Rigel Horton",
"RegisterDate": "2015-06-20T11:53:11-07:00"
},
{
"Account": "F0D12CC0-31AC-A82E-FD73-EEEFDBD21A36",
"Name": "Sylvester Gaines",
"RegisterDate": "2004-03-12T09:57:13-08:00"
},
{
"Account": "874FCC49-9A61-71BC-2F4E-2CE88348AD7B",
"Name": "Abbot Mckay",
"RegisterDate": "2008-12-26T20:42:57-08:00"
},
{
"Account": "B8DA1912-20A0-FB6E-0031-5F88FD63EF90",
"Name": "Solomon Green",
"RegisterDate": "2013-09-04T01:44:47-07:00"
}
];
}());

@ -1,82 +0,0 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
height: 100%;
}
body {
height: 100%;
padding: 10px;
color: #262626;
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-size: 14px;
font-weight: 300;
}
h1 {
margin: 0 0 8px 0;
font-size: 24px;
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-weight: 300;
}
h2 {
margin: 16px 0 8px 0;
font-size: 18px;
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-weight: 300;
}
ul {
list-style: none;
}
a {
color: #2ba6cb;
text-decoration: none;
}
a:hover {
text-decoration: underline;
color: #258faf;
}
input, button, select {
font-family: 'Helvetica Neue Light', 'Open Sans', Helvetica;
font-weight: 300;
font-size: 14px;
padding: 2px;
}
.navigation {
width: 200px;
position: absolute;
top: 0;
bottom: 0;
left: 0;
padding: 10px;
border-right: 1px solid #e9e9e9;
}
.navigation li {
margin: 10px 0;
}
.demo-frame {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 200px;
}
iframe[name='demo'] {
display: block;
width: 100%;
height: 100%;
border: none;
}

@ -1,72 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - External Pager Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<style>
.external-pager {
margin: 10px 0;
}
.external-pager .jsgrid-pager-current-page {
background: #c4e2ff;
color: #fff;
}
</style>
</head>
<body>
<h1>External Customized Pager</h1>
<div id="externalPager" class="external-pager"></div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
paging: true,
pageSize: 15,
pageButtonCount: 5,
pagerContainer: "#externalPager",
pagerFormat: "current page: {pageIndex} &nbsp;&nbsp; {first} {prev} {pages} {next} {last} &nbsp;&nbsp; total pages: {pageCount} total items: {itemCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
pageNavigatorNextText: "&#8230;",
pageNavigatorPrevText: "&#8230;",
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
],
data: db.clients
});
});
</script>
</body>
</html>

@ -1,31 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Simple jQuery DataGrid - Demos</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="navigation">
<h1>jsGrid Demos</h1>
<ul>
<li><a href="basic.html" target="demo">Basic Scenario</a></li>
<li><a href="static-data.html" target="demo">Static Data</a></li>
<li><a href="odata-service.html" target="demo">OData Service</a></li>
<li><a href="data-manipulation.html" target="demo">Data Manipulation</a></li>
<li><a href="validation.html" target="demo">Validation</a></li>
<li><a href="sorting.html" target="demo">Sorting</a></li>
<li><a href="loading-by-page.html" target="demo">Loading by Page</a></li>
<li><a href="custom-view.html" target="demo">Custom View</a></li>
<li><a href="custom-row-renderer.html" target="demo">Custom Row Renderer</a></li>
<li><a href="external-pager.html" target="demo">External Pager</a></li>
<li><a href="custom-grid-field.html" target="demo">Custom Grid Field</a></li>
<li><a href="localization.html" target="demo">Localization</a></li>
</ul>
</div>
<div class="demo-frame">
<iframe name="demo" src="basic.html"></iframe>
</div>
</body>
</html>

@ -1,90 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Loading Data by Page Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<style>
.pager-panel {
padding: 10px;
margin: 10px 0;
background: #fcfcfc;
border: 1px solid #e9e9e9;
display: inline-block;
}
</style>
</head>
<body>
<h1>Loading Data by Page</h1>
<div class="pager-panel">
<label>Page:
<select id="pager">
<option>1</option>
<option selected>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
</select>
</label>
</div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
autoload: true,
paging: true,
pageLoading: true,
pageSize: 15,
pageIndex: 2,
controller: {
loadData: function(filter) {
var startIndex = (filter.pageIndex - 1) * filter.pageSize;
return {
data: db.clients.slice(startIndex, startIndex + filter.pageSize),
itemsCount: db.clients.length
};
}
},
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
]
});
$("#pager").on("change", function() {
var page = parseInt($(this).val(), 10);
$("#jsGrid").jsGrid("openPage", page);
});
});
</script>
</body>
</html>

@ -1,62 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Localization (FR)</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.validation.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
<script src="../src/i18n/fr.js"></script>
</head>
<body>
<h1>Localization (FR)</h1>
<div id="jsGrid"></div>
<script>
$(function() {
jsGrid.locale("fr");
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
controller: db,
fields: [
{ name: "Name", title: "Nom", type: "text", width: 150, validate: "required" },
{ name: "Age", title: "Âge", type: "number", width: 50, validate: { validator: "range", param: [18,80] } },
{ name: "Address", title: "Adresse", type: "text", width: 200, validate: { validator: "rangeLength", param: [10, 250] } },
{ name: "Country", title: "Pays", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", title: "Marié", type: "checkbox", sorting: false },
{ type: "control" }
]
});
});
</script>
</body>
</html>

@ -1,74 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - OData Service Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.textarea.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<style>
.rating {
color: #F8CA03;
}
</style>
</head>
<body>
<h1>OData Service</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "auto",
width: "auto",
sorting: true,
paging: false,
autoload: true,
controller: {
loadData: function() {
var d = $.Deferred();
$.ajax({
url: "http://services.odata.org/V3/(S(3mnweai3qldmghnzfshavfok))/OData/OData.svc/Products",
dataType: "json"
}).done(function(response) {
d.resolve(response.value);
});
return d.promise();
}
},
fields: [
{ name: "Name", type: "text", width: 100 },
{ name: "Description", type: "textarea", width: 200 },
{ name: "Rating", type: "number", width: 150, align: "center",
itemTemplate: function(value) {
return $("<div>").addClass("rating").append(Array(value + 1).join("&#9733;"));
}
},
{ name: "Price", type: "number", width: 100,
itemTemplate: function(value) {
return value.toFixed(2) + "$"; }
}
]
});
});
</script>
</body>
</html>

@ -1,83 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Rows Reordering Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/cupertino/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Rows Reordering Scenario</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
autoload: true,
rowClass: function(item, itemIndex) {
return "client-" + itemIndex;
},
controller: {
loadData: function() {
return db.clients.slice(0, 15);
}
},
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false }
],
onRefreshed: function() {
var $gridData = $("#jsGrid .jsgrid-grid-body tbody");
$gridData.sortable({
update: function(e, ui) {
// array of indexes
var clientIndexRegExp = /\s*client-(\d+)\s*/;
var indexes = $.map($gridData.sortable("toArray", { attribute: "class" }), function(classes) {
return clientIndexRegExp.exec(classes)[1];
});
alert("Reordered indexes: " + indexes.join(", "));
// arrays of items
var items = $.map($gridData.find("tr"), function(row) {
return $(row).data("JSGridItem");
});
console && console.log("Reordered items", items);
}
});
}
});
});
</script>
</body>
</html>

@ -1,78 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Sorting Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<style>
.sort-panel {
padding: 10px;
margin: 10px 0;
background: #fcfcfc;
border: 1px solid #e9e9e9;
display: inline-block;
}
</style>
</head>
<body>
<h1>Sorting</h1>
<div class="sort-panel">
<label>Sorting Field:
<select id="sortingField">
<option>Name</option>
<option>Age</option>
<option>Address</option>
<option>Country</option>
<option>Married</option>
</select>
<button type="button" id="sort">Sort</button>
</label>
</div>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
autoload: true,
selecting: false,
controller: db,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
]
});
$("#sort").click(function() {
var field = $("#sortingField").val();
$("#jsGrid").jsGrid("sort", field);
});
});
</script>
</body>
</html>

@ -1,50 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Static Data Scenario</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
</head>
<body>
<h1>Static Data</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
sorting: true,
paging: true,
fields: [
{ name: "Name", type: "text", width: 150 },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married" }
],
data: db.clients
});
});
</script>
</body>
</html>

@ -1,61 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jsGrid - Validation</title>
<link rel="stylesheet" type="text/css" href="demos.css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,600,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../css/jsgrid.css" />
<link rel="stylesheet" type="text/css" href="../css/theme.css" />
<script src="../external/jquery/jquery-1.8.3.js"></script>
<script src="db.js"></script>
<script src="../src/jsgrid.core.js"></script>
<script src="../src/jsgrid.load-indicator.js"></script>
<script src="../src/jsgrid.load-strategies.js"></script>
<script src="../src/jsgrid.sort-strategies.js"></script>
<script src="../src/jsgrid.validation.js"></script>
<script src="../src/jsgrid.field.js"></script>
<script src="../src/fields/jsgrid.field.text.js"></script>
<script src="../src/fields/jsgrid.field.number.js"></script>
<script src="../src/fields/jsgrid.field.select.js"></script>
<script src="../src/fields/jsgrid.field.checkbox.js"></script>
<script src="../src/fields/jsgrid.field.control.js"></script>
</head>
<body>
<h1>Validation</h1>
<div id="jsGrid"></div>
<script>
$(function() {
$("#jsGrid").jsGrid({
height: "70%",
width: "100%",
filtering: true,
editing: true,
inserting: true,
sorting: true,
paging: true,
autoload: true,
pageSize: 15,
pageButtonCount: 5,
deleteConfirm: "Do you really want to delete the client?",
controller: db,
fields: [
{ name: "Name", type: "text", width: 150, validate: "required" },
{ name: "Age", type: "number", width: 50, validate: { validator: "range", param: [18,80] } },
{ name: "Address", type: "text", width: 200, validate: { validator: "rangeLength", param: [10, 250] } },
{ name: "Country", type: "select", items: db.countries, valueField: "Id", textField: "Name",
validate: { message: "Country should be specified", validator: function(value) { return value > 0; } } },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{ type: "control" }
]
});
});
</script>
</body>
</html>

@ -1,235 +0,0 @@
/**
* QUnit v1.10.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699a4;
background-color: #0d3349;
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
#qunit-header a {
text-decoration: none;
color: #c2ccd1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #fff;
}
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 .5em 0 .1em;
}
#qunit-banner {
height: 5px;
}
#qunit-testrunner-toolbar {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
overflow: hidden;
}
#qunit-userAgent {
padding: 0.5em 0 0.5em 2.5em;
background-color: #2b81af;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
#qunit-modulefilter-container {
float: right;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #fff;
list-style-position: inside;
}
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
display: none;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li a {
padding: 0.5em;
color: #c2ccd1;
text-decoration: none;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests ol {
margin-top: 0.5em;
padding: 0.5em;
background-color: #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 .5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
background-color: #e0f2be;
color: #374e0c;
text-decoration: none;
}
#qunit-tests ins {
background-color: #ffcaca;
color: #500;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: black; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #fff;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3c510c;
background-color: #fff;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: green; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/** Result */
#qunit-testresult {
padding: 0.5em 0.5em 0.5em 2.5em;
color: #2b81af;
background-color: #D2E0E6;
border-bottom: 1px solid white;
}
#qunit-testresult .module-name {
font-weight: bold;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}

File diff suppressed because it is too large Load Diff

@ -1,38 +0,0 @@
{
"name": "jsgrid",
"version": "1.5.3",
"description": "Lightweight data grid jQuery plugin. It supports basic grid operations like inserting, filtering, editing, deleting, paging, sorting, and validation. jsGrid is tunable and allows to customize appearance and components.",
"keywords": [
"grid",
"jquery",
"plugin"
],
"homepage": "http://js-grid.com",
"author": "Artem Tabalin",
"license": {
"type": "MIT",
"url": "https://github.com/tabalinas/jsgrid/blob/master/LICENSE"
},
"main": "dist/jsgrid.js",
"directories": {
"test": "tests"
},
"repository": {
"type": "git",
"url": "https://github.com/tabalinas/jsgrid"
},
"bugs": {
"url": "https://github.com/tabalinas/jsgrid/issues"
},
"dependencies": {},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-copy": "^0.7.0",
"grunt-contrib-cssmin": "^0.10.0",
"grunt-contrib-qunit": "^0.5.2",
"grunt-contrib-uglify": "^0.4.0",
"grunt-image-embed": "^0.3.1",
"grunt-string-replace": "^1.2.1"
}
}

@ -1,97 +0,0 @@
(function(jsGrid, $, undefined) {
var Field = jsGrid.Field;
function CheckboxField(config) {
Field.call(this, config);
}
CheckboxField.prototype = new Field({
sorter: "number",
align: "center",
autosearch: true,
itemTemplate: function(value) {
return this._createCheckbox().prop({
checked: value,
disabled: true
});
},
filterTemplate: function() {
if(!this.filtering)
return "";
var grid = this._grid,
$result = this.filterControl = this._createCheckbox();
$result.prop({
readOnly: true,
indeterminate: true
});
$result.on("click", function() {
var $cb = $(this);
if($cb.prop("readOnly")) {
$cb.prop({
checked: false,
readOnly: false
});
}
else if(!$cb.prop("checked")) {
$cb.prop({
readOnly: true,
indeterminate: true
});
}
});
if(this.autosearch) {
$result.on("click", function() {
grid.search();
});
}
return $result;
},
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createCheckbox();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createCheckbox();
$result.prop("checked", value);
return $result;
},
filterValue: function() {
return this.filterControl.get(0).indeterminate
? undefined
: this.filterControl.is(":checked");
},
insertValue: function() {
return this.insertControl.is(":checked");
},
editValue: function() {
return this.editControl.is(":checked");
},
_createCheckbox: function() {
return $("<input>").attr("type", "checkbox");
}
});
jsGrid.fields.checkbox = jsGrid.CheckboxField = CheckboxField;
}(jsGrid, jQuery));

@ -1,223 +0,0 @@
(function(jsGrid, $, undefined) {
var Field = jsGrid.Field;
function ControlField(config) {
Field.call(this, config);
this._configInitialized = false;
}
ControlField.prototype = new Field({
css: "jsgrid-control-field",
align: "center",
width: 50,
filtering: false,
inserting: false,
editing: false,
sorting: false,
buttonClass: "jsgrid-button",
modeButtonClass: "jsgrid-mode-button",
modeOnButtonClass: "jsgrid-mode-on-button",
searchModeButtonClass: "jsgrid-search-mode-button",
insertModeButtonClass: "jsgrid-insert-mode-button",
editButtonClass: "jsgrid-edit-button",
deleteButtonClass: "jsgrid-delete-button",
searchButtonClass: "jsgrid-search-button",
clearFilterButtonClass: "jsgrid-clear-filter-button",
insertButtonClass: "jsgrid-insert-button",
updateButtonClass: "jsgrid-update-button",
cancelEditButtonClass: "jsgrid-cancel-edit-button",
searchModeButtonTooltip: "Switch to searching",
insertModeButtonTooltip: "Switch to inserting",
editButtonTooltip: "Edit",
deleteButtonTooltip: "Delete",
searchButtonTooltip: "Search",
clearFilterButtonTooltip: "Clear filter",
insertButtonTooltip: "Insert",
updateButtonTooltip: "Update",
cancelEditButtonTooltip: "Cancel edit",
editButton: true,
deleteButton: true,
clearFilterButton: true,
modeSwitchButton: true,
_initConfig: function() {
this._hasFiltering = this._grid.filtering;
this._hasInserting = this._grid.inserting;
if(this._hasInserting && this.modeSwitchButton) {
this._grid.inserting = false;
}
this._configInitialized = true;
},
headerTemplate: function() {
if(!this._configInitialized) {
this._initConfig();
}
var hasFiltering = this._hasFiltering;
var hasInserting = this._hasInserting;
if(!this.modeSwitchButton || (!hasFiltering && !hasInserting))
return "";
if(hasFiltering && !hasInserting)
return this._createFilterSwitchButton();
if(hasInserting && !hasFiltering)
return this._createInsertSwitchButton();
return this._createModeSwitchButton();
},
itemTemplate: function(value, item) {
var $result = $([]);
if(this.editButton) {
$result = $result.add(this._createEditButton(item));
}
if(this.deleteButton) {
$result = $result.add(this._createDeleteButton(item));
}
return $result;
},
filterTemplate: function() {
var $result = this._createSearchButton();
return this.clearFilterButton ? $result.add(this._createClearFilterButton()) : $result;
},
insertTemplate: function() {
return this._createInsertButton();
},
editTemplate: function() {
return this._createUpdateButton().add(this._createCancelEditButton());
},
_createFilterSwitchButton: function() {
return this._createOnOffSwitchButton("filtering", this.searchModeButtonClass, true);
},
_createInsertSwitchButton: function() {
return this._createOnOffSwitchButton("inserting", this.insertModeButtonClass, false);
},
_createOnOffSwitchButton: function(option, cssClass, isOnInitially) {
var isOn = isOnInitially;
var updateButtonState = $.proxy(function() {
$button.toggleClass(this.modeOnButtonClass, isOn);
}, this);
var $button = this._createGridButton(this.modeButtonClass + " " + cssClass, "", function(grid) {
isOn = !isOn;
grid.option(option, isOn);
updateButtonState();
});
updateButtonState();
return $button;
},
_createModeSwitchButton: function() {
var isInserting = false;
var updateButtonState = $.proxy(function() {
$button.attr("title", isInserting ? this.searchModeButtonTooltip : this.insertModeButtonTooltip)
.toggleClass(this.insertModeButtonClass, !isInserting)
.toggleClass(this.searchModeButtonClass, isInserting);
}, this);
var $button = this._createGridButton(this.modeButtonClass, "", function(grid) {
isInserting = !isInserting;
grid.option("inserting", isInserting);
grid.option("filtering", !isInserting);
updateButtonState();
});
updateButtonState();
return $button;
},
_createEditButton: function(item) {
return this._createGridButton(this.editButtonClass, this.editButtonTooltip, function(grid, e) {
grid.editItem(item);
e.stopPropagation();
});
},
_createDeleteButton: function(item) {
return this._createGridButton(this.deleteButtonClass, this.deleteButtonTooltip, function(grid, e) {
grid.deleteItem(item);
e.stopPropagation();
});
},
_createSearchButton: function() {
return this._createGridButton(this.searchButtonClass, this.searchButtonTooltip, function(grid) {
grid.search();
});
},
_createClearFilterButton: function() {
return this._createGridButton(this.clearFilterButtonClass, this.clearFilterButtonTooltip, function(grid) {
grid.clearFilter();
});
},
_createInsertButton: function() {
return this._createGridButton(this.insertButtonClass, this.insertButtonTooltip, function(grid) {
grid.insertItem().done(function() {
grid.clearInsert();
});
});
},
_createUpdateButton: function() {
return this._createGridButton(this.updateButtonClass, this.updateButtonTooltip, function(grid, e) {
grid.updateItem();
e.stopPropagation();
});
},
_createCancelEditButton: function() {
return this._createGridButton(this.cancelEditButtonClass, this.cancelEditButtonTooltip, function(grid, e) {
grid.cancelEdit();
e.stopPropagation();
});
},
_createGridButton: function(cls, tooltip, clickHandler) {
var grid = this._grid;
return $("<input>").addClass(this.buttonClass)
.addClass(cls)
.attr({
type: "button",
title: tooltip
})
.on("click", function(e) {
clickHandler(grid, e);
});
},
editValue: function() {
return "";
}
});
jsGrid.fields.control = jsGrid.ControlField = ControlField;
}(jsGrid, jQuery));

@ -1,41 +0,0 @@
(function(jsGrid, $, undefined) {
var TextField = jsGrid.TextField;
function NumberField(config) {
TextField.call(this, config);
}
NumberField.prototype = new TextField({
sorter: "number",
align: "right",
readOnly: false,
filterValue: function() {
return this.filterControl.val()
? parseInt(this.filterControl.val() || 0, 10)
: undefined;
},
insertValue: function() {
return this.insertControl.val()
? parseInt(this.insertControl.val() || 0, 10)
: undefined;
},
editValue: function() {
return this.editControl.val()
? parseInt(this.editControl.val() || 0, 10)
: undefined;
},
_createTextBox: function() {
return $("<input>").attr("type", "number")
.prop("readonly", !!this.readOnly);
}
});
jsGrid.fields.number = jsGrid.NumberField = NumberField;
}(jsGrid, jQuery));

@ -1,121 +0,0 @@
(function(jsGrid, $, undefined) {
var NumberField = jsGrid.NumberField;
var numberValueType = "number";
var stringValueType = "string";
function SelectField(config) {
this.items = [];
this.selectedIndex = -1;
this.valueField = "";
this.textField = "";
if(config.valueField && config.items.length) {
var firstItemValue = config.items[0][config.valueField];
this.valueType = (typeof firstItemValue) === numberValueType ? numberValueType : stringValueType;
}
this.sorter = this.valueType;
NumberField.call(this, config);
}
SelectField.prototype = new NumberField({
align: "center",
valueType: numberValueType,
itemTemplate: function(value) {
var items = this.items,
valueField = this.valueField,
textField = this.textField,
resultItem;
if(valueField) {
resultItem = $.grep(items, function(item, index) {
return item[valueField] === value;
})[0] || {};
}
else {
resultItem = items[value];
}
var result = (textField ? resultItem[textField] : resultItem);
return (result === undefined || result === null) ? "" : result;
},
filterTemplate: function() {
if(!this.filtering)
return "";
var grid = this._grid,
$result = this.filterControl = this._createSelect();
if(this.autosearch) {
$result.on("change", function(e) {
grid.search();
});
}
return $result;
},
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createSelect();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createSelect();
(value !== undefined) && $result.val(value);
return $result;
},
filterValue: function() {
var val = this.filterControl.val();
return this.valueType === numberValueType ? parseInt(val || 0, 10) : val;
},
insertValue: function() {
var val = this.insertControl.val();
return this.valueType === numberValueType ? parseInt(val || 0, 10) : val;
},
editValue: function() {
var val = this.editControl.val();
return this.valueType === numberValueType ? parseInt(val || 0, 10) : val;
},
_createSelect: function() {
var $result = $("<select>"),
valueField = this.valueField,
textField = this.textField,
selectedIndex = this.selectedIndex;
$.each(this.items, function(index, item) {
var value = valueField ? item[valueField] : index,
text = textField ? item[textField] : item;
var $option = $("<option>")
.attr("value", value)
.text(text)
.appendTo($result);
$option.prop("selected", (selectedIndex === index));
});
$result.prop("disabled", !!this.readOnly);
return $result;
}
});
jsGrid.fields.select = jsGrid.SelectField = SelectField;
}(jsGrid, jQuery));

@ -1,69 +0,0 @@
(function(jsGrid, $, undefined) {
var Field = jsGrid.Field;
function TextField(config) {
Field.call(this, config);
}
TextField.prototype = new Field({
autosearch: true,
readOnly: false,
filterTemplate: function() {
if(!this.filtering)
return "";
var grid = this._grid,
$result = this.filterControl = this._createTextBox();
if(this.autosearch) {
$result.on("keypress", function(e) {
if(e.which === 13) {
grid.search();
e.preventDefault();
}
});
}
return $result;
},
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createTextBox();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createTextBox();
$result.val(value);
return $result;
},
filterValue: function() {
return this.filterControl.val();
},
insertValue: function() {
return this.insertControl.val();
},
editValue: function() {
return this.editControl.val();
},
_createTextBox: function() {
return $("<input>").attr("type", "text")
.prop("readonly", !!this.readOnly);
}
});
jsGrid.fields.text = jsGrid.TextField = TextField;
}(jsGrid, jQuery));

@ -1,34 +0,0 @@
(function(jsGrid, $, undefined) {
var TextField = jsGrid.TextField;
function TextAreaField(config) {
TextField.call(this, config);
}
TextAreaField.prototype = new TextField({
insertTemplate: function() {
if(!this.inserting)
return "";
return this.insertControl = this._createTextArea();
},
editTemplate: function(value) {
if(!this.editing)
return this.itemTemplate.apply(this, arguments);
var $result = this.editControl = this._createTextArea();
$result.val(value);
return $result;
},
_createTextArea: function() {
return $("<textarea>").prop("readonly", !!this.readOnly);
}
});
jsGrid.fields.textarea = jsGrid.TextAreaField = TextAreaField;
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.de = {
grid: {
noDataContent: "Die Daten konnten nicht gefunden werden",
deleteConfirm: "Möchten Sie die Daten unwiederruflich löschen?",
pagerFormat: "Seiten: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} von {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Bitte warten...",
invalidMessage: "Ihre Eingabe ist nicht zulässig!"
},
loadIndicator: {
message: "Lädt..."
},
fields: {
control: {
searchModeButtonTooltip: "Suche",
insertModeButtonTooltip: "Eintrag hinzufügen",
editButtonTooltip: "Bearbeiten",
deleteButtonTooltip: "Löschen",
searchButtonTooltip: "Eintrag finden",
clearFilterButtonTooltip: "Filter zurücksetzen",
insertButtonTooltip: "Hinzufügen",
updateButtonTooltip: "Speichern",
cancelEditButtonTooltip: "Abbrechen"
}
},
validators: {
required: { message: "Dies ist ein Pflichtfeld" },
rangeLength: { message: "Die Länge der Eingabe liegt außerhalb des zulässigen Bereichs" },
minLength: { message: "Die Eingabe ist zu kurz" },
maxLength: { message: "Die Eingabe ist zu lang" },
pattern: { message: "Die Eingabe entspricht nicht dem gewünschten Muster" },
range: { message: "Der eingegebene Wert liegt außerhalb des zulässigen Bereichs" },
min: { message: "Der eingegebene Wert ist zu niedrig" },
max: { message: "Der eingegebene Wert ist zu hoch" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.es = {
grid: {
noDataContent: "No encontrado",
deleteConfirm: "¿Está seguro?",
pagerFormat: "Paginas: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "Anterior",
pageNextText: "Siguiente",
pageFirstText: "Primero",
pageLastText: "Ultimo",
loadMessage: "Por favor, espere...",
invalidMessage: "¡Datos no válidos!"
},
loadIndicator: {
message: "Cargando..."
},
fields: {
control: {
searchModeButtonTooltip: "Cambiar a búsqueda",
insertModeButtonTooltip: "Cambiar a inserción",
editButtonTooltip: "Editar",
deleteButtonTooltip: "Suprimir",
searchButtonTooltip: "Buscar",
clearFilterButtonTooltip: "Borrar filtro",
insertButtonTooltip: "Insertar",
updateButtonTooltip: "Actualizar",
cancelEditButtonTooltip: "Cancelar edición"
}
},
validators: {
required: { message: "Campo requerido" },
rangeLength: { message: "La longitud del valor está fuera del intervalo definido" },
minLength: { message: "La longitud del valor es demasiado corta" },
maxLength: { message: "La longitud del valor es demasiado larga" },
pattern: { message: "El valor no se ajusta al patrón definido" },
range: { message: "Valor fuera del rango definido" },
min: { message: "Valor demasiado bajo" },
max: { message: "Valor demasiado alto" }
}
};
}(jsGrid, jQuery));

@ -1,47 +0,0 @@
(function(jsGrid) {
jsGrid.locales.fr = {
grid: {
noDataContent: "Pas de données",
deleteConfirm: "Êtes-vous sûr ?",
pagerFormat: "Pages: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Chargement en cours...",
invalidMessage: "Des données incorrectes sont entrés !"
},
loadIndicator: {
message: "Chargement en cours..."
},
fields: {
control: {
searchModeButtonTooltip: "Recherche",
insertModeButtonTooltip: "Ajouter une entrée",
editButtonTooltip: "Changer",
deleteButtonTooltip: "Effacer",
searchButtonTooltip: "Trouve",
clearFilterButtonTooltip: "Effacer",
insertButtonTooltip: "Ajouter",
updateButtonTooltip: "Sauvegarder",
cancelEditButtonTooltip: "Annuler"
}
},
validators: {
required: { message: "Champ requis" },
rangeLength: { message: "Longueur de la valeur du champ est hors de la plage définie" },
minLength: { message: "La valeur du champ est trop court" },
maxLength: { message: "La valeur du champ est trop long" },
pattern: { message: "La valeur du champ ne correspond pas à la configuration définie" },
range: { message: "La valeur du champ est hors de la plage définie" },
min: { message: "La valeur du champ est trop petit" },
max: { message: "La valeur du champ est trop grande" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.he = {
grid: {
noDataContent: "לא נמצא",
deleteConfirm: "האם אתה בטוח?",
pagerFormat: "עמודים: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} מתוך {pageCount}",
pagePrevText: "הקודם",
pageNextText: "הבא",
pageFirstText: "ראשון",
pageLastText: "אחרון",
loadMessage: "אנא המתן ...",
invalidMessage: "נתונים לא חוקיים!"
},
loadIndicator: {
message: "טוען..."
},
fields: {
control: {
searchModeButtonTooltip: "ביצוע חיפוש",
insertModeButtonTooltip: "ביצוע עריכת שורה",
editButtonTooltip: "עריכה",
deleteButtonTooltip: "מחיקה",
searchButtonTooltip: "חיפוש",
clearFilterButtonTooltip: "ניקוי מסנן",
insertButtonTooltip: "הכנסה",
updateButtonTooltip: "עדכון",
cancelEditButtonTooltip: "ביטול עריכה"
}
},
validators: {
required: { message: "שדה נדרש" },
rangeLength: { message: "אורכו של הערך הוא מחוץ לטווח המוגדר" },
minLength: { message: "אורכו של הערך קצר מדי" },
maxLength: { message: "אורכו של הערך ארוך מדי" },
pattern: { message: "אורכו של הערך ארוך מדי" },
range: { message: "ערך מחוץ לטווח" },
min: { message: "ערך נמוך מדי" },
max: { message: "גבוה מדי" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.ja = {
grid: {
noDataContent: "データが見つかりません。",
deleteConfirm: "削除しますよろしですか。",
pagerFormat: "頁: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; 【{pageIndex}{pageCount}】",
pagePrevText: "前",
pageNextText: "次",
pageFirstText: "最初",
pageLastText: "最後",
loadMessage: "しばらくお待ちください…",
invalidMessage: "入力されたデータが不正です。"
},
loadIndicator: {
message: "処理中…"
},
fields: {
control: {
searchModeButtonTooltip: "検索モードへ",
insertModeButtonTooltip: "登録モードへ",
editButtonTooltip: "編集",
deleteButtonTooltip: "削除",
searchButtonTooltip: "フィルター",
clearFilterButtonTooltip: "クリア",
insertButtonTooltip: "登録",
updateButtonTooltip: "更新",
cancelEditButtonTooltip: "編集戻す"
}
},
validators: {
required: { message: "項目が必要です。" },
rangeLength: { message: "項目の桁数が範囲外です。" },
minLength: { message: "項目の桁数が超過しています。" },
maxLength: { message: "項目の桁数が不足しています。" },
pattern: { message: "項目の値がパターンに一致しません。" },
range: { message: "項目の値が範囲外です。" },
min: { message: "項目の値が超過しています。" },
max: { message: "項目の値が不足しています。" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.ka = {
grid: {
noDataContent: "მონაცემები ცარიელია.",
deleteConfirm: "ნამდვილად გსურთ ჩანაწერის წაშლა?",
pagerFormat: "გვერდები: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} - {pageCount} დან.",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "გთხოვთ დაიცადოთ...",
invalidMessage: "შეყვანილია არასწორი მონაცემები!"
},
loadIndicator: {
message: "მიმდინარეობს ჩატვირთვა..."
},
fields: {
control: {
searchModeButtonTooltip: "ძებნა",
insertModeButtonTooltip: "ჩანაწერის დამატება",
editButtonTooltip: "შესწორება",
deleteButtonTooltip: "წაშლა",
searchButtonTooltip: "ძებნა",
clearFilterButtonTooltip: "ფილტრის გასუფთავება",
insertButtonTooltip: "დამატება",
updateButtonTooltip: "შენახვა",
cancelEditButtonTooltip: "გაუქმება"
}
},
validators: {
required: { message: "ველი აუცილებელია შესავსებად." },
rangeLength: { message: "შეყვანილი ჩანაწერის ზომა არ ექვემდებარება დიაპაზონს." },
minLength: { message: "შეყვანილი ჩანაწერის ზომა საკმაოდ პატარა არის." },
maxLength: { message: "შეყვანილი ჩანაწერის ზომა საკმაოდ დიდი არის." },
pattern: { message: "შეყვანილი მნიშვნელობა არ ემთხვევა მითითებულ შაბლონს." },
range: { message: "შეყვანილი ინფორმაცია არ ჯდება დიაპაზონში." },
min: { message: "შეყვანილი ინფორმაციის ზომა საკმაოდ პატარა არის." },
max: { message: "შეყვანილი ინფორმაციის ზომა საკმაოდ დიდი არის." }
}
};
}(jsGrid, jQuery));

@ -1,62 +0,0 @@
(function(jsGrid) {
jsGrid.locales.pl = {
grid: {
noDataContent: "Nie znaleziono",
deleteConfirm: "Czy jesteś pewien?",
pagerFormat: "Strony: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} z {pageCount}",
pagePrevText: "Poprzednia",
pageNextText: "Następna",
pageFirstText: "Pierwsza",
pageLastText: "Ostatnia",
loadMessage: "Proszę czekać...",
invalidMessage: "Wprowadzono nieprawidłowe dane!"
},
loadIndicator: {
message: "Ładowanie..."
},
fields: {
control: {
searchModeButtonTooltip: "Wyszukiwanie",
insertModeButtonTooltip: "Dodawanie",
editButtonTooltip: "Edytuj",
deleteButtonTooltip: "Usuń",
searchButtonTooltip: "Szukaj",
clearFilterButtonTooltip: "Wyczyść filtr",
insertButtonTooltip: "Dodaj",
updateButtonTooltip: "Aktualizuj",
cancelEditButtonTooltip: "Anuluj edytowanie"
}
},
validators: {
required: {
message: "Pole jest wymagane"
},
rangeLength: {
message: "Długość wartości pola znajduje się poza zdefiniowanym zakresem"
},
minLength: {
message: "Wartość pola jest zbyt krótka"
},
maxLength: {
message: "Wartość pola jest zbyt długa"
},
pattern: {
message: "Wartość pola nie zgadza się ze zdefiniowanym wzorem"
},
range: {
message: "Wartość pola znajduje się poza zdefiniowanym zakresem"
},
min: {
message: "Wartość pola jest zbyt mała"
},
max: {
message: "Wartość pola jest zbyt duża"
}
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales["pt-br"] = {
grid: {
noDataContent: "Não encontrado",
deleteConfirm: "Você tem certeza que deseja remover este item?",
pagerFormat: "Páginas: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "Anterior",
pageNextText: "Seguinte",
pageFirstText: "Primeira",
pageLastText: "Última",
loadMessage: "Por favor, espere...",
invalidMessage: "Dados inválidos!"
},
loadIndicator: {
message: "Carregando..."
},
fields: {
control: {
searchModeButtonTooltip: "Mudar para busca",
insertModeButtonTooltip: "Mudar para inserção",
editButtonTooltip: "Editar",
deleteButtonTooltip: "Remover",
searchButtonTooltip: "Buscar",
clearFilterButtonTooltip: "Remover filtro",
insertButtonTooltip: "Adicionar",
updateButtonTooltip: "Atualizar",
cancelEditButtonTooltip: "Cancelar Edição"
}
},
validators: {
required: { message: "Campo obrigatório" },
rangeLength: { message: "O valor esta fora do intervaldo definido" },
minLength: { message: "O comprimento do valor é muito curto" },
maxLength: { message: "O comprimento valor é muito longo" },
pattern: { message: "O valor informado não é compatível com o padrão" },
range: { message: "O valor informado esta fora do limite definido" },
min: { message: "O valor é muito curto" },
max: { message: "O valor é muito longo" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales.pt = {
grid: {
noDataContent: "Não encontrado",
deleteConfirm: "Você tem certeza que deseja remover este item?",
pagerFormat: "Páginas: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} de {pageCount}",
pagePrevText: "Anterior",
pageNextText: "Seguinte",
pageFirstText: "Primeira",
pageLastText: "Última",
loadMessage: "Por favor, espere...",
invalidMessage: "Dados inválidos!"
},
loadIndicator: {
message: "Carregando..."
},
fields: {
control: {
searchModeButtonTooltip: "Mudar para busca",
insertModeButtonTooltip: "Mudar para inserção",
editButtonTooltip: "Editar",
deleteButtonTooltip: "Remover",
searchButtonTooltip: "Buscar",
clearFilterButtonTooltip: "Remover filtro",
insertButtonTooltip: "Adicionar",
updateButtonTooltip: "Atualizar",
cancelEditButtonTooltip: "Cancelar Edição"
}
},
validators: {
required: { message: "Campo obrigatório" },
rangeLength: { message: "O valor esta fora do intervaldo definido" },
minLength: { message: "O comprimento do valor é muito curto" },
maxLength: { message: "O comprimento valor é muito longo" },
pattern: { message: "O valor informado não é compatível com o padrão" },
range: { message: "O valor informado esta fora do limite definido" },
min: { message: "O valor é muito curto" },
max: { message: "O valor é muito longo" }
}
};
}(jsGrid, jQuery));

@ -1,47 +0,0 @@
(function(jsGrid) {
jsGrid.locales.ru = {
grid: {
noDataContent: "Данных не найдено",
deleteConfirm: "Вы действительно хотите удалить запись?",
pagerFormat: "Страницы: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} из {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Пожалуйста, подождите...",
invalidMessage: "Введены неверные данные!"
},
loadIndicator: {
message: "Загрузка..."
},
fields: {
control: {
searchModeButtonTooltip: "Поиск",
insertModeButtonTooltip: "Добавить запись",
editButtonTooltip: "Изменить",
deleteButtonTooltip: "Удалить",
searchButtonTooltip: "Найти",
clearFilterButtonTooltip: "Очистить фильтр",
insertButtonTooltip: "Добавить",
updateButtonTooltip: "Сохранить",
cancelEditButtonTooltip: "Отменить"
}
},
validators: {
required: { message: "Поле обязательно для заполения" },
rangeLength: { message: "Длинна введенного значения вне допустимого диапазона" },
minLength: { message: "Введенное значение слишком короткое" },
maxLength: { message: "Введенное значение слишком длинное" },
pattern: { message: "Введенное значение не соответствует заданному шаблону" },
range: { message: "Введенное значение вне допустимого диапазона" },
min: { message: "Введенное значение слишком маленькое" },
max: { message: "Введенное значение слишком большое" }
}
};
}(jsGrid, jQuery));

@ -1,47 +0,0 @@
(function(jsGrid) {
jsGrid.locales.tr = {
grid: {
noDataContent: "Kayıt Bulunamadı",
deleteConfirm: "Emin misiniz ?",
pagerFormat: "Sayfalar: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} / {pageCount}",
pagePrevText: "<",
pageNextText: ">",
pageFirstText: "<<",
pageLastText: ">>",
loadMessage: "Lütfen bekleyiniz...",
invalidMessage: "Geçersiz veri girişi !"
},
loadIndicator: {
message: "Yükleniyor..."
},
fields: {
control: {
searchModeButtonTooltip: "Arama moduna geç",
insertModeButtonTooltip: "Yeni kayıt moduna geç",
editButtonTooltip: "Değiştir",
deleteButtonTooltip: "Sil",
searchButtonTooltip: "Bul",
clearFilterButtonTooltip: "Filtreyi temizle",
insertButtonTooltip: "Ekle",
updateButtonTooltip: "Güncelle",
cancelEditButtonTooltip: "Güncelleme iptali"
}
},
validators: {
required: { message: "Gerekli alandır" },
rangeLength: { message: "Alan değerinin uzunluğu tanımlanan aralık dışındadır" },
minLength: { message: "Alan değeri çok kısadır" },
maxLength: { message: "Alan değeri çok uzundur" },
pattern: { message: "Alan değeri tanımlanan şablon ile eşleşmiyor" },
range: { message: "Alan değeri tanımlı aralığın dışındadır" },
min: { message: "Alan değeri çok küçüktür" },
max: { message: "Alan değeri çok büyüktür" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales["zh-cn"] = {
grid: {
noDataContent: "暂无数据",
deleteConfirm: "确认删除?",
pagerFormat: "页码: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} / {pageCount}",
pagePrevText: "上一页",
pageNextText: "下一页",
pageFirstText: "第一页",
pageLastText: "最后页",
loadMessage: "请稍后...",
invalidMessage: "数据有误!"
},
loadIndicator: {
message: "载入中..."
},
fields: {
control: {
searchModeButtonTooltip: "切换为搜索",
insertModeButtonTooltip: "切换为新增",
editButtonTooltip: "编辑",
deleteButtonTooltip: "删除",
searchButtonTooltip: "搜索",
clearFilterButtonTooltip: "清空过滤",
insertButtonTooltip: "插入",
updateButtonTooltip: "更新",
cancelEditButtonTooltip: "取消编辑"
}
},
validators: {
required: { message: "字段必填" },
rangeLength: { message: "字段值长度超过定义范围" },
minLength: { message: "字段长度过短" },
maxLength: { message: "字段长度过长" },
pattern: { message: "字段值不符合定义规则" },
range: { message: "字段值超过定义范围" },
min: { message: "字段值太小" },
max: { message: "字段值太大" }
}
};
}(jsGrid, jQuery));

@ -1,46 +0,0 @@
(function(jsGrid) {
jsGrid.locales["zh-tw"] = {
grid: {
noDataContent: "暫無資料",
deleteConfirm: "確認刪除?",
pagerFormat: "頁碼: {first} {prev} {pages} {next} {last} &nbsp;&nbsp; {pageIndex} / {pageCount}",
pagePrevText: "上一頁",
pageNextText: "下一頁",
pageFirstText: "第一頁",
pageLastText: "最後一頁",
loadMessage: "請稍候...",
invalidMessage: "輸入資料不正確"
},
loadIndicator: {
message: "載入中..."
},
fields: {
control: {
searchModeButtonTooltip: "切換為搜尋",
insertModeButtonTooltip: "切換為新增",
editButtonTooltip: "編輯",
deleteButtonTooltip: "刪除",
searchButtonTooltip: "搜尋",
clearFilterButtonTooltip: "清除搜尋條件",
insertButtonTooltip: "新增",
updateButtonTooltip: "修改",
cancelEditButtonTooltip: "取消編輯"
}
},
validators: {
required: { message: "欄位必填" },
rangeLength: { message: "欄位字串長度超出範圍" },
minLength: { message: "欄位字串長度太短" },
maxLength: { message: "欄位字串長度太長" },
pattern: { message: "欄位字串不符合規則" },
range: { message: "欄位數值超出範圍" },
min: { message: "欄位數值太小" },
max: { message: "欄位數值太大" }
}
};
}(jsGrid, jQuery));

File diff suppressed because it is too large Load Diff

@ -1,72 +0,0 @@
(function(jsGrid, $, undefined) {
function Field(config) {
$.extend(true, this, config);
this.sortingFunc = this._getSortingFunc();
}
Field.prototype = {
name: "",
title: null,
css: "",
align: "",
width: 100,
visible: true,
filtering: true,
inserting: true,
editing: true,
sorting: true,
sorter: "string", // name of SortStrategy or function to compare elements
headerTemplate: function() {
return (this.title === undefined || this.title === null) ? this.name : this.title;
},
itemTemplate: function(value, item) {
return value;
},
filterTemplate: function() {
return "";
},
insertTemplate: function() {
return "";
},
editTemplate: function(value, item) {
this._value = value;
return this.itemTemplate(value, item);
},
filterValue: function() {
return "";
},
insertValue: function() {
return "";
},
editValue: function() {
return this._value;
},
_getSortingFunc: function() {
var sorter = this.sorter;
if($.isFunction(sorter)) {
return sorter;
}
if(typeof sorter === "string") {
return jsGrid.sortStrategies[sorter];
}
throw Error("wrong sorter for the field \"" + this.name + "\"!");
}
};
jsGrid.Field = Field;
}(jsGrid, jQuery));

@ -1,82 +0,0 @@
(function(jsGrid, $, undefined) {
function LoadIndicator(config) {
this._init(config);
}
LoadIndicator.prototype = {
container: "body",
message: "Loading...",
shading: true,
zIndex: 1000,
shaderClass: "jsgrid-load-shader",
loadPanelClass: "jsgrid-load-panel",
_init: function(config) {
$.extend(true, this, config);
this._initContainer();
this._initShader();
this._initLoadPanel();
},
_initContainer: function() {
this._container = $(this.container);
},
_initShader: function() {
if(!this.shading)
return;
this._shader = $("<div>").addClass(this.shaderClass)
.hide()
.css({
position: "absolute",
top: 0,
right: 0,
bottom: 0,
left: 0,
zIndex: this.zIndex
})
.appendTo(this._container);
},
_initLoadPanel: function() {
this._loadPanel = $("<div>").addClass(this.loadPanelClass)
.text(this.message)
.hide()
.css({
position: "absolute",
top: "50%",
left: "50%",
zIndex: this.zIndex
})
.appendTo(this._container);
},
show: function() {
var $loadPanel = this._loadPanel.show();
var actualWidth = $loadPanel.outerWidth();
var actualHeight = $loadPanel.outerHeight();
$loadPanel.css({
marginTop: -actualHeight / 2,
marginLeft: -actualWidth / 2
});
this._shader.show();
},
hide: function() {
this._loadPanel.hide();
this._shader.hide();
}
};
jsGrid.LoadIndicator = LoadIndicator;
}(jsGrid, jQuery));

@ -1,122 +0,0 @@
(function(jsGrid, $, undefined) {
function DirectLoadingStrategy(grid) {
this._grid = grid;
}
DirectLoadingStrategy.prototype = {
firstDisplayIndex: function() {
var grid = this._grid;
return grid.option("paging") ? (grid.option("pageIndex") - 1) * grid.option("pageSize") : 0;
},
lastDisplayIndex: function() {
var grid = this._grid;
var itemsCount = grid.option("data").length;
return grid.option("paging")
? Math.min(grid.option("pageIndex") * grid.option("pageSize"), itemsCount)
: itemsCount;
},
itemsCount: function() {
return this._grid.option("data").length;
},
openPage: function(index) {
this._grid.refresh();
},
loadParams: function() {
return {};
},
sort: function() {
this._grid._sortData();
this._grid.refresh();
return $.Deferred().resolve().promise();
},
reset: function() {
this._grid.refresh();
return $.Deferred().resolve().promise();
},
finishLoad: function(loadedData) {
this._grid.option("data", loadedData);
},
finishInsert: function(insertedItem) {
var grid = this._grid;
grid.option("data").push(insertedItem);
grid.refresh();
},
finishDelete: function(deletedItem, deletedItemIndex) {
var grid = this._grid;
grid.option("data").splice(deletedItemIndex, 1);
grid.reset();
}
};
function PageLoadingStrategy(grid) {
this._grid = grid;
this._itemsCount = 0;
}
PageLoadingStrategy.prototype = {
firstDisplayIndex: function() {
return 0;
},
lastDisplayIndex: function() {
return this._grid.option("data").length;
},
itemsCount: function() {
return this._itemsCount;
},
openPage: function(index) {
this._grid.loadData();
},
loadParams: function() {
var grid = this._grid;
return {
pageIndex: grid.option("pageIndex"),
pageSize: grid.option("pageSize")
};
},
reset: function() {
return this._grid.loadData();
},
sort: function() {
return this._grid.loadData();
},
finishLoad: function(loadedData) {
this._itemsCount = loadedData.itemsCount;
this._grid.option("data", loadedData.data);
},
finishInsert: function(insertedItem) {
this._grid.search();
},
finishDelete: function(deletedItem, deletedItemIndex) {
this._grid.search();
}
};
jsGrid.loadStrategies = {
DirectLoadingStrategy: DirectLoadingStrategy,
PageLoadingStrategy: PageLoadingStrategy
};
}(jsGrid, jQuery));

@ -1,36 +0,0 @@
(function(jsGrid, $, undefined) {
var isDefined = function(val) {
return typeof(val) !== "undefined" && val !== null;
};
var sortStrategies = {
string: function(str1, str2) {
if(!isDefined(str1) && !isDefined(str2))
return 0;
if(!isDefined(str1))
return -1;
if(!isDefined(str2))
return 1;
return ("" + str1).localeCompare("" + str2);
},
number: function(n1, n2) {
return n1 - n2;
},
date: function(dt1, dt2) {
return dt1 - dt2;
},
numberAsString: function(n1, n2) {
return parseFloat(n1) - parseFloat(n2);
}
};
jsGrid.sortStrategies = sortStrategies;
}(jsGrid, jQuery));

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save