├── .gitignore
├── .pre-commit-config.yaml
├── ABOUT-NLS
├── API.json
├── CONTRIBUTE.md
├── COPYING
├── COPYING.ASL2
├── COPYING.LGPL
├── ChangeLog
├── IBM-license-blacklist
├── INSTALL
├── Makefile.am
├── README.md
├── VERSION
├── __init__.py
├── autogen.sh
├── build-aux
├── config.rpath
├── genChangelog
└── pkg-version
├── check_spec_errors.sh
├── config.py.in
├── config.rpath
├── configure.ac
├── contrib
├── DEBIAN
│ ├── Makefile.am
│ └── control.in
├── Makefile.am
├── check_i18n.py
├── gingerbase.spec.fedora.in
├── gingerbase.spec.suse.in
└── make-deb.sh.in
├── control
├── Makefile.am
├── __init__.py
├── config.py
├── cpuinfo.py
├── debugreports.py
├── host.py
├── packagesupdate.py
├── smt.py
└── storage_devs.py
├── disks.py
├── docs
├── API.md
├── Makefile.am
├── README-HostStats-configuration.md
├── README.md
└── gingerbase-host-tab.png
├── gingerbase.conf
├── gingerbase.py
├── i18n.py
├── lscpu.py
├── m4
├── ac_python_module.m4
├── gettext.m4
├── iconv.m4
├── intlmacosx.m4
├── lib-ld.m4
├── lib-link.m4
├── lib-prefix.m4
├── nls.m4
├── po.m4
└── progtest.m4
├── mockmodel.py
├── model
├── Makefile.am
├── __init__.py
├── config.py.in
├── cpuinfo.py
├── debugreports.py
├── host.py
├── model.py
├── packagesupdate.py
├── smt.py
└── storage_devs.py
├── netinfo.py
├── po
├── LINGUAS
├── Makefile.in.in
├── Makevars
├── POTFILES.in
├── de_DE.po
├── en_US.po
├── es_ES.po
├── fr_FR.po
├── gen-pot.in
├── gingerbase.pot
├── it_IT.po
├── ja_JP.po
├── ko_KR.po
├── pt_BR.po
├── ru_RU.po
├── zh_CN.po
└── zh_TW.po
├── portageparser.py
├── repositories.py
├── swupdate.py
├── tests
├── Makefile.am
├── run_tests.sh.in
├── test_authorization.py
├── test_config.py.in
├── test_disks.py
├── test_host.py
├── test_model.py
├── test_netinfo.py
├── test_rest.py
├── test_smt.py
├── test_storage_devs.py
└── test_yumparser.py
├── ui
├── Makefile.am
├── config
│ ├── Makefile.am
│ └── tab-ext.xml
├── css
│ ├── Makefile.am
│ ├── gingerbase.css
│ └── src
│ │ ├── gingerbase.scss
│ │ └── modules
│ │ ├── _host.scss
│ │ └── _line-chart.scss
├── images
│ ├── Makefile.am
│ ├── gingerbase.svg
│ └── logo.ico
├── js
│ ├── Makefile.am
│ └── src
│ │ ├── gingerbase.api.js
│ │ ├── gingerbase.host-dashboard.js
│ │ ├── gingerbase.host-update.js
│ │ ├── gingerbase.report_add_main.js
│ │ ├── gingerbase.report_rename_main.js
│ │ ├── gingerbase.repository_add_main.js
│ │ └── gingerbase.repository_edit_main.js
└── pages
│ ├── Makefile.am
│ ├── help
│ ├── Makefile.am
│ ├── de_DE
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── dita-help.xsl
│ ├── en_US
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── es_ES
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── fr_FR
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── gingerbase.css
│ ├── it_IT
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── ja_JP
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── ko_KR
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── pt_BR
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── ru_RU
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── zh_CN
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ └── zh_TW
│ │ ├── Makefile.am
│ │ ├── host-dashboard.dita
│ │ └── host-update.dita
│ ├── i18n.json.tmpl
│ ├── report-add.html.tmpl
│ ├── report-rename.html.tmpl
│ ├── repository-add.html.tmpl
│ ├── repository-edit.html.tmpl
│ └── tabs
│ ├── Makefile.am
│ ├── host-dashboard.html.tmpl
│ └── host-update.html.tmpl
├── utils.py
└── yumparser.py
/.gitignore:
--------------------------------------------------------------------------------
1 | *.pyc
2 | *~
3 | i18n/mo/*
4 | log
5 | data
6 | mo
7 | autom4te.cache
8 | Makefile
9 | Makefile.in
10 | aclocal.m4
11 | build-aux/compile
12 | build-aux/config.guess
13 | build-aux/config.sub
14 | build-aux/install-sh
15 | build-aux/missing
16 | build-aux/py-compile
17 | configure
18 | config.log
19 | config.py
20 | config.status
21 | contrib/DEBIAN/control
22 | contrib/gingerbase.spec.fedora
23 | contrib/gingerbase.spec.suse
24 | contrib/make-deb.sh
25 | *.min.js
26 | *.gmo
27 | stamp-po
28 | gingerbase-*.tar.gz
29 | tests/run_tests.sh
30 | tests/test_config.py
31 | po/POTFILES
32 | po/gen-pot
33 | *.orig
34 | *.rej
35 | *.pem
36 | ui/pages/help/*/*.html
37 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | # Pre-commit git hooks, run locally before every commit
2 | # Init with
3 | # $ pip install -r requirements-dev.txt
4 | # $ pre-commit install
5 |
6 | repos:
7 | - repo: https://github.com/pre-commit/pre-commit-hooks
8 | rev: v2.1.0
9 | hooks:
10 | - id: trailing-whitespace
11 | - id: end-of-file-fixer
12 | exclude: '\.list$'
13 | #- id: check-docstring-first
14 | - id: check-json
15 | #- id: check-added-large-files
16 | - id: check-yaml
17 | - id: debug-statements
18 | #- id: name-tests-test
19 | - id: double-quote-string-fixer
20 | - id: requirements-txt-fixer
21 | - repo: https://gitlab.com/pycqa/flake8
22 | rev: 3.7.1
23 | hooks:
24 | - id: flake8
25 | - repo: https://github.com/pre-commit/mirrors-autopep8
26 | rev: v1.4.4
27 | hooks:
28 | - id: autopep8
29 | - repo: https://github.com/asottile/reorder_python_imports
30 | rev: v1.3.5
31 | hooks:
32 | - id: reorder-python-imports
33 | language_version: python3
34 |
--------------------------------------------------------------------------------
/CONTRIBUTE.md:
--------------------------------------------------------------------------------
1 | How to Contribute
2 | =================
3 |
4 | All development discussion happens on the mailing list. All development is done
5 | using the `git` SCM. Patches should be sent using the `git send-email` command
6 | to the ginger-dev-list@googlegroups.com mailing list.
7 |
8 | Please go through below wiki page which describe on how to contribute to the community.
9 | [How to Contribute](https://github.com/kimchi-project/ginger/wiki/How-to-Contribute)
10 |
11 | Good examples of how to send patches are included in
12 | [QEMU SubmitAPatch](http://wiki.qemu.org/Contribute/SubmitAPatch) and
13 | [Linux SubmittingPatches](https://www.kernel.org/doc/Documentation/SubmittingPatches).
14 |
15 | All documentation and READMEs are written using
16 | [Markdown](http://daringfireball.net/projects/markdown/).
17 |
18 | For a patch to be committed, it must receive at least one "Reviewed-by" on the
19 | mailing list.
20 |
--------------------------------------------------------------------------------
/COPYING:
--------------------------------------------------------------------------------
1 | Ginger Base is distributed pursuant to the terms of two different licenses.
2 | The user interface (located in ui/) is governed by the Apache License version 2.0.
3 |
4 | The rest of this distribution is governed by the GNU Lesser General Public
5 | License version 2.1.
6 |
7 | See COPYING.LGPL and COPYING.ASL2.
8 |
--------------------------------------------------------------------------------
/IBM-license-blacklist:
--------------------------------------------------------------------------------
1 | .gitignore
2 | ABOUT-NLS
3 | API.json
4 | CONTRIBUTE.md
5 | COPYING
6 | COPYING.ASL2
7 | COPYING.LGPL
8 | ChangeLog
9 | INSTALL
10 | VERSION
11 | gingerbase.conf
12 | build-aux/config.rpath
13 | build-aux/genChangelog
14 | build-aux/pkg-version
15 | config.rpath
16 | contrib/DEBIAN/control.in
17 | contrib/gingerbase.spec.fedora.in
18 | contrib/gingerbase.spec.suse.in
19 | docs/.*.md
20 | m4/.*.m4
21 | po/LINGUAS
22 | po/Makefile.in.in
23 | po/Makevars
24 | po/POTFILES.in
25 | po/gingerbase.pot
26 | ui/config/tab-ext.xml
27 | ui/images/.*.svg
28 | ui/pages/help/dita-help.xsl
29 | ui/pages/help/.*/.*.dita
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | docs/README.md
--------------------------------------------------------------------------------
/VERSION:
--------------------------------------------------------------------------------
1 | 2.2.1
2 |
--------------------------------------------------------------------------------
/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | from wok.plugins.gingerbase.gingerbase import Gingerbase
20 | __all__ = [Gingerbase]
21 |
--------------------------------------------------------------------------------
/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Project Ginger Base
4 | #
5 | # Copyright IBM Corp, 2013-2016
6 | #
7 | # Code derived from Project Kimchi
8 | #
9 | # This library is free software; you can redistribute it and/or
10 | # modify it under the terms of the GNU Lesser General Public
11 | # License as published by the Free Software Foundation; either
12 | # version 2.1 of the License, or (at your option) any later version.
13 | #
14 | # This library is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 | # Lesser General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU Lesser General Public
20 | # License along with this library; if not, write to the Free Software
21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 |
23 | aclocal
24 | automake --add-missing
25 | autoreconf
26 |
27 | if [ ! -f "configure" ]; then
28 | echo "Failed to generate configure script. Check to make sure autoconf, "
29 | echo "automake, and other build dependencies are properly installed."
30 | exit 1
31 | fi
32 |
33 | if [ "x$1" == "x--system" ]; then
34 | ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
35 | else
36 | if [ $# -gt 0 ]; then
37 | ./configure $@
38 | else
39 | ./configure --prefix=/usr/local
40 | fi
41 | fi
42 |
--------------------------------------------------------------------------------
/build-aux/genChangelog:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # This script is based on code from the Kandan project:
4 | # https://github.com/kandanapp/kandan/blob/master/gen-changelog.sh
5 |
6 | echo "CHANGELOG"
7 | echo "========="
8 | echo
9 | git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tac |grep -v '^$' | while read TAG ; do
10 | if [ $NEXT ]; then
11 | echo "#### [$NEXT] ####"
12 | elif [ "$1" != "--release" ]; then
13 | echo "#### [Current] ####"
14 | else
15 | NEXT=$TAG
16 | continue
17 | fi
18 | GIT_PAGER=cat git log --pretty=format:" * [%h] %<(78,trunc)%s (%an)" $TAG..$NEXT
19 | NEXT=$TAG
20 | echo; echo
21 | done
22 | FIRST=$(git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | head -1)
23 |
24 | echo "#### [$FIRST] ####"
25 | GIT_PAGER=cat git log --pretty=format:" * [%h] %<(78,trunc)%s (%an)" $FIRST
26 |
--------------------------------------------------------------------------------
/build-aux/pkg-version:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Copyright 2008-2012 Red Hat, Inc.
4 | #
5 | # This program is free software; you can redistribute it and/or modify
6 | # it under the terms of the GNU General Public License as published by
7 | # the Free Software Foundation; either version 2 of the License, or
8 | # (at your option) any later version.
9 | #
10 | # This program is distributed in the hope that it will be useful,
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | # GNU General Public License for more details.
14 | #
15 | # You should have received a copy of the GNU General Public License
16 | # along with this program; if not, write to the Free Software
17 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 |
19 | # tags and output versions:
20 | # - 4.9.0 => 4.9.0 (upstream clean)
21 | # - 4.9.0-1 => 4.9.0 (downstream clean)
22 | # - 4.9.0-2-g34e62f => 4.9.0 (upstream dirty)
23 | # - 4.9.0-1-2-g34e62f => 4.9.0 (downstream dirty)
24 | AWK_VERSION='
25 | BEGIN { FS="-" }
26 | /^[0-9]/ {
27 | print $1
28 | }'
29 |
30 | # tags and output releases:
31 | # - 4.9.0 => 0 (upstream clean)
32 | # - 4.9.0-1 => 1 (downstream clean)
33 | # - 4.9.0-2-g34e62f1 => 2.git34e62f1 (upstream dirty)
34 | # - 4.9.0-1-2-g34e62f1 => 1.2.git34e62f1 (downstream dirty)
35 | AWK_RELEASE='
36 | BEGIN { FS="-"; OFS="." }
37 | /^[0-9]/ {
38 | if (NF == 1) print 0
39 | else if (NF == 2) print $2
40 | else if (NF == 3) print $2, "git" substr($3, 2)
41 | else if (NF == 4) print $2, $3, "git" substr($4, 2)
42 | }'
43 |
44 | if [ ! -e .git ]; then
45 | PKG_VERSION=`cat VERSION`
46 | else
47 | PKG_VERSION=`git describe --tags --match "[0-9]*" || cat VERSION`
48 | fi
49 |
50 | if test "x$1" = "x--full"; then
51 | echo $PKG_VERSION | tr -d '[:space:]'
52 | elif test "x$1" = "x--version"; then
53 | echo $PKG_VERSION | awk "$AWK_VERSION" | tr -cd '[:alnum:].'
54 | elif test "x$1" = "x--release"; then
55 | echo $PKG_VERSION | awk "$AWK_RELEASE" | tr -cd '[:alnum:].'
56 | else
57 | echo "usage: $0 [--full|--version|--release]"
58 | exit 1
59 | fi
60 |
--------------------------------------------------------------------------------
/check_spec_errors.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | #
4 | # Project Wok
5 | #
6 | # Copyright IBM Corp, 2016
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 |
22 | echo "Checking spec guidelines"
23 |
24 | # create links
25 | cp contrib/gingerbase.spec.fedora contrib/gingerbase_fedora.spec
26 | cp contrib/gingerbase.spec.suse contrib/gingerbase_suse.spec
27 |
28 | # run checking
29 | rpmlint contrib/gingerbase_fedora.spec
30 | rpmlint contrib/gingerbase_suse.spec
31 |
32 | # remove links
33 | rm contrib/gingerbase_fedora.spec
34 | rm contrib/gingerbase_suse.spec
35 |
--------------------------------------------------------------------------------
/config.py.in:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2017
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | #
20 |
21 | import os
22 | import threading
23 |
24 | from wok.config import PluginConfig, PluginPaths
25 | from wok.utils import load_plugin_conf
26 |
27 | gingerBaseLock = threading.Lock()
28 |
29 |
30 | def get_debugreports_path():
31 | return os.path.join(PluginPaths('gingerbase').state_dir, 'debugreports')
32 |
33 |
34 | def get_object_store():
35 | return os.path.join(PluginPaths('gingerbase').state_dir,
36 | 'objectstore')
37 |
38 |
39 | def get_config():
40 | return load_plugin_conf('kimchi')
41 |
42 |
43 | config = get_config()
44 |
45 |
46 | class GingerBasePaths(PluginPaths):
47 |
48 | def __init__(self):
49 | super(GingerBasePaths, self).__init__('gingerbase')
50 |
51 |
52 | gingerBasePaths = GingerBasePaths()
53 |
54 |
55 | class GingerBaseConfig(PluginConfig):
56 | def __init__(self):
57 | super(GingerBaseConfig, self).__init__('gingerbase')
58 |
59 | custom_config = {
60 | '/data/debugreports': {
61 | 'tools.staticdir.on': True,
62 | 'tools.staticdir.dir': os.path.join(gingerBasePaths.state_dir,
63 | 'debugreports'),
64 | 'tools.nocache.on': False,
65 | 'tools.wokauth.on': True,
66 | 'tools.staticdir.content_types': {'xz': 'application/x-xz'}
67 | },
68 | '/help': {
69 | 'tools.staticdir.on': True,
70 | 'tools.staticdir.dir': os.path.join(gingerBasePaths.ui_dir,
71 | 'pages/help'),
72 | 'tools.nocache.on': True
73 | }
74 | }
75 |
76 | self.update(custom_config)
77 |
--------------------------------------------------------------------------------
/configure.ac:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | AC_INIT([gingerbase], [m4_esyscmd([./build-aux/pkg-version --version])])
21 |
22 | AC_SUBST([PACKAGE_VERSION],
23 | [m4_esyscmd([./build-aux/pkg-version --version])])
24 |
25 | AC_SUBST([PACKAGE_RELEASE],
26 | [m4_esyscmd([./build-aux/pkg-version --release])])
27 |
28 | # Testing for version and release
29 | AS_IF([test "x$PACKAGE_VERSION" = x],
30 | AC_MSG_ERROR([package version not defined]))
31 | AS_IF([test "x$PACKAGE_RELEASE" = x],
32 | AC_MSG_ERROR([package release not defined]))
33 |
34 | AC_CONFIG_AUX_DIR([build-aux])
35 | AM_INIT_AUTOMAKE([-Wno-portability])
36 | AM_PATH_PYTHON([3.6])
37 | AC_PATH_PROG([PEP8], [pep8], [/usr/bin/pep8])
38 | AC_PATH_PROG([GIT], [git], [/usr/bin/git])
39 | AC_PATH_PROG([RPMLINT], [rpmlint], [/usr/bin/rpmlint])
40 | AC_PYTHON_MODULE([unittest])
41 | AC_SUBST([HAVE_PYMOD_UNITTEST])
42 | AC_SUBST([PYTHON_VERSION])
43 | AM_GNU_GETTEXT([external])
44 | AM_GNU_GETTEXT_VERSION([0.10])
45 | AC_PATH_PROG([CHEETAH], [cheetah], [/usr/bin/cheetah])
46 |
47 | # Checking for pyflakes
48 | AC_PATH_PROG([PYFLAKES], [pyflakes])
49 | if test "x$PYFLAKES" = "x"; then
50 | AC_MSG_WARN([pyflakes not found])
51 | fi
52 |
53 | AC_ARG_ENABLE(
54 | [sample],
55 | [AS_HELP_STRING(
56 | [--enable-sample],
57 | [enable sample plugin @<:@default=no@:>@]
58 | )],
59 | ,
60 | [enable_sample="no"]
61 | )
62 |
63 | if test "${enable_sample}" = "yes"; then
64 | AC_SUBST([ENABLE_SAMPLE], [True])
65 | else
66 | AC_SUBST([ENABLE_SAMPLE], [False])
67 | fi
68 |
69 | AC_CONFIG_FILES([
70 | po/Makefile.in
71 | po/gen-pot
72 | Makefile
73 | docs/Makefile
74 | control/Makefile
75 | model/Makefile
76 | ui/Makefile
77 | ui/config/Makefile
78 | ui/css/Makefile
79 | ui/images/Makefile
80 | ui/js/Makefile
81 | ui/pages/Makefile
82 | ui/pages/help/Makefile
83 | ui/pages/tabs/Makefile
84 | ui/pages/help/en_US/Makefile
85 | ui/pages/help/de_DE/Makefile
86 | ui/pages/help/es_ES/Makefile
87 | ui/pages/help/fr_FR/Makefile
88 | ui/pages/help/it_IT/Makefile
89 | ui/pages/help/ja_JP/Makefile
90 | ui/pages/help/ko_KR/Makefile
91 | ui/pages/help/pt_BR/Makefile
92 | ui/pages/help/ru_RU/Makefile
93 | ui/pages/help/zh_CN/Makefile
94 | ui/pages/help/zh_TW/Makefile
95 | contrib/Makefile
96 | contrib/DEBIAN/Makefile
97 | contrib/DEBIAN/control
98 | contrib/gingerbase.spec.fedora
99 | contrib/gingerbase.spec.suse
100 | tests/Makefile
101 | ],[
102 | chmod +x po/gen-pot
103 | ])
104 |
105 | AC_OUTPUT
106 |
--------------------------------------------------------------------------------
/contrib/DEBIAN/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | CLEANFILES = control
21 |
--------------------------------------------------------------------------------
/contrib/DEBIAN/control.in:
--------------------------------------------------------------------------------
1 | Package: ginger-base
2 | Version: @PACKAGE_VERSION@
3 | Section: base
4 | Priority: optional
5 | Architecture: all
6 | Depends: wok (>= 2.1.0),
7 | python-apt,
8 | python-cherrypy3,
9 | python-configobj,
10 | python-lxml,
11 | python-parted,
12 | python-psutil (>= 0.6.0),
13 | gettext,
14 | git,
15 | sosreport
16 | Build-Depends: libxslt,
17 | gettext,
18 | python-lxml
19 | Maintainer: Daniel Henrique Barboza
20 | Description: Ginger Base is an open source base host management plugin for Wok (Webserver Originated from Kimchi), that provides an intuitive web panel with common tools for configuring and managing the Linux systems.
21 |
--------------------------------------------------------------------------------
/contrib/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | SUBDIRS = DEBIAN
21 |
22 | EXTRA_DIST = \
23 | check_i18n.py \
24 | gingerbase.spec.fedora.in \
25 | gingerbase.spec.suse.in \
26 | make-deb.sh.in \
27 | $(NULL)
28 |
29 | make-deb.sh: make-deb.sh.in $(top_builddir)/config.status
30 | $(AM_V_GEN)sed \
31 | -e 's|[@]PACKAGE_VERSION[@]|$(PACKAGE_VERSION)|g' \
32 | -e 's|[@]PACKAGE_RELEASE[@]|$(PACKAGE_RELEASE)|g' \
33 | < $< > $@-t && \
34 | chmod a+x $@-t && \
35 | mv $@-t $@
36 | BUILT_SOURCES = make-deb.sh
37 |
38 | CLEANFILES = gingerbase.spec.fedora gingerbase.spec.suse gingerbase.spec make-deb.sh
39 |
--------------------------------------------------------------------------------
/contrib/check_i18n.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Project Ginger Base
4 | #
5 | # Copyright IBM Corp, 2014-2016
6 | #
7 | # Code derived from Project Kimchi
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | import importlib
22 | import os
23 | import re
24 | import sys
25 |
26 |
27 | # Match all conversion specifier with mapping key
28 | PATTERN = re.compile(
29 | r"""%\([^)]+\) # Mapping key
30 | [#0\-+]? # Conversion flags (optional)
31 | (\d+|\*)? # Minimum field width (optional)
32 | (\.(\d+|\*))? # Precision (optional)
33 | [lLh]? # Length modifier (optional)
34 | [cdeEfFgGioursxX%] # Conversion type""",
35 | re.VERBOSE,
36 | )
37 | BAD_PATTERN = re.compile(r'%\([^)]*?\)')
38 |
39 |
40 | def load_i18n_module(i18nfile):
41 | mname = i18nfile.replace('/', '.').rstrip('.py').lstrip('src.')
42 | return importlib.import_module(mname)
43 |
44 |
45 | def check_string_formatting(messages):
46 | for k, v in messages.items():
47 | if BAD_PATTERN.findall(PATTERN.sub(' ', v)):
48 | print('bad i18n string formatting:')
49 | print(f' {k}: {v}')
50 | exit(1)
51 |
52 |
53 | def check_obsolete_messages(path, messages):
54 | def find_message_key(path, k):
55 | for root, dirs, files in os.walk(path):
56 | for f in files:
57 | fname = os.path.join(root, f)
58 | if (
59 | not fname.endswith('i18n.py')
60 | and fname.endswith('.py')
61 | or fname.endswith('.json')
62 | ):
63 | with open(fname) as f:
64 | string = ''.join(f.readlines())
65 | if k in string:
66 | return True
67 | return False
68 |
69 | for k in messages.keys():
70 | if not find_message_key(path, k):
71 | print(f' {k} is obsolete, it is no longer in use')
72 | exit(1)
73 |
74 |
75 | def main():
76 | print('Checking for invalid i18n string...')
77 | for f in sys.argv[1:]:
78 | messages = load_i18n_module(f).messages
79 | check_string_formatting(messages)
80 | check_obsolete_messages(os.path.dirname(f), messages)
81 | print('Checking for invalid i18n string successfully')
82 |
83 |
84 | if __name__ == '__main__':
85 | main()
86 |
--------------------------------------------------------------------------------
/contrib/gingerbase.spec.fedora.in:
--------------------------------------------------------------------------------
1 | Name: ginger-base
2 | Version: @PACKAGE_VERSION@
3 | Release: @PACKAGE_RELEASE@%{?dist}
4 | Summary: Wok plugin for base host management
5 | BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}
6 | BuildArch: noarch
7 | Group: System Environment/Base
8 | License: LGPL/ASL2
9 | Source0: %{name}-%{version}.tar.gz
10 | Requires: wok >= 2.1.0
11 | Requires: pyparted
12 | Requires: python-cherrypy
13 | Requires: python-configobj
14 | Requires: python-lxml
15 | Requires: python-psutil >= 0.6.0
16 | Requires: rpm-python
17 | Requires: gettext
18 | Requires: git
19 | Requires: sos
20 | BuildRequires: gettext-devel
21 | BuildRequires: libxslt
22 | BuildRequires: python-lxml
23 |
24 | %if 0%{?fedora} >= 23
25 | Requires: python2-dnf
26 | %endif
27 |
28 | %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
29 | %global with_systemd 1
30 | %endif
31 |
32 | %if 0%{?rhel} == 6
33 | Requires: python-ordereddict
34 | BuildRequires: python-unittest2
35 | %endif
36 |
37 | %description
38 | Ginger Base is an open source base host management plugin for Wok
39 | (Webserver Originated from Kimchi), that provides an intuitive web panel with
40 | common tools for configuring and managing the Linux systems.
41 |
42 | %prep
43 | %setup -q
44 |
45 | %build
46 | %configure
47 | make
48 |
49 |
50 | %install
51 | rm -rf %{buildroot}
52 | make DESTDIR=%{buildroot} install
53 |
54 |
55 | %clean
56 | rm -rf $RPM_BUILD_ROOT
57 |
58 | %files
59 | %attr(-,root,root)
60 | %{python_sitelib}/wok/plugins/gingerbase
61 | %{_datadir}/gingerbase
62 | %{_prefix}/share/locale/*/LC_MESSAGES/gingerbase.mo
63 | %{_datadir}/wok/plugins/gingerbase
64 | %{_datadir}/wok/plugins/gingerbase/ui/pages/tabs/host-dashboard.html.tmpl
65 | %{_datadir}/wok/plugins/gingerbase/ui/pages/tabs/host-update.html.tmpl
66 | %{_sysconfdir}/wok/plugins.d/gingerbase.conf
67 | %{_sharedstatedir}/gingerbase/
68 |
69 |
70 | %changelog
71 | * Wed Mar 23 2016 Daniel Henrique Barboza
72 | - Added wok version restriction >= 2.1.0
73 |
74 | * Tue Aug 25 2015 Chandra Shehkhar Reddy Potula 0.0-1
75 | - First build
76 |
--------------------------------------------------------------------------------
/contrib/gingerbase.spec.suse.in:
--------------------------------------------------------------------------------
1 | Name: ginger-base
2 | Version: @PACKAGE_VERSION@
3 | Release: @PACKAGE_RELEASE@%{?dist}
4 | Summary: Wok plugin for base host management
5 | BuildRoot: %{_topdir}/BUILD/%{name}-%{version}-%{release}
6 | BuildArch: noarch
7 | Group: System Environment/Base
8 | License: LGPL/ASL2
9 | Source0: %{name}-%{version}.tar.gz
10 | Requires: wok >= 2.1.0
11 | Requires: gettext-tools
12 | Requires: git
13 | Requires: python-CherryPy
14 | Requires: python-configobj
15 | Requires: python-lxml
16 | Requires: python-parted
17 | Requires: python-psutil >= 0.6.0
18 | Requires: rpm-python
19 | BuildRequires: gettext-tools
20 | BuildRequires: libxslt-tools
21 | BuildRequires: python-lxml
22 |
23 | %if 0%{?suse_version} == 1100
24 | Requires: python-ordereddict
25 | %endif
26 |
27 | %if 0%{?suse_version} > 1140
28 | %global with_systemd 1
29 | %endif
30 |
31 | %description
32 | Ginger Base is an open source base host management plugin for Wok
33 | (Webserver Originated from Kimchi), that provides an intuitive web panel with
34 | common tools for configuring and managing the Linux systems.
35 |
36 | %prep
37 | %setup -q
38 |
39 | %build
40 | %configure
41 | make
42 |
43 |
44 | %install
45 | rm -rf %{buildroot}
46 | make DESTDIR=%{buildroot} install
47 |
48 |
49 | %clean
50 | rm -rf $RPM_BUILD_ROOT
51 |
52 | %files
53 | %attr(-,root,root)
54 | %{python_sitelib}/wok/plugins/gingerbase
55 | %{_datadir}/gingerbase
56 | %{_prefix}/share/locale/*/LC_MESSAGES/gingerbase.mo
57 | %{_datadir}/wok/plugins/gingerbase
58 | %{_sysconfdir}/wok/plugins.d/gingerbase.conf
59 | %{_var}/lib/gingerbase/
60 |
61 |
62 | %changelog
63 | * Wed Mar 23 2016 Daniel Henrique Barboza
64 | - Added wok version restriction >= 2.1.0
65 |
66 | * Tue Aug 25 2015 Chandra Shehkhar Reddy Potula 0.0-1
67 | - First build
68 |
--------------------------------------------------------------------------------
/contrib/make-deb.sh.in:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Project Ginger Base
4 | #
5 | # Copyright IBM Corp, 2013-2016
6 | #
7 | # Code derived from Project Kimchi
8 | #
9 | # This library is free software; you can redistribute it and/or
10 | # modify it under the terms of the GNU Lesser General Public
11 | # License as published by the Free Software Foundation; either
12 | # version 2.1 of the License, or (at your option) any later version.
13 | #
14 | # This library is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 | # Lesser General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU Lesser General Public
20 | # License along with this library; if not, write to the Free Software
21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 |
23 | VERSION="@PACKAGE_VERSION@"
24 | RELEASE="@PACKAGE_RELEASE@"
25 |
26 | if [ ! -f configure ]; then
27 | echo "Please run this script from the top of the package tree"
28 | exit 1
29 | fi
30 |
31 | TMPDIR=`mktemp -d`
32 |
33 | make DESTDIR=$TMPDIR install-deb
34 | dpkg-deb -b $TMPDIR ginger-base-${VERSION}-${RELEASE}.noarch.deb
35 | rm -rf $TMPDIR
36 |
--------------------------------------------------------------------------------
/control/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | control_PYTHON = *.py
21 |
22 | controldir = $(pythondir)/wok/plugins/gingerbase/control
23 |
24 | install-data-local:
25 | $(MKDIR_P) $(DESTDIR)$(controldir)
26 |
--------------------------------------------------------------------------------
/control/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | import os
20 |
21 | from wok.control.utils import load_url_sub_node
22 |
23 |
24 | sub_nodes = load_url_sub_node(os.path.dirname(__file__), __name__)
25 |
--------------------------------------------------------------------------------
/control/config.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok.control.base import Resource
22 | from wok.control.utils import UrlSubNode
23 |
24 |
25 | @UrlSubNode('config')
26 | class Config(Resource):
27 | def __init__(self, model, id=None):
28 | super(Config, self).__init__(model, id)
29 |
30 | @property
31 | def data(self):
32 | return self.info
33 |
--------------------------------------------------------------------------------
/control/cpuinfo.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2017
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok.control.base import Resource
22 |
23 |
24 | class CPUInfo(Resource):
25 | def __init__(self, model):
26 | super(CPUInfo, self).__init__(model)
27 | self.admin_methods = ['GET']
28 | self.uri_fmt = '/host/cpuinfo'
29 |
30 | @property
31 | def data(self):
32 | return {'threading_enabled': self.info['guest_threads_enabled'],
33 | 'sockets': self.info['sockets'],
34 | 'cores': self.info['cores_available'],
35 | 'threads_per_core': self.info['threads_per_core']
36 | }
37 |
--------------------------------------------------------------------------------
/control/debugreports.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2017
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok.control.base import AsyncCollection
22 | from wok.control.base import Resource
23 | from wok.control.utils import internal_redirect
24 | from wok.control.utils import UrlSubNode
25 |
26 |
27 | DEBUGREPORTS_ACTIVITY = {
28 | 'POST': {'default': 'GGBDR0001L'},
29 | }
30 |
31 | DEBUGREPORT_ACTIVITY = {
32 | 'PUT': {'default': 'GGBDR0002L'},
33 | 'DELETE': {'default': 'GGBDR0003L'},
34 | }
35 |
36 |
37 | @UrlSubNode('debugreports', True)
38 | class DebugReports(AsyncCollection):
39 | def __init__(self, model):
40 | super(DebugReports, self).__init__(model)
41 | self.resource = DebugReport
42 | self.admin_methods = ['GET', 'POST']
43 |
44 | # set user log messages and make sure all parameters are present
45 | self.log_map = DEBUGREPORTS_ACTIVITY
46 | self.log_args.update({'name': ''})
47 |
48 | def _get_resources(self, filter_params):
49 | res_list = super(DebugReports, self)._get_resources(filter_params)
50 | return sorted(res_list, key=lambda x: x.data['time'], reverse=True)
51 |
52 |
53 | class DebugReport(Resource):
54 | def __init__(self, model, ident):
55 | super(DebugReport, self).__init__(model, ident)
56 | self.admin_methods = ['GET', 'PUT', 'POST']
57 | self.uri_fmt = '/debugreports/%s'
58 | self.content = DebugReportContent(model, ident)
59 | self.log_map = DEBUGREPORT_ACTIVITY
60 |
61 | @property
62 | def data(self):
63 | return {'name': self.ident,
64 | 'uri': self.info['uri'],
65 | 'time': self.info['ctime']}
66 |
67 |
68 | class DebugReportContent(Resource):
69 | def __init__(self, model, ident):
70 | super(DebugReportContent, self).__init__(model, ident)
71 | self.admin_methods = ['GET']
72 |
73 | def get(self):
74 | self.lookup()
75 | internal_uri = self.info['uri'].replace('plugins/gingerbase', '')
76 | raise internal_redirect(internal_uri)
77 |
--------------------------------------------------------------------------------
/control/host.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2017
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok.control.base import Collection
22 | from wok.control.base import Resource
23 | from wok.control.utils import UrlSubNode
24 | from wok.plugins.gingerbase.control.cpuinfo import CPUInfo
25 | from wok.plugins.gingerbase.control.packagesupdate import PackagesUpdate
26 | from wok.plugins.gingerbase.control.packagesupdate import SwUpdateProgress
27 | from wok.plugins.gingerbase.control.smt import Smt
28 |
29 |
30 | HOST_ACTIVITY = {
31 | 'POST': {
32 | 'reboot': 'GGBHOST0001L',
33 | 'shutdown': 'GGBHOST0002L',
34 | 'swupdate': 'GGBPKGUPD0001L',
35 | },
36 | }
37 |
38 | REPOSITORIES_ACTIVITY = {
39 | 'POST': {'default': 'GGBREPOS0001L'},
40 | }
41 |
42 | REPOSITORY_ACTIVITY = {
43 | 'PUT': {'default': 'GGBREPOS0002L'},
44 | 'DELETE': {'default': 'GGBREPOS0003L'},
45 | 'POST': {
46 | 'enable': 'GGBREPOS0004L',
47 | 'disable': 'GGBREPOS0005L',
48 | },
49 | }
50 |
51 |
52 | @UrlSubNode('host', True)
53 | class Host(Resource):
54 | def __init__(self, model, id=None):
55 | super(Host, self).__init__(model, id)
56 | self.admin_methods = ['POST']
57 | self.uri_fmt = '/host/%s'
58 | self.reboot = self.generate_action_handler('reboot')
59 | self.shutdown = self.generate_action_handler('shutdown')
60 | self.stats = HostStats(self.model)
61 | self.packagesupdate = PackagesUpdate(self.model)
62 | self.repositories = Repositories(self.model)
63 | self.swupdate = self.generate_action_handler_task('swupdate')
64 | self.swupdateprogress = SwUpdateProgress(self.model)
65 | self.cpuinfo = CPUInfo(self.model)
66 | self.smt = Smt(self.model)
67 | self.capabilities = Capabilities(self.model)
68 | self.log_map = HOST_ACTIVITY
69 |
70 | @property
71 | def data(self):
72 | return self.info
73 |
74 |
75 | class HostStats(Resource):
76 | def __init__(self, model, id=None):
77 | super(HostStats, self).__init__(model, id)
78 | self.history = HostStatsHistory(self.model)
79 |
80 | @property
81 | def data(self):
82 | return self.info
83 |
84 |
85 | class HostStatsHistory(Resource):
86 | @property
87 | def data(self):
88 | return self.info
89 |
90 |
91 | class Capabilities(Resource):
92 | def __init__(self, model, id=None):
93 | super(Capabilities, self).__init__(model, id)
94 |
95 | @property
96 | def data(self):
97 | return self.info
98 |
99 |
100 | class Repositories(Collection):
101 | def __init__(self, model):
102 | super(Repositories, self).__init__(model)
103 | self.admin_methods = ['GET', 'POST']
104 | self.resource = Repository
105 |
106 | # set user log messages and make sure all parameters are present
107 | self.log_map = REPOSITORIES_ACTIVITY
108 | self.log_args.update({'repo_id': ''})
109 |
110 |
111 | class Repository(Resource):
112 | def __init__(self, model, id):
113 | super(Repository, self).__init__(model, id)
114 | self.admin_methods = ['GET', 'PUT', 'POST', 'DELETE']
115 | self.uri_fmt = '/host/repositories/%s'
116 | self.enable = self.generate_action_handler('enable')
117 | self.disable = self.generate_action_handler('disable')
118 | self.log_map = REPOSITORY_ACTIVITY
119 |
120 | @property
121 | def data(self):
122 | return self.info
123 |
--------------------------------------------------------------------------------
/control/packagesupdate.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2016-2017
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok import template
22 | from wok.control.base import AsyncResource
23 | from wok.control.base import Collection
24 | from wok.control.base import Resource
25 | from wok.control.base import SimpleCollection
26 | from wok.control.utils import get_class_name
27 | from wok.control.utils import model_fn
28 |
29 |
30 | PACKAGEUPDATE_ACTIVITY = {'POST': {'upgrade': 'GGBPKGUPD0002L'}}
31 |
32 |
33 | class PackagesUpdate(Collection):
34 | def __init__(self, model):
35 | super(PackagesUpdate, self).__init__(model)
36 | self.admin_methods = ['GET']
37 | self.resource = PackageUpdate
38 |
39 | def get(self, filter_params):
40 | res_list = []
41 | get_list = getattr(self.model, model_fn(self, 'get_list'))
42 | res_list = get_list(*self.model_args, **filter_params)
43 | return template.render(get_class_name(self), res_list)
44 |
45 |
46 | class PackageUpdate(Resource):
47 | def __init__(self, model, id=None):
48 | super(PackageUpdate, self).__init__(model, id)
49 | self.admin_methods = ['GET', 'POST']
50 | self.upgrade = self.generate_action_handler_task('upgrade')
51 | self.log_map = PACKAGEUPDATE_ACTIVITY
52 | self.deps = PackageDeps(self.model, id)
53 |
54 | @property
55 | def data(self):
56 | return self.info
57 |
58 |
59 | class PackageDeps(SimpleCollection):
60 | def __init__(self, model, pkg=None):
61 | super(PackageDeps, self).__init__(model)
62 | self.admin_methods = ['GET']
63 | self.pkg = pkg
64 | self.resource_args = [self.pkg, ]
65 | self.model_args = [self.pkg, ]
66 |
67 |
68 | class SwUpdateProgress(AsyncResource):
69 | def __init__(self, model, id=None):
70 | super(SwUpdateProgress, self).__init__(model, id)
71 | self.admin_methods = ['GET']
72 |
73 | @property
74 | def data(self):
75 | return self.info
76 |
--------------------------------------------------------------------------------
/control/smt.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2016-2017
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | from wok.control.base import Resource
20 | from wok.control.utils import UrlSubNode
21 |
22 | SMT_ACTIVITY = {
23 | 'POST': {
24 | 'enable': 'GINSMT0001L',
25 | 'disable': 'GINSMT0002L',
26 | },
27 | }
28 |
29 |
30 | @UrlSubNode('smt', True)
31 | class Smt(Resource):
32 | def __init__(self, model, id=None):
33 | super(Smt, self).__init__(model, id)
34 | self.admin_methods = ['GET']
35 | self.uri_fmt = '/host/smt/%s'
36 | self.enable = self.generate_action_handler('enable', ['smt_val'])
37 | self.disable = self.generate_action_handler('disable')
38 | self.log_map = SMT_ACTIVITY
39 |
40 | @property
41 | def data(self):
42 | return self.info
43 |
--------------------------------------------------------------------------------
/control/storage_devs.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2016-2017
5 | #
6 | # Code derived from Project Ginger
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok.control.base import SimpleCollection
22 | from wok.control.utils import UrlSubNode
23 |
24 |
25 | @UrlSubNode('stgdevs', True)
26 | class StorageDevs(SimpleCollection):
27 | """
28 | Collections representing the storage devices on the system
29 | """
30 |
31 | def __init__(self, model):
32 | super(StorageDevs, self).__init__(model)
33 | self.admin_methods = ['GET']
34 |
--------------------------------------------------------------------------------
/docs/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | docdir = $(datadir)/gingerbase/doc
21 |
22 | dist_doc_DATA = \
23 | API.md \
24 | README.md \
25 | gingerbase-host-tab.png \
26 | $(NULL)
27 |
--------------------------------------------------------------------------------
/docs/README-HostStats-configuration.md:
--------------------------------------------------------------------------------
1 | GingerBase Project - HostStats Configuration
2 | ============================================
3 |
4 | One of the main features of GingerBase is the Host Statistics (HostStats)
5 | visualization. This feature is responsible to collect and show on UI the data
6 | for CPU, memory, network and disk usage on host system. A history of the last
7 | 60 seconds of statistics is cached and the UI is capable to show this
8 | information when Dashboard screen of the Host tab is selected.
9 |
10 | To create this history, it's possible that Wok consumes about 1% of host's CPU
11 | when in idle mode, due the background task executed every second to collect and
12 | cache the host statistics. This CPU consumption can be reduced by turning off
13 | the host statistics history, making Wok only collect host's data when Dashboard
14 | screen of the Host tab is accessed.
15 |
16 | By default the cache of host statistics history is enabled. To disable it, do
17 | the following:
18 |
19 | * Edit the /etc/wok/plugins.d/gingerbase.conf file and change the value of
20 | **statshistory_on** to False:
21 |
22 | ```
23 | statshistory_on = False
24 | ```
25 |
26 | * Then (re)start Wok service:
27 |
28 | ```
29 | sudo systemctl start wokd.service
30 | ```
31 |
32 | The Wok server will not cache host statistics history and the graphics of the
33 | Dashboard screen will show data since the moment this screen is accessed.
34 |
35 | Enjoy!
36 |
--------------------------------------------------------------------------------
/docs/gingerbase-host-tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kimchi-project/gingerbase/42ef0cf5a25164a83473f7c8a3567a1f7f7bd481/docs/gingerbase-host-tab.png
--------------------------------------------------------------------------------
/gingerbase.conf:
--------------------------------------------------------------------------------
1 | [wok]
2 | # Enable Ginger base plugin on Wok server (values: True|False)
3 | enable = True
4 |
5 | [gingerbase]
6 | # Enable Host Statistics History cache (values: True|False, default:True)
7 | statshistory_on = True
8 |
--------------------------------------------------------------------------------
/gingerbase.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2017
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | import json
20 | import os
21 | import tempfile
22 |
23 | import cherrypy
24 | from wok.plugins.gingerbase import config
25 | from wok.plugins.gingerbase import mockmodel
26 | from wok.plugins.gingerbase.control import sub_nodes
27 | from wok.plugins.gingerbase.i18n import messages
28 | from wok.plugins.gingerbase.model import model as gingerBaseModel
29 | from wok.root import WokRoot
30 |
31 |
32 | class Gingerbase(WokRoot):
33 | def __init__(self, wok_options):
34 | make_dirs = [
35 | os.path.dirname(os.path.abspath(config.get_object_store())),
36 | os.path.abspath(config.get_debugreports_path())
37 | ]
38 | for directory in make_dirs:
39 | if not os.path.isdir(directory):
40 | os.makedirs(directory)
41 |
42 | if wok_options.test and (wok_options.test is True or
43 | wok_options.test.lower() == 'true'):
44 | self.objectstore_loc = tempfile.mktemp()
45 | self.model = mockmodel.MockModel(self.objectstore_loc)
46 |
47 | def remove_objectstore():
48 | if os.path.exists(self.objectstore_loc):
49 | os.unlink(self.objectstore_loc)
50 | cherrypy.engine.subscribe('exit', remove_objectstore)
51 | else:
52 | self.model = gingerBaseModel.Model()
53 |
54 | dev_env = wok_options.environment != 'production'
55 | super(Gingerbase, self).__init__(self.model, dev_env)
56 |
57 | for ident, node in sub_nodes.items():
58 | setattr(self, ident, node(self.model))
59 |
60 | self.api_schema = json.load(open(os.path.join(os.path.dirname(
61 | os.path.abspath(__file__)), 'API.json')))
62 | self.paths = config.gingerBasePaths
63 | self.domain = 'gingerbase'
64 | self.messages = messages
65 |
66 | def get_custom_conf(self):
67 | return config.GingerBaseConfig()
68 |
--------------------------------------------------------------------------------
/m4/ac_python_module.m4:
--------------------------------------------------------------------------------
1 | dnl @synopsis AC_PYTHON_MODULE(modname[, fatal])
2 | dnl
3 | dnl Checks for Python module.
4 | dnl
5 | dnl If fatal is non-empty then absence of a module will trigger an
6 | dnl error.
7 | dnl
8 | dnl @category InstalledPackages
9 | dnl @author Andrew Collier .
10 | dnl @version 2004-07-14
11 | dnl @license AllPermissive
12 |
13 | AC_DEFUN([AC_PYTHON_MODULE],[
14 | AC_MSG_CHECKING(python module: $1)
15 | python -c "import $1" 2>/dev/null
16 | if test $? -eq 0;
17 | then
18 | AC_MSG_RESULT(yes)
19 | eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
20 | else
21 | AC_MSG_RESULT(no)
22 | eval AS_TR_CPP(HAVE_PYMOD_$1)=no
23 | #
24 | if test -n "$2"
25 | then
26 | AC_MSG_ERROR(failed to find required module $1)
27 | exit 1
28 | fi
29 | fi
30 | ])
31 |
--------------------------------------------------------------------------------
/m4/intlmacosx.m4:
--------------------------------------------------------------------------------
1 | # intlmacosx.m4 serial 3 (gettext-0.18)
2 | dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
3 | dnl This file is free software; the Free Software Foundation
4 | dnl gives unlimited permission to copy and/or distribute it,
5 | dnl with or without modifications, as long as this notice is preserved.
6 | dnl
7 | dnl This file can can be used in projects which are not available under
8 | dnl the GNU General Public License or the GNU Library General Public
9 | dnl License but which still want to provide support for the GNU gettext
10 | dnl functionality.
11 | dnl Please note that the actual code of the GNU gettext library is covered
12 | dnl by the GNU Library General Public License, and the rest of the GNU
13 | dnl gettext package package is covered by the GNU General Public License.
14 | dnl They are *not* in the public domain.
15 |
16 | dnl Checks for special options needed on MacOS X.
17 | dnl Defines INTL_MACOSX_LIBS.
18 | AC_DEFUN([gt_INTL_MACOSX],
19 | [
20 | dnl Check for API introduced in MacOS X 10.2.
21 | AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
22 | [gt_cv_func_CFPreferencesCopyAppValue],
23 | [gt_save_LIBS="$LIBS"
24 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
25 | AC_TRY_LINK([#include ],
26 | [CFPreferencesCopyAppValue(NULL, NULL)],
27 | [gt_cv_func_CFPreferencesCopyAppValue=yes],
28 | [gt_cv_func_CFPreferencesCopyAppValue=no])
29 | LIBS="$gt_save_LIBS"])
30 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
31 | AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
32 | [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
33 | fi
34 | dnl Check for API introduced in MacOS X 10.3.
35 | AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
36 | [gt_save_LIBS="$LIBS"
37 | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
38 | AC_TRY_LINK([#include ], [CFLocaleCopyCurrent();],
39 | [gt_cv_func_CFLocaleCopyCurrent=yes],
40 | [gt_cv_func_CFLocaleCopyCurrent=no])
41 | LIBS="$gt_save_LIBS"])
42 | if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
43 | AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
44 | [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
45 | fi
46 | INTL_MACOSX_LIBS=
47 | if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
48 | INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
49 | fi
50 | AC_SUBST([INTL_MACOSX_LIBS])
51 | ])
52 |
--------------------------------------------------------------------------------
/m4/lib-ld.m4:
--------------------------------------------------------------------------------
1 | # lib-ld.m4 serial 4 (gettext-0.18)
2 | dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc.
3 | dnl This file is free software; the Free Software Foundation
4 | dnl gives unlimited permission to copy and/or distribute it,
5 | dnl with or without modifications, as long as this notice is preserved.
6 |
7 | dnl Subroutines of libtool.m4,
8 | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
9 | dnl with libtool.m4.
10 |
11 | dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
12 | AC_DEFUN([AC_LIB_PROG_LD_GNU],
13 | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld],
14 | [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
15 | case `$LD -v 2>&1 conf$$.sh
35 | echo "exit 0" >>conf$$.sh
36 | chmod +x conf$$.sh
37 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
38 | PATH_SEPARATOR=';'
39 | else
40 | PATH_SEPARATOR=:
41 | fi
42 | rm -f conf$$.sh
43 | fi
44 | ac_prog=ld
45 | if test "$GCC" = yes; then
46 | # Check if gcc -print-prog-name=ld gives a path.
47 | AC_MSG_CHECKING([for ld used by GCC])
48 | case $host in
49 | *-*-mingw*)
50 | # gcc leaves a trailing carriage return which upsets mingw
51 | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
52 | *)
53 | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
54 | esac
55 | case $ac_prog in
56 | # Accept absolute paths.
57 | [[\\/]* | [A-Za-z]:[\\/]*)]
58 | [re_direlt='/[^/][^/]*/\.\./']
59 | # Canonicalize the path of ld
60 | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
61 | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
62 | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
63 | done
64 | test -z "$LD" && LD="$ac_prog"
65 | ;;
66 | "")
67 | # If it fails, then pretend we aren't using GCC.
68 | ac_prog=ld
69 | ;;
70 | *)
71 | # If it is relative, then search for the first ld in PATH.
72 | with_gnu_ld=unknown
73 | ;;
74 | esac
75 | elif test "$with_gnu_ld" = yes; then
76 | AC_MSG_CHECKING([for GNU ld])
77 | else
78 | AC_MSG_CHECKING([for non-GNU ld])
79 | fi
80 | AC_CACHE_VAL([acl_cv_path_LD],
81 | [if test -z "$LD"; then
82 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
83 | for ac_dir in $PATH; do
84 | test -z "$ac_dir" && ac_dir=.
85 | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
86 | acl_cv_path_LD="$ac_dir/$ac_prog"
87 | # Check to see if the program is GNU ld. I'd rather use --version,
88 | # but apparently some GNU ld's only accept -v.
89 | # Break only if it was the GNU/non-GNU ld that we prefer.
90 | case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
91 | *GNU* | *'with BFD'*)
92 | test "$with_gnu_ld" != no && break ;;
93 | *)
94 | test "$with_gnu_ld" != yes && break ;;
95 | esac
96 | fi
97 | done
98 | IFS="$ac_save_ifs"
99 | else
100 | acl_cv_path_LD="$LD" # Let the user override the test with a path.
101 | fi])
102 | LD="$acl_cv_path_LD"
103 | if test -n "$LD"; then
104 | AC_MSG_RESULT([$LD])
105 | else
106 | AC_MSG_RESULT([no])
107 | fi
108 | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
109 | AC_LIB_PROG_LD_GNU
110 | ])
111 |
--------------------------------------------------------------------------------
/m4/nls.m4:
--------------------------------------------------------------------------------
1 | # nls.m4 serial 5 (gettext-0.18)
2 | dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation,
3 | dnl Inc.
4 | dnl This file is free software; the Free Software Foundation
5 | dnl gives unlimited permission to copy and/or distribute it,
6 | dnl with or without modifications, as long as this notice is preserved.
7 | dnl
8 | dnl This file can can be used in projects which are not available under
9 | dnl the GNU General Public License or the GNU Library General Public
10 | dnl License but which still want to provide support for the GNU gettext
11 | dnl functionality.
12 | dnl Please note that the actual code of the GNU gettext library is covered
13 | dnl by the GNU Library General Public License, and the rest of the GNU
14 | dnl gettext package package is covered by the GNU General Public License.
15 | dnl They are *not* in the public domain.
16 |
17 | dnl Authors:
18 | dnl Ulrich Drepper , 1995-2000.
19 | dnl Bruno Haible , 2000-2003.
20 |
21 | AC_PREREQ([2.50])
22 |
23 | AC_DEFUN([AM_NLS],
24 | [
25 | AC_MSG_CHECKING([whether NLS is requested])
26 | dnl Default is enabled NLS
27 | AC_ARG_ENABLE([nls],
28 | [ --disable-nls do not use Native Language Support],
29 | USE_NLS=$enableval, USE_NLS=yes)
30 | AC_MSG_RESULT([$USE_NLS])
31 | AC_SUBST([USE_NLS])
32 | ])
33 |
--------------------------------------------------------------------------------
/m4/progtest.m4:
--------------------------------------------------------------------------------
1 | # progtest.m4 serial 6 (gettext-0.18)
2 | dnl Copyright (C) 1996-2003, 2005, 2008-2010 Free Software Foundation, Inc.
3 | dnl This file is free software; the Free Software Foundation
4 | dnl gives unlimited permission to copy and/or distribute it,
5 | dnl with or without modifications, as long as this notice is preserved.
6 | dnl
7 | dnl This file can can be used in projects which are not available under
8 | dnl the GNU General Public License or the GNU Library General Public
9 | dnl License but which still want to provide support for the GNU gettext
10 | dnl functionality.
11 | dnl Please note that the actual code of the GNU gettext library is covered
12 | dnl by the GNU Library General Public License, and the rest of the GNU
13 | dnl gettext package package is covered by the GNU General Public License.
14 | dnl They are *not* in the public domain.
15 |
16 | dnl Authors:
17 | dnl Ulrich Drepper , 1996.
18 |
19 | AC_PREREQ([2.50])
20 |
21 | # Search path for a program which passes the given test.
22 |
23 | dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
24 | dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
25 | AC_DEFUN([AM_PATH_PROG_WITH_TEST],
26 | [
27 | # Prepare PATH_SEPARATOR.
28 | # The user is always right.
29 | if test "${PATH_SEPARATOR+set}" != set; then
30 | echo "#! /bin/sh" >conf$$.sh
31 | echo "exit 0" >>conf$$.sh
32 | chmod +x conf$$.sh
33 | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
34 | PATH_SEPARATOR=';'
35 | else
36 | PATH_SEPARATOR=:
37 | fi
38 | rm -f conf$$.sh
39 | fi
40 |
41 | # Find out how to test for executable files. Don't use a zero-byte file,
42 | # as systems may use methods other than mode bits to determine executability.
43 | cat >conf$$.file <<_ASEOF
44 | #! /bin/sh
45 | exit 0
46 | _ASEOF
47 | chmod +x conf$$.file
48 | if test -x conf$$.file >/dev/null 2>&1; then
49 | ac_executable_p="test -x"
50 | else
51 | ac_executable_p="test -f"
52 | fi
53 | rm -f conf$$.file
54 |
55 | # Extract the first word of "$2", so it can be a program name with args.
56 | set dummy $2; ac_word=[$]2
57 | AC_MSG_CHECKING([for $ac_word])
58 | AC_CACHE_VAL([ac_cv_path_$1],
59 | [case "[$]$1" in
60 | [[\\/]]* | ?:[[\\/]]*)
61 | ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
62 | ;;
63 | *)
64 | ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
65 | for ac_dir in ifelse([$5], , $PATH, [$5]); do
66 | IFS="$ac_save_IFS"
67 | test -z "$ac_dir" && ac_dir=.
68 | for ac_exec_ext in '' $ac_executable_extensions; do
69 | if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
70 | echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
71 | if [$3]; then
72 | ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
73 | break 2
74 | fi
75 | fi
76 | done
77 | done
78 | IFS="$ac_save_IFS"
79 | dnl If no 4th arg is given, leave the cache variable unset,
80 | dnl so AC_PATH_PROGS will keep looking.
81 | ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
82 | ])dnl
83 | ;;
84 | esac])dnl
85 | $1="$ac_cv_path_$1"
86 | if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
87 | AC_MSG_RESULT([$][$1])
88 | else
89 | AC_MSG_RESULT([no])
90 | fi
91 | AC_SUBST([$1])dnl
92 | ])
93 |
--------------------------------------------------------------------------------
/model/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | model_PYTHON = $(filter-out config.py, $(wildcard *.py))
21 |
22 | nodist_model_PYTHON = config.py
23 |
24 | EXTRA_DIST = config.py.in
25 |
26 | modeldir = $(pythondir)/wok/plugins/gingerbase/model
27 |
28 | install-data-local:
29 | $(MKDIR_P) $(DESTDIR)$(modeldir)
30 |
31 | do_substitution = \
32 | sed -e 's,[@]gingerbaseversion[@],$(PACKAGE_VERSION),g' \
33 | -e 's,[@]gingerbaserelease[@],$(PACKAGE_RELEASE),g'
34 |
35 | config.py: config.py.in Makefile
36 | $(do_substitution) < $(srcdir)/config.py.in > config.py
37 |
38 | BUILT_SOURCES = config.py
39 | CLEANFILES = config.py
40 | $(models_PYTHON:%.py=%.pyc) \
41 | $(NULL)
42 |
--------------------------------------------------------------------------------
/model/__init__.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
--------------------------------------------------------------------------------
/model/config.py.in:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2016
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 |
22 |
23 | from wok.plugins.gingerbase.config import config
24 |
25 |
26 | __version__ = "@gingerbaseversion@"
27 | __release__ = "@gingerbaserelease@"
28 |
29 |
30 | class ConfigModel(object):
31 | def __init__(self, **kargs):
32 | pass
33 |
34 | def lookup(self, name):
35 | gbconfig = config.get('gingerbase', {})
36 | return {'version': "-".join([__version__, __release__]),
37 | 'statshistory_on': gbconfig.get('statshistory_on', True)}
38 |
--------------------------------------------------------------------------------
/model/cpuinfo.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | import platform
22 |
23 | from wok.exception import InvalidOperation
24 | from wok.exception import InvalidParameter
25 | from wok.plugins.gingerbase.lscpu import LsCpu
26 | from wok.utils import run_command
27 |
28 |
29 | ARCH = 'power' if platform.machine().startswith('ppc') else 'x86'
30 |
31 |
32 | class CPUInfoModel(object):
33 | """
34 | Get information about a CPU for hyperthreading (on x86)
35 | or SMT (on POWER) for logic when creating templates and VMs.
36 | """
37 |
38 | def __init__(self, **kargs):
39 | self.guest_threads_enabled = False
40 | self.sockets = 0
41 | self.cores_present = 0
42 | self.cores_available = 0
43 | self.cores_per_socket = 0
44 | self.threads_per_core = 0
45 | self.max_threads = 0
46 | self.lscpu = LsCpu()
47 |
48 | if ARCH == 'power':
49 | # IBM PowerPC
50 | self.guest_threads_enabled = True
51 | out, error, rc = run_command(['ppc64_cpu', '--smt'])
52 | if rc or 'on' in out:
53 | # SMT has to be disabled for guest to use threads as CPUs.
54 | # rc is always zero, whether SMT is off or on.
55 | self.guest_threads_enabled = False
56 | out, error, rc = run_command(['ppc64_cpu', '--cores-present'])
57 | if not rc:
58 | self.cores_present = int(out.split()[-1])
59 | out, error, rc = run_command(['ppc64_cpu', '--cores-on'])
60 | if not rc:
61 | self.cores_available = int(out.split()[-1])
62 | out, error, rc = run_command(['ppc64_cpu', '--threads-per-core'])
63 | if not rc:
64 | self.threads_per_core = int(out.split()[-1])
65 | self.sockets = self.cores_present / self.threads_per_core
66 | if self.sockets == 0:
67 | self.sockets = 1
68 | self.cores_per_socket = self.cores_present / self.sockets
69 | else:
70 | # Intel or AMD
71 | self.guest_threads_enabled = True
72 | self.sockets = int(self.lscpu.get_sockets())
73 | self.cores_per_socket = int(self.lscpu.get_cores_per_socket())
74 | self.cores_present = self.cores_per_socket * self.sockets
75 | self.cores_available = self.cores_present
76 | self.threads_per_core = self.lscpu.get_threads_per_core()
77 |
78 | def lookup(self, ident):
79 | return {
80 | 'guest_threads_enabled': self.guest_threads_enabled,
81 | 'sockets': self.sockets,
82 | 'cores_per_socket': self.cores_per_socket,
83 | 'cores_present': self.cores_present,
84 | 'cores_available': self.cores_available,
85 | 'threads_per_core': self.threads_per_core,
86 | }
87 |
88 | def check_topology(self, vcpus, topology):
89 | """
90 | param vcpus: should be an integer
91 | param iso_path: the path of the guest ISO
92 | param topology: {'sockets': x, 'cores': x, 'threads': x}
93 | """
94 | sockets = topology['sockets']
95 | cores = topology['cores']
96 | threads = topology['threads']
97 |
98 | if not self.guest_threads_enabled:
99 | raise InvalidOperation('GGBCPUINF0003E')
100 | if vcpus != sockets * cores * threads:
101 | raise InvalidParameter('GGBCPUINF0002E')
102 | if vcpus > self.cores_available * self.threads_per_core:
103 | raise InvalidParameter('GGBCPUINF0001E')
104 | if threads > self.threads_per_core:
105 | raise InvalidParameter('GGBCPUINF0002E')
106 |
--------------------------------------------------------------------------------
/model/model.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | from wok.basemodel import BaseModel
20 | from wok.objectstore import ObjectStore
21 | from wok.plugins.gingerbase import config
22 | from wok.utils import get_all_model_instances
23 | from wok.utils import get_model_instances
24 | from wok.utils import upgrade_objectstore_schema
25 |
26 |
27 | class Model(BaseModel):
28 | def __init__(self, objstore_loc=None):
29 |
30 | if objstore_loc is None:
31 | objstore_loc = config.get_object_store()
32 |
33 | # Some paths or URI's present in the objectstore have changed after
34 | # Wok 2.0.0 release. Check here if a schema upgrade is necessary.
35 | upgrade_objectstore_schema(objstore_loc, 'version')
36 |
37 | self.objstore = ObjectStore(objstore_loc)
38 | kargs = {'objstore': self.objstore}
39 |
40 | models = get_all_model_instances(__name__, __file__, kargs)
41 |
42 | # Import task model from Wok
43 | instances = get_model_instances('wok.model.tasks')
44 | for instance in instances:
45 | models.append(instance(**kargs))
46 |
47 | return super(Model, self).__init__(models)
48 |
--------------------------------------------------------------------------------
/model/packagesupdate.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2016
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok.asynctask import AsyncTask
22 | from wok.exception import OperationFailed
23 | from wok.model.tasks import TaskModel
24 | from wok.plugins.gingerbase.swupdate import SoftwareUpdate
25 | from wok.utils import wok_log
26 |
27 |
28 | class PackagesUpdateModel(object):
29 | def __init__(self, **kargs):
30 | try:
31 | self.host_swupdate = SoftwareUpdate()
32 | except Exception:
33 | self.host_swupdate = None
34 |
35 | def get_list(self):
36 | if self.host_swupdate is None:
37 | raise OperationFailed('GGBPKGUPD0004E')
38 |
39 | return self.host_swupdate.getUpdates()
40 |
41 |
42 | class PackageUpdateModel(object):
43 | def __init__(self, **kargs):
44 | self.task = TaskModel(**kargs)
45 | self.objstore = kargs['objstore']
46 | self.pkgs2update = []
47 | try:
48 | self.host_swupdate = SoftwareUpdate()
49 | except Exception:
50 | self.host_swupdate = None
51 |
52 | def lookup(self, name):
53 | if self.host_swupdate is None:
54 | raise OperationFailed('GGBPKGUPD0004E')
55 |
56 | return self.host_swupdate.getUpdate(name)
57 |
58 | def _resolve_dependencies(self, package=None, dep_list=None):
59 | """
60 | Resolve the dependencies for a given package from the dictionary of
61 | eligible packages to be upgraded.
62 | """
63 | if dep_list is None:
64 | dep_list = []
65 | if package is None:
66 | return []
67 | dep_list.append(package)
68 | deps = self.host_swupdate.getPackageDeps(package)
69 | for pkg in deps:
70 | if pkg in dep_list:
71 | break
72 | self._resolve_dependencies(pkg, dep_list)
73 | return dep_list
74 |
75 | def upgrade(self, name):
76 | """
77 | Execute the update of a specific package (and its dependencies, if
78 | necessary) in the system.
79 |
80 | @param: Name
81 | @return: task
82 | """
83 | if self.host_swupdate is None:
84 | raise OperationFailed('GGBPKGUPD0004E')
85 |
86 | self.pkgs2update = self.host_swupdate.getUpdates()
87 | pkgs_list = self._resolve_dependencies(name)
88 | msg = 'The following packages will be updated: ' + ', '.join(pkgs_list)
89 | wok_log.debug(msg)
90 | taskid = AsyncTask('/plugins/gingerbase/host/packagesupdate/%s/upgrade'
91 | % name, self.host_swupdate.doUpdate, pkgs_list).id
92 | return self.task.lookup(taskid)
93 |
94 |
95 | class PackageDepsModel(object):
96 | def __init__(self, **kargs):
97 | try:
98 | self.host_swupdate = SoftwareUpdate()
99 | except Exception:
100 | self.host_swupdate = None
101 |
102 | def get_list(self, pkg):
103 | return self.host_swupdate.getPackageDeps(pkg)
104 |
105 |
106 | class SwUpdateProgressModel(object):
107 | def __init__(self, **kargs):
108 | self.task = TaskModel(**kargs)
109 | self.objstore = kargs['objstore']
110 |
111 | def lookup(self, *name):
112 | try:
113 | swupdate = SoftwareUpdate()
114 | except Exception:
115 | raise OperationFailed('GGBPKGUPD0004E')
116 |
117 | taskid = AsyncTask('/plugins/gingerbase/host/swupdateprogress',
118 | swupdate.tailUpdateLogs).id
119 | return self.task.lookup(taskid)
120 |
--------------------------------------------------------------------------------
/po/LINGUAS:
--------------------------------------------------------------------------------
1 | en_US
2 | pt_BR
3 | zh_CN
4 | de_DE
5 | es_ES
6 | fr_FR
7 | it_IT
8 | ja_JP
9 | ko_KR
10 | ru_RU
11 | zh_TW
12 |
--------------------------------------------------------------------------------
/po/Makevars:
--------------------------------------------------------------------------------
1 | # Makefile variables for PO directory in any package using GNU gettext.
2 |
3 | # Usually the message domain is the same as the package name.
4 | DOMAIN = gingerbase
5 |
6 | # These two variables depend on the location of this directory.
7 | subdir = po
8 | top_builddir = ..
9 |
10 | # These options get passed to xgettext.
11 | XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
12 |
13 | # This is the copyright holder that gets inserted into the header of the
14 | # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
15 | # package. (Note that the msgstr strings, extracted from the package's
16 | # sources, belong to the copyright holder of the package.) Translators are
17 | # expected to transfer the copyright for their translations to this person
18 | # or entity, or to disclaim their copyright. The empty string stands for
19 | # the public domain; in this case the translators are expected to disclaim
20 | # their copyright.
21 | COPYRIGHT_HOLDER =
22 |
23 | # This is the email address or URL to which the translators shall report
24 | # bugs in the untranslated strings:
25 | # - Strings which are not entire sentences, see the maintainer guidelines
26 | # in the GNU gettext documentation, section 'Preparing Strings'.
27 | # - Strings which use unclear terms or require additional context to be
28 | # understood.
29 | # - Strings which make invalid assumptions about notation of date, time or
30 | # money.
31 | # - Pluralisation problems.
32 | # - Incorrect English spelling.
33 | # - Incorrect formatting.
34 | # It can be your email address, or a mailing list address where translators
35 | # can write to without being subscribed, or the URL of a web page through
36 | # which the translators can contact you.
37 | MSGID_BUGS_ADDRESS = ginger-dev-list@googlegroups.com
38 |
39 | # This is the list of locale categories, beyond LC_MESSAGES, for which the
40 | # message catalogs shall be used. It is usually empty.
41 | EXTRA_LOCALE_CATEGORIES =
42 |
--------------------------------------------------------------------------------
/po/POTFILES.in:
--------------------------------------------------------------------------------
1 | # List of source files which contain translatable strings.
2 | i18n.py
3 | ui/pages/*.tmpl
4 | ui/pages/tabs/*.tmpl
5 |
--------------------------------------------------------------------------------
/po/gen-pot.in:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Project Ginger Base
4 | #
5 | # Copyright IBM Corp, 2013-2016
6 | #
7 | # Code derived from Project Kimchi
8 | #
9 | # This library is free software; you can redistribute it and/or
10 | # modify it under the terms of the GNU Lesser General Public
11 | # License as published by the Free Software Foundation; either
12 | # version 2.1 of the License, or (at your option) any later version.
13 | #
14 | # This library is distributed in the hope that it will be useful,
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 | # Lesser General Public License for more details.
18 | #
19 | # You should have received a copy of the GNU Lesser General Public
20 | # License along with this library; if not, write to the Free Software
21 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 |
23 | for src in $@; do
24 | if [ ${src: -3} == ".py" ]; then
25 | cat $src
26 | else
27 | cat $src | @CHEETAH@ compile -
28 | fi
29 | done | xgettext --no-location -o gingerbase.pot -L Python -
30 |
--------------------------------------------------------------------------------
/portageparser.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2017
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | from wok.utils import run_command
22 |
23 |
24 | def _filter_lines_checkupdate_output(output):
25 | """returns lines starting with ["""
26 | return [line for line in output.split('\n')
27 | if line.startswith('[')]
28 |
29 |
30 | def _get_portage_checkupdate_output():
31 | """simple formatted output of outdated packages"""
32 | cmd = ['emerge', '-up', '--quiet', '--nospinner', '@world']
33 | out, error, return_code = run_command(cmd, silent=True)
34 | if return_code == 1:
35 | return ''
36 | return out
37 |
38 |
39 | def packages_list_update(checkupdate_output=None):
40 | """
41 | Returns a list of packages eligible to be updated.
42 | """
43 | if checkupdate_output is None:
44 | checkupdate_output = _get_portage_checkupdate_output()
45 | filtered_output = _filter_lines_checkupdate_output(checkupdate_output)
46 |
47 | packages = []
48 | names = []
49 | for line in filtered_output:
50 | arch = ''
51 | line = line.split(']', 1)
52 | name = line[1].strip().split()[0]
53 | version = ''
54 | repo = ''
55 | if name not in names:
56 | names.append(name)
57 | pkg = {'package_name': name, 'arch': arch, 'version': version,
58 | 'repository': repo}
59 | packages.append(pkg)
60 | return packages
61 |
62 |
63 | def package_deps(pkg_name):
64 | """
65 | dependencies for a given package.
66 | make sure pkg_name is a full atom (grp/pkg-ver)
67 | """
68 | cmd = ['equery', '-C', '-q', 'depgraph', '=%s' % pkg_name]
69 | out, error, return_code = run_command(cmd, silent=True)
70 | if return_code == 1:
71 | return []
72 | packages = set()
73 | for line in out.split('\n')[2:]:
74 | elems = line.split()
75 | if elems:
76 | packages.add(elems[-1].strip())
77 |
78 | return list(packages)
79 |
80 |
81 | def package_info(pkg_name):
82 | """
83 | dict holding info about package.
84 | no meaningful way to return arch, version, repo in gentoo
85 | therefore only pkg_name is returned, equery holds other
86 | metafacts, also interesting?
87 | """
88 | cmd = ['equery', '-C', '-q', 'meta', pkg_name]
89 | out, error, return_code = run_command(cmd, silent=True)
90 | if return_code == 1:
91 | return None
92 | return {'package_name': pkg_name, 'arch': '',
93 | 'version': '', 'repository': ''}
94 |
95 |
96 | if __name__ == '__main__':
97 | print(packages_list_update())
98 | print(package_deps('www-servers/nginx-1.11.6'))
99 | print(package_info('www-servers/nginx-1.11.6'))
100 |
--------------------------------------------------------------------------------
/tests/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | EXTRA_DIST = \
21 | Makefile.am \
22 | run_tests.sh.in \
23 | test_config.py.in \
24 | $(filter-out test_config.py, $(wildcard *.py)) \
25 | $(NULL)
26 |
27 | noinst_SCRIPTS = run_tests.sh
28 |
29 | do_substitution = \
30 | sed -e 's,[@]HAVE_PYMOD_UNITTEST[@],$(HAVE_PYMOD_UNITTEST),g' \
31 | -e 's,[@]prefix[@],$(prefix),g' \
32 | -e 's,[@]datadir[@],$(datadir),g' \
33 | -e 's,[@]PYTHON_VERSION[@],$(PYTHON_VERSION),g' \
34 | -e 's,[@]wokdir[@],$(pythondir)/wok,g' \
35 | -e 's,[@]pkgdatadir[@],$(pkgdatadir),g'
36 |
37 |
38 | run_tests.sh: run_tests.sh.in Makefile
39 | $(do_substitution) < $(srcdir)/run_tests.sh.in > run_tests.sh
40 | chmod +x run_tests.sh
41 |
42 | test_config.py: test_config.py.in Makefile
43 | $(do_substitution) < $(srcdir)/test_config.py.in > test_config.py
44 |
45 | check-local:
46 | ./run_tests.sh
47 |
48 | BUILT_SOURCES = test_config.py
49 | CLEANFILES = run_tests.sh test_config.py
50 |
--------------------------------------------------------------------------------
/tests/run_tests.sh.in:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Project Ginger Base
4 | #
5 | # Copyright IBM Corp, 2013-2016
6 | #
7 | # This library is free software; you can redistribute it and/or
8 | # modify it under the terms of the GNU Lesser General Public
9 | # License as published by the Free Software Foundation; either
10 | # version 2.1 of the License, or (at your option) any later version.
11 | #
12 | # This library is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | # Lesser General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Lesser General Public
18 | # License along with this library; if not, write to the Free Software
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 |
21 | HAVE_UNITTEST=@HAVE_PYMOD_UNITTEST@
22 | PYTHON_VER=@PYTHON_VERSION@
23 |
24 | if [ "$1" = "-v" ]; then
25 | OPTS="-v"
26 | shift
27 | else
28 | OPTS=""
29 | fi
30 |
31 | if [ $# -ne 0 ]; then
32 | ARGS="$@"
33 | else
34 | ARGS=`find -name "test_*.py" | xargs -I @ basename @ .py`
35 | fi
36 |
37 | if [ "$HAVE_UNITTEST" != "yes" -o "$PYTHON_VER" == "2.6" ]; then
38 | CMD="unit2"
39 | else
40 | CMD="python -m unittest"
41 | fi
42 |
43 | LIST=($ARGS)
44 | MODEL_LIST=()
45 | MOCK_LIST=()
46 | for ((i=0;i<${#LIST[@]};i++)); do
47 |
48 | if [[ ${LIST[$i]} == test_model* ]]; then
49 | MODEL_LIST+=(${LIST[$i]})
50 | else
51 | MOCK_LIST+=(${LIST[$i]})
52 | fi
53 | done
54 |
55 | # ../../../../../ refers to wok root
56 | # ../../../../ refers to wok directory
57 | # ../../../ refers to plugins directory
58 | PYTHONPATH=../../../../../:../../../../:../../../ $CMD $OPTS ${MODEL_LIST[@]} ${MOCK_LIST[@]}
59 |
--------------------------------------------------------------------------------
/tests/test_authorization.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2017
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | import unittest
22 | from functools import partial
23 |
24 | from tests.utils import patch_auth
25 | from tests.utils import request
26 | from tests.utils import run_server
27 |
28 | test_server = None
29 |
30 |
31 | def setUpModule():
32 | global test_server
33 |
34 | patch_auth()
35 | test_server = run_server(test_mode=True)
36 |
37 |
38 | def tearDownModule():
39 | test_server.stop()
40 |
41 |
42 | class AuthorizationTests(unittest.TestCase):
43 | def setUp(self):
44 | self.request = partial(request, user='user')
45 |
46 | def test_nonroot_access(self):
47 | # Non-root users can access static host information
48 | resp = self.request('/plugins/gingerbase/host', '{}', 'GET')
49 | self.assertEquals(200, resp.status)
50 |
51 | # Non-root users can access host stats
52 | resp = self.request('/plugins/gingerbase/host/stats', '{}', 'GET')
53 | self.assertEquals(200, resp.status)
54 |
55 | # Non-root users can not reboot/shutdown host system
56 | resp = self.request('/plugins/gingerbase/host/reboot', '{}', 'POST')
57 | self.assertEquals(403, resp.status)
58 | resp = self.request('/plugins/gingerbase/host/shutdown', '{}', 'POST')
59 | self.assertEquals(403, resp.status)
60 |
61 | # Normal users can not upgrade packages
62 | uri = '/plugins/gingerbase/host/packagesupdate/ginger/upgrade'
63 | resp = self.request(uri, '{}', 'POST')
64 | self.assertEquals(403, resp.status)
65 | resp = self.request('/plugins/gingerbase/host/swupdate', '{}', 'POST')
66 | self.assertEquals(403, resp.status)
67 |
--------------------------------------------------------------------------------
/tests/test_config.py.in:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2017
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 |
22 | import unittest
23 | from cherrypy.lib.reprconf import Parser
24 |
25 | from wok.config import CACHEEXPIRES
26 | from wok.config import Paths, PluginPaths
27 |
28 | from wok.plugins.gingerbase.config import get_debugreports_path
29 | from wok.plugins.gingerbase.config import GingerBaseConfig, GingerBasePaths
30 |
31 | get_prefix = None
32 |
33 |
34 | def setUpModule():
35 | global get_prefix
36 | get_prefix = Paths.get_prefix
37 |
38 |
39 | def tearDownModule():
40 | Paths.get_prefix = GingerBasePaths.get_prefix = get_prefix
41 |
42 |
43 | class ConfigTests(unittest.TestCase):
44 | def assertInstalledPath(self, actual, expected):
45 | if '@pkgdatadir@' != '/usr/share/gingerbase':
46 | usr_local = '/usr/local'
47 | if not expected.startswith('/usr'):
48 | expected = usr_local + expected
49 | self.assertEquals(actual, expected)
50 |
51 | def test_installed_plugin_paths(self):
52 | GingerBasePaths.get_prefix = lambda self: '@datadir@/wok'
53 | paths = GingerBasePaths()
54 | self.assertInstalledPath(paths.conf_dir, '/etc/wok/plugins.d')
55 | self.assertInstalledPath(paths.conf_file,
56 | '/etc/wok/plugins.d/gingerbase.conf')
57 | self.assertInstalledPath(paths.src_dir, '@wokdir@/plugins/gingerbase')
58 | self.assertInstalledPath(paths.ui_dir,
59 | '@datadir@/wok/plugins/gingerbase/ui')
60 | self.assertInstalledPath(paths.mo_dir, '@prefix@/share/locale')
61 |
62 | def test_uninstalled_plugin_paths(self):
63 | GingerBasePaths.get_prefix = PluginPaths.get_prefix = get_prefix
64 | paths = GingerBasePaths()
65 | prefix = paths.prefix
66 | self.assertEquals(paths.conf_dir, '%s/src/wok/plugins/gingerbase'
67 | % prefix)
68 | self.assertEquals(paths.conf_file,
69 | '%s/src/wok/plugins/gingerbase/gingerbase.conf'
70 | % prefix)
71 | self.assertEquals(paths.src_dir, '%s/src/wok/plugins/gingerbase'
72 | % prefix)
73 | self.assertEquals(paths.ui_dir,
74 | '%s/src/wok/plugins/gingerbase/ui' % prefix)
75 | self.assertEquals(paths.mo_dir,
76 | '%s/src/wok/plugins/gingerbase/mo' % prefix)
77 |
78 | def test_gingerbase_config(self):
79 | GingerBasePaths.get_prefix = PluginPaths.get_prefix = get_prefix
80 | paths = GingerBasePaths()
81 | pluginPrefix = paths.add_prefix(paths.plugin_dir)
82 | configObj = {
83 | 'wok': {
84 | 'enable': True
85 | },
86 | 'gingerbase': {
87 | 'statshistory_on': True,
88 | },
89 | '/': {
90 | 'tools.trailing_slash.on': False,
91 | 'request.methods_with_bodies': ('POST', 'PUT'),
92 | 'tools.nocache.on': True,
93 | 'tools.proxy.on': True,
94 | 'tools.sessions.on': True,
95 | 'tools.sessions.name': 'wok',
96 | 'tools.sessions.secure': True,
97 | 'tools.sessions.httponly': True,
98 | 'tools.sessions.locking': 'explicit',
99 | 'tools.sessions.storage_type': 'ram'
100 | },
101 | '/help': {
102 | 'tools.nocache.on': True,
103 | 'tools.staticdir.dir': '%s/ui/pages/help' % pluginPrefix,
104 | 'tools.staticdir.on': True
105 | },
106 | '/js': {
107 | 'tools.wokauth.on': False,
108 | 'tools.nocache.on': False,
109 | 'tools.staticdir.dir': '%s/ui/js' % pluginPrefix,
110 | 'tools.expires.on': True,
111 | 'tools.expires.secs': CACHEEXPIRES,
112 | 'tools.staticdir.on': True
113 | },
114 | '/css': {
115 | 'tools.wokauth.on': False,
116 | 'tools.nocache.on': False,
117 | 'tools.staticdir.dir': '%s/ui/css' % pluginPrefix,
118 | 'tools.expires.on': True,
119 | 'tools.expires.secs': CACHEEXPIRES,
120 | 'tools.staticdir.on': True
121 | },
122 | '/images': {
123 | 'tools.wokauth.on': False,
124 | 'tools.nocache.on': False,
125 | 'tools.staticdir.dir': '%s/ui/images' % pluginPrefix,
126 | 'tools.staticdir.content_types': {'svg': 'image/svg+xml'},
127 | 'tools.staticdir.on': True
128 | },
129 | '/ui/config/tab-ext.xml': {
130 | 'tools.nocache.on': True,
131 | 'tools.staticfile.on': True,
132 | 'tools.staticfile.filename': '%s/ui/config/tab-ext.xml' %
133 | pluginPrefix,
134 | },
135 | '/data/debugreports': {
136 | 'tools.wokauth.on': True,
137 | 'tools.nocache.on': False,
138 | 'tools.staticdir.dir': get_debugreports_path(),
139 | 'tools.staticdir.content_types': {'xz': 'application/x-xz'},
140 | 'tools.staticdir.on': True
141 | }
142 | }
143 |
144 | gingerbase_config = \
145 | Parser().dict_from_file(GingerBasePaths().conf_file)
146 | gingerbase_config.update(GingerBaseConfig())
147 | self.assertEquals(gingerbase_config, configObj)
148 |
--------------------------------------------------------------------------------
/tests/test_disks.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Ginger Base
3 | #
4 | # Copyright IBM Corp, 2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | import unittest
20 |
21 | import mock
22 | from wok.exception import NotFoundError
23 | from wok.exception import OperationFailed
24 | from wok.plugins.gingerbase.disks import _get_lsblk_devs
25 | from wok.plugins.gingerbase.disks import pvs_with_vg_list
26 |
27 |
28 | class DiskTests(unittest.TestCase):
29 |
30 | @mock.patch('wok.plugins.gingerbase.disks.run_command')
31 | def test_lsblk_returns_404_when_device_not_found(self, mock_run_command):
32 | mock_run_command.return_value = ['', 'not a block device', 32]
33 | fake_dev = '/not/a/true/block/dev'
34 | keys = ['MOUNTPOINT']
35 |
36 | with self.assertRaises(NotFoundError):
37 | _get_lsblk_devs(keys, [fake_dev])
38 | cmd = ['lsblk', '-Pbo', 'MOUNTPOINT', fake_dev]
39 | mock_run_command.assert_called_once_with(cmd)
40 |
41 | @mock.patch('wok.plugins.gingerbase.disks.run_command')
42 | def test_lsblk_returns_500_when_unknown_error_occurs(
43 | self, mock_run_command):
44 |
45 | mock_run_command.return_value = ['', '', 1]
46 | valid_dev = '/valid/block/dev'
47 | keys = ['MOUNTPOINT']
48 |
49 | with self.assertRaises(OperationFailed):
50 | _get_lsblk_devs(keys, [valid_dev])
51 | cmd = ['lsblk', '-Pbo', 'MOUNTPOINT', valid_dev]
52 | mock_run_command.assert_called_once_with(cmd)
53 |
54 | @mock.patch('wok.plugins.gingerbase.disks.run_command')
55 | def test_pvs_with_vg_list(self, mock_run_command):
56 | mock_run_command.return_value = ["""
57 | /dev/mapper/36005076307ffc6a60000000000001f22 vpoolfclun2
58 | /dev/mapper/36005076307ffc6a60000000000001f23 vpoolfclun
59 | /dev/dasdb1""", '', 0]
60 | outlist = pvs_with_vg_list()
61 | self.assertEqual(outlist[0].get('/dev/dasdb1'), 'N/A')
62 |
--------------------------------------------------------------------------------
/ui/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | SUBDIRS = config css images js pages
19 |
20 | uidir = $(datadir)/wok/plugins/gingerbase/ui
21 |
--------------------------------------------------------------------------------
/ui/config/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | xmldir = $(datadir)/wok/plugins/gingerbase/ui/config
19 |
20 | dist_xml_DATA = \
21 | tab-ext.xml \
22 | $(NULL)
23 |
--------------------------------------------------------------------------------
/ui/config/tab-ext.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 | Host
21 |
22 |
23 |
24 | Dashboard
25 | 0
26 | plugins/gingerbase/tabs/host-dashboard.html
27 |
28 |
29 |
30 |
31 | Updates
32 | 20
33 | plugins/gingerbase/tabs/host-update.html
34 |
35 |
36 |
--------------------------------------------------------------------------------
/ui/css/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | cssdir = $(datadir)/wok/plugins/gingerbase/ui/css
19 | dist_css_DATA = gingerbase.css
20 |
21 | css: src/*.scss src/modules/*.scss
22 | echo "Compiling .scss file $<"
23 | sassc -s expanded $< gingerbase.css
24 |
--------------------------------------------------------------------------------
/ui/css/src/gingerbase.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Ginger Base
3 | *
4 | * Copyright IBM Corp, 2015-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 |
21 | //
22 | // Wok Variables
23 | // ----------------------------------------------------------------------------
24 | @import "../../../../../../../ui/css/src/modules/wok-variables";
25 |
26 | //
27 | // Imported functions
28 | // ----------------------------------------------------------------------------
29 | @import "../../../../../../../ui/css/src/modules/compact";
30 | @import "../../../../../../../ui/css/src/vendor/bootstrap-sass/bootstrap/mixins";
31 | @import "../../../../../../../ui/css/src/vendor/bootstrap-sass/bootstrap/grid";
32 | @import "../../../../../../../ui/css/src/vendor/compass-mixins/lib/compass";
33 | @import "../../../../../../../ui/css/src/modules/wok-accordion";
34 |
35 | //
36 | // Ginger Base variables and classes
37 | // ----------------------------------------------------------------------------
38 | @import "modules/host";
39 | @import "modules/line-chart"
40 |
--------------------------------------------------------------------------------
/ui/css/src/modules/_line-chart.scss:
--------------------------------------------------------------------------------
1 | //
2 | // Gingerbase
3 | //
4 | // Copyright IBM Corp, 2015-2016
5 | //
6 | // Code derived from Project Kimchi
7 | //
8 | // Licensed under the Apache License, Version 2.0 (the "License");
9 | // you may not use this file except in compliance with the License.
10 | // You may obtain a copy of the License at
11 | //
12 | // http://www.apache.org/licenses/LICENSE-2.0
13 | //
14 | // Unless required by applicable law or agreed to in writing, software
15 | // distributed under the License is distributed on an "AS IS" BASIS,
16 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | // See the License for the specific language governing permissions and
18 | // limitations under the License.
19 | //
20 |
21 | .chart-container {
22 | background: #fff;
23 | }
24 |
25 | .line-chart {
26 | overflow: hidden;
27 | }
28 |
29 | .line-chart .background {
30 | fill: #fff;
31 | }
32 |
33 | .line-chart text {
34 | color: red;
35 | font-size: 12px;
36 | }
37 |
38 | .line-chart polyline {
39 | fill: none;
40 | stroke-width: 3px;
41 | stroke-linejoin: round;
42 | }
43 |
44 | #container-chart-cpu{
45 |
46 | .line-chart polyline {
47 | stroke: #d9182d;
48 | }
49 |
50 | .line-chart path {
51 | fill: url(#patternbg);
52 | }
53 |
54 | }
55 |
56 | #container-chart-memory {
57 |
58 | .line-chart polyline {
59 | stroke: #008abf;
60 | }
61 |
62 | .line-chart path {
63 | fill: url(#patternbg);
64 | }
65 |
66 | }
67 |
68 | #container-chart-disk-io {
69 |
70 | .line-chart polyline {
71 | stroke: #00a6a0;
72 |
73 | &.disk-write {
74 | stroke: $state-warning-border;
75 | }
76 |
77 | }
78 |
79 | .line-chart path {
80 | fill: none;
81 | &.disk-write {
82 | fill: url(#patternbg);
83 | }
84 |
85 | }
86 |
87 | }
88 |
89 |
90 | #container-chart-network-io {
91 |
92 | .line-chart polyline {
93 | stroke: #7f1c7d;
94 |
95 | &.network-sent {
96 | stroke: #8cc63f;
97 | }
98 | }
99 |
100 | .line-chart path {
101 | fill: none;
102 | &.network-sent {
103 | fill: url(#patternbg);
104 | }
105 | }
106 | }
107 | #container-chart-cpu,
108 | #container-chart-memory{
109 | height: 207px !important;
110 | }
111 |
112 | .chart-container,
113 | .chart-legend-container,
114 | .chart-label {
115 | display: inline-block;
116 | vertical-align: top;
117 | }
118 |
119 | .chart-legend-container {
120 | width: 310px;
121 | white-space: nowrap;
122 | margin-bottom: 40px;
123 | margin-right: 0;
124 | }
125 |
126 | .chart-vaxis-container {
127 | width: 120px;
128 | position: absolute;
129 | text-align: left;
130 | display: block;
131 | height: 22px;
132 | margin-left: 15px;
133 | top: 78px;
134 | font-size: 13pt;
135 | font-weight: 300;
136 | white-space: nowrap;
137 | }
138 |
139 | #disk-dashboard .chart-vaxis-container,
140 | #network-dashboard .chart-vaxis-container {
141 | top: 99px;
142 | }
143 |
144 | .chart-legend-container .legend-wrapper {
145 | margin: 0;
146 | position: relative;
147 | height: 40px;
148 | width: 120px;
149 | white-space: nowrap;
150 | }
151 |
152 | #disk-dashboard, #network-dashboard {
153 |
154 | .legend-wrapper {
155 | width: 134px;
156 | height: 74px;
157 | }
158 |
159 | span.legend-string {
160 | display: block;
161 | margin-top: -16px;
162 | white-space: nowrap;
163 | }
164 |
165 | }
166 |
167 | .chart-legend-container .legend-icon {
168 | position: absolute;
169 | top: 0;
170 | left: 0;
171 | width: 5px;
172 | }
173 |
174 | .chart-legend-container span.legend-label, .chart-legend-container span.legend-string {
175 | font-size: 18px;
176 | font-family: $font-family-base;
177 | }
178 |
179 | .chart-legend-container span.legend-label {
180 | margin: 0 3px;
181 | }
182 |
183 | .chart-legend-container .latest-value {
184 | position: relative;
185 | text-align: left;
186 | display: inline-block;
187 | height: 22px;
188 | margin-left: 15px;
189 |
190 | span.number {
191 | top: -9px;
192 | position: relative;
193 | vertical-align: top;
194 | font-weight: 700;
195 | font-size: 27px;
196 | font-family: $font-family-base;
197 | }
198 |
199 | }
200 |
--------------------------------------------------------------------------------
/ui/images/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2017
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | imagedir = $(datadir)/wok/plugins/gingerbase/ui/images
19 |
20 | dist_image_DATA = *.ico *.svg
21 |
--------------------------------------------------------------------------------
/ui/images/gingerbase.svg:
--------------------------------------------------------------------------------
1 |
2 |
55 |
--------------------------------------------------------------------------------
/ui/images/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kimchi-project/gingerbase/42ef0cf5a25164a83473f7c8a3567a1f7f7bd481/ui/images/logo.ico
--------------------------------------------------------------------------------
/ui/js/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | EXTRA_DIST = src
19 |
20 | jsdir = $(datadir)/wok/plugins/gingerbase/ui/js
21 |
22 | dist_js_DATA = gingerbase.min.js $(filter-out gingerbase.min.js, $(wildcard *.js))
23 |
24 | gingerbase.min.js: src/*.js
25 | cat $(sort $^) > $@
26 |
27 | CLEANFILES = gingerbase.min.js
28 |
--------------------------------------------------------------------------------
/ui/js/src/gingerbase.report_add_main.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2015-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | gingerbase.report_add_main = function() {
21 | var reportGridID = 'available-reports-grid';
22 | var addReportForm = $('#form-report-add');
23 | var submitButton = $('#button-report-add');
24 | var nameTextbox = $('input[name="name"]', addReportForm);
25 | nameTextbox.select();
26 |
27 | var submitForm = function(event) {
28 | if(submitButton.prop('disabled')) {
29 | return false;
30 | }
31 | var reportName = nameTextbox.val();
32 | var validator = RegExp("^[A-Za-z0-9-]*$");
33 | if (!validator.test(reportName)) {
34 | wok.message.error.code('GGBDR6011M','#alert-modal-debugreportadd-container', true);
35 | return false;
36 | }
37 | var formData = addReportForm.serializeObject();
38 | var taskAccepted = false;
39 | var onTaskAccepted = function() {
40 | if(taskAccepted) {
41 | return;
42 | }
43 | taskAccepted = true;
44 | wok.topic('gingerbase/debugReportAdded').publish();
45 | $('#button-report-cancel').trigger('click');
46 | };
47 |
48 | gingerbase.createReport(formData, function(result) {
49 | onTaskAccepted();
50 | wok.topic('gingerbase/debugReportAdded').publish();
51 | $('#button-report-cancel').trigger('click');
52 | }, function(result) {
53 | // Error message from Async Task status
54 | if (result['message']) {
55 | var errText = result['message'];
56 | }
57 | // Error message from standard gingerbase exception
58 | else {
59 | var errText = result['responseJSON']['reason'];
60 | }
61 | result && wok.message.error(errText,'#alert-modal-debugreportadd-container', true);
62 |
63 | taskAccepted &&
64 | $('.grid-body-view table tr:first-child',
65 | '#' + reportGridID).remove();
66 | submitButton.prop('disabled', false);
67 | nameTextbox.select();
68 | }, onTaskAccepted);
69 |
70 | event.preventDefault();
71 | };
72 |
73 | addReportForm.on('submit', submitForm);
74 | submitButton.on('click', submitForm);
75 | };
76 |
--------------------------------------------------------------------------------
/ui/js/src/gingerbase.report_rename_main.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2015-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | gingerbase.report_rename_main = function() {
21 | var renameReportForm = $('#form-report-rename');
22 | var submitButton = $('#button-report-rename');
23 | var nameTextbox = $('input[name="name"]', renameReportForm);
24 | var submitForm = function(event) {
25 | if(submitButton.prop('disabled')) {
26 | return false;
27 | }
28 | var reportName = nameTextbox.val();
29 |
30 | // if the user hasn't changed the report's name,
31 | // nothing should be done.
32 | if (reportName == gingerbase.selectedReport) {
33 | wok.message.error.code('GGBDR6013M','#alert-modal-debugreportrename-container', true);
34 | return false;
35 | }
36 |
37 | var validator = RegExp("^[A-Za-z0-9-]*$");
38 | if (!validator.test(reportName)) {
39 | wok.message.error.code('GGBDR6011M','#alert-modal-debugreportrename-container', true);
40 | return false;
41 | }
42 | var formData = renameReportForm.serializeObject();
43 | submitButton.prop('disabled', true);
44 | nameTextbox.prop('disabled', true);
45 | gingerbase.renameReport(gingerbase.selectedReport, formData, function(result) {
46 | submitButton.prop('disabled', false);
47 | nameTextbox.prop('disabled', false);
48 | wok.window.close();
49 | wok.topic('gingerbase/debugReportRenamed').publish({
50 | result: result
51 | });
52 | }, function(result) {
53 | var errText = result &&
54 | result['responseJSON'] &&
55 | result['responseJSON']['reason'];
56 | wok.message.error(errText,'#alert-modal-debugreportrename-container', true);
57 | submitButton.prop('disabled', false);
58 | nameTextbox.prop('disabled', false).focus();
59 | });
60 |
61 | event.preventDefault();
62 | };
63 |
64 | renameReportForm.on('submit', submitForm);
65 | submitButton.on('click', submitForm);
66 |
67 | nameTextbox.val(gingerbase.selectedReport).select();
68 | };
69 |
--------------------------------------------------------------------------------
/ui/js/src/gingerbase.repository_add_main.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2015-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | gingerbase.repository_add_main = function() {
21 |
22 | var addForm = $('#form-repository-add');
23 | var addButton = $('#button-repository-add');
24 |
25 | if(gingerbase.capabilities['repo_mngt_tool']=="yum") {
26 | addForm.find('div.deb').hide();
27 | }
28 | else if(gingerbase.capabilities['repo_mngt_tool']=="deb") {
29 | addForm.find('div.yum').hide();
30 | }
31 |
32 | var validateField = function(event) {
33 | var valid=($(this).val()!=='');
34 | $(addButton).prop('disabled', !valid);
35 | return(valid);
36 | };
37 |
38 | var validateForm = function(event) {
39 | var valid=false;
40 | addForm.find('input.required').each( function() {
41 | valid=($(this).val()!=='');
42 | return(!valid);
43 | });
44 | return(valid);
45 | }
46 |
47 | addForm.find('input.required').on('input propertychange', validateField);
48 |
49 | var weedObject = function(obj) {
50 | for (var key in obj) {
51 | if (obj.hasOwnProperty(key)) {
52 | if((typeof(obj[key])==="object") && !Array.isArray(obj[key])) {
53 | weedObject(obj[key]);
54 | }
55 | else if(obj[key] == '') {
56 | delete obj[key];
57 | }
58 | }
59 | }
60 | }
61 |
62 | var addRepository = function(event) {
63 | var valid = validateForm();
64 | if(!valid) {
65 | return false;
66 | }
67 |
68 | var formData = $(addForm).serializeObject();
69 |
70 | if (formData && formData.isMirror!=undefined) {
71 | formData.isMirror=(String(formData.isMirror).toLowerCase() === 'true');
72 | }
73 | if(formData.isMirror) {
74 | if(formData.config==undefined) {
75 | formData.config=new Object();
76 | }
77 | formData.config.mirrorlist=formData.baseurl;
78 | delete formData.baseurl;
79 | delete formData.isMirror;
80 | }
81 | weedObject(formData);
82 | if(formData.config && formData.config.comps) {
83 | formData.config.comps=formData.config.comps.split(/[,\s]/);
84 | for(var i=0; i>formData.config.comps.length; i++) {
85 | formData.config.comps[i]=formData.config.comps[i].trim();
86 | }
87 | for (var j=formData.config.comps.indexOf(""); j!=-1; j=formData.config.comps.indexOf("")) {
88 | formData.config.comps.splice(j, 1);
89 | }
90 | }
91 |
92 | gingerbase.createRepository(formData, function() {
93 | wok.topic('gingerbase/repositoryAdded').publish();
94 | $("#repositories-grid-enable-button").attr('disabled', true);
95 | $("#repositories-grid-edit-button").attr('disabled', true);
96 | $("#repositories-grid-remove-button").attr('disabled', true);
97 | wok.window.close();
98 | }, function(jqXHR, textStatus, errorThrown) {
99 | var reason = jqXHR &&
100 | jqXHR['responseJSON'] &&
101 | jqXHR['responseJSON']['reason'];
102 | wok.message.error(reason, '#alert-modal-container');
103 | });
104 | return false;
105 | };
106 |
107 | $(addForm).on('submit', function(e){
108 | e.preventDefault();
109 | e.stopPropagation();
110 | addRepository();
111 | });
112 |
113 | $(addButton).on('click',function(e){
114 | e.preventDefault();
115 | e.stopPropagation();
116 | $(addForm).submit();
117 | });
118 | };
119 |
--------------------------------------------------------------------------------
/ui/js/src/gingerbase.repository_edit_main.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2015-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | gingerbase.repository_edit_main = function() {
21 |
22 | var editForm = $('#form-repository-edit');
23 | var saveButton = $('#repository-edit-button-save');
24 |
25 | if(gingerbase.capabilities['repo_mngt_tool']=="yum") {
26 | editForm.find('div.deb').hide();
27 | }
28 | else if(gingerbase.capabilities['repo_mngt_tool']=="deb") {
29 | editForm.find('div.yum').hide();
30 | }
31 |
32 | gingerbase.retrieveRepository(gingerbase.selectedRepository, function(repository) {
33 | editForm.fillWithObject(repository);
34 |
35 | $('input', editForm).on('input propertychange', function(event) {
36 | if($(this).val() !== '') {
37 | $(saveButton).prop('disabled', false);
38 | }
39 | });
40 | });
41 |
42 |
43 | var editRepository = function(event) {
44 | var formData = $(':input:visible', $(editForm)).serializeObject();
45 |
46 | if (formData && formData.config) {
47 | formData.config.gpgcheck=(String(formData.config.gpgcheck).toLowerCase() === 'true');
48 | }
49 |
50 | if(formData.config && formData.config.comps) {
51 | formData.config.comps=formData.config.comps.split(/[,\s]/);
52 | for(var i=0; i>formData.config.comps.length; i++) {
53 | formData.config.comps[i]=formData.config.comps[i].trim();
54 | }
55 | for (var j=formData.config.comps.indexOf(""); j!=-1; j=formData.config.comps.indexOf("")) {
56 | formData.config.comps.splice(j, 1);
57 | }
58 | }
59 |
60 | gingerbase.updateRepository(gingerbase.selectedRepository, formData, function() {
61 | wok.topic('gingerbase/repositoryUpdated').publish();
62 | $("#repositories-grid-enable-button").attr('disabled', true);
63 | $("#repositories-grid-edit-button").attr('disabled', true);
64 | $("#repositories-grid-remove-button").attr('disabled', true);
65 | wok.window.close();
66 | }, function(jqXHR, textStatus, errorThrown) {
67 | var reason = jqXHR &&
68 | jqXHR['responseJSON'] &&
69 | jqXHR['responseJSON']['reason'];
70 | wok.message.error(reason, '#alert-modal-container');
71 | });
72 |
73 | return false;
74 | };
75 |
76 | $(editForm).on('submit', editRepository);
77 | $(saveButton).on('click', editRepository);
78 | };
79 |
--------------------------------------------------------------------------------
/ui/pages/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | SUBDIRS = help tabs
19 |
20 | htmldir = $(datadir)/wok/plugins/gingerbase/ui/pages
21 |
22 | dist_html_DATA = $(wildcard *.tmpl) $(NULL)
23 |
--------------------------------------------------------------------------------
/ui/pages/help/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # Code derived from Project Kimchi
7 | # This library is free software; you can redistribute it and/or
8 | # modify it under the terms of the GNU Lesser General Public
9 | # License as published by the Free Software Foundation; either
10 | # version 2.1 of the License, or (at your option) any later version.
11 | #
12 | # This library is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | # Lesser General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Lesser General Public
18 | # License along with this library; if not, write to the Free Software
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 |
21 | SUBDIRS = zh_CN it_IT en_US zh_TW pt_BR ja_JP ru_RU ko_KR fr_FR de_DE es_ES
22 |
23 | DITA_HTML_FILES = $(patsubst %.dita,%.html,$(wildcard */*.dita))
24 | HTML_FILES = $(if $(DITA_HTML_FILES), $(DITA_HTML_FILES), $(wildcard */*.html))
25 | DITA_XSL_FILE = dita-help.xsl
26 |
27 | EXTRA_DIST = $(DITA_XSL_FILE)
28 |
29 | helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help
30 |
31 | dist_help_DATA = gingerbase.css
32 |
33 | all: $(HTML_FILES) $(wildcard */*.dita)
34 |
35 | %.html: %.dita $(DITA_XSL_FILE)
36 | xsltproc -o $@ $(DITA_XSL_FILE) $<
37 |
38 | CLEANFILES = $(HTML_FILES)
39 |
--------------------------------------------------------------------------------
/ui/pages/help/de_DE/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | de_DE_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/de_DE
21 |
22 | dist_de_DE_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/de_DE/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | Host
12 | Die Seite Host Dashboard zeigt Informationen zum Hostsystem an und ermöglicht Ihnen, den Host herunterzufahren, erneut zu starten und eine Verbindung zu ihm herzustellen.
13 |
14 |
Sie können die folgenden Aktionen am Host durchführen:
15 |
Wählen Sie Herunterfahren aus, um das Hostsystem herunterzufahren.
16 |
Wählen Sie Erneut starten aus, um das Hostsystem erneut zu starten.
17 |
18 |
Klicken Sie auf die folgenden Abschnitte, um Informationen zum Host anzuzeigen:
19 |
20 |
Basisinformationen
21 |
Dieser Abschnitt zeigt die Verteilung, die Version und den Codenamen des Hostbetriebssystems sowie den Prozessortyp, die Anzahl der Online-CPUs und die Speicherkapazität in GB an.
22 |
23 |
Systemstatistik
24 |
Dieser Abschnitt zeigt mithilfe von Grafiken Statistiken für CPU, Speicher, Platten-E/A und Netz-E/A für den Host an.
25 |
26 |
Debugberichte
27 |
Dieser Abschnitt zeigt Debugberichte, einschließlich Name und Dateipfad, an.
28 | Sie haben die Möglichkeit, einen neuen Bericht zu erstellen oder einen bestehenden Bericht umzubenennen, zu entfernen oder herunterzuladen.
Der Debugbericht wird während des Befehls sosreport generiert. Er ist verfügbar für Red Hat Enterprise Linux-, Fedora-
29 | und Ubuntu-Verteilungen. Der Befehl generiert eine .tar-Datei, die Konfigurations- und Diagnoseinformationen enthält, wie zum Beispiel Kernelversion, geladene Module sowie System- und Servicekonfigurationdateien.
30 | Der Befehl führt zudem externe Programme aus, um weitere Informationen zu sammeln, und speichert diese Ausgabe im resultierenden Archiv.
Klicken Sie auf die folgenden Abschnitte, um Informationen zum Host anzuzeigen:
15 |
16 |
Software-Updates
17 |
Dieser Abschnitt zeigt Informationen für alle Pakete an, bei denen Aktualisierungen verfügbar sind, einschließlich Paketname, Version, Architektur und Repository. Sie können alle aufgelisteten Pakete aktualisieren, indem Sie Alle aktualisieren auswählen. Sie können nicht einzelne Pakete zur Aktualisierung auswählen.
18 |
19 |
Repositorys
20 |
Dieser Abschnitt zeigt Repositorys an, die dem Hostsystem zugeordnet sind. Sie können Repositorys hinzufügen, aktivieren, bearbeiten oder entfernen. Beim Hinzufügen wird ein Repository dem Hostsystem zugeordnet. Das Aktivieren eines Repositorys dagegen ermöglicht dem Host den Zugriff auf das Repository. Wenn Ihr System Red Hat Enterprise
21 | Linux oder Fedora ist, können Sie yum-Repositorys hinzufügen.
22 | Wenn Ihr System Ubuntu oder Debian ist, fügen Sie deb-Repositorys hinzu.
Wenn Sie mit yum-Repositorys arbeiten, können Sie eine GPG-Prüfung hinzufügen, um sicherzustellen, dass ein Paket aus diesem Repository nicht beschädigt wurde.
23 | Wählen Sie ein Repository und dann Bearbeiten aus. Wählen Sie Ja aus, um GPG-Prüfung zu aktivieren, und geben Sie dann eine URL zur GPG-Schlüsseldatei für das Repository ein.
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ui/pages/help/en_US/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | en_US_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/en_US
21 |
22 | dist_en_US_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
--------------------------------------------------------------------------------
/ui/pages/help/en_US/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | Host Dashboard
12 | The Host page shows information about
13 | the host system, and allows you to shut down, restart, and connect
14 | to the host.
15 |
16 |
You can perform the following actions on the host:
17 |
Select Shut down to shut down the host
18 | system.
19 |
Select Restart to restart the host system.
20 |
21 |
Click the following sections to display information about the host:
22 |
23 |
Basic information
24 |
This section displays the host operating system distribution,
25 | version, and code name, as well as the processor type, the number
26 | of online CPUs and amount of memory in GB.
27 |
28 |
System statistics
29 |
This section displays graphs to show statistics for CPU, memory,
30 | disk I/O, and network I/O for the host.
31 |
32 |
Debug reports
33 |
This section displays debug reports, including name and file path.
34 | You can select from options to generate a new report, or rename, remove,
35 | or download an existing report.
The debug report is generated using
36 | the sosreport command. It is available for Red
37 | Hat Enterprise Linux, Fedora,
38 | and Ubuntu distributions. The command generates a .tar file that contains
39 | configuration and diagnostic information, such as the running kernel
40 | version, loaded modules, and system and service configuration files.
41 | The command also runs external programs to collect further information
42 | and stores this output in the resulting archive.
Click the following sections to display information about the host:
16 |
17 |
Software Updates
18 |
This section displays information for all of the packages that
19 | have updates available, including package name, version, architecture,
20 | and repository. You can update all of the packages listed by selecting Update
21 | All. You cannot select individual packages for updates.
22 |
23 |
Repositories
24 |
This section displays repositories that are associated with the
25 | host system. You can add, enable, edit, or remove repositories. Adding
26 | a repository associates it with the host system while enabling a repository
27 | allows the host to access it. If your system is based on Red Hat Enterprise
28 | Linux or Fedora, you can add yum repositories.
29 | If your system is Ubuntu or Debian, then add deb repositories.
If
30 | you are working with yum repositories, you can add a GPG check to
31 | verify that a package from this repository have not been corrupted.
32 | Select a repository and then Edit. Select Yes to
33 | enable GPG Check and then enter a URL to the
34 | GPG key file for the repository.
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/ui/pages/help/es_ES/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # Code derived from Project Kimchi
7 | # This library is free software; you can redistribute it and/or
8 | # modify it under the terms of the GNU Lesser General Public
9 | # License as published by the Free Software Foundation; either
10 | # version 2.1 of the License, or (at your option) any later version.
11 | #
12 | # This library is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | # Lesser General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Lesser General Public
18 | # License along with this library; if not, write to the Free Software
19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 |
21 | es_ES_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/es_ES
22 |
23 | dist_es_ES_help_DATA = $(wildcard *.html) $(NULL)
24 |
25 | EXTRA_DIST = $(wildcard *.dita)
26 |
27 | CLEANFILES = $(wildcard *.html)
28 |
--------------------------------------------------------------------------------
/ui/pages/help/es_ES/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | Host
12 | La página Host Dashboard muestra información sobre el sistema host y le permite concluir, reiniciar y conectar con el sistema principal.
13 |
14 |
Puede realizar las acciones siguientes en el host:
15 |
Seleccione Concluir para concluir el sistema host.
16 |
Seleccione Reiniciar para reiniciar el sistema host.
17 |
18 |
Pulse en las secciones siguientes para visualizar información acerca del host:
19 |
20 |
Información básica
21 |
Esta sección muestra la distribución del sistema operativo de host, la versión, el nombre de código, así como el tipo de procesador, el número de CPU en línea y la cantidad de memoria en GB.
22 |
23 |
Estadísticas del sistema
24 |
Esta sección muestra gráficos para mostrar estadísticas para CPU, memoria, E/S de disco y E/S de red para el host.
25 |
26 |
Informes de depuración
27 |
En esta sección se muestran informes de depuración, incluido el nombre y la ruta de archivo.
28 | Puede seleccionar entre opciones para generar un informe nuevo, o bien redenominar, eliminar o descargar un informe existente.
El informe de depuración se genera utilizando el mandato sosreport. Está disponible para distribuciones de Red
29 | Hat Enterprise Linux, Fedora y Ubuntu. El mandato genera un archivo .tar que contiene la información de configuración y de diagnóstico, como la versión de kernel en ejecución, los módulos de carga y los archivos de configuración del sistema y servicio.
30 | El mandato también ejecuta programas externos para recopilar información adicional y almacena esta salida en el archivo resultante.
Pulse en las secciones siguientes para visualizar información acerca del host:
15 |
16 |
Actualizaciones de software
17 |
En esta sección se muestra información para todos los paquetes que tienen actualizaciones disponibles, incluido el nombre de paquete, versión, arquitectura y repositorio. Puede actualizar todos los paquetes listados seleccionando Actualizar todo. No puede seleccionar paquetes individuales para las actualizaciones.
18 |
19 |
Repositorios
20 |
En esta sección se muestran los repositorios que están asociados con el sistema host. Puede añadir, habilitar, editar o eliminar repositorios. Añadir un repositorio lo asocia con el sistema host mientras que habilitar un repositorio permite que el host acceda a él. Si el sistema es Red Hat Enterprise
21 | Linux o Fedora, puede añadir repositorios yum.
22 | Si el sistema es Ubuntu o Debian, añada repositorios deb.
Si está trabajando con repositorios yum, puede añadir una comprobación GPG para verificar que un paquete de este repositorio no ha resultado dañado.
23 | Seleccione un repositorio y, a continuación, Editar. Seleccione Sí para habilitar Comprobación GPG y, a continuación, especifique un URL al archivo de claves GPG para el repositorio.
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ui/pages/help/fr_FR/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | fr_FR_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/fr_FR
21 |
22 | dist_fr_FR_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/fr_FR/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | Hôte
12 | La page Hôte affiche des informations
13 | sur le système hôte et vous permet d'arrêter, de redémarrer et de vous
14 | connecter à l'hôte.
15 |
16 |
Vous pouvez effectuer les actions suivantes sur l'hôte :
17 |
Sélectionnez Arrêter pour arrêter le système hôte.
18 |
Sélectionnez Redémarrer pour redémarrer le système hôte.
19 |
20 |
Cliquez sur les sections suivantes pour afficher des informations sur l'hôte :
21 |
22 |
Informations de base
23 |
Cette section affiche la distribution, la version et le nom de code
24 | du système d'exploitation hôte, ainsi que le type de processeur, le nombre d'UC en ligne et la quantité de mémoire en Go.
25 |
26 |
Statistiques système
27 |
Cette section affiche les graphiques des statistiques pour l'UC, mémoire, ainsi que
28 | les E-S disque et E-S réseau pour l'hôte.
29 |
30 |
Rapports de débogage
31 |
Cette section affiche les rapports de débogage, y compris le nom et le chemin du fichier.
32 | Vous pouvez faire un choix parmi les options afin de générer un nouveau rapport, ou renommer, supprimer,
33 | ou télécharger un rapport existant.
Le rapport de débogage est généré à
34 | l'aide de la commande sosreport. Cette option est disponible pour les distributions
35 | Red Hat Enterprise Linux, Fedora et Ubuntu. La commande génère un fichier .tar contenant la configuration et des informations de diagnostic,
36 | telles que la version du noyau d'exécution, les modules chargés, ainsi que les fichiers de configuration
37 | du système et de la maintenance.
38 | La commande exécute également des programmes externes pour collecter des informations
39 | supplémentaires et stocke cette sortie dans l'archive résultante.
Cliquez sur les sections suivantes pour afficher des informations sur l'hôte :
16 |
17 |
Mises à jour logicielles
18 |
Cette section affiche des informations pour tous les modules qui
19 | disposent de mises à jour disponibles, y compris le nom de module, la version, l'architecture
20 | et le référentiel. Vous pouvez mettre à jour toutes les modules répertoriés en sélectionnant Tout
21 | mettre à jour. Vous ne pouvez pas sélectionner des modules individuels pour les mises à jour.
22 |
23 |
Référentiels
24 |
Cette section affiche les référentiels associés au système hôte. Vous pouvez ajouter, activer, éditer ou retirer des référentiels. L'ajout d'un référentiel associe celui-ci au système hôte,
25 | tandis que l'activation d'un référentiel permet à l'hôte d'y accéder. Si votre système est Red Hat Enterprise Linux ou Fedora,
26 | vous pouvez ajouter des référentiels yum.
27 | Si votre système est de type Ubuntu ou Debian, ajoutez des référentiels
28 | deb.
Si vous travaillez avec des référentiels yum, vous pouvez ajouter un contrôle GPG
29 | afin de vérifier qu'un module provenant de ce référentiel n'a pas été endommagé.
30 | Sélectionnez un référentiel puis cliquez sur Editer. Sélectionnez Oui pour activer Contrôle GPG, puis entrez une URL pour le fichier de clés GPG du référentiel.
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/ui/pages/help/gingerbase.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2015-2016
5 | *
6 | * Code derived from Project Kimchi
7 | * Licensed under the Apache License, Version 2.0 (the "License");
8 | * you may not use this file except in compliance with the License.
9 | * You may obtain a copy of the License at
10 | *
11 | * http://www.apache.org/licenses/LICENSE-2.0
12 | *
13 | * Unless required by applicable law or agreed to in writing, software
14 | * distributed under the License is distributed on an "AS IS" BASIS,
15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 | * See the License for the specific language governing permissions and
17 | * limitations under the License.
18 | */
19 | BODY {
20 | background: #FFFFFF;
21 | margin-bottom: 1em;
22 | margin-left: .5em;
23 | }
24 |
25 | bold {
26 | font-weight: bold;
27 | }
28 |
29 | boldItalic {
30 | font-weight: bold;
31 | font-style: italic;
32 | }
33 |
34 | italic {
35 | font-style: italic;
36 | }
37 |
38 | underlined {
39 | text-decoration: underline;
40 | }
41 |
42 | uicontrol {
43 | font-weight: bold;
44 | }
45 |
46 | filepath {
47 | font-family: monospace, monospace;
48 | }.option {
49 | font-family: monospace, monospace;
50 | }
51 |
52 | cmdname {
53 | font-weight: bold;
54 | font-family: monospace, monospace;
55 | }
56 |
57 | .defparmname {
58 | font-weight: bold;
59 | text-decoration: underline;
60 | font-family: monospace, monospace;
61 | }
62 |
63 | .kwd {
64 | font-weight: bold;
65 | }
66 |
67 | .defkwd {
68 | font-weight: bold;
69 | text-decoration: underline;
70 | }
71 |
72 | var {
73 | font-style : italic;
74 | }
75 |
76 | strongwintitle {
77 | font-weight : bold;
78 | }
79 |
80 | parmname {
81 | font-weight: bold;
82 | font-family: monospace, monospace;
83 | white-space: nowrap;
84 | }
85 |
86 | code {
87 | font-family: monospace, monospace;
88 | }
89 |
90 | pre {
91 | font-family: monospace, monospace;
92 | }
93 |
94 | CITE {
95 | font-style: italic;
96 | }
97 |
98 | EM {
99 | font-style: italic;
100 | }
101 |
102 | STRONG {
103 | font-weight: bold;
104 | }
105 |
106 | VAR {
107 | font-style: italic;
108 | }
109 |
110 | dt {
111 | font-weight: bold;
112 | }
113 |
114 | /***********************************************************
115 | * Basic fonts
116 | ***********************************************************/
117 | body,
118 | td,
119 | th,
120 | caption {
121 | font-family: Verdana, Arial, Helvetica, sans-serif;
122 | font-size: 10pt;
123 | }
124 |
125 | pre, code {
126 | font-family: MS Courier New, Courier, monospace;
127 | }
128 |
129 | h1, h2, h3 {
130 | font-size: 12pt;
131 | font-weight: bold;
132 | color: #336699;
133 | }
134 |
135 | h4 {
136 | font-size: 10pt;
137 | font-weight: bold;
138 | color: #336699;
139 | }
140 |
141 | /***********************************************************
142 | * Basic indents, padding, and margin
143 | ***********************************************************/
144 | body {
145 | color: black;
146 | background-color: white;
147 | margin: 0;
148 | padding-top: 0.2em;
149 | padding-left: 0.6em;
150 | padding-right: 0.2em;
151 | padding-bottom: 1em;
152 | }
153 |
154 | h1,
155 | h2,
156 | h3,
157 | h4,
158 | h5,
159 | h6 {
160 | padding: 0;
161 | margin-top: 1em;
162 | margin-bottom: 0.75em;
163 | margin-left: 0;
164 | margin-right: 0;
165 | }
166 |
167 | address,
168 | dl,
169 | li,
170 | p {
171 | padding: 0;
172 | margin-top: 0.75em;
173 | margin-bottom: 0.75em;
174 | margin-left: 0;
175 | margin-right: 0;
176 | line-height: 125%;
177 | }
178 |
179 | td dl {
180 | margin-left: 2em;
181 | }
182 |
183 | pre {
184 | padding: 0;
185 | margin-top: 0.75em;
186 | margin-bottom: 0.75em;
187 | margin-left: 2em;
188 | margin-right: 0;
189 | }
190 |
191 | ol,
192 | ul {
193 | padding: 0;
194 | margin-top: 0.75em;
195 | margin-bottom: 0.75em;
196 | margin-left: 2.00em;
197 | margin-right: 0;
198 | }
199 |
200 | dd {
201 | margin-left: 3.00em;
202 | margin-top: 0.75em;
203 | margin-bottom: 0.75em;
204 | }
205 |
206 | dt {
207 | margin-left: 1.00em;
208 | margin-top: 0.75em;
209 | }
210 |
--------------------------------------------------------------------------------
/ui/pages/help/it_IT/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | it_IT_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/it_IT
21 |
22 | dist_it_IT_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/it_IT/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | Host
12 | La pagina Host visualizza le informazioni sul sistema host e consente di arrestarlo, riavviarlo e connettersi ad esso.
13 |
14 |
È possibile effettuare le seguenti operazioni sull'host:
15 |
Selezionare Arresta per arrestare il sistema host.
16 |
Selezionare Riavvia per riavviare il sistema host.
17 |
18 |
Fare clic sulle seguenti sezioni per visualizzare le informazioni sull'host:
19 |
20 |
Informazioni di base
21 |
Questa sezione visualizza il nome codice, la versione e la distribuzione del sistema operativo, come pure il tipo di processore, il numero di CPU in linea e la quantità di memoria in GB.
22 |
23 |
Statistiche di sistema
24 |
Questa sezione visualizza i grafici che mostrano le statistiche per la CPU, la memoria, l'I/O disco e di rete per l'host.
25 |
26 |
Report di debug
27 |
Questa sezione visualizza i report di debug, incluso il nome e il percorso file.
28 | Le opzioni disponibili consentono di generare un nuovo report oppure ridenominare, rimuovere o scaricare un report esistente.
Il report di debug viene generato utilizzando il comando sosreport. È disponibile per le distribuzioni Red
29 | Hat Enterprise Linux, Fedora e Ubuntu. Il comando genera un file .tar che contiene informazioni di diagnostica e configurazione, come la versione del kernel in esecuzione, i moduli caricati e i file di configurazione del servizio e del sistema.
30 | Il comando esegue anche programmi esterni per raccogliere ulteriori informazioni e memorizza l'output nell'archivio risultante.
Fare clic sulle seguenti sezioni per visualizzare le informazioni sull'host:
15 |
16 |
Aggiornamenti del software
17 |
Questa sezione visualizza le informazioni per tutti i pacchetti per cui sono disponibili gli aggiornamenti, incluso il nome, la versione, l'architettura e il repository del pacchetto. È possibile aggiornare tutti i pacchetti elencati, selezionando Aggiorna tutto. Non è possibile selezionare singoli pacchetti per gli aggiornamenti.
18 |
19 |
Repository
20 |
Questa sezione visualizza i repository associati al sistema host. È possibile aggiungere, abilitare, modificare o rimuovere i repository. L'aggiunta di un repository lo associa al sistema host, mentre l'abilitazione di un repository
21 | consente all'host di accedervi. Se il sistema è Red Hat Enterprise
22 | Linux o Fedora, è possibile aggiungere i repository yum.
23 | Se il sistema è Ubuntu o Debian, aggiungere i repository deb.
Se si stanno utilizzando i repository yum, è possibile aggiungere un controllo GPG per verificare che un pacchetto da questo repository non sia stato corrotto.
24 | Selezionare un repository, quindi Modifica. Selezionare Sì per abilitare il controllo GPG, quindi immettere un URL al file di chiavi GPG per il
25 | repository.
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/ui/pages/help/ja_JP/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | ja_JP_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/ja_JP
21 |
22 | dist_ja_JP_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/ja_JP/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | ホスト
12 | 「ホスト」ページには、ホスト・システムに関する情報が表示されます。ここで、ホストをシャットダウン、再始動、またホストに接続することができます。
13 |
14 |
15 |
以下のアクションをホストに対して実行できます。
16 |
17 |
ホスト・システムをシャットダウンするには「シャットダウン」を選択します。
18 |
19 |
ホスト・システムを再始動するには「再始動」を選択します。
20 |
21 |
22 |
ホストに関する情報を表示するには、以下の選択項目をクリックしてください。
23 |
24 |
25 |
基本情報
26 |
このセクションには、ホスト・オペレーティング・システムのディストリビューション、バージョン、およびコード名、さらにプロセッサー・タイプ、オンライン CPU の数、およびメモリーの量 (GB 単位)が表示されます。
27 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/ui/pages/help/ko_KR/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | ko_KR_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/ko_KR
21 |
22 | dist_ko_KR_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/ko_KR/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | 호스트
12 | 호스트 페이지에는 호스트 시스템에 대한 정보가 표시되며 이 페이지를 사용하여 호스트를 종료 및 다시 시작하거나 호스트에 연결할 수 있습니다.
13 |
14 |
호스트에 대해 다음 조치를 수행할 수 있습니다.
15 |
호스트 시스템을 종료하려면 시스템 종료를 선택합니다.
16 |
호스트 시스템을 다시 시작하려면 다시 시작을 선택합니다.
17 |
18 |
호스트에 대한 정보를 표시하려면 다음 섹션을 클릭하십시오.
19 |
20 |
기본 정보
21 |
이 섹션에는 호스트 운영 체제 배포,
22 | 버전, 코드 이름, 프로세서 유형, 온라인 CPU 수,
23 | 메모리 용량(GB) 등이 표시됩니다.
24 |
25 |
시스템 통계
26 |
이 섹션에는 호스트의 CPU, 메모리, 디스크 I/O, 네트워크 I/O에 대한 통계를 표시하는 그래프가 표시됩니다.
27 |
28 |
디버그 보고서
29 |
이 섹션에는 이름 및 파일 경로를 포함한 디버그 보고서가 표시됩니다.
30 | 새 보고서 생성, 기존 보고서 이름 바꾸기, 제거, 다운로드 등의 옵션 중에서 선택할 수 있습니다.
디버그 보고서는 sosreport 명령을 사용하여 생성됩니다. 이는 Red Hat Enterprise Linux, Fedora 및 Ubuntu 배포에서 사용 가능합니다. 이 명령은 구성 및 진단 정보(예: 실행 중인 커널 버전, 로드된 모듈, 시스템 및 서비스 구성 파일)를 포함하는 .tar 파일을 생성합니다.
31 | 또한 이 명령은 외부 프로그램을 실행하여 추가 정보를 수집하고 결과 아카이브에 이 출력을 저장합니다.
이 섹션에는 패키지 이름, 버전, 아키텍처, 저장소를 비롯하여 사용 가능한 업데이트가 있는 모든 패키지에 대한 정보가 표시됩니다. 모두 업데이트를 선택하여 나열된 모든 패키지를 업데이트할 수 있습니다. 업데이트에 대해 개별 패키지를 선택할 수는 없습니다.
18 |
19 |
저장소
20 |
이 섹션에는 호스트 시스템과 연관된 저장소가 표시됩니다. 저장소를 추가하거나, 사용으로 설정하거나, 편집하거나, 제거할 수 있습니다. 저장소를 추가하면 저장소가 호스트 시스템과 연관되며, 저장소를 사용으로 설정하면 호스트가 저장소에 액세스할 수 있습니다. 해당 시스템이 Red Hat Enterprise Linux 또는 Fedora인 경우, yum 저장소를 추가할 수 있습니다.
21 | 해당 시스템이 Ubuntu 또는 Debian인 경우, deb 저장소를 추가하십시오.
yum 저장소로 작업하는 경우, GPG 검사를 추가하여 이 저장소의 패키지가 손상되지 않았는지 확인할 수 있습니다.
22 | 저장소를 선택한 후 편집을 선택하십시오. 예를 선택하여
23 | GPG 검사를 사용으로 설정한 후
24 | 저장소에 대한 GPG 키 파일의 URL을 입력하십시오.
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ui/pages/help/pt_BR/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | pt_BR_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/pt_BR
21 |
22 | dist_pt_BR_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/pt_BR/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | Host
12 | A página Host mostra informações sobre
13 | o sistema host e permite encerrar, reiniciar e conectar
14 | ao host.
15 |
16 |
É possível executar as ações a segur no host:
17 |
Selecione Encerrar para encerrar o sistema
18 | host.
19 |
Selecione Reiniciar para reiniciar o sistema host.
20 |
21 |
Clique nas seções a seguir para exibir informações sobre o host:
22 |
23 |
Informações básicas
24 |
Esta seção exibe a distribuição do sistema operacional do host,
25 | a versão e o nome do código, bem como o tipo de processador, o número de CPUs on-line e a quantia de
26 | memória em GB.
27 |
28 |
Estatísticas do sistema
29 |
Esta seção exibe gráficos para mostrar estatísticas para CPU, memória,
30 | E/S de disco e E/S de rede para o host.
31 |
32 |
Relatórios de depuração
33 |
Esta seção exibe relatórios de depuração, incluindo nome e caminho do arquivo.
34 | É possível selecionar a partir das opções para gerar um novo relatório ou renomear, remover
35 | ou fazer o download de um relatório existente.
O relatório de depuração é gerado usando
36 | o comando sosreport. Ele está disponível para distribuições
37 | Red Hat Enterprise Linux, Fedora
38 | e Ubuntu. O comando gera um arquivo .tar que contém
39 | informações de configuração e de diagnóstico, como versão do kernel
40 | em execução, módulos carregados e arquivos de configuração de sistema e de serviço.
41 | O comando também executa programas externos para coletar informações adicionais
42 | e armazena essa saída no archive resultante.
Clique nas seções a seguir para exibir informações sobre o host:
16 |
17 |
Atualizações de software
18 |
Esta seção exibe informações de todos os pacotes que
19 | possuem atualizações disponíveis, incluindo nome do pacote, versão, arquitetura
20 | e repositório. É possível atualizar todos os pacotes listados selecionando Atualizar
21 | todos. Não é possível selecionar pacotes individuais para atualizações.
22 |
23 |
Repositórios
24 |
Esta seção exibe repositórios que estão associados ao
25 | sistema host. É possível incluir, ativar, editar ou remover repositórios. Incluir
26 | um repositório o associa com o sistema host enquanto ativar um repositório
27 | permite que o host o acesse. Se o seu sistema for Red Hat Enterprise
28 | Linux ou Fedora, será possível incluir repositórios yum.
29 | Se o seu sistema for Ubuntu ou Debian, inclua repositórios deb.
Se
30 | você estiver trabalhando com repositórios yum, será possível incluir uma verificação de GPG para
31 | verificar se um pacote desse repositório não foi corrompido.
32 | Selecione um repositório e, em seguida, Editar. Selecione Sim para
33 | ativar a Verificação de GPG e, então, insira uma URL no arquivo-chave de GPG para o
34 | repositório.
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/ui/pages/help/ru_RU/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | ru_RU_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/ru_RU
21 |
22 | dist_ru_RU_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/ru_RU/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | Хост
12 | Страница Хост показывает информацию о системе хоста и позволяет останавливать хост, перезапускать хост и подключаться к нему.
13 |
14 |
На хосте можно выполнять следующие действия:
15 |
Завершить работу - остановить систему хоста.
16 |
Перезапустить - перезапустить систему хоста.
17 |
18 |
Щелкните на следующих разделах для просмотра информации о хосте:
19 |
20 |
Базовая информация
21 |
В этом разделе показывается вариант операционной системы, его версия и кодовое имя, а также тип процессора, число подключенных процессоров и объем памяти в ГБ.
22 |
23 |
Системная статистика
24 |
В этом разделе показываются графики, отражающие статистическую информацию о процессоре, памяти, дисковом вводе-выводе и сетевом вводе-выводе для хоста.
25 |
26 |
Отладочные отчеты
27 |
В этом разделе показываются отладочные отчеты, включая имя и путь.
28 | Доступны команды для создания, переименования, удаления и загрузки отчетов.
Отладочный отчет создается командой sosreport. Он доступен для Red
29 | Hat Enterprise Linux, Fedora и Ubuntu. Команда создает файл .tar с конфигурационной и диагностической информацией, такой как версия ядра, загруженные модули и файлы конфигурации системы и служб.
30 | Команда также выполняет внешние программы для сбора дополнительной информации и сохраняет их вывод в результирующем архиве.
Щелкните на следующих разделах для просмотра информации о хосте:
15 |
16 |
Обновления программного обеспечения
17 |
В этом разделе показывается информация обо всех пакетах, для которых доступны обновления, включая имя пакета, версию, архитектуру и хранилище. Можно обновить все пакеты в списке щелчком на Обновить все. Отдельные пакеты для обновления выбрать нельзя.
18 |
19 |
Хранилища
20 |
В этом разделе показываются хранилища, связанные с системой хоста. Хранилища можно добавлять, активировать, изменять и удалять. При добавлении хранилище связывается с системой хоста, при активации хранилище становится доступным для хоста. Если система - Red Hat Enterprise Linux или Fedora, можно добавить хранилища yum.
21 | Если система - Ubuntu или Debian, добавьте хранилища deb.
При работе с хранилищами yum можно добавить проверку GPG для проверки целостности пакетов из данного хранилища.
22 | Выберите хранилище и щелкните на Изменить. Выберите Да, чтобы включить Проверку GPG, и введите URL файла ключей GPG для хранилища.
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/ui/pages/help/zh_CN/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | zh_CN_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/zh_CN
21 |
22 | dist_zh_CN_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/zh_CN/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | 主机
12 | “主机”页面显示有关主机系统的信息,并且允许您对主机进行关闭、启动和连接。
13 |
14 |
可对主机执行以下操作:
15 |
选择关闭以关闭主机系统。
16 |
选择重新启动以重新启动主机系统。
17 |
18 |
单击以下部分以显示有关主机的信息:
19 |
20 |
基本信息
21 |
本部分显示主机操作系统分发版、版本和代码名称以及处理器类型、联机 CPU 的数目和内存量(以 GB 计)。
本部分显示与主机系统关联的存储库。您可以添加、启用、编辑或除去存储库。当启用存储库会允许主机对其进行访问时,添加存储库会将其与主机系统关联。如果您的系统为 Red Hat Enterprise Linux 或 Fedora,那么可添加 yum 存储库。如果您的系统为 Ubuntu 或 Debian,那么请添加 deb 存储库。
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/ui/pages/help/zh_TW/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2014-2016
5 | #
6 | # This library is free software; you can redistribute it and/or
7 | # modify it under the terms of the GNU Lesser General Public
8 | # License as published by the Free Software Foundation; either
9 | # version 2.1 of the License, or (at your option) any later version.
10 | #
11 | # This library is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | # Lesser General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU Lesser General Public
17 | # License along with this library; if not, write to the Free Software
18 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 |
20 | zh_TW_helpdir = $(datadir)/wok/plugins/gingerbase/ui/pages/help/zh_TW
21 |
22 | dist_zh_TW_help_DATA = $(wildcard *.html) $(NULL)
23 |
24 | EXTRA_DIST = $(wildcard *.dita)
25 |
26 | CLEANFILES = $(wildcard *.html)
27 |
--------------------------------------------------------------------------------
/ui/pages/help/zh_TW/host-dashboard.dita:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
10 |
11 | 主機
12 | 「主機」頁面會顯示主機系統的相關資訊,並容許您關閉、重新啟動以及連接到主機。
13 |
14 |
您可以針對主機執行下列動作:
15 |
選取關閉以關閉主機系統。
16 |
選取重新啟動以重新啟動主機系統。
17 |
18 |
按一下下列區段以顯示主機的相關資訊:
19 |
20 |
基本資訊
21 |
此區段會顯示主機作業系統發行套件、版本、程式碼名稱以及處理器類型、線上 CPU 數目和記憶體數量 (GB)。
此區段會顯示與主機系統相關聯的儲存庫。您可以新增、啟用、編輯或移除儲存庫。新增儲存庫可使它與主機系統相關聯,而啟用儲存庫則容許主機存取儲存庫。如果您的系統是
21 | Red Hat Enterprise Linux 或 Fedora,則可以新增 yum 儲存庫。如果您的系統是
22 | Ubuntu 或 Debian,則可以新增 deb 儲存庫。
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ui/pages/report-add.html.tmpl:
--------------------------------------------------------------------------------
1 | #*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2013-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | *#
20 | #unicode UTF-8
21 | #import gettext
22 | #from wok.cachebust import href
23 | #silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang, fallback=True)
24 | #silent _ = t.gettext
25 | #silent _t = t.gettext
26 |
27 |
28 |
29 |
$_("Generate a New Debug Report")
30 |
31 |
32 |
33 |
41 |
42 |
46 |
47 |
50 |
--------------------------------------------------------------------------------
/ui/pages/report-rename.html.tmpl:
--------------------------------------------------------------------------------
1 | #*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2014-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | *#
20 | #unicode UTF-8
21 | #import gettext
22 | #from wok.cachebust import href
23 | #silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang, fallback=True)
24 | #silent _ = t.gettext
25 | #silent _t = t.gettext
26 |
27 |
28 |
29 |
$_("Rename a Debug Report")
30 |
31 |
32 |
33 |
41 |
42 |
47 |
48 |
51 |
--------------------------------------------------------------------------------
/ui/pages/repository-add.html.tmpl:
--------------------------------------------------------------------------------
1 | #*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2014-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | *#
20 | #unicode UTF-8
21 | #import gettext
22 | #from wok.cachebust import href
23 | #silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang, fallback=True)
24 | #silent _ = t.gettext
25 | #silent _t = t.gettext
26 |
27 |
28 |
$_("Add a Repository")
29 |
30 |
31 |
32 |
65 |
66 |
70 |
71 |
74 |
--------------------------------------------------------------------------------
/ui/pages/repository-edit.html.tmpl:
--------------------------------------------------------------------------------
1 | #*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2014-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | *#
20 | #unicode UTF-8
21 | #import gettext
22 | #from wok.cachebust import href
23 | #silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang, fallback=True)
24 | #silent _ = t.gettext
25 | #silent _t = t.gettext
26 |
27 |
28 |
$_("Edit Repository")
29 |
30 |
31 |
32 |
71 |
72 |
76 |
77 |
80 |
--------------------------------------------------------------------------------
/ui/pages/tabs/Makefile.am:
--------------------------------------------------------------------------------
1 | #
2 | # Ginger Base
3 | #
4 | # Copyright IBM Corp, 2013-2016
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 |
18 | tabshtmldir = $(datadir)/wok/plugins/gingerbase/ui/pages/tabs
19 |
20 |
21 | dist_tabshtml_DATA = $(wildcard *.html.tmpl) $(NULL)
22 |
--------------------------------------------------------------------------------
/ui/pages/tabs/host-update.html.tmpl:
--------------------------------------------------------------------------------
1 | #*
2 | * Project Ginger Base
3 | *
4 | * Copyright IBM Corp, 2015-2016
5 | *
6 | * Code derived from Project Kimchi
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | *#
20 |
21 | #unicode UTF-8
22 | #import gettext
23 | #from wok.cachebust import href
24 | #silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang, fallback=True)
25 | #silent _ = t.gettext
26 | #silent _t = t.gettext
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/utils.py:
--------------------------------------------------------------------------------
1 | #
2 | # Project Kimchi
3 | #
4 | # Copyright IBM Corp, 2015-2016
5 | #
6 | # Code derived from Project Kimchi
7 | #
8 | # This library is free software; you can redistribute it and/or
9 | # modify it under the terms of the GNU Lesser General Public
10 | # License as published by the Free Software Foundation; either
11 | # version 2.1 of the License, or (at your option) any later version.
12 | #
13 | # This library is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | # Lesser General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU Lesser General Public
19 | # License along with this library; if not, write to the Free Software
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | #
22 | import base64
23 | import contextlib
24 | import os
25 | import urllib.parse
26 | from http.client import HTTPConnection
27 | from http.client import HTTPException
28 | from http.client import HTTPSConnection
29 |
30 | from wok.exception import InvalidParameter
31 |
32 |
33 | MAX_REDIRECTION_ALLOWED = 5
34 |
35 |
36 | def check_url_path(path, redirected=0):
37 | if redirected > MAX_REDIRECTION_ALLOWED:
38 | return False
39 | try:
40 | code = ''
41 | parse_result = urllib.parse.urlparse(path)
42 | headers = {}
43 | server_name = parse_result.hostname
44 | if (parse_result.scheme in ['https', 'ftp']) and \
45 | (parse_result.username and parse_result.password):
46 | # Yum accepts http urls with user and password credentials. Handle
47 | # them and avoid access test errors
48 | credential = parse_result.username + ':' + parse_result.password
49 | headers = {'Authorization': 'Basic %s' %
50 | base64.b64encode(credential)}
51 | urlpath = parse_result.path
52 | if not urlpath:
53 | # Just a server, as with a repo.
54 | with contextlib.closing(urllib.request.urlopen(path)) as res:
55 | code = res.getcode()
56 | else:
57 | # socket.gaierror could be raised,
58 | # which is a child class of IOError
59 | if headers:
60 | conn = HTTPSConnection(server_name, timeout=15)
61 | else:
62 | conn = HTTPConnection(server_name, timeout=15)
63 | # Don't try to get the whole file:
64 | conn.request('HEAD', urlpath, headers=headers)
65 | response = conn.getresponse()
66 | code = response.status
67 | conn.close()
68 | if code == 200:
69 | return True
70 | elif code == 301 or code == 302:
71 | for header in response.getheaders():
72 | if header[0] == 'location':
73 | return check_url_path(header[1], redirected + 1)
74 | else:
75 | return False
76 | except (urllib.request.URLError, HTTPException, IOError, ValueError):
77 | return False
78 | return True
79 |
80 |
81 | def validate_repo_url(url):
82 | url_parts = url.split('://') # [0] = prefix, [1] = rest of URL
83 |
84 | if url_parts[0] == '':
85 | raise InvalidParameter('GGBREPOS0002E')
86 |
87 | if url_parts[0] in ['http', 'https', 'ftp']:
88 | if not check_url_path(url):
89 | raise InvalidParameter('GGBUTILS0001E', {'url': url})
90 | elif url_parts[0] == 'file':
91 | if not os.path.exists(url_parts[1]):
92 | raise InvalidParameter('GGBUTILS0001E', {'url': url})
93 | else:
94 | raise InvalidParameter('GGBREPOS0002E')
95 |
--------------------------------------------------------------------------------