2022-12-09 16:30:58 +08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2022, KylinSoft Co., Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Authors: iaom <zhangpengfei@kylinos.cn>
|
|
|
|
*
|
|
|
|
*/
|
2022-10-26 18:01:40 +08:00
|
|
|
import QtQuick 2.0
|
2022-12-09 16:30:58 +08:00
|
|
|
import QtQuick.Layouts 1.12
|
2022-10-26 18:01:40 +08:00
|
|
|
|
2022-12-09 16:30:58 +08:00
|
|
|
Rectangle {
|
2024-04-17 17:43:50 +08:00
|
|
|
height: 250
|
2022-12-09 16:30:58 +08:00
|
|
|
width: 320
|
|
|
|
Column {
|
|
|
|
visible: true
|
|
|
|
width: parent.width
|
|
|
|
height: childrenRect.height
|
|
|
|
StatusKeyValue {
|
|
|
|
id: basicIndexDocumentNum
|
|
|
|
keyText: qsTr("Basic index document number")
|
2024-04-15 09:52:06 +08:00
|
|
|
valueText: monitor.basicIndexDocNum
|
2022-12-09 16:30:58 +08:00
|
|
|
}
|
2022-10-26 18:01:40 +08:00
|
|
|
|
2022-12-09 16:30:58 +08:00
|
|
|
StatusKeyValue {
|
|
|
|
id: contentIndexDocumentNum
|
|
|
|
keyText: qsTr("Content index document number")
|
2024-04-15 09:52:06 +08:00
|
|
|
valueText: monitor.contentIndexDocNum
|
|
|
|
}
|
|
|
|
StatusKeyValue {
|
|
|
|
id: ocrContentIndexDocumentNum
|
|
|
|
keyText: qsTr("OCR content index document number")
|
|
|
|
valueText: monitor.ocrContentIndexDocNum
|
2022-12-09 16:30:58 +08:00
|
|
|
}
|
2024-04-17 17:43:50 +08:00
|
|
|
StatusKeyValue {
|
|
|
|
id: aiIndexDocumentNum
|
|
|
|
keyText: qsTr("ai index document number")
|
|
|
|
valueText: monitor.aiIndexDocNum
|
|
|
|
}
|
2022-12-09 16:30:58 +08:00
|
|
|
|
|
|
|
StatusKeyValue {
|
|
|
|
id: indexState
|
|
|
|
keyText: qsTr("Index state")
|
2024-04-15 09:52:06 +08:00
|
|
|
valueText: monitor.indexState
|
2022-12-09 16:30:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
IndexProgressBar {
|
|
|
|
id: basicIndexProgress
|
|
|
|
width: parent.width;
|
|
|
|
name: "Basic index progress"
|
|
|
|
from: 0
|
2024-04-15 09:52:06 +08:00
|
|
|
to: monitor.basicIndexSize
|
|
|
|
value: monitor.basicIndexProgress
|
|
|
|
visible: true
|
2022-12-09 16:30:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
IndexProgressBar {
|
|
|
|
id: contentIndexProgress
|
|
|
|
width: parent.width;
|
|
|
|
name: "Content index progress"
|
|
|
|
from: 0
|
2024-04-15 09:52:06 +08:00
|
|
|
to: monitor.contentIndexSize
|
|
|
|
value: monitor.contentIndexProgress
|
|
|
|
visible: true
|
2022-12-09 16:30:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
IndexProgressBar {
|
2024-04-15 09:52:06 +08:00
|
|
|
id: ocrContentIndexProgress
|
2022-12-09 16:30:58 +08:00
|
|
|
name: "OCR index progress"
|
|
|
|
width: parent.width;
|
|
|
|
from: 0
|
2024-04-15 09:52:06 +08:00
|
|
|
to: monitor.ocrContentIndexSize
|
|
|
|
value: monitor.ocrContentIndexProgress
|
|
|
|
visible: true
|
2022-12-09 16:30:58 +08:00
|
|
|
}
|
2024-04-17 17:43:50 +08:00
|
|
|
IndexProgressBar {
|
|
|
|
id: aiIndexProgress
|
|
|
|
name: "Ai progress"
|
|
|
|
width: parent.width;
|
|
|
|
from: 0
|
|
|
|
to: monitor.aiIndexSize
|
|
|
|
value: monitor.aiIndexProgress
|
|
|
|
visible: true
|
|
|
|
}
|
2022-12-09 16:30:58 +08:00
|
|
|
}
|
2024-04-15 09:52:06 +08:00
|
|
|
Component.onCompleted: {
|
|
|
|
monitor.basicIndexDone.connect(onBasicIndexDone);
|
|
|
|
monitor.contentIndexDone.connect(onContentIndexDone);
|
|
|
|
monitor.ocrContentIndexDone.connect(onOcrContentIndexDone);
|
2024-04-17 17:43:50 +08:00
|
|
|
monitor.aiIndexDone.connect(onAiIndexDone);
|
2024-04-15 09:52:06 +08:00
|
|
|
monitor.basicIndexStart.connect(onBasicIndexStart);
|
|
|
|
monitor.contentIndexStart.connect(onContentIndexStart);
|
|
|
|
monitor.ocrContentIndexStart.connect(onOcrContentIndexStart);
|
2024-04-17 17:43:50 +08:00
|
|
|
monitor.aiIndexStart.connect(onAiIndexStart);
|
2024-04-15 09:52:06 +08:00
|
|
|
}
|
|
|
|
function onBasicIndexStart() {
|
|
|
|
basicIndexProgress.state = "Running"
|
|
|
|
}
|
|
|
|
function onContentIndexStart() {
|
|
|
|
contentIndexProgress.state = "Running"
|
|
|
|
}
|
|
|
|
function onOcrContentIndexStart() {
|
|
|
|
ocrContentIndexProgress.state = "Running"
|
|
|
|
}
|
2024-04-17 17:43:50 +08:00
|
|
|
function onAiIndexStart() {
|
|
|
|
aiIndexProgress.state = "Running"
|
|
|
|
}
|
2024-04-15 09:52:06 +08:00
|
|
|
function onBasicIndexDone() {
|
|
|
|
basicIndexProgress.state = "Done"
|
|
|
|
}
|
|
|
|
function onContentIndexDone() {
|
|
|
|
contentIndexProgress.state = "Done"
|
|
|
|
}
|
|
|
|
function onOcrContentIndexDone() {
|
|
|
|
ocrContentIndexProgress.state = "Done"
|
|
|
|
}
|
2024-04-17 17:43:50 +08:00
|
|
|
function onAiIndexDone() {
|
|
|
|
aiIndexProgress.state = "Done"
|
|
|
|
}
|
2022-10-26 18:01:40 +08:00
|
|
|
}
|