├── hawk ├── log │ └── .gitignore ├── tmp │ └── .gitignore ├── vendor │ └── assets │ │ ├── stylesheets │ │ ├── misc │ │ │ ├── _moment.scss │ │ │ ├── _html5shiv.scss │ │ │ └── _respond.scss │ │ ├── bootstrap │ │ │ ├── _growl.scss │ │ │ ├── _wizard.scss │ │ │ ├── mixins │ │ │ │ ├── _center-block.scss │ │ │ │ ├── _opacity.scss │ │ │ │ ├── _size.scss │ │ │ │ ├── _text-overflow.scss │ │ │ │ ├── _tab-focus.scss │ │ │ │ ├── _labels.scss │ │ │ │ ├── _resize.scss │ │ │ │ ├── _progress-bar.scss │ │ │ │ ├── _text-emphasis.scss │ │ │ │ ├── _reset-filter.scss │ │ │ │ ├── _nav-divider.scss │ │ │ │ ├── _background-variant.scss │ │ │ │ ├── _alerts.scss │ │ │ │ ├── _nav-vertical-align.scss │ │ │ │ ├── _reset-text.scss │ │ │ │ ├── _border-radius.scss │ │ │ │ ├── _pagination.scss │ │ │ │ ├── _responsive-visibility.scss │ │ │ │ ├── _panels.scss │ │ │ │ ├── _hide-text.scss │ │ │ │ ├── _clearfix.scss │ │ │ │ ├── _list-group.scss │ │ │ │ └── _table-row.scss │ │ │ ├── _wells.scss │ │ │ ├── _breadcrumbs.scss │ │ │ ├── _responsive-embed.scss │ │ │ ├── _close.scss │ │ │ ├── _component-animations.scss │ │ │ ├── _utilities.scss │ │ │ ├── _thumbnails.scss │ │ │ └── _pager.scss │ │ ├── jquery │ │ │ ├── _blockui.scss │ │ │ ├── _jquery.scss │ │ │ ├── _jsviews.scss │ │ │ ├── _rails.scss │ │ │ ├── _sortable.scss │ │ │ ├── _validate.scss │ │ │ ├── _matchheight.scss │ │ │ └── _stickytabs.scss │ │ ├── font-awesome │ │ │ ├── _fixed-width.scss │ │ │ ├── _screen-reader.scss │ │ │ ├── _larger.scss │ │ │ ├── _list.scss │ │ │ ├── _core.scss │ │ │ ├── font-awesome.scss │ │ │ ├── _stacked.scss │ │ │ ├── _bordered-pulled.scss │ │ │ ├── _rotated-flipped.scss │ │ │ ├── _path.scss │ │ │ └── _animated.scss │ │ ├── _bootstrap.scss │ │ └── vendor.scss │ │ ├── javascripts │ │ ├── font-awesome │ │ │ └── font-awesome.js │ │ ├── bootstrap.js │ │ ├── jquery │ │ │ └── locale │ │ │ │ └── validate │ │ │ │ ├── methods_pt.js │ │ │ │ ├── methods_nl.js │ │ │ │ ├── methods_de.js │ │ │ │ ├── messages_zh.js │ │ │ │ ├── messages_zh_TW.js │ │ │ │ ├── messages_ko.js │ │ │ │ ├── messages_ja.js │ │ │ │ ├── messages_hu.js │ │ │ │ └── messages_ar.js │ │ ├── bootstrap-sprockets.js │ │ ├── bootstrap │ │ │ └── locale │ │ │ │ └── table │ │ │ │ ├── messages_nl_NL.js │ │ │ │ ├── messages_es_AR.js │ │ │ │ ├── messages_ko_KR.js │ │ │ │ ├── messages_hu_HU.js │ │ │ │ ├── messages_zh_TW.js │ │ │ │ ├── messages_it_IT.js │ │ │ │ ├── messages_zh_CN.js │ │ │ │ ├── messages_ru_RU.js │ │ │ │ ├── messages_pl_PL.js │ │ │ │ ├── messages_de_DE.js │ │ │ │ ├── messages_pt_BR.js │ │ │ │ ├── messages_fr_FR.js │ │ │ │ └── messages_cs_CZ.js │ │ └── vendor.js │ │ ├── fonts │ │ ├── font-awesome │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ └── bootstrap │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ └── images │ │ └── bootstrap │ │ └── fileinput │ │ ├── loading.gif │ │ └── loading-sm.gif ├── locale │ └── .gitignore ├── public │ ├── robots.txt │ ├── doc │ │ ├── sle-ha-manuals_en │ │ ├── sle-ha-guide_en-pdf │ │ ├── sle-ha-geo-manuals_en │ │ ├── sle-ha-geo-quick_en-pdf │ │ ├── sle-ha-nfs-quick_en-pdf │ │ └── sle-ha-install-quick_en-pdf │ ├── favicon.ico │ └── dummy │ │ ├── transition.png │ │ ├── hb_report-hawk-2014-05-26_09:14-2015-05-27_09:14.tar.bz2 │ │ ├── hb_report-hawk-2015-04-01_11:16-2015-06-01_11:16.tar.bz2 │ │ └── hb_report-hawk-2015-05-31_11:16-2015-06-01_11:16.tar.bz2 ├── app │ ├── assets │ │ ├── images │ │ │ ├── favicon.png │ │ │ ├── head │ │ │ │ └── white.png │ │ │ ├── logo │ │ │ │ ├── hawk.png │ │ │ │ └── white.png │ │ │ └── misc │ │ │ │ └── blank.png │ │ ├── stylesheets │ │ │ ├── gettext.scss │ │ │ ├── ie.scss │ │ │ ├── shared │ │ │ │ ├── _list.scss │ │ │ │ ├── _foot.scss │ │ │ │ ├── _simulator.scss │ │ │ │ └── _misc.scss │ │ │ ├── authentication │ │ │ │ ├── _media.scss │ │ │ │ └── _foot.scss │ │ │ ├── authentication.scss │ │ │ ├── application.scss │ │ │ └── application │ │ │ │ └── _basics.scss │ │ ├── config │ │ │ └── manifest.js │ │ ├── fonts │ │ │ ├── roboto-v15-latin-300.eot │ │ │ ├── roboto-v15-latin-300.ttf │ │ │ ├── roboto-v15-latin-300.woff │ │ │ ├── roboto-v15-latin-300.woff2 │ │ │ ├── roboto-v15-latin-500.eot │ │ │ ├── roboto-v15-latin-500.ttf │ │ │ ├── roboto-v15-latin-500.woff │ │ │ ├── roboto-v15-latin-500.woff2 │ │ │ ├── roboto-v15-latin-700.eot │ │ │ ├── roboto-v15-latin-700.ttf │ │ │ ├── roboto-v15-latin-700.woff │ │ │ ├── roboto-v15-latin-700.woff2 │ │ │ ├── roboto-v15-latin-900.eot │ │ │ ├── roboto-v15-latin-900.ttf │ │ │ ├── roboto-v15-latin-900.woff │ │ │ ├── roboto-v15-latin-900.woff2 │ │ │ ├── roboto-v15-latin-regular.eot │ │ │ ├── roboto-v15-latin-regular.ttf │ │ │ ├── roboto-v15-latin-regular.woff │ │ │ └── roboto-v15-latin-regular.woff2 │ │ └── javascripts │ │ │ ├── locale │ │ │ ├── en_US.js │ │ │ ├── ar.js │ │ │ ├── ja.js │ │ │ ├── sv.js │ │ │ ├── cs.js │ │ │ ├── es.js │ │ │ ├── fr.js │ │ │ ├── hu.js │ │ │ ├── it.js │ │ │ ├── ko.js │ │ │ ├── pl.js │ │ │ ├── ru.js │ │ │ ├── zh_CN.js │ │ │ ├── zh_TW.js │ │ │ ├── de.js │ │ │ ├── nl.js │ │ │ └── pt_BR.js │ │ │ ├── ie.js │ │ │ ├── gettext.js │ │ │ ├── module │ │ │ ├── modals.js │ │ │ ├── help.js │ │ │ └── profiles.js │ │ │ └── authentication.js │ ├── views │ │ ├── shared │ │ │ ├── _footer.html.erb │ │ │ ├── _modal.html.erb │ │ │ ├── _helpentry.html.erb │ │ │ ├── _flash.html.erb │ │ │ ├── _helpsidebar.html.erb │ │ │ └── _header.html.erb │ │ ├── reports │ │ │ ├── graph.html.erb │ │ │ └── detail.html.erb │ │ ├── nodes │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── sessions │ │ │ └── new.html.erb │ │ ├── roles │ │ │ ├── new.html.erb │ │ │ ├── edit.html.erb │ │ │ └── index.html.erb │ │ ├── users │ │ │ ├── new.html.erb │ │ │ ├── edit.html.erb │ │ │ ├── index.html.erb │ │ │ └── _form.html.erb │ │ ├── simulator │ │ │ └── help.html.erb │ │ ├── layouts │ │ │ └── modal.html.erb │ │ ├── primitives │ │ │ ├── new.html.erb │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── constraints │ │ │ ├── show.html.erb │ │ │ └── index.html.erb │ │ ├── tags │ │ │ ├── new.html.erb │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── alerts │ │ │ ├── new.html.erb │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── clones │ │ │ ├── new.html.erb │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── groups │ │ │ ├── new.html.erb │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── tickets │ │ │ ├── new.html.erb │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── orders │ │ │ ├── new.html.erb │ │ │ ├── index.html.erb │ │ │ └── edit.html.erb │ │ ├── locations │ │ │ ├── new.html.erb │ │ │ └── index.html.erb │ │ ├── masters │ │ │ ├── new.html.erb │ │ │ └── index.html.erb │ │ ├── colocations │ │ │ ├── new.html.erb │ │ │ └── index.html.erb │ │ ├── resources │ │ │ └── index.html.erb │ │ ├── fencing │ │ │ ├── _table.html.erb │ │ │ └── index.html.erb │ │ ├── profiles │ │ │ └── edit.html.erb │ │ └── commands │ │ │ └── index.html.erb │ ├── helpers │ │ ├── rule_helper.rb │ │ ├── dashboards_helper.rb │ │ ├── group_helper.rb │ │ ├── clone_helper.rb │ │ ├── order_helper.rb │ │ ├── master_helper.rb │ │ ├── colocation_helper.rb │ │ ├── crm_config_helper.rb │ │ ├── profile_helper.rb │ │ ├── ticket_helper.rb │ │ ├── location_helper.rb │ │ ├── role_helper.rb │ │ ├── user_helper.rb │ │ ├── constraints_helper.rb │ │ ├── states_helper.rb │ │ └── simulator_helper.rb │ ├── lib │ │ ├── tasks │ │ │ └── brakeman.rake │ │ └── hawk │ │ │ └── secure_cookies.rb │ ├── controllers │ │ ├── api │ │ │ └── v1 │ │ │ │ ├── cluster_controller.rb │ │ │ │ ├── status_controller.rb │ │ │ │ ├── nodes_controller.rb │ │ │ │ └── resources_controller.rb │ │ ├── errors_controller.rb │ │ ├── commands_controller.rb │ │ └── pages_controller.rb │ ├── models │ │ └── recipient.rb │ ├── validators │ │ ├── order_validator.rb │ │ └── colocation_validator.rb │ └── collections │ │ ├── role_collection.rb │ │ ├── rule_collection.rb │ │ └── user_collection.rb ├── config │ ├── spring.rb │ ├── initializers │ │ ├── mime.rb │ │ ├── mime_types.rb │ │ ├── cookies.rb │ │ ├── application_controller_renderer.rb │ │ ├── filter.rb │ │ ├── filter_parameter_logging.rb │ │ ├── cookies_serializer.rb │ │ ├── wrap.rb │ │ ├── backtrace_silencers.rb │ │ ├── hash.rb │ │ ├── assets.rb │ │ ├── session.rb │ │ ├── wrap_parameters.rb │ │ ├── cors.rb │ │ └── inflections.rb │ ├── gettext_i18n_rails_js.yml │ ├── cable.yml │ ├── help │ │ └── en-US │ │ │ ├── constraints │ │ │ ├── intro.md │ │ │ ├── location.md │ │ │ ├── order.md │ │ │ ├── ticket.md │ │ │ └── colocation.md │ │ │ ├── crm_config │ │ │ └── intro.md │ │ │ └── resources │ │ │ ├── primitive.md │ │ │ ├── master.md │ │ │ ├── tag.md │ │ │ ├── clone.md │ │ │ ├── group.md │ │ │ ├── intro.md │ │ │ ├── user.md │ │ │ ├── template.md │ │ │ └── role.md │ ├── environment.rb │ ├── branding.yml │ ├── languages.yml │ ├── secrets.yml │ └── puma.rb ├── spec │ ├── fixtures │ │ └── files │ │ │ └── api_token_dummy.store │ ├── support │ │ └── helpers │ │ │ └── api.rb │ ├── models │ │ └── profile_spec.rb │ └── lib │ │ └── util_spec.rb ├── .rspec ├── config.ru ├── bin │ ├── rake │ ├── bundle │ └── rails ├── test │ ├── unit │ │ ├── acl_test.rb │ │ ├── cib_test.rb │ │ ├── tag_test.rb │ │ ├── clone_test.rb │ │ ├── group_test.rb │ │ ├── master_test.rb │ │ ├── node_test.rb │ │ ├── order_test.rb │ │ ├── record_test.rb │ │ ├── report_test.rb │ │ ├── role_test.rb │ │ ├── rule_test.rb │ │ ├── step_test.rb │ │ ├── ticket_test.rb │ │ ├── user_test.rb │ │ ├── wizard_test.rb │ │ ├── cluster_test.rb │ │ ├── location_test.rb │ │ ├── profile_test.rb │ │ ├── resource_test.rb │ │ ├── session_test.rb │ │ ├── template_test.rb │ │ ├── colocation_test.rb │ │ ├── constraint_test.rb │ │ ├── crm_config_test.rb │ │ ├── primitive_test.rb │ │ └── tableless_test.rb │ ├── controllers │ │ ├── cib_controller_test.rb │ │ ├── nodes_controller_test.rb │ │ ├── pages_controller_test.rb │ │ ├── roles_controller_test.rb │ │ ├── tags_controller_test.rb │ │ ├── users_controller_test.rb │ │ ├── checks_controller_test.rb │ │ ├── clones_controller_test.rb │ │ ├── graphs_controller_test.rb │ │ ├── groups_controller_test.rb │ │ ├── masters_controller_test.rb │ │ ├── orders_controller_test.rb │ │ ├── profiles_controller_test.rb │ │ ├── sessions_controller_test.rb │ │ ├── tickets_controller_test.rb │ │ ├── wizards_controller_test.rb │ │ ├── crm_config_controller_test.rb │ │ ├── dashboards_controller_test.rb │ │ ├── explorers_controller_test.rb │ │ ├── locations_controller_test.rb │ │ ├── primitives_controller_test.rb │ │ ├── resources_controller_test.rb │ │ ├── templates_controller_test.rb │ │ ├── application_controller_test.rb │ │ ├── colocations_controller_test.rb │ │ └── constraints_controller_test.rb │ └── test_helper.rb └── Rakefile ├── e2e_test ├── requirements-test.txt ├── .dockerignore ├── Makefile ├── AUTHORS ├── .pylintrc ├── .travis.yml └── Dockerfile ├── .rubocop_todo.yml ├── screens ├── hawk_status.png └── hawk_wizards.png ├── test ├── run ├── _internal_runner.sh └── Dockerfile ├── .travis.yml ├── .codeclimate.yml ├── scripts ├── dev-server.json ├── server.json.in ├── hawk-backend.service.in ├── hawk.service.in └── create-directory-layout.sh ├── AUTHORS ├── .editorconfig ├── tools └── common.h.in ├── .gitignore ├── .javascript-style.json └── doc ├── release.md └── design.md /hawk/log/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /hawk/tmp/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/misc/_moment.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /e2e_test/requirements-test.txt: -------------------------------------------------------------------------------- 1 | flake8 2 | pylint 3 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_growl.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_wizard.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_blockui.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_jquery.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_jsviews.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_rails.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_sortable.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_validate.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/misc/_html5shiv.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/misc/_respond.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.rubocop_todo.yml: -------------------------------------------------------------------------------- 1 | Metrics/LineLength: 2 | Max: 1024 3 | -------------------------------------------------------------------------------- /hawk/locale/.gitignore: -------------------------------------------------------------------------------- 1 | *.edit.po 2 | *.po.time_stamp 3 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_matchheight.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/jquery/_stickytabs.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /e2e_test/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | **/__pycache__ 3 | **/*.pyc 4 | -------------------------------------------------------------------------------- /hawk/public/robots.txt: -------------------------------------------------------------------------------- 1 | # User-Agent: * 2 | # Disallow: / 3 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/font-awesome/font-awesome.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hawk/public/doc/sle-ha-manuals_en: -------------------------------------------------------------------------------- 1 | /usr/share/doc/manual/sle-ha-manuals_en -------------------------------------------------------------------------------- /hawk/public/doc/sle-ha-guide_en-pdf: -------------------------------------------------------------------------------- 1 | /usr/share/doc/manual/sle-ha-guide_en-pdf -------------------------------------------------------------------------------- /hawk/public/doc/sle-ha-geo-manuals_en: -------------------------------------------------------------------------------- 1 | /usr/share/doc/manual/sle-ha-geo-manuals_en -------------------------------------------------------------------------------- /hawk/public/doc/sle-ha-geo-quick_en-pdf: -------------------------------------------------------------------------------- 1 | /usr/share/doc/manual/sle-ha-geo-quick_en-pdf -------------------------------------------------------------------------------- /hawk/public/doc/sle-ha-nfs-quick_en-pdf: -------------------------------------------------------------------------------- 1 | /usr/share/doc/manual/sle-ha-nfs-quick_en-pdf -------------------------------------------------------------------------------- /hawk/public/doc/sle-ha-install-quick_en-pdf: -------------------------------------------------------------------------------- 1 | /usr/share/doc/manual/sle-ha-install-quick_en-pdf -------------------------------------------------------------------------------- /hawk/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/public/favicon.ico -------------------------------------------------------------------------------- /screens/hawk_status.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/screens/hawk_status.png -------------------------------------------------------------------------------- /e2e_test/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | @flake8 --ignore=E501 3 | @pylint --ignored-modules=distutils *.py 4 | -------------------------------------------------------------------------------- /screens/hawk_wizards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/screens/hawk_wizards.png -------------------------------------------------------------------------------- /hawk/public/dummy/transition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/public/dummy/transition.png -------------------------------------------------------------------------------- /hawk/app/assets/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/images/favicon.png -------------------------------------------------------------------------------- /hawk/app/assets/images/head/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/images/head/white.png -------------------------------------------------------------------------------- /hawk/app/assets/images/logo/hawk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/images/logo/hawk.png -------------------------------------------------------------------------------- /hawk/app/assets/images/logo/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/images/logo/white.png -------------------------------------------------------------------------------- /hawk/app/assets/images/misc/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/images/misc/blank.png -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/gettext.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | -------------------------------------------------------------------------------- /hawk/app/views/shared/_footer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 5 | -------------------------------------------------------------------------------- /hawk/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../javascripts .js 3 | //= link_directory ../javascripts/locale .js -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-300.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-300.eot -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-300.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-300.ttf -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-300.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-300.woff -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-300.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-300.woff2 -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-500.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-500.eot -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-500.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-500.ttf -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-500.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-500.woff -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-500.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-500.woff2 -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-700.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-700.eot -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-700.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-700.ttf -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-700.woff -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-700.woff2 -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-900.eot -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-900.ttf -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-900.woff -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-900.woff2 -------------------------------------------------------------------------------- /e2e_test/AUTHORS: -------------------------------------------------------------------------------- 1 | Alexei.Tighineanu@suse.com @atighineanu 2 | Alvaro.Carvajal@suse.com @alvarocarvajald 3 | Ricardo.Branco@suse.com @ricardobranco777 4 | -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-regular.eot -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-regular.ttf -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-regular.woff -------------------------------------------------------------------------------- /hawk/app/assets/fonts/roboto-v15-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/app/assets/fonts/roboto-v15-latin-regular.woff2 -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/font-awesome/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/font-awesome/FontAwesome.otf -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/en_US.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | -------------------------------------------------------------------------------- /hawk/config/spring.rb: -------------------------------------------------------------------------------- 1 | # %w( 2 | # .ruby-version 3 | # .rbenv-vars 4 | # tmp/restart.txt 5 | # tmp/caching-dev.txt 6 | # ).each { |path| Spring.watch(path) } 7 | -------------------------------------------------------------------------------- /hawk/vendor/assets/images/bootstrap/fileinput/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/images/bootstrap/fileinput/loading.gif -------------------------------------------------------------------------------- /hawk/vendor/assets/images/bootstrap/fileinput/loading-sm.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/images/bootstrap/fileinput/loading-sm.gif -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.eot -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/font-awesome/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /hawk/spec/fixtures/files/api_token_dummy.store: -------------------------------------------------------------------------------- 1 | --- 2 | hacluster: !ruby/struct:Struct::ApiToken 3 | username: hacluster 4 | api_token: a123456789 5 | expires: 2388665373 6 | -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/ie.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | @import "misc/html5shiv"; 5 | @import "misc/respond"; 6 | -------------------------------------------------------------------------------- /hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/vendor/assets/fonts/bootstrap/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /hawk/.rspec: -------------------------------------------------------------------------------- 1 | --color 2 | --require spec_helper 3 | 4 | # Tags 5 | # cluster_env: This test needs a cluster environment 6 | 7 | # Skip all tests tagged with "cluster_env" 8 | --tag ~cluster_env 9 | -------------------------------------------------------------------------------- /hawk/config.ru: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require ::File.expand_path("../config/environment", __FILE__) 5 | run Rails.application 6 | -------------------------------------------------------------------------------- /hawk/public/dummy/hb_report-hawk-2014-05-26_09:14-2015-05-27_09:14.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/public/dummy/hb_report-hawk-2014-05-26_09:14-2015-05-27_09:14.tar.bz2 -------------------------------------------------------------------------------- /hawk/public/dummy/hb_report-hawk-2015-04-01_11:16-2015-06-01_11:16.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/public/dummy/hb_report-hawk-2015-04-01_11:16-2015-06-01_11:16.tar.bz2 -------------------------------------------------------------------------------- /hawk/public/dummy/hb_report-hawk-2015-05-31_11:16-2015-06-01_11:16.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClusterLabs/hawk/HEAD/hawk/public/dummy/hb_report-hawk-2015-05-31_11:16-2015-06-01_11:16.tar.bz2 -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_fixed-width.scss: -------------------------------------------------------------------------------- 1 | // Fixed Width Icons 2 | // ------------------------- 3 | .#{$fa-css-prefix}-fw { 4 | width: (18em / 14); 5 | text-align: center; 6 | } 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/ie.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require misc/html5shiv 5 | //= require misc/respond 6 | //= require_self 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/ar.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_ar 6 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/ja.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_ja 6 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/sv.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_sv 6 | -------------------------------------------------------------------------------- /hawk/config/initializers/mime.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | Mime::Type.tap do |config| 5 | config.register "image/svg+xml", :svg 6 | end 7 | -------------------------------------------------------------------------------- /hawk/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_screen-reader.scss: -------------------------------------------------------------------------------- 1 | // Screen Readers 2 | // ------------------------- 3 | 4 | .sr-only { @include sr-only(); } 5 | .sr-only-focusable { @include sr-only-focusable(); } 6 | -------------------------------------------------------------------------------- /e2e_test/.pylintrc: -------------------------------------------------------------------------------- 1 | [MESSAGES CONTROL] 2 | disable=missing-docstring,line-too-long,too-many-public-methods,too-many-instance-attributes,too-many-arguments,too-many-statements,too-few-public-methods,raise-missing-from 3 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/gettext.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_tree ./gettext/locale 5 | //= require gettext/all 6 | //= require_self 7 | -------------------------------------------------------------------------------- /hawk/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # Copyright (c) 2009-2015 Tim Serong 3 | # See COPYING for license. 4 | 5 | require_relative "../config/boot" 6 | require "rake" 7 | 8 | Rake.application.run 9 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_center-block.scss: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | @mixin center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /hawk/config/gettext_i18n_rails_js.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | output_path: "app/assets/javascripts/gettext/locale" 5 | jed_options: 6 | pretty: true 7 | -------------------------------------------------------------------------------- /hawk/app/views/reports/graph.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | <%= report_graph_image params[:id], params[:transition] %> 5 |
6 |
7 |
8 | -------------------------------------------------------------------------------- /hawk/config/cable.yml: -------------------------------------------------------------------------------- 1 | # development: 2 | # adapter: async 3 | # 4 | # test: 5 | # adapter: async 6 | # 7 | # production: 8 | # adapter: redis 9 | # url: redis://localhost:6379/1 10 | # channel_prefix: hawk_production 11 | -------------------------------------------------------------------------------- /hawk/config/initializers/cookies.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | Rails.application.config.tap do |config| 5 | config.action_dispatch.cookies_serializer = :json 6 | end 7 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_opacity.scss: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | @mixin opacity($opacity) { 4 | opacity: $opacity; 5 | // IE8 filter 6 | $opacity-ie: ($opacity * 100); 7 | filter: alpha(opacity=$opacity-ie); 8 | } 9 | -------------------------------------------------------------------------------- /hawk/config/initializers/application_controller_renderer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # ApplicationController.renderer.defaults.merge!( 4 | # http_host: 'example.org', 5 | # https: false 6 | # ) 7 | -------------------------------------------------------------------------------- /hawk/config/initializers/filter.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | Rails.application.config.tap do |config| 5 | config.filter_parameters += [ 6 | :password 7 | ] 8 | end 9 | -------------------------------------------------------------------------------- /hawk/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # Copyright (c) 2009-2015 Tim Serong 3 | # See COPYING for license. 4 | 5 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__) 6 | load Gem.bin_path("bundler", "bundle") 7 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/constraints/intro.md: -------------------------------------------------------------------------------- 1 | ## Constraints 2 | 3 | Resource constraints specify: 4 | 5 | * on which cluster nodes resources can run 6 | * in which order resources will be loaded 7 | * what other resources a specific resource depends on 8 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_size.scss: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | @mixin size($width, $height) { 4 | width: $width; 5 | height: $height; 6 | } 7 | 8 | @mixin square($size) { 9 | @include size($size, $size); 10 | } 11 | -------------------------------------------------------------------------------- /hawk/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/cs.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_cs 6 | //= require bootstrap/locale/table/messages_cs_CZ 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/es.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_es 6 | //= require bootstrap/locale/table/messages_es_AR 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/fr.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_fr 6 | //= require bootstrap/locale/table/messages_fr_FR 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/hu.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_hu 6 | //= require bootstrap/locale/table/messages_hu_HU 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/it.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_it 6 | //= require bootstrap/locale/table/messages_it_IT 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/ko.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_ko 6 | //= require bootstrap/locale/table/messages_ko_KR 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/pl.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_pl 6 | //= require bootstrap/locale/table/messages_pl_PL 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/ru.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_ru 6 | //= require bootstrap/locale/table/messages_ru_RU 7 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/zh_CN.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_zh 6 | //= require bootstrap/locale/table/messages_zh_CN 7 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_text-overflow.scss: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | @mixin text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/zh_TW.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_zh_TW 6 | //= require bootstrap/locale/table/messages_zh_TW 7 | -------------------------------------------------------------------------------- /hawk/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | # Load the Rails application. 5 | require_relative 'application' 6 | 7 | # Initialize the Rails application. 8 | Rails.application.initialize! 9 | -------------------------------------------------------------------------------- /hawk/test/unit/acl_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class AclTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/cib_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class CibTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/tag_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class TagTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /e2e_test/.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | dist: focal 4 | 5 | python: 6 | - "3.6" 7 | - "3.7" 8 | - "3.8" 9 | - "3.9" 10 | 11 | install: 12 | - pip install -r requirements-test.txt 13 | 14 | script: 15 | - make test 16 | - make test-docker 17 | -------------------------------------------------------------------------------- /hawk/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # Copyright (c) 2009-2015 Tim Serong 3 | # See COPYING for license. 4 | 5 | APP_PATH = File.expand_path("../../config/application", __FILE__) 6 | 7 | require_relative "../config/boot" 8 | require "rails/commands" 9 | -------------------------------------------------------------------------------- /hawk/test/unit/clone_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class CloneTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/group_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class GroupTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/master_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class MasterTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/node_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class NodeTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/order_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class OrderTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/record_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class RecordTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/report_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ReportTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/role_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class RoleTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/rule_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class RuleTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/step_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class StepTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/ticket_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class TicketTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/user_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class UserTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/wizard_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class WizardTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_tab-focus.scss: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | @mixin tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /hawk/test/unit/cluster_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ClusterTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/location_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class LocationTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/profile_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ProfileTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/resource_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ResourceTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/session_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class SessionTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/template_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class TemplateTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /test/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #docker pull krig/hawkbase:latest 3 | mkdir -p .bundler-test-cache 4 | docker run -t -v "$(pwd):/hawk" -v "$(pwd)/.bundler-test-cache:/bundle" krig/hawkbase /bin/sh -c "systemctl start dbus; cd /hawk; ./test/_internal_runner.sh $(whoami) $(id -u) $(id -g)" 5 | -------------------------------------------------------------------------------- /hawk/spec/support/helpers/api.rb: -------------------------------------------------------------------------------- 1 | module Helpers 2 | module ApiHelpers 3 | def pass_fake_yaml_store 4 | fake_yaml_store = YAML.load_file(file_fixture("api_token_dummy.store")) 5 | allow(File).to receive(:open).and_return(fake_yaml_store) 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /hawk/test/unit/colocation_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ColocationTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/constraint_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ConstraintTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/crm_config_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class CrmConfigTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/primitive_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class PrimitiveTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/unit/tableless_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class TablelessTest < ActiveSupport::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_labels.scss: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | @mixin label-variant($color) { 4 | background-color: $color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken($color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_resize.scss: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | @mixin resizable($direction) { 4 | resize: $direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /hawk/test/controllers/cib_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class CibControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/nodes_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class NodesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/pages_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class PagesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/roles_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class RolesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/tags_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class TagsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/users_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class UsersControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/config/initializers/cookies_serializer.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Specify a serializer for the signed and encrypted cookie jars. 4 | # Valid options are :json, :marshal, and :hybrid. 5 | Rails.application.config.action_dispatch.cookies_serializer = :json 6 | -------------------------------------------------------------------------------- /hawk/test/controllers/checks_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ChecksControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/clones_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ClonesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/graphs_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class GraphsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/groups_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class GroupsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/masters_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class MastersControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/orders_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class OrdersControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/profiles_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ProfilesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/sessions_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class SessionsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/tickets_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class TicketsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/wizards_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class WizardsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | ENV["RAILS_ENV"] ||= "test" 5 | 6 | require File.expand_path("../../config/environment", __FILE__) 7 | require "rails/test_help" 8 | 9 | class ActiveSupport::TestCase 10 | end 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | - RAILS_ENV: test 3 | 4 | sudo: false 5 | language: ruby 6 | cache: bundler 7 | 8 | branches: 9 | except: 10 | - rails-2_3 11 | - rails-3_2 12 | 13 | rvm: 14 | - "2.4.0" 15 | 16 | gemfile: hawk/Gemfile 17 | script: sh -c 'cd hawk && ruby -- ./bin/bundle exec rspec' 18 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/de.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_de 6 | //= require jquery/locale/validate/methods_de 7 | //= require bootstrap/locale/table/messages_de_DE 8 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/nl.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_nl 6 | //= require jquery/locale/validate/methods_nl 7 | //= require bootstrap/locale/table/messages_nl_NL 8 | -------------------------------------------------------------------------------- /hawk/test/controllers/crm_config_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class CrmConfigControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/dashboards_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class DashboardsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/explorers_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ExplorersControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/locations_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class LocationsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/primitives_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class PrimitivesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/resources_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ResourcesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/templates_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class TemplatesControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_progress-bar.scss: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | @mixin progress-bar-variant($color) { 4 | background-color: $color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | @include gradient-striped; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/locale/pt_BR.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | //= require jquery/locale/validate/messages_pt_BR 6 | //= require jquery/locale/validate/methods_pt 7 | //= require bootstrap/locale/table/messages_pt_BR 8 | -------------------------------------------------------------------------------- /hawk/test/controllers/application_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ApplicationControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/colocations_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ColocationsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/test/controllers/constraints_controller_test.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | require "test_helper" 5 | 6 | class ConstraintsControllerTest < ActionController::TestCase 7 | test "the truth" do 8 | assert true 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /hawk/Rakefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | FileUtils.mkdir_p [ 5 | "tmp/pids", 6 | "tmp/sessions", 7 | "tmp/sockets", 8 | "tmp/cache" 9 | ] 10 | 11 | require ::File.expand_path("../config/application", __FILE__) 12 | Rails.application.load_tasks 13 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | // [converter] $parent hack 4 | @mixin text-emphasis-variant($parent, $color) { 5 | #{$parent} { 6 | color: $color; 7 | } 8 | a#{$parent}:hover, 9 | a#{$parent}:focus { 10 | color: darken($color, 10%); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_reset-filter.scss: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | @mixin reset-filter() { 7 | filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); 8 | } 9 | -------------------------------------------------------------------------------- /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | exclude_paths: 3 | - hawk/vendor/* 4 | - bootstrap-hawk/* 5 | - hawk/app/assets/javascripts/gettext/* 6 | engines: 7 | rubocop: 8 | enabled: true 9 | rubymotion: 10 | enabled: true 11 | bundler-audit: 12 | enabled: false 13 | eslint: 14 | enabled: true 15 | csslint: 16 | enabled: true 17 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/module/modals.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | $(function() { 5 | $('body').on('hidden.bs.modal', '.modal', function() { 6 | $(this) 7 | .removeData('bs.modal') 8 | .find('.modal-content') 9 | .empty(); 10 | }); 11 | }); 12 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_nav-divider.scss: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | @mixin nav-divider($color: #e5e5e5) { 6 | height: 1px; 7 | margin: (($line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: $color; 10 | } 11 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/_bootstrap.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | @import "bootstrap/multiselect"; 5 | @import "bootstrap/table"; 6 | @import "bootstrap/growl"; 7 | @import "bootstrap/wizard"; 8 | @import "bootstrap/fileinput"; 9 | @import "bootstrap/daterangepicker"; 10 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/crm_config/intro.md: -------------------------------------------------------------------------------- 1 | ## Cluster Configuration 2 | 3 | Global cluster options control how the cluster behaves when confronted 4 | with certain situations. 5 | 6 | ### Resource and operation defaults 7 | 8 | These are default values that apply to all configured resources, 9 | unless otherwise specified in the particular resource. 10 | -------------------------------------------------------------------------------- /hawk/config/initializers/wrap.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | ActiveSupport.on_load :action_controller do 5 | wrap_parameters format: [:json] if respond_to? :wrap_parameters 6 | end 7 | 8 | #ActiveSupport.on_load(:active_record) do 9 | # self.include_root_in_json = false 10 | #end 11 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require bootstrap/multiselect 5 | //= require bootstrap/table 6 | //= require bootstrap/growl 7 | //= require bootstrap/wizard 8 | //= require bootstrap/fileinput 9 | //= require bootstrap/daterangepicker 10 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_background-variant.scss: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | // [converter] $parent hack 4 | @mixin bg-variant($parent, $color) { 5 | #{$parent} { 6 | background-color: $color; 7 | } 8 | a#{$parent}:hover, 9 | a#{$parent}:focus { 10 | background-color: darken($color, 10%); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /hawk/app/views/nodes/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text 'server', _('Nodes'), class: 'page' %> 5 |

6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/shared/_list.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | .dl-inline { 5 | margin: 0; 6 | 7 | dt, dd { 8 | display: inline-block; 9 | margin: 0; 10 | } 11 | 12 | dt { 13 | margin: 0 5px; 14 | } 15 | } 16 | 17 | .list-group-item { 18 | padding: 8px 15px 7px 15px; 19 | } 20 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/primitive.md: -------------------------------------------------------------------------------- 1 | ### Primitive 2 | 3 | Primitive resources are the most basic type of resource. 4 | 5 | To create a primitive, define an ID and specify some parameters like 6 | class, (provider), and type. 7 | 8 | An example of a primitive resource is `ocf:heartbeat:IPaddr`, which 9 | can be used to configure a floating IP address for your cluster. 10 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_alerts.scss: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | @mixin alert-variant($background, $border, $text-color) { 4 | background-color: $background; 5 | border-color: $border; 6 | color: $text-color; 7 | 8 | hr { 9 | border-top-color: darken($border, 5%); 10 | } 11 | .alert-link { 12 | color: darken($text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /hawk/app/helpers/rule_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module RuleHelper 5 | def rule_options(selected) 6 | options_for_select( 7 | [ 8 | [_("Read"), "read"], 9 | [_("Write"), "write"], 10 | [_("Deny"), "deny"], 11 | ], 12 | selected 13 | ) 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /scripts/dev-server.json: -------------------------------------------------------------------------------- 1 | { 2 | "route": [ 3 | { 4 | "handler": "monitor", 5 | "path": "/monitor" 6 | }, 7 | { 8 | "handler": "file", 9 | "path": "/", 10 | "target": "/vagrant/hawk/public" 11 | }, 12 | { 13 | "handler": "proxy", 14 | "path": "/", 15 | "target": "unix:///vagrant/hawk/tmp/hawk.sock" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/authentication/_media.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | @media (max-width: 300px) { 5 | body { 6 | margin-bottom: 0; 7 | } 8 | 9 | #content { 10 | &.darkbar { 11 | border-radius: 0 !important; 12 | } 13 | } 14 | 15 | footer { 16 | position: relative; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /scripts/server.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "route": [ 3 | { 4 | "handler": "monitor", 5 | "path": "/monitor" 6 | }, 7 | { 8 | "handler": "file", 9 | "path": "/", 10 | "target": "@WWW_BASE@/hawk/public" 11 | }, 12 | { 13 | "handler": "proxy", 14 | "path": "/", 15 | "target": "unix://@WWW_BASE@/hawk/tmp/hawk.sock" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Ayoub Belarbi 2 | Jan Sperling 3 | Kristoffer Grönlund 4 | Lukas Krause 5 | Manuele Carlini 6 | Richa Bisht 7 | Thomas Boerger 8 | Thomas Hutterer 9 | Tim Serong 10 | Tobias D. Oestreicher 11 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/authentication.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require_self 5 | 6 | $(function() { 7 | if ($("#session_username").val() == "") { 8 | $("#session_username").focus(); 9 | } else { 10 | if ($("#session_password").val() == "") { 11 | $("#session_password").focus(); 12 | } 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /hawk/app/views/sessions/new.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for @session, url: signin_path, simple: true, bootstrap: true do |main_form| %> 2 | <%= main_form.text_field :username, placeholder: _("Username"), label: { class: 'sr-only' } %> 3 | <%= main_form.password_field :password, placeholder: _("Password"), label: { class: 'sr-only' } %> 4 | <%= main_form.submit _("Login"), class: "btn btn-primary btn-block" %> 5 | <% end %> 6 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # top-most EditorConfig file 2 | root = true 3 | 4 | # Unix-style newlines with a newline ending every file 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | # Matches multiple files with brace expansion notation 11 | # Set default charset 12 | [*.{js,rb,html,html.erb,yml,json}] 13 | charset = utf-8 14 | indent_style = space 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /hawk/app/views/shared/_modal.html.erb: -------------------------------------------------------------------------------- 1 | 6 | 11 | -------------------------------------------------------------------------------- /hawk/app/lib/tasks/brakeman.rake: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | namespace :brakeman do 5 | desc "Run Brakeman" 6 | task :run, :output_files do |t, args| 7 | require "brakeman" 8 | 9 | files = args[:output_files].split(" ") if args[:output_files] 10 | Brakeman.run app_path: ".", output_files: files, print_report: true 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /hawk/app/views/roles/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "group", _("Create Role"), class: "page" %> 5 |

6 |
7 |
8 | <%= render partial: "form", locals: { cib: @cib, role: @role } %> 9 |
10 |
11 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :role, mapping: nil } %> 12 | -------------------------------------------------------------------------------- /hawk/app/views/users/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "user", _("Create ACL Target"), class: "page" %> 5 |

6 |
7 |
8 | <%= render partial: "form", locals: { cib: @cib, user: @user } %> 9 |
10 |
11 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :user, mapping: nil } %> 12 | -------------------------------------------------------------------------------- /hawk/config/branding.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | # The main page title that gets displayed on all pages on the top bar and 5 | # within the meta information. 6 | title: 'SUSE Hawk' 7 | 8 | # The provider will get displayed on the footer of each page to show who 9 | # provides this nice project ;-) 10 | provider: 'Copyright © 2009-2025 SUSE, LLC' 11 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/methods_pt.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?\/\d\d?\/\d\d\d?\d?$/.test(a)}})}); 5 | -------------------------------------------------------------------------------- /hawk/app/controllers/api/v1/cluster_controller.rb: -------------------------------------------------------------------------------- 1 | module Api 2 | module V1 3 | class ClusterController < ApiController 4 | before_action :get_status 5 | attr_reader :current_user 6 | 7 | def index 8 | render json: @status.cluster.to_json 9 | end 10 | 11 | private 12 | 13 | def get_status 14 | @status = Status.new(@current_user) 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /hawk/config/languages.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | ar: 'العربية' 5 | cs: 'čeština' 6 | de: 'Deutsch' 7 | en_US: 'English' 8 | es: 'Español' 9 | fr: 'Français' 10 | hu: 'Magyar' 11 | it: 'Italiano' 12 | ja: '日本語' 13 | ko: 'Korean' 14 | nl: 'Nederlands' 15 | pl: 'Polski' 16 | pt_BR: 'Português' 17 | ru: 'Русский' 18 | sv: 'Svenska' 19 | zh_CN: '简体中文' 20 | zh_TW: '繁體中文' 21 | -------------------------------------------------------------------------------- /hawk/app/controllers/api/v1/status_controller.rb: -------------------------------------------------------------------------------- 1 | module Api 2 | module V1 3 | class StatusController < ApiController 4 | before_action :get_status 5 | attr_reader :current_user 6 | 7 | def index 8 | render json: @status.root.to_json 9 | end 10 | 11 | private 12 | 13 | def get_status 14 | @status = Status.new(@current_user) 15 | end 16 | 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /hawk/app/views/simulator/help.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 9 | 14 |
15 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/methods_nl.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?[\.\/\-]\d\d?[\.\/\-]\d\d\d?\d?$/.test(a)}})}); 5 | -------------------------------------------------------------------------------- /hawk/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | @mixin navbar-vertical-align($element-height) { 7 | margin-top: (($navbar-height - $element-height) / 2); 8 | margin-bottom: (($navbar-height - $element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /hawk/app/views/layouts/modal.html.erb: -------------------------------------------------------------------------------- 1 | 2 | "> 3 | 4 | 5 | <%= meta_title %> 6 | 7 | <%= current_metatags %> 8 | " rel="shortcut icon"> 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_larger.scss: -------------------------------------------------------------------------------- 1 | // Icon Sizes 2 | // ------------------------- 3 | 4 | /* makes the font 33% larger relative to the icon container */ 5 | .#{$fa-css-prefix}-lg { 6 | font-size: (4em / 3); 7 | line-height: (3em / 4); 8 | vertical-align: -15%; 9 | } 10 | .#{$fa-css-prefix}-2x { font-size: 2em; } 11 | .#{$fa-css-prefix}-3x { font-size: 3em; } 12 | .#{$fa-css-prefix}-4x { font-size: 4em; } 13 | .#{$fa-css-prefix}-5x { font-size: 5em; } 14 | -------------------------------------------------------------------------------- /hawk/app/helpers/dashboards_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module DashboardsHelper 5 | 6 | def javascript_for_clusters(clusters) 7 | clusters.map do |cluster| 8 | "dashboardAddCluster(#{cluster.to_json});" 9 | end.join("\n") 10 | end 11 | 12 | def escape_cluster_name(cluster_name) 13 | return "none" if cluster_name.blank? 14 | cluster_name.gsub(/[^0-9A-Za-z]/, '') 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /hawk/app/controllers/errors_controller.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 SUSE LLC 2 | # See COPYING for license. 3 | 4 | class ErrorsController < ActionController::Base 5 | protect_from_forgery with: :exception 6 | 7 | def not_found 8 | respond_to do |format| 9 | format.html do 10 | render :file => "#{Rails.root}/public/404.html", :layout => false, :status => :not_found 11 | end 12 | format.any do 13 | head :not_found 14 | end 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_list.scss: -------------------------------------------------------------------------------- 1 | // List Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-ul { 5 | padding-left: 0; 6 | margin-left: $fa-li-width; 7 | list-style-type: none; 8 | > li { position: relative; } 9 | } 10 | .#{$fa-css-prefix}-li { 11 | position: absolute; 12 | left: -$fa-li-width; 13 | width: $fa-li-width; 14 | top: (2em / 14); 15 | text-align: center; 16 | &.#{$fa-css-prefix}-lg { 17 | left: -$fa-li-width + (4em / 14); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /hawk/app/helpers/group_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module GroupHelper 5 | def group_children_list 6 | @cib.resources.select { |r| !r.key?(:children) }.map { |x| x[:id] }.sort { |a, b| a.natcmp(b, true) } 7 | end 8 | 9 | def group_children_for(group) 10 | ch = [] 11 | ch = ch.push(group.children).flatten if group.children 12 | group_children_list.each {|child| ch.push(child) if !ch.include? child} 13 | ch 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /hawk/config/secrets.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | development: 5 | secret_key_base: '2c5d384c7ee6cceed52e32a53f307c5cef2f0ac8f04c1d72105baf477cbbf57de047a99ba21295b454a5f29c19f17cbbebf23f18beb58a4c114bb20ec2c38076' 6 | 7 | test: 8 | secret_key_base: 'd83f4c419cbf9a7b1ea115516ab5f4735ec3df709efdbb271c6ac0f503637b1f4c80691063886a6a4314a093b7b50c87768e8ec82276bb62cc3b565cb4e46754' 9 | 10 | production: 11 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> 12 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/methods_de.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.methods,{date:function(a,b){return this.optional(b)||/^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(a)}})}); 5 | -------------------------------------------------------------------------------- /hawk/app/views/primitives/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "file-o", @title, class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "primitives/form", locals: { cib: @cib, primitive: @primitive } %> 12 |
13 |
14 | <%= render partial: "primitives/help", locals: { cib: @cib, primitive: @primitive } %> 15 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/shared/_foot.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | .footer { 5 | position: fixed; 6 | bottom: 0px; 7 | width: 250px; 8 | padding: 5px 10px 15px 20px; 9 | border-top: $footer-border; 10 | color: $white; 11 | background: $sidebar-bg; 12 | 13 | span { 14 | color: $copyright-fg; 15 | display: block; 16 | font-size: 0.9em; 17 | line-height: 1.6em; 18 | } 19 | 20 | .metadata { 21 | text-align: right; 22 | } 23 | } -------------------------------------------------------------------------------- /hawk/config/initializers/hash.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | class Hash 5 | def diff(other) 6 | (self.keys + other.keys).uniq.inject({}) do |memo, key| 7 | unless self[key] == other[key] 8 | if self[key].kind_of?(Hash) && other[key].kind_of?(Hash) 9 | memo[key] = self[key].diff(other[key]) 10 | else 11 | memo[key] = [self[key], other[key]] 12 | end 13 | end 14 | 15 | memo 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /hawk/app/views/constraints/show.html.erb: -------------------------------------------------------------------------------- 1 |
2 | 12 | 13 | 18 |
19 | -------------------------------------------------------------------------------- /hawk/app/views/shared/_helpentry.html.erb: -------------------------------------------------------------------------------- 1 |
2 |

3 | <% if values[:shortdesc] %> 4 | <%= values[:shortdesc] %> 5 | <% else %> 6 | <%= content_tag :code, key %> 7 | <% end %> 8 |

9 | <% if values[:longdesc] %> 10 | <%= simple_format values[:longdesc] %> 11 | <% end %> 12 | <% unless values[:default].blank? %> 13 | <%= content_tag :em, _("Default") %> 14 | <%= ": " %> 15 | <%= content_tag :code, sanitize(values[:default].to_s) %> 16 | <% end %> 17 |
18 | -------------------------------------------------------------------------------- /hawk/config/initializers/assets.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | Rails.application.config.tap do |config| 5 | config.assets.version = "1.0" 6 | 7 | config.assets.precompile = %w( manifest.js ) 8 | config.assets.precompile << [ 9 | "gettext.css", "gettext.js", 10 | "application.css","application.js", 11 | "authentication.css", "authentication.js", 12 | "dashboard.css", "dashboard.js", 13 | "ie.css", "ie.js", 14 | "vendor.css", "vendor.js" 15 | ] 16 | end 17 | -------------------------------------------------------------------------------- /hawk/app/views/shared/_flash.html.erb: -------------------------------------------------------------------------------- 1 |
2 | <% flash.each do |name, message| %> 3 | 14 | <% end %> 15 |
16 | -------------------------------------------------------------------------------- /hawk/app/views/tags/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Create Tag"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, tag: @tag } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :tag, mapping: @tag.help_text.merge(@tag.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/master.md: -------------------------------------------------------------------------------- 1 | ### Promotable Resource 2 | 3 | Promotable resources are a specialization of clones. They allow the 4 | instances to be in one of two operating modes. When first starting up, 5 | the resource is considered `promotable`. A subset of instances can 6 | subsequently be `promoted`. 7 | 8 | To create a promotable resource, define an ID and select the child 9 | resource that you want to use for the promotable resource. 10 | 11 | An example of a promotable resource is `ocf:linbit:drbd` for the 12 | configuration of DRBD. 13 | -------------------------------------------------------------------------------- /hawk/config/initializers/session.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | Rails.application.config.tap do |config| 5 | config.session_store( 6 | :cookie_store, 7 | key: Rails.env == "production" ? "hawk" : "hawk-development", 8 | 9 | # Allow session cookie to persist for a (somewhat arbitrary) ten days. 10 | # This means when using the dashboard you won"t be required to log in 11 | # to all your clusters all the time. 12 | expire_after: 60 * 60 * 24 * 10 13 | ) 14 | end 15 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_core.scss: -------------------------------------------------------------------------------- 1 | // Base Class Definition 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix} { 5 | display: inline-block; 6 | font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration 7 | font-size: inherit; // can't have font-size inherit on line above, so need to override 8 | text-rendering: auto; // optimizelegibility throws things off #1094 9 | -webkit-font-smoothing: antialiased; 10 | -moz-osx-font-smoothing: grayscale; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/font-awesome.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome 3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) 4 | */ 5 | 6 | @import "variables"; 7 | @import "mixins"; 8 | @import "path"; 9 | @import "core"; 10 | @import "larger"; 11 | @import "fixed-width"; 12 | @import "list"; 13 | @import "bordered-pulled"; 14 | @import "animated"; 15 | @import "rotated-flipped"; 16 | @import "stacked"; 17 | @import "icons"; 18 | @import "screen-reader"; 19 | -------------------------------------------------------------------------------- /hawk/app/views/nodes/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "server", _("Edit Node"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, node: @node } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :node, mapping: @node.help_text.merge(@node.mapping) } %> 15 | -------------------------------------------------------------------------------- /tools/common.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011-2013 SUSE LLC, All Rights Reserved. 3 | * See COPYING for license. 4 | * 5 | * Author: Tim Serong 6 | * 7 | */ 8 | 9 | #ifndef _HAWK_DEFS_H 10 | #define _HAWK_DEFS_H 11 | 12 | const char * const VAGRANT = "vagrant"; 13 | const char * const HACLUSTER = "hacluster"; 14 | const char * const HACLIENT = "haclient"; 15 | 16 | #define LIBDIR "@LIBDIR@" 17 | #define BINDIR "@BINDIR@" 18 | #define SBINDIR "@SBINDIR@" 19 | 20 | #define WITHIN_VAGRANT @WITHIN_VAGRANT@ 21 | 22 | #endif /* HAWK_DEFS_H */ 23 | -------------------------------------------------------------------------------- /hawk/app/helpers/clone_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module CloneHelper 5 | def clone_child_list 6 | @cib.resources.select do |r| 7 | !r.key?(:children) || (r.key?(:children) && r[:type] == "group") 8 | end.map{|x| x[:id]}.sort do |a, b| 9 | a.natcmp(b, true) 10 | end 11 | end 12 | 13 | def clone_child_for(clone) 14 | if clone.child 15 | clone_child_list.push(clone.child).sort 16 | else 17 | clone_child_list.sort 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /hawk/app/views/alerts/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Create Alert"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, alert: @alert } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :alert, mapping: @alert.help_text.merge(@alert.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/app/views/clones/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Create Clone"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, clone: @clone } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :clone, mapping: @clone.help_text.merge(@clone.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/app/views/groups/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "group", _("Create Group"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, group: @group } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :group, mapping: @group.help_text.merge(@group.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/app/helpers/order_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module OrderHelper 5 | def available_order_actions 6 | { 7 | "start" => _("Start"), 8 | "promote" => _("Promote"), 9 | "demote" => _("Demote"), 10 | "stop" => _("Stop") 11 | } 12 | end 13 | 14 | def available_order_resources 15 | [ 16 | @cib.resources.map{|x| x[:id]}, 17 | @cib.templates.map{|x| x[:id]} 18 | ].flatten.sort do |a, b| 19 | a.natcmp(b, true) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap-sprockets.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require ./bootstrap/affix 5 | //= require ./bootstrap/alert 6 | //= require ./bootstrap/button 7 | //= require ./bootstrap/carousel 8 | //= require ./bootstrap/collapse 9 | //= require ./bootstrap/dropdown 10 | //= require ./bootstrap/tab 11 | //= require ./bootstrap/transition 12 | //= require ./bootstrap/scrollspy 13 | //= require ./bootstrap/modal 14 | //= require ./bootstrap/tooltip 15 | //= require ./bootstrap/popover 16 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/vendor.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | @import "jquery/jquery"; 5 | @import "jquery/rails"; 6 | @import "jquery/validate"; 7 | @import "jquery/matchheight"; 8 | @import "jquery/stickytabs"; 9 | @import "jquery/jsviews"; 10 | @import "jquery/sortable"; 11 | @import "jquery/blockui"; 12 | @import "misc/moment"; 13 | @import "bootstrap-sprockets"; 14 | @import "bootstrap"; 15 | @import "font-awesome/font-awesome"; 16 | @import "misc/highlight"; 17 | @import "misc/eventcontrol"; 18 | -------------------------------------------------------------------------------- /hawk/app/helpers/master_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module MasterHelper 5 | def master_child_list 6 | @cib.resources.select do |r| 7 | !r.key?(:children) || (r.key?(:children) && r[:type] == "group") 8 | end.map{|x| x[:id]}.sort do |a, b| 9 | a.natcmp(b, true) 10 | end 11 | end 12 | 13 | def master_child_for(master) 14 | if master.child 15 | master_child_list.push(master.child).sort 16 | else 17 | master_child_list.sort 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /hawk/app/views/tickets/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "ticket", _("Create Ticket"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, ticket: @ticket } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :ticket, mapping: @ticket.help_text.merge(@ticket.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/module/help.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | $(function() { 5 | $('[data-help-target]').each(function() { 6 | $( 7 | $(this).data('help-target') 8 | ).hide(); 9 | }); 10 | 11 | $( 12 | document 13 | ).on('mouseenter', '[data-help-filter]', function() { 14 | $target = $($(this).parents('[data-help-target]').data('help-target')); 15 | 16 | $target 17 | .hide() 18 | .filter($(this).attr('data-help-filter')) 19 | .show(); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /hawk/app/views/orders/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "sort-amount-desc", _("Create Order"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, order: @order } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :order, mapping: @order.help_text.merge(@order.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/spec/models/profile_spec.rb: -------------------------------------------------------------------------------- 1 | require "rails_helper" 2 | 3 | RSpec.describe Profile, :type => :model do 4 | context "default language" do 5 | it "is I18n.locale by default" do 6 | profile = Profile.new 7 | expect(profile.language).to eq(I18n.locale.to_s.dasherize) 8 | end 9 | it "has stonith warning enabled" do 10 | profile = Profile.new 11 | expect(profile.stonithwarning).to eq(true) 12 | end 13 | it "is valid by default" do 14 | profile = Profile.new 15 | expect(profile.valid?).to eq(true) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/tag.md: -------------------------------------------------------------------------------- 1 | ### Tag 2 | 3 | Tags are a way to refer to multiple resources at once, without 4 | creating any colocation or ordering relationship between them. You can 5 | use tags for grouping conceptually related resources. All resources 6 | belonging to a tag can then be started or stopped with a single 7 | command. 8 | 9 | To create a tag, define an ID and select the objects that you want to 10 | refer to with the tag. 11 | 12 | For example, if you have several resources related to a database, you 13 | can add all related resources to a tag named `database`. 14 | -------------------------------------------------------------------------------- /hawk/app/views/locations/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "globe", _("Create Location"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, location: @location } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :location, mapping: @location.help_text.merge(@location.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/app/views/masters/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "superscript", _("Create Promotable Resource"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, master: @master } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :master, mapping: @master.help_text.merge(@master.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/config/initializers/cors.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Avoid CORS issues when API is called from the frontend app. 4 | # Handle Cross-Origin Resource Sharing (CORS) in order to accept cross-origin AJAX requests. 5 | 6 | # Read more: https://github.com/cyu/rack-cors 7 | 8 | # Rails.application.config.middleware.insert_before 0, Rack::Cors do 9 | # allow do 10 | # origins 'example.com' 11 | # 12 | # resource '*', 13 | # headers: :any, 14 | # methods: [:get, :post, :put, :patch, :delete, :options, :head] 15 | # end 16 | # end 17 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/constraints/location.md: -------------------------------------------------------------------------------- 1 | ### Location 2 | 3 | A location constraint defines on which node a resource may be run, is 4 | preferred to be run, or may not be run. 5 | 6 | To create a location constraint, specify an ID, select the resource 7 | for which to define the constraint, a score and node. The score 8 | indicates the value you are assigning to this resource 9 | constraint. Constraints with higher scores are applied before those 10 | with lower scores. 11 | 12 | An example of a location constraint is to place all resources related 13 | to a certain database on the same node. 14 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/clone.md: -------------------------------------------------------------------------------- 1 | ### Clone 2 | 3 | Clones are resources that can run simultaneously on multiple nodes in 4 | your cluster. 5 | 6 | To create a clone, define an ID and select the child resource that you 7 | want to use as clone. Any regular resources or resource groups can be 8 | cloned. Instances of cloned resources may behave identically. However, 9 | they may also be configured differently, depending on which node they 10 | are hosted. 11 | 12 | An example of a resource that can be configured as clone is 13 | `ocf:pacemaker:controld` for cluster file systems like OCFS2. 14 | -------------------------------------------------------------------------------- /hawk/spec/lib/util_spec.rb: -------------------------------------------------------------------------------- 1 | require "rails_helper" 2 | 3 | unless ENV["TRAVIS"] 4 | describe Util, :cluster_env do 5 | describe "#acl_enable?" do 6 | 7 | before do 8 | value = true 9 | Util.safe_x('/usr/sbin/cibadmin', '--modify', '--xml-text', %Q[]) 10 | end 11 | 12 | context "given that enable-acl property is set to true" do 13 | it "returns true" do 14 | expect(Util.acl_enabled?).to be true 15 | end 16 | end 17 | 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /hawk/app/helpers/colocation_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module ColocationHelper 5 | def available_colocation_roles 6 | { 7 | "Started" => _("Started"), 8 | "Master" => _("Promoted"), 9 | "Slave" => _("Promotable"), 10 | "Stopped" => _("Stopped") 11 | } 12 | end 13 | 14 | def available_colocation_resources 15 | [ 16 | @cib.resources.map{|x| x[:id]}, 17 | @cib.templates.map{|x| x[:id]} 18 | ].flatten.sort do |a, b| 19 | a.natcmp(b, true) 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /hawk/app/views/colocations/new.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "tasks", _("Create Colocation"), class: "page" %> 5 |
6 |
7 |
8 |

9 |
10 |
11 | <%= render partial: "form", locals: { cib: @cib, colocation: @colocation } %> 12 |
13 |
14 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :colocation, mapping: @colocation.help_text.merge(@colocation.mapping) } %> 15 | -------------------------------------------------------------------------------- /hawk/app/views/shared/_helpsidebar.html.erb: -------------------------------------------------------------------------------- 1 | <% content_for :rightbar do %> 2 |
3 |
4 | <% unless category.nil? || help.nil? %> 5 | <%= localized_help_for category, help %> 6 | <% end %> 7 |
8 |
9 | <% unless mapping.nil? %> 10 | <% mapping.each do |key, values| %> 11 | <%= render partial: "shared/helpentry", locals: { key: key, values: values } %> 12 | <% end %> 13 | <% end %> 14 |
15 |
16 | <% end %> 17 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_reset-text.scss: -------------------------------------------------------------------------------- 1 | @mixin reset-text() { 2 | font-family: $font-family-base; 3 | // We deliberately do NOT reset font-size. 4 | font-style: normal; 5 | font-weight: normal; 6 | letter-spacing: normal; 7 | line-break: auto; 8 | line-height: $line-height-base; 9 | text-align: left; // Fallback for where `start` is not supported 10 | text-align: start; 11 | text-decoration: none; 12 | text-shadow: none; 13 | text-transform: none; 14 | white-space: normal; 15 | word-break: normal; 16 | word-spacing: normal; 17 | word-wrap: normal; 18 | } 19 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/authentication.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | @import "bootstrap/variables"; 5 | @import "bootstrap/mixins"; 6 | 7 | @import "theme"; 8 | 9 | @import "shared/form"; 10 | @import "shared/circle"; 11 | @import "shared/list"; 12 | @import "shared/nav"; 13 | @import "shared/misc"; 14 | @import "shared/table"; 15 | @import "shared/panel"; 16 | @import "shared/foot"; 17 | 18 | @import "authentication/foot"; 19 | @import "authentication/basics"; 20 | @import "authentication/content"; 21 | @import "authentication/media"; 22 | -------------------------------------------------------------------------------- /hawk/app/helpers/crm_config_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module CrmConfigHelper 5 | def crm_config_revert_button(form, role) 6 | form.submit( 7 | _("Revert"), 8 | class: "btn btn-default cancel revert", 9 | name: "revert", 10 | confirm: _("Any changes will be lost - do you wish to proceed?") 11 | ) 12 | end 13 | 14 | def crm_config_apply_button(form, role) 15 | form.submit( 16 | _("Apply"), 17 | class: "btn btn-primary submit", 18 | name: "submit" 19 | ) 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /hawk/app/controllers/api/v1/nodes_controller.rb: -------------------------------------------------------------------------------- 1 | module Api 2 | module V1 3 | class NodesController < ApiController 4 | before_action :get_status 5 | attr_reader :current_user 6 | 7 | def index 8 | render json: @status.nodes.to_json 9 | end 10 | 11 | def show 12 | @status.nodes.each do |node_inst| 13 | render json: node_inst.to_json if params[:id] == node_inst.id 14 | end 15 | end 16 | 17 | private 18 | 19 | def get_status 20 | @status = Status.new(@current_user) 21 | end 22 | 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_stacked.scss: -------------------------------------------------------------------------------- 1 | // Stacked Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-stack { 5 | position: relative; 6 | display: inline-block; 7 | width: 2em; 8 | height: 2em; 9 | line-height: 2em; 10 | vertical-align: middle; 11 | } 12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { 13 | position: absolute; 14 | left: 0; 15 | width: 100%; 16 | text-align: center; 17 | } 18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; } 19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; } 20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; } 21 | -------------------------------------------------------------------------------- /hawk/app/controllers/api/v1/resources_controller.rb: -------------------------------------------------------------------------------- 1 | module Api 2 | module V1 3 | class ResourcesController < ApiController 4 | before_action :get_status 5 | attr_reader :current_user 6 | 7 | def index 8 | render json: @status.resources.to_json 9 | end 10 | 11 | def show 12 | @status.resources.each do |res_inst| 13 | render json: res_inst.to_json if params[:id] == res_inst.id 14 | end 15 | end 16 | 17 | private 18 | 19 | def get_status 20 | @status = Status.new(@current_user) 21 | end 22 | 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_border-radius.scss: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | @mixin border-top-radius($radius) { 4 | border-top-right-radius: $radius; 5 | border-top-left-radius: $radius; 6 | } 7 | @mixin border-right-radius($radius) { 8 | border-bottom-right-radius: $radius; 9 | border-top-right-radius: $radius; 10 | } 11 | @mixin border-bottom-radius($radius) { 12 | border-bottom-right-radius: $radius; 13 | border-bottom-left-radius: $radius; 14 | } 15 | @mixin border-left-radius($radius) { 16 | border-bottom-left-radius: $radius; 17 | border-top-left-radius: $radius; 18 | } 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.orig 2 | *.rej 3 | *.swp 4 | *.bak 5 | *~ 6 | *.o 7 | *.tmp 8 | *.mo 9 | *.src.rpm 10 | #*.*# 11 | .#* 12 | hawk*.tar.bz2 13 | .vagrant 14 | *.vdi 15 | 16 | # ./scripts 17 | scripts/hawk.suse 18 | scripts/hawk.redhat 19 | 20 | # ./tools 21 | tools/hawk_chkpwd 22 | tools/hawk_monitor 23 | tools/hawk_invoke 24 | tools/common.h 25 | 26 | # ./hawk (bundler config and Gemfile.lock) 27 | hawk/.bundle 28 | hawk/Gemfile.lock 29 | hawk/Gemfile.local 30 | hawk/.ruby-version 31 | 32 | # cache for bundler in test container 33 | .bundler-test-cache 34 | 35 | 36 | hawk/api_token_entries.store 37 | 38 | hawk/.byebug_history 39 | 40 | -------------------------------------------------------------------------------- /.javascript-style.json: -------------------------------------------------------------------------------- 1 | { 2 | "asi": false, 3 | "bitwise": true, 4 | "browser": true, 5 | "camelcase": false, 6 | "curly": true, 7 | "forin": true, 8 | "immed": true, 9 | "latedef": "nofunc", 10 | "maxlen": 1024, 11 | "newcap": true, 12 | "noarg": true, 13 | "noempty": true, 14 | "nonew": true, 15 | "predef": [ 16 | "$", 17 | "jQuery", 18 | "jasmine", 19 | "beforeEach", 20 | "describe", 21 | "expect", 22 | "it", 23 | "angular", 24 | "inject", 25 | "module" 26 | ], 27 | "quotmark": false, 28 | "trailing": true, 29 | "undef": true, 30 | "unused": true 31 | } 32 | 33 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/application.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | @import "bootstrap/variables"; 5 | @import "bootstrap/mixins"; 6 | 7 | @import "theme"; 8 | 9 | @import "shared/form"; 10 | @import "shared/circle"; 11 | @import "shared/list"; 12 | @import "shared/nav"; 13 | @import "shared/misc"; 14 | @import "shared/table"; 15 | @import "shared/panel"; 16 | @import "shared/simulator"; 17 | @import "shared/foot"; 18 | 19 | @import "application/basics"; 20 | @import "application/head"; 21 | @import "application/content"; 22 | @import "application/media"; 23 | 24 | @import "dashboard"; 25 | -------------------------------------------------------------------------------- /hawk/app/controllers/commands_controller.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 Kristoffer Gronlund 2 | # See COPYING for license. 3 | 4 | class CommandsController < ApplicationController 5 | before_action :login_required 6 | before_action :set_title 7 | before_action :set_cib 8 | 9 | def index 10 | @cmds = CrmEvents.instance.cmds 11 | respond_to do |format| 12 | format.html 13 | format.json do 14 | render json: @cmds 15 | end 16 | end 17 | end 18 | 19 | protected 20 | 21 | def set_title 22 | @title = _("Command Log") 23 | end 24 | 25 | def set_cib 26 | @cib = current_cib 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/group.md: -------------------------------------------------------------------------------- 1 | ### Group 2 | 3 | Resource groups contain a set of resources that need to be located 4 | together, be started sequentially and stopped in the reverse order. 5 | 6 | To create a group, define an ID and select the resources that will be 7 | members of the group. 8 | 9 | An example for use of a group is a Web server that requires an IP 10 | address and a file system. Configure IP address and file system as 11 | separate resources and combine them into a cluster resource group. In 12 | case of a software or hardware malfunction, the group will fail over 13 | to another cluster node, similar to an individual cluster resource. 14 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_pagination.scss: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | @mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: $padding-vertical $padding-horizontal; 8 | font-size: $font-size; 9 | line-height: $line-height; 10 | } 11 | &:first-child { 12 | > a, 13 | > span { 14 | @include border-left-radius($border-radius); 15 | } 16 | } 17 | &:last-child { 18 | > a, 19 | > span { 20 | @include border-right-radius($border-radius); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /hawk/app/models/recipient.rb: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | # Copyright (c) 2016 Kristoffer Gronlund 3 | # See COPYING for license. 4 | require 'invoker' 5 | 6 | class Recipient < Tableless 7 | attribute :id, String 8 | attribute :value, String 9 | attribute :params, Hash 10 | attribute :meta, Hash 11 | 12 | validates :id, 13 | presence: { message: _("ID is required") }, 14 | format: { with: /\A[a-zA-Z0-9_-]+\z/, message: _("Invalid ID") } 15 | 16 | validates :value, presence: { message: _("Recipient path is required") } 17 | 18 | def params 19 | @params ||= {} 20 | end 21 | 22 | def meta 23 | @meta ||= {} 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | // [converter] $parent hack 6 | @mixin responsive-visibility($parent) { 7 | #{$parent} { 8 | display: block !important; 9 | } 10 | table#{$parent} { display: table !important; } 11 | tr#{$parent} { display: table-row !important; } 12 | th#{$parent}, 13 | td#{$parent} { display: table-cell !important; } 14 | } 15 | 16 | // [converter] $parent hack 17 | @mixin responsive-invisibility($parent) { 18 | #{$parent} { 19 | display: none !important; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/intro.md: -------------------------------------------------------------------------------- 1 | ## Resources 2 | 3 | For every service or application that you want to be highly available, 4 | configure a cluster resource. Cluster resources can include Web 5 | sites, e-mail servers, databases, file systems, virtual machines, and 6 | any other server-based applications or services. 7 | 8 | Before configuring and starting a cluster resource, set up the service 9 | or application first. For example, set up an Apache server and 10 | complete its configuration before configuring a resource for it. If a 11 | service or application has specific environment requirements, make 12 | sure they are present and identical on all cluster nodes. 13 | -------------------------------------------------------------------------------- /hawk/app/views/tags/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Tags"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_tag_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :tag, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_nl_NL.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["nl-NL"]={formatLoadingMessage:function(){return"Laden, even geduld..."},formatRecordsPerPage:function(a){return a+" records per pagina"},formatShowingRows:function(a,b,c){return"Toon "+a+" tot "+b+" van "+c+" records"},formatSearch:function(){return"Zoeken"},formatNoMatches:function(){return"Geen resultaten gevonden"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["nl-NL"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/vendor.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | //= require jquery/jquery 5 | //= require jquery/rails 6 | //= require jquery/validate 7 | //= require jquery/matchheight 8 | //= require jquery/stickytabs 9 | //= require jquery/jsviews 10 | //= require jquery/sortable 11 | //= require jquery/blockui 12 | //= require jquery/mousewheel 13 | //= require misc/moment 14 | //= require bootstrap-sprockets 15 | //= require bootstrap 16 | //= require font-awesome/font-awesome 17 | //= require misc/highlight 18 | //= require misc/cookie 19 | //= require misc/eventcontrol 20 | 21 | //= require js-routes 22 | -------------------------------------------------------------------------------- /doc/release.md: -------------------------------------------------------------------------------- 1 | # Release 2 | 3 | # Release Github Branches: 4 | 5 | Actively maintained are: 6 | 7 | - SLE15 and higher -> `master` 8 | 9 | - SLE12 -> `sles12-sp3 and sp4` github branches 10 | 11 | - Factory -> opensuse Tubleweed 12 | 13 | # Note on sle15 and sles12 branches: 14 | 15 | sle15 and sle12 have completely different design and also, the ruby supported is quite different 16 | 17 | 18 | ### Packaging Notes 19 | 20 | For anyone looking to package Hawk for distributions, the best approach is probably to look at the RPM packaging at the SUSE Open Build Service and begin from there: 21 | 22 | * https://build.opensuse.org/package/show/network:ha-clustering:Factory/hawk2 23 | -------------------------------------------------------------------------------- /hawk/app/views/shared/_header.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | <%= meta_title %> 4 | 5 | <%= current_metatags %> 6 | <%= favicon_link_tag "favicon.png" %> 7 | <%= stylesheet_link_tag "vendor" %> 8 | <%= stylesheet_link_tag "gettext" %> 9 | <%= stylesheet_link_tag "application" %> 10 | <%= yield :stylesheets %> 11 | <%= javascript_include_tag "vendor" %> 12 | <%= javascript_include_tag "gettext" %> 13 | <%= javascript_include_tag "application" %> 14 | <%= javascript_include_tag localized_js %> 15 | <%= yield :javascripts %> 16 | 20 | 21 | -------------------------------------------------------------------------------- /test/_internal_runner.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "**** Creating user / group ****" 4 | oname=$1 5 | ouid=$2 6 | ogid=$3 7 | awk '{ FS = ":" } { print $3 }' < /etc/group | grep -q $ogid || groupadd -g $ogid 8 | id -u $oname >/dev/null 2>&1 || useradd -u $ouid -g $ogid $oname 9 | mkdir -p /home/$oname 10 | chown -R $oname /home/$oname 11 | 12 | export BUNDLE_JOBS=2 13 | export BUNDLE_PATH=/bundle 14 | export RAILS_ENV=test 15 | 16 | echo "**** Install ruby dependencies ****" 17 | cd /hawk/hawk || exit 18 | bundle.ruby2.5 config --global silence_root_warning 1 19 | bundle.ruby2.5 install 20 | 21 | 22 | echo "**** Run tests ****" 23 | su $oname -c "ruby.ruby2.5 -- ./bin/bundle exec rspec" 24 | -------------------------------------------------------------------------------- /hawk/app/views/alerts/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Alerts"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_alert_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :alert, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/clones/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Clones"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_clone_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :clone, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/groups/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "group", _("Groups"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_group_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :group, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/tickets/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "ticket", _("Tickets"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_ticket_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :ticket, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_panels.scss: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | @mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) { 4 | border-color: $border; 5 | 6 | & > .panel-heading { 7 | color: $heading-text-color; 8 | background-color: $heading-bg-color; 9 | border-color: $heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: $border; 13 | } 14 | .badge { 15 | color: $heading-bg-color; 16 | background-color: $heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: $border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /scripts/hawk-backend.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=HA Web Konsole Backend 3 | After=network.target 4 | StopWhenUnneeded=true 5 | 6 | [Service] 7 | Type=simple 8 | KillMode=control-group 9 | TimeoutSec=300 10 | TimeoutStopSec=10 11 | User=hacluster 12 | Group=haclient 13 | WorkingDirectory=@WWW_BASE@/hawk 14 | Environment="HAWK_ENV=production" 15 | Environment="HAWK_BIND=unix://@WWW_BASE@/hawk/tmp/hawk.sock" 16 | EnvironmentFile=-/etc/sysconfig/hawk 17 | ExecStart=/usr/bin/puma@RUBY_SUFFIX@ -C @WWW_BASE@/hawk/config/puma.rb 18 | ExecStop=/usr/bin/pumactl@RUBY_SUFFIX@ -S @WWW_BASE@/hawk/tmp/pids/puma.state stop 19 | ExecReload=/usr/bin/pumactl@RUBY_SUFFIX@ -S @WWW_BASE@/hawk/tmp/pids/puma.state restart 20 | -------------------------------------------------------------------------------- /hawk/app/views/orders/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "sort-amount-desc", _("Orders"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_order_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :order, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/resources/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "code", _("Resources"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), types_cib_resources_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :intro, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_wells.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: $well-bg; 12 | border: 1px solid $well-border; 13 | border-radius: $border-radius-base; 14 | @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: $border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: $border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /hawk/app/views/fencing/_table.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <% fencing_topology.each do |level| %> 8 | 9 | <% if level[:type] == "node" %> 10 | 11 | <% elsif level[:type] == "pattern" %> 12 | 13 | <% else %> 14 | 15 | <% end %> 16 | 17 | 18 | 19 | <% end %> 20 |
<%= _("Target") %><%= _("Index") %><%= _("Devices") %>
<%= level[:target] %><%= level[:target] %><%= level[:target] %>=<%= level[:value] %><%= level[:index] %><%= level[:devices].join(",") %>
21 | -------------------------------------------------------------------------------- /hawk/app/views/locations/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "globe", _("Locations"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_location_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :location, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/constraints/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "eye", _("Constraints"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), types_cib_constraints_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :intro, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/masters/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "superscript", _("Promotable Resources"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_master_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :master, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /scripts/hawk.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=HA Web Konsole 3 | Wants=hawk-backend.service 4 | After=network.target hawk-backend.service 5 | PropagatesReloadTo=hawk-backend.service 6 | 7 | [Service] 8 | Type=simple 9 | User=hacluster 10 | Group=haclient 11 | WorkingDirectory=@WWW_BASE@/hawk 12 | Restart=always 13 | RestartSec=5 14 | Environment="HAWK_ENV=production" 15 | EnvironmentFile=-/etc/sysconfig/hawk 16 | 17 | # Run ExecStartPre with root-permissions 18 | PermissionsStartOnly=true 19 | ExecStartPre=@WWW_BASE@/hawk/bin/generate-ssl-cert 20 | ExecStart=/usr/sbin/hawk-apiserver -key ${HAWK_KEY} -cert ${HAWK_CERT} -port ${HAWK_PORT} -config /etc/hawk/server.json 21 | 22 | [Install] 23 | WantedBy=multi-user.target 24 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_es_AR.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["es-AR"]={formatLoadingMessage:function(){return"Cargando, espere por favor..."},formatRecordsPerPage:function(a){return a+" registros por página"},formatShowingRows:function(a,b,c){return"Mostrando "+a+" a "+b+" de "+c+" filas"},formatSearch:function(){return"Buscar"},formatNoMatches:function(){return"No se encontraron registros"},formatAllRows:function(){return"Todo"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["es-AR"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_hide-text.scss: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | @mixin hide-text() { 11 | font: 0/0 a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | @mixin text-hide() { 20 | @include hide-text; 21 | } 22 | -------------------------------------------------------------------------------- /hawk/app/views/fencing/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "plug", _("Fencing Topology"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("pencil", _("Edit")), cib_fencing_edit_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 | <%= render partial: "fencing/table", locals: { fencing_topology: @fencing_topology } %> 15 |
16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :fencing, mapping: nil } %> 19 | -------------------------------------------------------------------------------- /test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM krig/crmsh:latest 2 | MAINTAINER Kristoffer Gronlund version: 0.1 3 | 4 | ENV container docker 5 | 6 | VOLUME [ "/sys/fs/cgroup" ] 7 | 8 | RUN zypper -n --no-gpg-checks ar obs://network:ha-clustering:BuildDep/openSUSE_Leap_42.3 network:ha-clustering:BuildDep 9 | 10 | RUN zypper -n --no-gpg-checks ref 11 | 12 | RUN zypper -n --no-gpg-checks in ruby2.5-devel ruby2.5-rubygem-bundler libxml2-devel libxslt-devel gcc make patch nodejs6 13 | 14 | RUN zypper -n --no-gpg-checks in ruby2.5-rubygem-puma ruby2.5-rubygem-virtus ruby2.5-rubygem-fast_gettext ruby2.5-rubygem-sprockets ruby2.5-rubygem-kramdown ruby2.5-rubygem-uglifier ruby2.5-rubygem-gettext ruby2.5-rubygem-nokogiri 15 | 16 | CMD ["/usr/lib/systemd/systemd", "--system"] 17 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_bordered-pulled.scss: -------------------------------------------------------------------------------- 1 | // Bordered & Pulled 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-border { 5 | padding: .2em .25em .15em; 6 | border: solid .08em $fa-border-color; 7 | border-radius: .1em; 8 | } 9 | 10 | .#{$fa-css-prefix}-pull-left { float: left; } 11 | .#{$fa-css-prefix}-pull-right { float: right; } 12 | 13 | .#{$fa-css-prefix} { 14 | &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } 15 | &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } 16 | } 17 | 18 | /* Deprecated as of 4.4.0 */ 19 | .pull-right { float: right; } 20 | .pull-left { float: left; } 21 | 22 | .#{$fa-css-prefix} { 23 | &.pull-left { margin-right: .3em; } 24 | &.pull-right { margin-left: .3em; } 25 | } 26 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_breadcrumbs.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: $breadcrumb-padding-vertical $breadcrumb-padding-horizontal; 8 | margin-bottom: $line-height-computed; 9 | list-style: none; 10 | background-color: $breadcrumb-bg; 11 | border-radius: $border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "#{$breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: $breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: $breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_responsive-embed.scss: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_clearfix.scss: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | @mixin clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /hawk/app/views/roles/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "group", _("Edit Role"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("trash", _("Delete")), cib_role_path(cib_id: @cib.id, id: @role.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @role.id } %> 8 |
9 |
10 |

11 |
12 |
13 | <%= render partial: "form", locals: { cib: @cib, role: @role } %> 14 |
15 |
16 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :role, mapping: nil } %> 17 | -------------------------------------------------------------------------------- /hawk/app/views/roles/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "group", _("Roles"), class: "page" %> 5 | 6 | <%= _("Access Control Lists") %> 7 | 8 |
9 |
10 | <%= link_to icon_text("plus", _("Create")), new_cib_role_path, class: "btn btn-default" %> 11 |
12 |
13 |

14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :role, mapping: nil } %> 22 | -------------------------------------------------------------------------------- /hawk/app/views/users/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "user", _("Edit ACL Target"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("trash", _("Delete")), cib_user_path(cib_id: @cib.id, id: @user.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @user.id } %> 8 |
9 |
10 |

11 |
12 |
13 | <%= render partial: "form", locals: { cib: @cib, user: @user } %> 14 |
15 |
16 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :user, mapping: nil } %> 17 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_ko_KR.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ko-KR"]={formatLoadingMessage:function(){return"데이터를 불러오는 중입니다..."},formatRecordsPerPage:function(a){return"페이지 당 "+a+"개 데이터 출력"},formatShowingRows:function(a,b,c){return"전체 "+c+"개 중 "+a+"~"+b+"번째 데이터 출력,"},formatSearch:function(){return"검색"},formatNoMatches:function(){return"조회된 데이터가 없습니다."},formatRefresh:function(){return"새로 고침"},formatToggle:function(){return"전환"},formatColumns:function(){return"컬럼 필터링"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ko-KR"])}(jQuery); -------------------------------------------------------------------------------- /doc/design.md: -------------------------------------------------------------------------------- 1 | # Design 2 | 3 | ## API 4 | 5 | Hawk is being restructured to provide a cleaner separation between the 6 | frontend and the backend. As a first step towards this goal, Hawk now 7 | uses its own small API proxy daemon as a web server, which is 8 | maintained as a separate project: 9 | 10 | * [API Server Repository](https://github.com/krig/hawk-apiserver) 11 | 12 | 13 | ## A Note on SSL Certificates 14 | 15 | The Hawk init script will automatically generate a self-signed SSL 16 | certificate, in `/etc/hawk/hawk.pem`. If you want 17 | to use your own certificate, replace `hawk.key` and `hawk.pem` with 18 | your certificate. For browsers to accept this certificate, the node running Hawk will need to be accessed via the domain name specified in the certificate. 19 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/user.md: -------------------------------------------------------------------------------- 1 | ### ACL Target 2 | 3 | Access control lists (ACLs) consist of an ordered set of access rules. Those can be combined into specific roles (for individual tasks like monitoring the cluster). Afterwards, assign users to a role that matches their tasks. 4 | 5 | - ACLs are an optional feature. 6 | 7 | - If ACLs are not enabled, `root` and all users of the `haclient` group have full read/write access to the cluster configuration. 8 | 9 | - Even if ACLs are enabled and configured, both `root` and the default CRM owner `hacluster` always have full access to the cluster configuration. 10 | 11 | #### Create User/ACL Target 12 | 13 | **ACL Target ID**: Define a unique ID. 14 | 15 | **Roles**: Select one or multiple roles to assign to the user. 16 | 17 | -------------------------------------------------------------------------------- /hawk/app/views/users/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "user", _("Targets"), class: "page" %> 5 | 6 | <%= _("Access Control Lists") %> 7 | 8 |
9 |
10 | <%= link_to icon_text("plus", _("Create")), new_cib_user_path(cib_id: @cib.id), class: "btn btn-default" %> 11 |
12 |
13 |

14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :user, mapping: nil } %> 22 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_hu_HU.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["hu-HU"]={formatLoadingMessage:function(){return"Betöltés, kérem várjon..."},formatRecordsPerPage:function(a){return a+" rekord per oldal"},formatShowingRows:function(a,b,c){return"Megjelenítve "+a+" - "+b+" / "+c+" összesen"},formatSearch:function(){return"Keresés"},formatNoMatches:function(){return"Nincs találat"},formatRefresh:function(){return"Frissítés"},formatToggle:function(){return"Váltás"},formatColumns:function(){return"Oszlopok"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["hu-HU"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_zh_TW.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["zh-TW"]={formatLoadingMessage:function(){return"正在努力地載入資料,請稍候……"},formatRecordsPerPage:function(a){return"每頁顯示 "+a+" 項記錄"},formatShowingRows:function(a,b,c){return"顯示第 "+a+" 到第 "+b+" 項記錄,總共 "+c+" 項記錄"},formatSearch:function(){return"搜尋"},formatNoMatches:function(){return"沒有找符合的結果"},formatPaginationSwitch:function(){return"隱藏/顯示分頁"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切換"},formatColumns:function(){return"列"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-TW"])}(jQuery); -------------------------------------------------------------------------------- /hawk/app/views/profiles/edit.html.erb: -------------------------------------------------------------------------------- 1 |

2 | <%= icon_text 'home', _('Preferences'), class: 'page' %> 3 |

4 |
5 |
6 | <%= form_for [@cib, @profile], horizontal: true, bootstrap: true, method: :put do |main_form| %> 7 | <%= main_form.select :language, :language_options, { include_hidden: false }, { } %> 8 | <%= main_form.select :stonithwarning, { _("Yes") => true, _("No") => false }, { include_hidden: false }, label: _("Display warning if STONITH is disabled") %> 9 | <%= main_form.button_group do %> 10 | <%= profile_apply_button(main_form, @profile) %> 11 | <%= profile_revert_button(main_form, @profile) %> 12 | <% end %> 13 | <% end %> 14 |
15 |
16 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_it_IT.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["it-IT"]={formatLoadingMessage:function(){return"Caricamento in corso..."},formatRecordsPerPage:function(a){return a+" records per pagina"},formatShowingRows:function(a,b,c){return"Pagina "+a+" di "+b+" ("+c+" records)"},formatSearch:function(){return"Cerca"},formatNoMatches:function(){return"Nessun record trovato"},formatRefresh:function(){return"Rinfrescare"},formatToggle:function(){return"Alternare"},formatColumns:function(){return"Colonne"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["it-IT"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_zh_CN.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["zh-CN"]={formatLoadingMessage:function(){return"正在努力地加载数据中,请稍候……"},formatRecordsPerPage:function(a){return"每页显示 "+a+" 条记录"},formatShowingRows:function(a,b,c){return"显示第 "+a+" 到第 "+b+" 条记录,总共 "+c+" 条记录"},formatSearch:function(){return"搜索"},formatNoMatches:function(){return"没有找到匹配的记录"},formatPaginationSwitch:function(){return"隐藏/显示分页"},formatRefresh:function(){return"刷新"},formatToggle:function(){return"切换"},formatColumns:function(){return"列"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["zh-CN"])}(jQuery); -------------------------------------------------------------------------------- /hawk/app/views/primitives/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "file-o", @title, class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), path_for_new_resource, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <% content_for :rightbar do %> 19 |
20 |
21 | <%= localized_help_for_primitives %> 22 |
23 |
24 | <% end %> 25 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_ru_RU.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["ru-RU"]={formatLoadingMessage:function(){return"Пожалуйста, подождите, идёт загрузка..."},formatRecordsPerPage:function(a){return a+" записей на страницу"},formatShowingRows:function(a,b,c){return"Записи с "+a+" по "+b+" из "+c},formatSearch:function(){return"Поиск"},formatNoMatches:function(){return"Ничего не найдено"},formatRefresh:function(){return"Обновить"},formatToggle:function(){return"Переключить"},formatColumns:function(){return"Колонки"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["ru-RU"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_rotated-flipped.scss: -------------------------------------------------------------------------------- 1 | // Rotated & Flipped Icons 2 | // ------------------------- 3 | 4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } 5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } 6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } 7 | 8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } 9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } 10 | 11 | // Hook for IE8-9 12 | // ------------------------- 13 | 14 | :root .#{$fa-css-prefix}-rotate-90, 15 | :root .#{$fa-css-prefix}-rotate-180, 16 | :root .#{$fa-css-prefix}-rotate-270, 17 | :root .#{$fa-css-prefix}-flip-horizontal, 18 | :root .#{$fa-css-prefix}-flip-vertical { 19 | filter: none; 20 | } 21 | -------------------------------------------------------------------------------- /hawk/app/validators/order_validator.rb: -------------------------------------------------------------------------------- 1 | class OrderValidator < ActiveModel::Validator 2 | 3 | def validate(record) 4 | unless record.score.blank? 5 | record.score.strip! 6 | unless [ 7 | "mandatory", 8 | "optional", 9 | "serialize", 10 | "inf", 11 | "-inf", 12 | "infinity", 13 | "-infinity" 14 | ].include? record.score.downcase 15 | unless record.score.match(/^-?[0-9]+$/) 16 | record.errors[:score] << _("Invalid score value") 17 | end 18 | end 19 | else 20 | record.errors[:score] << _("Score is required") 21 | end 22 | 23 | if record.resources.length < 2 24 | record.errors[:base] << _("Constraint must consist of at least two separate resources") 25 | end 26 | end 27 | 28 | end -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_pl_PL.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["pl-PL"]={formatLoadingMessage:function(){return"Ładowanie, proszę czekać..."},formatRecordsPerPage:function(a){return a+" rekordów na stronę"},formatShowingRows:function(a,b,c){return"Wyświetlanie rekordów od "+a+" do "+b+" z "+c},formatSearch:function(){return"Szukaj"},formatNoMatches:function(){return"Niestety, nic nie znaleziono"},formatRefresh:function(){return"Odśwież"},formatToggle:function(){return"Przełącz"},formatColumns:function(){return"Kolumny"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["pl-PL"])}(jQuery); -------------------------------------------------------------------------------- /hawk/app/controllers/pages_controller.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | class PagesController < ApplicationController 5 | before_action :login_required 6 | 7 | layout :detect_modal_layout, 8 | only: [:help] 9 | 10 | def index 11 | @title = _("Welcome") 12 | 13 | respond_to do |format| 14 | format.html do 15 | redirect_to cib_path(cib_id: view_context.current_cib.id), status: 301 16 | end 17 | end 18 | end 19 | 20 | def help 21 | @title = _("Help") 22 | 23 | respond_to do |format| 24 | format.html 25 | end 26 | end 27 | 28 | protected 29 | 30 | def detect_modal_layout 31 | if request.xhr? 32 | "modal" 33 | else 34 | detect_current_layout 35 | end 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/messages_zh.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"必须填写",remote:"请修正此栏位",email:"请输入有效的电子邮件",url:"请输入有效的网址",date:"请输入有效的日期",dateISO:"请输入有效的日期 (YYYY-MM-DD)",number:"请输入正确的数字",digits:"只可输入数字",creditcard:"请输入有效的信用卡号码",equalTo:"你的输入不相同",extension:"请输入有效的后缀",maxlength:a.validator.format("最多 {0} 个字"),minlength:a.validator.format("最少 {0} 个字"),rangelength:a.validator.format("请输入长度为 {0} 至 {1} 之間的字串"),range:a.validator.format("请输入 {0} 至 {1} 之间的数值"),max:a.validator.format("请输入不大于 {0} 的数值"),min:a.validator.format("请输入不小于 {0} 的数值")})}); 5 | -------------------------------------------------------------------------------- /scripts/create-directory-layout.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | DESTDIR=$1 3 | WWW_BASE=$2 4 | WWW_LOG=$3 5 | WWW_TMP=$4 6 | mkdir -p "$DESTDIR$WWW_BASE/hawk/locale" 7 | mkdir -p "$DESTDIR$WWW_LOG" 8 | mkdir -p "$DESTDIR$WWW_TMP/cache" 9 | mkdir -p "$DESTDIR$WWW_TMP/explorer/uploads" 10 | mkdir -p "$DESTDIR$WWW_TMP/pids" 11 | mkdir -p "$DESTDIR$WWW_TMP/sessions" 12 | mkdir -p "$DESTDIR$WWW_TMP/sockets" 13 | mkdir -p "$DESTDIR$WWW_TMP/home" 14 | [ "$WWW_LOG" != "$WWW_BASE/hawk/log" ] && ln -rfs "$DESTDIR$WWW_LOG" "$DESTDIR$WWW_BASE/hawk/log" 15 | [ "$WWW_TMP" != "$WWW_BASE/hawk/tmp" ] && ln -rfs "$DESTDIR$WWW_TMP" "$DESTDIR$WWW_BASE/hawk/tmp" 16 | chown -R hacluster.haclient "$DESTDIR$WWW_LOG" || true 17 | chown -R hacluster.haclient "$DESTDIR$WWW_TMP" || true 18 | chmod g+w "$DESTDIR$WWW_TMP/home" 19 | chmod g+w "$DESTDIR$WWW_TMP/explorer" 20 | -------------------------------------------------------------------------------- /hawk/app/collections/role_collection.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | class RoleCollection < Array 5 | def <<(record) 6 | if record.kind_of? Hash 7 | super(Role.new(record)) 8 | else 9 | super 10 | end 11 | end 12 | 13 | def build(attrs = {}) 14 | self.push Role.new(attrs) 15 | end 16 | 17 | def valid? 18 | # remove_empty! 19 | 20 | if map(&:valid?).include? false 21 | false 22 | else 23 | true 24 | end 25 | end 26 | 27 | protected 28 | 29 | def remove_empty! 30 | default_record = Role.new.attributes 31 | 32 | map! do |record| 33 | if record.attributes == default_record 34 | nil 35 | else 36 | record 37 | end 38 | end.compact! 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /hawk/app/collections/rule_collection.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | class RuleCollection < Array 5 | def <<(record) 6 | if record.kind_of? Hash 7 | super(Rule.new(record)) 8 | else 9 | super 10 | end 11 | end 12 | 13 | def build(attrs = {}) 14 | self.push Rule.new(attrs) 15 | end 16 | 17 | def valid? 18 | # remove_empty! 19 | 20 | if map(&:valid?).include? false 21 | false 22 | else 23 | true 24 | end 25 | end 26 | 27 | protected 28 | 29 | def remove_empty! 30 | default_record = Rule.new.attributes 31 | 32 | map! do |record| 33 | if record.attributes == default_record 34 | nil 35 | else 36 | record 37 | end 38 | end.compact! 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /hawk/app/collections/user_collection.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | class UserCollection < Array 5 | def <<(record) 6 | if record.kind_of? Hash 7 | super(User.new(record)) 8 | else 9 | super 10 | end 11 | end 12 | 13 | def build(attrs = {}) 14 | self.push User.new(attrs) 15 | end 16 | 17 | def valid? 18 | # remove_empty! 19 | 20 | if map(&:valid?).include? false 21 | false 22 | else 23 | true 24 | end 25 | end 26 | 27 | protected 28 | 29 | def remove_empty! 30 | default_record = User.new.attributes 31 | 32 | map! do |record| 33 | if record.attributes == default_record 34 | nil 35 | else 36 | record 37 | end 38 | end.compact! 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_de_DE.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["de-DE"]={formatLoadingMessage:function(){return"Lade, bitte warten..."},formatRecordsPerPage:function(a){return a+" Einträge pro Seite"},formatShowingRows:function(a,b,c){return"Zeige "+a+" bis "+b+" von "+c+" Zeile"+(c>1?"n":"")},formatSearch:function(){return"Suchen"},formatNoMatches:function(){return"Keine passenden Ergebnisse gefunden"},formatRefresh:function(){return"Neu laden"},formatToggle:function(){return"Umschalten"},formatColumns:function(){return"Spalten"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["de-DE"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/messages_zh_TW.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"必須填寫",remote:"請修正此欄位",email:"請輸入有效的電子郵件",url:"請輸入有效的網址",date:"請輸入有效的日期",dateISO:"請輸入有效的日期 (YYYY-MM-DD)",number:"請輸入正確的數值",digits:"只可輸入數字",creditcard:"請輸入有效的信用卡號碼",equalTo:"請重複輸入一次",extension:"請輸入有效的後綴",maxlength:a.validator.format("最多 {0} 個字"),minlength:a.validator.format("最少 {0} 個字"),rangelength:a.validator.format("請輸入長度為 {0} 至 {1} 之間的字串"),range:a.validator.format("請輸入 {0} 至 {1} 之間的數值"),max:a.validator.format("請輸入不大於 {0} 的數值"),min:a.validator.format("請輸入不小於 {0} 的數值")})}); 5 | -------------------------------------------------------------------------------- /hawk/app/helpers/profile_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module ProfileHelper 5 | def language_options(selected) 6 | options = Profile.available_languages.to_a.map do |v| 7 | v.reverse 8 | end 9 | 10 | options_for_select( 11 | options, 12 | selected 13 | ) 14 | end 15 | 16 | def profile_revert_button(form, role) 17 | form.submit( 18 | _("Revert"), 19 | class: "btn btn-default cancel revert", 20 | name: "revert", 21 | confirm: _("Any changes will be lost - do you wish to proceed?") 22 | ) 23 | end 24 | 25 | def profile_apply_button(form, role) 26 | form.submit( 27 | _("Apply"), 28 | class: "btn btn-primary submit", 29 | name: "submit" 30 | ) 31 | end 32 | end 33 | -------------------------------------------------------------------------------- /hawk/app/views/colocations/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "tasks", _("Colocations"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_colocation_path, class: "btn btn-default" %> 8 |
9 |
10 |

11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | <% content_for :rightbar do %> 19 |
20 |
21 | <%= localized_help_for :constraints, :colocation %> 22 |
23 |
24 | <% end %> 25 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/template.md: -------------------------------------------------------------------------------- 1 | ### Resource Template 2 | 3 | If you need lots of resources with similar configurations, define a 4 | resource template. After being defined, it can be referenced in 5 | primitives or in certain types of constraints. 6 | 7 | If a template is referenced in a primitive, the primitive inherits all 8 | operations, instance attributes (parameters), meta attributes, and 9 | utilization attributes defined in the template. Additionally, you can 10 | define specific operations or attributes for your primitive. If any of 11 | these are defined in both template and primitive, the values in the 12 | primitive take precedence over the ones defined in the template. 13 | 14 | To create a resource template, define an ID and specify some 15 | parameters like class, (provider), and type -- exactly like you would 16 | specify a primitive. 17 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/shared/_simulator.scss: -------------------------------------------------------------------------------- 1 | .batch-navbar-on { 2 | color: $batch-button-active-fg; 3 | padding-top: 20px; 4 | } 5 | 6 | .batch-control-bar strong { 7 | color: $batch-bar-text; 8 | line-height: 40px; 9 | } 10 | 11 | .batch-transition-graph-data { 12 | overflow: auto; 13 | } 14 | 15 | .batch-transition-data { 16 | max-height: 600px; 17 | overflow: auto; 18 | padding: 4px; 19 | } 20 | 21 | .batch-cib-in-data { 22 | max-height: 600px; 23 | overflow: auto; 24 | padding: 4px; 25 | } 26 | 27 | .batch-cib-out-data { 28 | max-height: 600px; 29 | overflow: auto; 30 | padding: 4px; 31 | } 32 | 33 | .batch-diff-data { 34 | max-height: 600px; 35 | overflow: auto; 36 | } 37 | 38 | .batch-summary-data { 39 | max-height: 600px; 40 | overflow: auto; 41 | padding: 4px; 42 | } 43 | 44 | .help-cursor { 45 | cursor: help; 46 | } -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_list-group.scss: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | @mixin list-group-item-variant($state, $background, $color) { 4 | .list-group-item-#{$state} { 5 | color: $color; 6 | background-color: $background; 7 | 8 | // [converter] extracted a&, button& to a.list-group-item-#{$state}, button.list-group-item-#{$state} 9 | } 10 | 11 | a.list-group-item-#{$state}, 12 | button.list-group-item-#{$state} { 13 | color: $color; 14 | 15 | .list-group-item-heading { 16 | color: inherit; 17 | } 18 | 19 | &:hover, 20 | &:focus { 21 | color: $color; 22 | background-color: darken($background, 5%); 23 | } 24 | &.active, 25 | &.active:hover, 26 | &.active:focus { 27 | color: #fff; 28 | background-color: $color; 29 | border-color: $color; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /hawk/app/helpers/ticket_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module TicketHelper 5 | def ticket_losspolicy_options(selected) 6 | options_for_select( 7 | [ 8 | [_("Stop"), "stop"], 9 | [_("Demote"), "demote"], 10 | [_("Fence"), "fence"], 11 | [_("Freeze"), "freeze"] 12 | ], 13 | selected 14 | ) 15 | end 16 | 17 | def available_ticket_roles 18 | { 19 | "Started" => _("Started"), 20 | "Master" => _("Promoted"), 21 | "Slave" => _("Promotable"), 22 | "Stopped" => _("Stopped") 23 | } 24 | end 25 | 26 | def available_ticket_resources 27 | [ 28 | @cib.resources.map{|x| x[:id]}, 29 | @cib.templates.map{|x| x[:id]} 30 | ].flatten.sort do |a, b| 31 | a.natcmp(b, true) 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_pt_BR.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["pt-BR"]={formatLoadingMessage:function(){return"Carregando, aguarde..."},formatRecordsPerPage:function(a){return a+" registros por página"},formatShowingRows:function(a,b,c){return"Exibindo "+a+" até "+b+" de "+c+" linhas"},formatSearch:function(){return"Pesquisar"},formatRefresh:function(){return"Recarregar"},formatToggle:function(){return"Alternar"},formatColumns:function(){return"Colunas"},formatPaginationSwitch:function(){return"Ocultar/Exibir paginação"},formatNoMatches:function(){return"Nenhum registro encontrado"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["pt-BR"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_path.scss: -------------------------------------------------------------------------------- 1 | /* FONT PATH 2 | * -------------------------- */ 3 | 4 | @font-face { 5 | font-family: 'FontAwesome'; 6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); 7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), 8 | url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), 9 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), 10 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), 11 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); 12 | // src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | -------------------------------------------------------------------------------- /hawk/app/helpers/location_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module LocationHelper 5 | def location_resource_options(selected) 6 | available = [ 7 | @cib.resources.map{|x| x[:id]} 8 | ].flatten.uniq.sort do |a, b| 9 | a.natcmp(b, true) 10 | end 11 | 12 | options_for_select( 13 | available, 14 | selected 15 | ) 16 | end 17 | 18 | def location_node_options(selected) 19 | available = [ 20 | @cib.nodes.map{|x| x[:id]} 21 | ].flatten.uniq.sort do |a, b| 22 | a.natcmp(b, true) 23 | end 24 | options_for_select( 25 | available, 26 | selected 27 | ) 28 | end 29 | 30 | def location_discovery_options(selected) 31 | options_for_select( 32 | ["always", "never", "exclusive"], 33 | selected 34 | ) 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_fr_FR.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["fr-FR"]={formatLoadingMessage:function(){return"Chargement en cours, patientez, s´il vous plaît ..."},formatRecordsPerPage:function(a){return a+" lignes par page"},formatShowingRows:function(a,b,c){return"Affichage des lignes "+a+" à "+b+" sur "+c+" lignes au total"},formatSearch:function(){return"Rechercher"},formatNoMatches:function(){return"Aucun résultat trouvé"},formatRefresh:function(){return"Rafraîchir"},formatToggle:function(){return"Alterner"},formatColumns:function(){return"Colonnes"},formatAllRows:function(){return"Tous"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["fr-FR"])}(jQuery); -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/mixins/_table-row.scss: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | @mixin table-row-variant($state, $background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.#{$state}, 10 | > th.#{$state}, 11 | &.#{$state} > td, 12 | &.#{$state} > th { 13 | background-color: $background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.#{$state}:hover, 21 | > th.#{$state}:hover, 22 | &.#{$state}:hover > td, 23 | &:hover > .#{$state}, 24 | &.#{$state}:hover > th { 25 | background-color: darken($background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/constraints/order.md: -------------------------------------------------------------------------------- 1 | ### Order 2 | 3 | Ordering constraints define the order in which resources are started 4 | and stopped. 5 | 6 | To create an order constraint, specify an ID, select the resources 7 | between which to define the constraint, and add a score. The score 8 | determines the location relationship between the resources: The 9 | constraint is mandatory if the score is greater than zero, otherwise 10 | it is only a suggestion. The default value is INFINITY. Keeping the 11 | option `Symmetrical` set to `Yes` (default) defines that the resources 12 | are stopped in reverse order. 13 | 14 | An example for use of an order constraint is a Web service 15 | (e.g. Apache) that depends on a certain IP address. Configure 16 | resources for the IP address and the Web service, then add an order 17 | constraint that defines that the IP address is started before Apache 18 | is started. 19 | -------------------------------------------------------------------------------- /hawk/app/views/reports/detail.html.erb: -------------------------------------------------------------------------------- 1 | <% unless @transition[:tags].empty? %> 2 |
3 |
4 | <% @transition[:tags].each do |tag| %> 5 | <% if tag == "error" || tag == "unclean" %> 6 | 7 | <%= tag %> 8 | 9 | <% else %> 10 | 11 | <%= tag %> 12 | 13 | <% end %> 14 | <% end %> 15 |
16 |
17 | <% end %> 18 |
19 |
20 |
<%= history_text_markup @transition[:info] %>
21 |
22 |
23 | <% unless @transition[:info_err].blank? %> 24 |
25 |
26 |
<%= history_text_markup @transition[:info_err] %>
27 |
28 |
29 | <% end %> 30 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/font-awesome/_animated.scss: -------------------------------------------------------------------------------- 1 | // Spinning Icons 2 | // -------------------------- 3 | 4 | .#{$fa-css-prefix}-spin { 5 | -webkit-animation: fa-spin 2s infinite linear; 6 | animation: fa-spin 2s infinite linear; 7 | } 8 | 9 | .#{$fa-css-prefix}-pulse { 10 | -webkit-animation: fa-spin 1s infinite steps(8); 11 | animation: fa-spin 1s infinite steps(8); 12 | } 13 | 14 | @-webkit-keyframes fa-spin { 15 | 0% { 16 | -webkit-transform: rotate(0deg); 17 | transform: rotate(0deg); 18 | } 19 | 100% { 20 | -webkit-transform: rotate(359deg); 21 | transform: rotate(359deg); 22 | } 23 | } 24 | 25 | @keyframes fa-spin { 26 | 0% { 27 | -webkit-transform: rotate(0deg); 28 | transform: rotate(0deg); 29 | } 30 | 100% { 31 | -webkit-transform: rotate(359deg); 32 | transform: rotate(359deg); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/messages_ko.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"필수 항목입니다.",remote:"항목을 수정하세요.",email:"유효하지 않은 E-Mail주소입니다.",url:"유효하지 않은 URL입니다.",date:"올바른 날짜를 입력하세요.",dateISO:"올바른 날짜(ISO)를 입력하세요.",number:"유효한 숫자가 아닙니다.",digits:"숫자만 입력 가능합니다.",creditcard:"신용카드 번호가 바르지 않습니다.",equalTo:"같은 값을 다시 입력하세요.",extension:"올바른 확장자가 아닙니다.",maxlength:a.validator.format("{0}자를 넘을 수 없습니다. "),minlength:a.validator.format("{0}자 이상 입력하세요."),rangelength:a.validator.format("문자 길이가 {0} 에서 {1} 사이의 값을 입력하세요."),range:a.validator.format("{0} 에서 {1} 사이의 값을 입력하세요."),max:a.validator.format("{0} 이하의 값을 입력하세요."),min:a.validator.format("{0} 이상의 값을 입력하세요.")})}); 5 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/application/_basics.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | html { 5 | position: relative; 6 | } 7 | 8 | body { 9 | cursor: default; 10 | padding-top: 53px; 11 | font-family: $body-text; 12 | font-weight: 400; 13 | } 14 | 15 | 16 | h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { 17 | font-family: $body-text; 18 | font-weight: 500; 19 | } 20 | 21 | .fa-pulse-opacity { 22 | -webkit-animation: pulsate 1s ease-out; 23 | -webkit-animation-iteration-count: infinite; 24 | } 25 | 26 | .fa-fw { 27 | font-size: 1.0em; 28 | text-align: center; 29 | line-height: 1.433em; 30 | } 31 | 32 | .btn-xs { 33 | padding: 5px 6px; 34 | } 35 | 36 | .filter .btn { 37 | padding: 9px 10px; 38 | } 39 | 40 | @-webkit-keyframes pulsate { 41 | 0% {opacity: 0.0;} 42 | 50% {opacity: 1.0;} 43 | 100% {opacity: 0.0;} 44 | } -------------------------------------------------------------------------------- /hawk/app/helpers/role_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module RoleHelper 5 | def role_options(selected) 6 | options_for_select( 7 | Role.ordered.map{|x| x[:id]}, 8 | selected 9 | ) 10 | end 11 | 12 | def role_revert_button(form, role) 13 | form.submit( 14 | _("Revert"), 15 | class: "btn btn-default cancel revert simple-hidden", 16 | name: "revert", 17 | confirm: _("Any changes will be lost - do you wish to proceed?") 18 | ) 19 | end 20 | 21 | def role_apply_button(form, role) 22 | form.submit( 23 | _("Apply"), 24 | class: "btn btn-primary submit", 25 | name: "submit" 26 | ) 27 | end 28 | 29 | def role_create_button(form, role) 30 | form.submit( 31 | _("Create"), 32 | class: "btn btn-primary submit", 33 | name: "submit" 34 | ) 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /hawk/app/helpers/user_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module UserHelper 5 | def user_options(selected) 6 | options_for_select( 7 | User.ordered.map{|x| x[:id]}, 8 | selected 9 | ) 10 | end 11 | 12 | def user_revert_button(form, user) 13 | form.submit( 14 | _("Revert"), 15 | class: "btn btn-default cancel revert simple-hidden", 16 | name: "revert", 17 | confirm: _("Any changes will be lost - do you wish to proceed?") 18 | ) 19 | end 20 | 21 | def user_apply_button(form, user) 22 | form.submit( 23 | _("Apply"), 24 | class: "btn btn-primary submit", 25 | name: "submit" 26 | ) 27 | end 28 | 29 | def user_create_button(form, user) 30 | form.submit( 31 | _("Create"), 32 | class: "btn btn-primary submit", 33 | name: "submit" 34 | ) 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/bootstrap/locale/table/messages_cs_CZ.js: -------------------------------------------------------------------------------- 1 | /* 2 | * bootstrap-table - v1.8.1 - 2015-05-29 3 | * https://github.com/wenzhixin/bootstrap-table 4 | * Copyright (c) 2015 zhixin wen 5 | * Licensed MIT License 6 | */ 7 | !function(a){"use strict";a.fn.bootstrapTable.locales["cs-CZ"]={formatLoadingMessage:function(){return"Čekejte, prosím..."},formatRecordsPerPage:function(a){return a+" položek na stránku"},formatShowingRows:function(a,b,c){return"Zobrazena "+a+". - "+b+". položka z celkových "+c},formatSearch:function(){return"Vyhledávání"},formatNoMatches:function(){return"Nenalezena žádná vyhovující položka"},formatPaginationSwitch:function(){return"Skrýt/Zobrazit stránkování"},formatRefresh:function(){return"Aktualizovat"},formatToggle:function(){return"Přepni"},formatColumns:function(){return"Sloupce"},formatAllRows:function(){return"Vše"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["cs-CZ"])}(jQuery); -------------------------------------------------------------------------------- /hawk/config/help/en-US/resources/role.md: -------------------------------------------------------------------------------- 1 | ### ACL Role 2 | 3 | An ACL role is a set of rules which describe access rights to CIB. Each rule consists of: 4 | 5 | - an access right `(read`, `write`, or `deny`) 6 | - a specification (XPath expression, type, or ID reference) where to apply the rule 7 | 8 | #### Create Role 9 | 10 | **Role ID**: Define a unique ID. 11 | 12 | **Right**: Select the access right (read/write/deny). 13 | 14 | **Xpath**: Enter an Xpath expression for the CIB elements that you want the access right to apply to (e.g. `//constraints/rsc_location` to make it apply to location constraints). 15 | 16 | **Type**: Enter the name of the CIB XML element that you want the access right to apply to (e.g. `rsc_location` to make it apply to location constraints). 17 | 18 | **Ref**: Enter the ID of the CIB XML element that you want the access right to apply to type (e.g. `rsc1` to make it apply to all XML elements with the ID `rsc1`). 19 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/messages_ja.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"このフィールドは必須です。",remote:"このフィールドを修正してください。",email:"有効なEメールアドレスを入力してください。",url:"有効なURLを入力してください。",date:"有効な日付を入力してください。",dateISO:"有効な日付(ISO)を入力してください。",number:"有効な数字を入力してください。",digits:"数字のみを入力してください。",creditcard:"有効なクレジットカード番号を入力してください。",equalTo:"同じ値をもう一度入力してください。",extension:"有効な拡張子を含む値を入力してください。",maxlength:a.validator.format("{0} 文字以内で入力してください。"),minlength:a.validator.format("{0} 文字以上で入力してください。"),rangelength:a.validator.format("{0} 文字から {1} 文字までの値を入力してください。"),range:a.validator.format("{0} から {1} までの値を入力してください。"),max:a.validator.format("{0} 以下の値を入力してください。"),min:a.validator.format("{0} 以上の値を入力してください。")})}); 5 | -------------------------------------------------------------------------------- /hawk/config/puma.rb: -------------------------------------------------------------------------------- 1 | require 'fileutils' 2 | 3 | ROOT = File.expand_path("../../", __FILE__) 4 | 5 | @environment = ENV["HAWK_ENV"] || "production" 6 | @bind = ENV["HAWK_BIND"] || "unix:///usr/share/hawk/tmp/hawk.sock" 7 | 8 | bind @bind 9 | directory ROOT 10 | environment @environment 11 | 12 | tag "hawk" 13 | 14 | prune_bundler false 15 | 16 | threads 0, 1 17 | 18 | workers 1 19 | 20 | # Use the `preload_app!` method when specifying a `workers` number. 21 | # This directive tells Puma to first boot the application and load code 22 | # before forking the application. This takes advantage of Copy On Write 23 | # process behavior so workers use less memory. 24 | preload_app! 25 | 26 | worker_timeout 60 27 | 28 | pidfile File.join(ROOT, "tmp", "pids", "puma.pid") 29 | state_path File.join(ROOT, "tmp", "pids", "puma.state") 30 | 31 | ["tmp/pids", "tmp/sessions", "tmp/sockets", "tmp/cache"].each do |name| 32 | FileUtils.mkdir_p File.join(ROOT, name) 33 | end 34 | -------------------------------------------------------------------------------- /hawk/app/helpers/constraints_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module ConstraintsHelper 5 | # Gives role or action suffix 6 | # (":Master", ":Started", ":promote", ":start" etc.). 7 | def role_string(klass, hash) 8 | role = klass == Colocation ? hash[:role] : hash[:action] 9 | role ? ":#{role}" : "" 10 | end 11 | 12 | # prettify colocation or order constraint 13 | def rsc_set(con) 14 | con.resources.map {|set| 15 | if set[:sequential] 16 | set[:resources].map {|rsc| 17 | "" + h(rsc[:id] + role_string(con.class, set)) + "" 18 | }.join(image_tag('arrow-right.png', :alt => '→')) 19 | else 20 | "" + set[:resources].map {|rsc| 21 | h(rsc[:id] + role_string(con.class, set)) 22 | }.join(" ") + "" 23 | end 24 | }.join(image_tag('arrow-right.png', :alt => '→')) 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /hawk/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | ActiveSupport::Inflector.inflections do |inflect| 5 | inflect.uncountable "crm_config" 6 | 7 | inflect.acronym "DC" 8 | inflect.acronym "SAP" 9 | inflect.acronym "NFS" 10 | inflect.acronym "STONITH" 11 | inflect.acronym "IP" 12 | inflect.acronym "ID" 13 | inflect.acronym "LVS" 14 | inflect.acronym "OCFS2" 15 | inflect.acronym "cLVM" 16 | inflect.acronym "CIDR" 17 | inflect.acronym "SBD" 18 | inflect.acronym "QA" 19 | end 20 | 21 | module ActiveSupport::Inflector 22 | # does the opposite of humanize ... mostly. 23 | # Basically does a space-substituting .underscore 24 | def dehumanize(the_string) 25 | result = the_string.to_s.dup 26 | result.downcase.gsub(/ +/,'_') 27 | end 28 | end 29 | 30 | class String 31 | def dehumanize 32 | ActiveSupport::Inflector.dehumanize(self) 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /hawk/app/validators/colocation_validator.rb: -------------------------------------------------------------------------------- 1 | class ColocationValidator < ActiveModel::Validator 2 | 3 | def validate(record) 4 | unless record.score.blank? 5 | record.score.strip! 6 | unless [ 7 | "mandatory", 8 | "advisory", 9 | "inf", 10 | "-inf", 11 | "infinity", 12 | "-infinity" 13 | ].include? record.score.downcase 14 | unless record.score.match(/^-?[0-9]+$/) 15 | record.errors[:score] << _("Invalid score value") 16 | end 17 | end 18 | else 19 | record.errors[:score] << _("Score is required") 20 | end 21 | 22 | unless record.node_attr.blank? 23 | unless record.node_attr.match(/\A[a-zA-Z0-9_-]+\z/) 24 | record.errors[:node_attr] << _("Invalid node attribute") 25 | end 26 | end 27 | 28 | if record.resources.length < 2 29 | record.errors[:base] << _("Constraint must consist of at least two separate resources") 30 | end 31 | end 32 | 33 | end -------------------------------------------------------------------------------- /hawk/app/views/commands/index.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "calendar-o", _("Command Log"), class: "page" %> 5 |

6 |
7 |
8 |
9 |
10 |
11 |
12 |

13 | <%= _("Lists crm commands recently executed by hawk, most recent first.") %> 14 |

15 |
16 |
17 |
18 |
19 |
20 | <% @cmds.reverse_each do |cmd| %> 21 |
<%= cmd.lines[1..-1].join %>
22 | <% end %> 23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 | -------------------------------------------------------------------------------- /hawk/app/helpers/states_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2015 Tim Serong 2 | # See COPYING for license. 3 | 4 | module StatesHelper 5 | def status_class_for(type) 6 | case type.to_sym 7 | when :ok 8 | "circle-success" 9 | when :errors 10 | "circle-danger" 11 | when :maintenance 12 | "circle-info" 13 | when :nostonith 14 | "circle-warning" 15 | else 16 | "circle-warning" 17 | end 18 | end 19 | 20 | def status_icon_for(type) 21 | icon_tag(status_icon_name_for(type)) 22 | end 23 | 24 | def status_icon_name_for(type) 25 | case type.to_sym 26 | when :ok 27 | "check" 28 | when :errors 29 | "exclamation-triangle" 30 | when :maintenance 31 | "wrench" 32 | when :nostonith 33 | "plug" 34 | else 35 | "question" 36 | end 37 | end 38 | 39 | def tags_with_resources 40 | @cib.tags.select { |tag| tag[:refs].any? { |ref| @cib.resources_by_id.include? ref } } 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_close.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: ($font-size-base * 1.5); 9 | font-weight: $close-font-weight; 10 | line-height: 1; 11 | color: $close-color; 12 | text-shadow: $close-text-shadow; 13 | @include opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: $close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | @include opacity(.5); 21 | } 22 | 23 | // [converter] extracted button& to button.close 24 | } 25 | 26 | // Additional properties for button version 27 | // iOS requires the button element instead of an anchor tag. 28 | // If you want the anchor version, it requires `href="#"`. 29 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 30 | button.close { 31 | padding: 0; 32 | cursor: pointer; 33 | background: transparent; 34 | border: 0; 35 | -webkit-appearance: none; 36 | } 37 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/constraints/ticket.md: -------------------------------------------------------------------------------- 1 | ### Ticket 2 | 3 | Tickets are a special type of constraint used for Geo clustering. A 4 | ticket grants the right to run certain resources on a specific cluster 5 | site. 6 | 7 | To create a ticket constraint, specify a constraint ID, enter a 8 | ticket's ID and add the resources that you want to depend on this 9 | ticket. Additionally, you can set a loss-policy to define what should 10 | happen to the resources if the ticket is revoked. The attribute 11 | `loss-policy` can have the following values: 12 | 13 | * `fence`: Fence the nodes that are running the relevant resources. 14 | * `stop`: Stop the relevant resources. 15 | * `freeze`: Do nothing to the relevant resources. 16 | * `demote`: Demote relevant promoted resources. 17 | 18 | An example for a ticket constraint would be a primitive resource 19 | `rsc1` that depends on `ticketA`. If you set `loss-policy="fence"`, 20 | the node that runs `rsc1` would be fenced in case `ticketA` is 21 | revoked from the cluster site this node belongs to. 22 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_component-animations.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | @include transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | // [converter] extracted tr&.in to tr.collapse.in 23 | // [converter] extracted tbody&.in to tbody.collapse.in 24 | } 25 | 26 | tr.collapse.in { display: table-row; } 27 | 28 | tbody.collapse.in { display: table-row-group; } 29 | 30 | .collapsing { 31 | position: relative; 32 | height: 0; 33 | overflow: hidden; 34 | @include transition-property(height, visibility); 35 | @include transition-duration(.35s); 36 | @include transition-timing-function(ease); 37 | } 38 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_utilities.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | @include clearfix; 11 | } 12 | .center-block { 13 | @include center-block; 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | @include text-hide; 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /hawk/app/lib/hawk/secure_cookies.rb: -------------------------------------------------------------------------------- 1 | module Hawk 2 | class SecureCookies 3 | 4 | COOKIE_SEPARATOR = "\n".freeze 5 | 6 | def initialize(app) 7 | @app = app 8 | end 9 | 10 | def call(env) 11 | status, headers, body = @app.call(env) 12 | 13 | if headers['Set-Cookie'].present? 14 | cookies = headers['Set-Cookie'].split(COOKIE_SEPARATOR) 15 | 16 | # cookies might be 2-D array in the rack-3 / sprockets-4.2 17 | cookies.each do |cookie| 18 | next if cookie.blank? 19 | 20 | # no matter what, always add Secure + HttpOnly 21 | if not cookie.kind_of?(Array) 22 | cookie << '; Secure ; HttpOnly' 23 | else 24 | cookie.each do |cookie_atom| 25 | next if cookie_atom.blank? 26 | cookie_atom << '; Secure ; HttpOnly' 27 | end 28 | end 29 | end 30 | 31 | headers['Set-Cookie'] = cookies.join(COOKIE_SEPARATOR) 32 | end 33 | 34 | [status, headers, body] 35 | end 36 | 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /hawk/app/views/users/_form.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 | <%= form_for [cib, user], horizontal: true, bootstrap: true do |main_form| %> 4 | <%= errors_for user %> 5 | <% if user.new_record? %> 6 | <%= main_form.text_field :id, label: _("Target ID") %> 7 | <% else %> 8 | <%= main_form.text_field :id, label: _("Target ID"), readonly: true %> 9 | <% end %> 10 | <%= main_form.select :roles, :role_options, { include_hidden: false }, { multiple: true, size: 5 } %> 11 | <%= main_form.button_group do %> 12 | <% if user.new_record? %> 13 | <%= user_create_button(main_form, user) %> 14 | <% else %> 15 | <%= user_apply_button(main_form, user) %> 16 | <%= user_revert_button(main_form, user) %> 17 | <% end %> 18 | <%= link_to _("Back"), cib_users_path(cib_id: cib.id), class: "btn btn-default back" %> 19 | <% end %> 20 | <% end %> 21 |
22 |
23 | -------------------------------------------------------------------------------- /hawk/config/help/en-US/constraints/colocation.md: -------------------------------------------------------------------------------- 1 | ### Colocation 2 | 3 | A colocational constraint tells the cluster which resources may or may not run 4 | together on a node. 5 | 6 | To create a location constraint, specify an ID, select the resources between 7 | which to define the constraint, and add a score. The score determines the 8 | location relationship between the resources. 9 | 10 | * Positive values: The resources should run on the same node. 11 | * Negative values: The resources should not run on the same node. 12 | * Score of INFINITY: The resources have to run on the same node. 13 | * Score of -INFINITY: The resources must not run on the same node. 14 | 15 | An example for use of a colocation constraint is a Web service that depends on 16 | an IP address. Configure individual resources for the IP address and the Web 17 | service, then add a colocation constraint with a score of INFINITY. It defines 18 | that the Web service must run on the same node as the IP address. This also 19 | means that if the IP address is not running on any node, the Web service will 20 | not be permitted to run. 21 | -------------------------------------------------------------------------------- /hawk/app/views/tags/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Edit Tag"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_tag_path(cib_id: @cib.id), class: "btn btn-default" %> 8 | <%= link_to icon_text("font", _("Rename")), edit_name_cib_resource_path(cib_id: @cib.id, id: @tag.id, source: :resource), class: "btn btn-default", data: { toggle: :modal, target: "#modal" } %> 9 | <%= link_to icon_text("trash", _("Delete")), cib_tag_path(cib_id: @cib.id, id: @tag.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @tag.id } %> 10 |
11 |
12 |

13 |
14 |
15 | <%= render partial: "form", locals: { cib: @cib, tag: @tag } %> 16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :tag, mapping: @tag.help_text.merge(@tag.mapping) } %> 19 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_thumbnails.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: $thumbnail-padding; 10 | margin-bottom: $line-height-computed; 11 | line-height: $line-height-base; 12 | background-color: $thumbnail-bg; 13 | border: 1px solid $thumbnail-border; 14 | border-radius: $thumbnail-border-radius; 15 | @include transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | @include img-responsive; 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // [converter] extracted a&:hover, a&:focus, a&.active to a.thumbnail:hover, a.thumbnail:focus, a.thumbnail.active 25 | 26 | // Image captions 27 | .caption { 28 | padding: $thumbnail-caption-padding; 29 | color: $thumbnail-caption-color; 30 | } 31 | } 32 | 33 | // Add a hover state for linked versions only 34 | a.thumbnail:hover, 35 | a.thumbnail:focus, 36 | a.thumbnail.active { 37 | border-color: $link-color; 38 | } 39 | -------------------------------------------------------------------------------- /hawk/app/views/primitives/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "file-o", @title, class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("clone", _("Copy")), path_for_new_resource(cib_id: @cib.id), class: "btn btn-default" %> 8 | <%= link_to icon_text("font", _("Rename")), edit_name_cib_resource_path(cib_id: @cib.id, id: @primitive.id, source: :resource), class: "btn btn-default", data: { toggle: :modal, target: "#modal" } %> 9 | <%= link_to icon_text("trash", _("Delete")), path_for_resource(cib_id: @cib.id, id: @primitive.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @primitive.id } %> 10 |
11 |
12 |

13 |
14 |
15 | <%= render partial: "primitives/form", locals: { cib: @cib, primitive: @primitive } %> 16 |
17 |
18 | <%= render partial: "primitives/help", locals: { cib: @cib, primitive: @primitive } %> 19 | -------------------------------------------------------------------------------- /hawk/app/assets/javascripts/module/profiles.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | $(function() { 5 | $('#profiles #middle form') 6 | .find('.select') 7 | .multiselect({ 8 | disableIfEmpty: true, 9 | enableFiltering: true, 10 | buttonWidth: '100%', 11 | label: function(element) { 12 | return $(element).html() + ' [' + $(element).val() + ']'; 13 | }, 14 | buttonText: function(element) { 15 | return $(element).html() + ' [' + $(element).val() + ']'; 16 | }, 17 | onChange: function(element) { 18 | $(element.context.form) 19 | .find('[name="revert"]') 20 | .show() 21 | .end() 22 | .find('a.back') 23 | .attr('data-confirm', __('Any changes will be lost - do you wish to proceed?')) 24 | .end(); 25 | } 26 | }).end() 27 | .validate({ 28 | rules: { 29 | 'profile[language]': { 30 | required: true 31 | } 32 | } 33 | }); 34 | }); 35 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/messages_hu.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"Kötelező megadni.",maxlength:a.validator.format("Legfeljebb {0} karakter hosszú legyen."),minlength:a.validator.format("Legalább {0} karakter hosszú legyen."),rangelength:a.validator.format("Legalább {0} és legfeljebb {1} karakter hosszú legyen."),email:"Érvényes e-mail címnek kell lennie.",url:"Érvényes URL-nek kell lennie.",date:"Dátumnak kell lennie.",number:"Számnak kell lennie.",digits:"Csak számjegyek lehetnek.",equalTo:"Meg kell egyeznie a két értéknek.",range:a.validator.format("{0} és {1} közé kell esnie."),max:a.validator.format("Nem lehet nagyobb, mint {0}."),min:a.validator.format("Nem lehet kisebb, mint {0}."),creditcard:"Érvényes hitelkártyaszámnak kell lennie.",remote:"Kérem javítsa ki ezt a mezőt.",dateISO:"Kérem írjon be egy érvényes dátumot (ISO)."})}); 5 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/authentication/_foot.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | footer { 5 | position: absolute; 6 | bottom: 0; 7 | width: 100%; 8 | padding: 20px 0 0; 9 | z-index: 950; 10 | 11 | .other-links { 12 | display: block; 13 | a { 14 | color: $footer-icon-bg; 15 | margin: 0 10px 7px 0; 16 | float: left; 17 | 18 | .circle { 19 | width: 25px; 20 | height: 25px; 21 | background: $footer-icon-bg; 22 | border-radius: 15px; 23 | 24 | .fa { 25 | color: $sidebar-bg; 26 | font-size: 14px; 27 | } 28 | 29 | &:hover { 30 | background: $theme-green; 31 | } 32 | } 33 | &:hover { 34 | color: $theme-green; 35 | } 36 | } 37 | } 38 | 39 | .copyright { 40 | color: $copyright-fg; 41 | clear: both; 42 | } 43 | 44 | .logo { 45 | text-align: right; 46 | } 47 | 48 | .bottom-line { 49 | height: 12px; 50 | background: $theme-green; 51 | margin-top: 12px; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /hawk/app/helpers/simulator_helper.rb: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2015 Kristoffer Gronlund 2 | # See COPYING for license. 3 | 4 | module SimulatorHelper 5 | def node_actions 6 | [:online, :offline, :unclean] 7 | end 8 | 9 | def op_actions 10 | [:monitor, :start, :stop, :promote, :demote, :notify, :migrate_to, :migrate_from] 11 | end 12 | 13 | def ticket_actions 14 | [:grant, :revoke, :standby, :activate] 15 | end 16 | 17 | def op_results 18 | { 19 | 0 => _('success'), 20 | 1 => _('generic error'), 21 | 2 => _('incorrect arguments'), 22 | 3 => _('unimplemented action'), 23 | 4 => _('insufficient permissions'), 24 | 5 => _('installation error'), 25 | 6 => _('configuration error'), 26 | 7 => _('not running'), 27 | 8 => _('promoted'), 28 | 9 => _('failed (promoted)') 29 | } 30 | end 31 | 32 | def resource_instances 33 | [].tap do |instances| 34 | current_cib.resources_by_id.each do |name, rsc| 35 | next unless rsc.has_key? :instances 36 | instances.push name 37 | end 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /hawk/app/views/alerts/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Edit Alert"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_alert_path(cib_id: @cib.id), class: "btn btn-default" %> 8 | <%= link_to icon_text("font", _("Rename")), edit_name_cib_resource_path(cib_id: @cib.id, id: @alert.id, source: :resource), class: "btn btn-default", data: { toggle: :modal, target: "#modal" } %> 9 | <%= link_to icon_text("trash", _("Delete")), cib_alert_path(cib_id: @cib.id, id: @alert.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @alert.id } %> 10 |
11 |
12 |

13 |
14 |
15 | <%= render partial: "form", locals: { cib: @cib, alert: @alert } %> 16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :alert, mapping: @alert.help_text.merge(@alert.mapping) } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/clones/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "copy", _("Edit Clone"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_clone_path(cib_id: @cib.id), class: "btn btn-default" %> 8 | <%= link_to icon_text("font", _("Rename")), edit_name_cib_resource_path(cib_id: @cib.id, id: @clone.id, source: :resource), class: "btn btn-default", data: { toggle: :modal, target: "#modal" } %> 9 | <%= link_to icon_text("trash", _("Delete")), cib_clone_path(cib_id: @cib.id, id: @clone.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @clone.id } %> 10 |
11 |
12 |

13 |
14 |
15 | <%= render partial: "form", locals: { cib: @cib, clone: @clone } %> 16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :clone, mapping: @clone.help_text.merge(@clone.mapping) } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/groups/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "group", _("Edit Group"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_group_path(cib_id: @cib.id), class: "btn btn-default" %> 8 | <%= link_to icon_text("font", _("Rename")), edit_name_cib_resource_path(cib_id: @cib.id, id: @group.id, source: :resource), class: "btn btn-default", data: { toggle: :modal, target: "#modal" } %> 9 | <%= link_to icon_text("trash", _("Delete")), cib_group_path(cib_id: @cib.id, id: @group.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @group.id } %> 10 |
11 |
12 |

13 |
14 |
15 | <%= render partial: "form", locals: { cib: @cib, group: @group } %> 16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :resources, help: :group, mapping: @group.help_text.merge(@group.mapping) } %> 19 | -------------------------------------------------------------------------------- /hawk/vendor/assets/javascripts/jquery/locale/validate/messages_ar.js: -------------------------------------------------------------------------------- 1 | /*! jQuery Validation Plugin - v1.13.1 - 10/14/2014 2 | * http://jqueryvalidation.org/ 3 | * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */ 4 | !function(a){"function"==typeof define&&define.amd?define(["jquery","../../validate"],a):a(jQuery)}(function(a){a.extend(a.validator.messages,{required:"هذا الحقل إلزامي",remote:"يرجى تصحيح هذا الحقل للمتابعة",email:"رجاء إدخال عنوان بريد إلكتروني صحيح",url:"رجاء إدخال عنوان موقع إلكتروني صحيح",date:"رجاء إدخال تاريخ صحيح",dateISO:"رجاء إدخال تاريخ صحيح (ISO)",number:"رجاء إدخال عدد بطريقة صحيحة",digits:"رجاء إدخال أرقام فقط",creditcard:"رجاء إدخال رقم بطاقة ائتمان صحيح",equalTo:"رجاء إدخال نفس القيمة",extension:"رجاء إدخال ملف بامتداد موافق عليه",maxlength:a.validator.format("الحد الأقصى لعدد الحروف هو {0}"),minlength:a.validator.format("الحد الأدنى لعدد الحروف هو {0}"),rangelength:a.validator.format("عدد الحروف يجب أن يكون بين {0} و {1}"),range:a.validator.format("رجاء إدخال عدد قيمته بين {0} و {1}"),max:a.validator.format("رجاء إدخال عدد أقل من أو يساوي (0}"),min:a.validator.format("رجاء إدخال عدد أكبر من أو يساوي (0}")})}); 5 | -------------------------------------------------------------------------------- /e2e_test/Dockerfile: -------------------------------------------------------------------------------- 1 | # Defines the tag for OBS and build script builds: 2 | #!BuildTag: hawk_test 3 | # Use the repositories defined in OBS for installing packages 4 | #!UseOBSRepositories 5 | FROM registry.opensuse.org/opensuse/leap:15.4 6 | 7 | RUN zypper -n install -y --no-recommends \ 8 | MozillaFirefox \ 9 | MozillaFirefox-branding-upstream \ 10 | chromium \ 11 | file \ 12 | python3-paramiko \ 13 | python3-PyVirtualDisplay \ 14 | python3-selenium \ 15 | xauth \ 16 | xdpyinfo \ 17 | xorg-x11-fonts \ 18 | xorg-x11-Xvnc && \ 19 | zypper -n clean -a 20 | 21 | RUN zypper -n install -y --no-recommends \ 22 | gzip \ 23 | tar \ 24 | wget && \ 25 | zypper -n clean -a && \ 26 | wget -O- https://github.com/mozilla/geckodriver/releases/download/v0.32.0/geckodriver-v0.32.0-linux64.tar.gz | tar zxf - -C /usr/local/bin/ 27 | 28 | RUN chmod +x /usr/local/bin/* 29 | 30 | RUN useradd -l -m -d /test test 31 | 32 | COPY *.py / 33 | 34 | ENV PYTHONPATH / 35 | ENV PYTHONUNBUFFERED 1 36 | ENV DBUS_SESSION_BUS_ADDRESS /dev/null 37 | 38 | WORKDIR /test 39 | 40 | USER test 41 | ENTRYPOINT ["/usr/bin/python3", "/hawk_test.py"] 42 | -------------------------------------------------------------------------------- /hawk/vendor/assets/stylesheets/bootstrap/_pager.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: $line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | @include clearfix; 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: $pager-bg; 19 | border: 1px solid $pager-border; 20 | border-radius: $pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: $pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: $pager-disabled-color; 50 | background-color: $pager-bg; 51 | cursor: $cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /hawk/app/assets/stylesheets/shared/_misc.scss: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2015 Tim Serong 2 | // See COPYING for license. 3 | 4 | .simple-hidden { 5 | display: none; 6 | } 7 | 8 | .margin-bottom { 9 | margin-bottom: 20px; 10 | } 11 | 12 | .toggleable, 13 | .clickable { 14 | cursor: pointer; 15 | } 16 | 17 | .softhide { 18 | display: none; 19 | } 20 | 21 | .img-responsive { 22 | width: 100%; 23 | } 24 | 25 | .btn { 26 | &.btn-circle { 27 | width: 35px; 28 | height: 35px; 29 | text-align: center; 30 | padding: 6px 0; 31 | line-height: 1.428571429; 32 | border-radius: 20px; 33 | } 34 | } 35 | 36 | .diff_sub { 37 | background: $diff-sub-bg; 38 | } 39 | 40 | .diff_add { 41 | background: $diff-add-bg; 42 | } 43 | 44 | .diff_chg { 45 | background: $diff-chg-bg; 46 | } 47 | 48 | 49 | td.diff_header { 50 | color: $diff-header-fg; 51 | } 52 | 53 | table.diff { 54 | border: 0; 55 | font-family: monospace; 56 | width: 100%; 57 | } 58 | 59 | .diff_next { 60 | background-color: $diff-next-bg; 61 | } 62 | 63 | .fa-status-small { 64 | font-size: 66%; 65 | vertical-align: top; 66 | } 67 | -------------------------------------------------------------------------------- /hawk/app/views/orders/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "sort-amount-desc", _("Edit Order"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_order_path(cib_id: @cib.id), class: "btn btn-default" %> 8 | <%= link_to icon_text("font", _("Rename")), edit_name_cib_constraint_path(cib_id: @cib.id, id: @order.id, source: :constraint), class: "btn btn-default", data: { toggle: :modal, target: "#modal" } %> 9 | <%= link_to icon_text("trash", _("Delete")), cib_order_path(cib_id: @cib.id, id: @order.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @order.id } %> 10 |
11 |
12 |

13 |
14 |
15 | <%= render partial: "form", locals: { cib: @cib, order: @order } %> 16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :order, mapping: @order.help_text.merge(@order.mapping) } %> 19 | -------------------------------------------------------------------------------- /hawk/app/views/tickets/edit.html.erb: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | <%= icon_text "ticket", _("Edit Ticket"), class: "page" %> 5 |
6 |
7 | <%= link_to icon_text("plus", _("Create")), new_cib_ticket_path(cib_id: @cib.id), class: "btn btn-default" %> 8 | <%= link_to icon_text("font", _("Rename")), edit_name_cib_constraint_path(cib_id: @cib.id, id: @ticket.id, source: :constraint), class: "btn btn-default", data: { toggle: :modal, target: "#modal" } %> 9 | <%= link_to icon_text("trash", _("Delete")), cib_ticket_path(cib_id: @cib.id, id: @ticket.id), method: "delete", class: "btn btn-default", data: { confirm: _("Are you sure you wish to delete %s?") % @ticket.id } %> 10 |
11 |
12 |

13 |
14 |
15 | <%= render partial: "form", locals: { cib: @cib, ticket: @ticket } %> 16 |
17 |
18 | <%= render partial: "shared/helpsidebar", locals: { category: :constraints, help: :ticket, mapping: @ticket.help_text.merge(@ticket.mapping) } %> 19 | --------------------------------------------------------------------------------