Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bacula Community Edition
Bacula Community
Commits
33971c7f
Commit
33971c7f
authored
Dec 15, 2022
by
Marcin Haba
Browse files
baculum: Add dedupengine output type to status storage
parent
489d5384
Changes
3
Hide whitespace changes
Inline
Side-by-side
gui/baculum/protected/API/Modules/StatusStorage.php
View file @
33971c7f
...
...
@@ -38,6 +38,7 @@ class StatusStorage extends ComponentStatusModule {
const
OUTPUT_TYPE_RUNNING
=
'running'
;
const
OUTPUT_TYPE_TERMINATED
=
'terminated'
;
const
OUTPUT_TYPE_DEVICES
=
'devices'
;
const
OUTPUT_TYPE_DEDUPENGINE
=
'dedupengine'
;
/**
* Get parsed storage status.
...
...
@@ -78,18 +79,23 @@ class StatusStorage extends ComponentStatusModule {
$autochangers
=
[];
$ach_dev
=
[];
$empty_lines
=
0
;
for
(
$i
=
0
;
$i
<
count
(
$output
);
$i
++
)
{
for
(
$i
=
0
;
$i
<
count
(
$output
);
$i
++
)
{
if
(
preg_match
(
'/[\[\]]$/'
,
$output
[
$i
])
===
1
)
{
$output
[
$i
]
=
''
;
}
if
(
empty
(
$output
[
$i
]))
{
$empty_lines
++
;
if
(
count
(
$part
)
>
10
)
{
$result
[]
=
$part
;
$part
=
[];
}
if
(
count
(
$ach_dev
)
==
2
)
{
$autochangers
[
$autochanger
][
'devices'
][]
=
$ach_dev
;
$ach_dev
=
[];
continue
;
}
if
(
count
(
$part
)
>
7
)
{
$result
[]
=
$part
;
$part
=
[];
continue
;
}
if
(
$empty_lines
==
4
&&
$autochanger
)
{
if
(
$empty_lines
>
3
&&
$autochanger
)
{
$autochanger
=
null
;
}
}
else
{
...
...
@@ -144,7 +150,8 @@ class StatusStorage extends ComponentStatusModule {
self
::
OUTPUT_TYPE_HEADER
,
self
::
OUTPUT_TYPE_RUNNING
,
self
::
OUTPUT_TYPE_TERMINATED
,
self
::
OUTPUT_TYPE_DEVICES
self
::
OUTPUT_TYPE_DEVICES
,
self
::
OUTPUT_TYPE_DEDUPENGINE
)
);
}
...
...
gui/baculum/protected/API/Pages/API/StorageStatus.php
View file @
33971c7f
...
...
@@ -58,7 +58,9 @@ class StorageStatus extends ConsoleOutputPage {
$out
=
(
object
)[
'output'
=>
[],
'error'
=>
0
];
if
(
$out_format
===
parent
::
OUTPUT_FORMAT_RAW
)
{
$out
=
$this
->
getRawOutput
([
'storage'
=>
$storage
->
name
]);
$out
=
$this
->
getRawOutput
([
'storage'
=>
$storage
->
name
]);
}
elseif
(
$out_format
===
parent
::
OUTPUT_FORMAT_JSON
)
{
$out
=
$this
->
getJSONOutput
([
'storage'
=>
$storage
->
name
,
...
...
gui/baculum/protected/API/openapi_baculum.json
View file @
33971c7f
...
...
@@ -2527,17 +2527,18 @@
{
"$ref"
:
"#/components/parameters/StorageId"
},
{
"$ref"
:
"#/components/parameters/Output"
},
{
"name"
:
"type"
,
"in"
:
"query"
,
"required"
:
false
,
"description"
:
"Output type using together with output=json parameter."
,
"schema"
:
{
"type"
:
"string"
,
"enum"
:
[
"header"
,
"running"
,
"devices"
,
"terminated"
]
"enum"
:
[
"header"
,
"running"
,
"devices"
,
"terminated"
,
"dedupengine"
]
}
},
{
"$ref"
:
"#/components/parameters/Output"
}
]
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment