added display of installed services on the page PageSettingsServersList
This commit is contained in:
parent
0058edc24e
commit
925fd9f268
4 changed files with 34 additions and 2 deletions
|
|
@ -129,6 +129,25 @@ QJsonObject ContainersModel::getCurrentlyProcessedContainerConfig()
|
||||||
return qvariant_cast<QJsonObject>(data(index(m_currentlyProcessedContainerIndex), ConfigRole));
|
return qvariant_cast<QJsonObject>(data(index(m_currentlyProcessedContainerIndex), ConfigRole));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList ContainersModel::getAllInstalledServicesName(const int serverIndex)
|
||||||
|
{
|
||||||
|
QStringList servicesName;
|
||||||
|
const auto &containers = m_settings->containers(serverIndex);
|
||||||
|
for (const DockerContainer &container : containers.keys()) {
|
||||||
|
if (ContainerProps::containerService(container) == ServiceType::Other && m_containers.contains(container)) {
|
||||||
|
if (container == DockerContainer::Dns) {
|
||||||
|
servicesName.append("DNS");
|
||||||
|
} else if (container == DockerContainer::Sftp) {
|
||||||
|
servicesName.append("SFTP");
|
||||||
|
} else if (container == DockerContainer::TorWebSite) {
|
||||||
|
servicesName.append("TOR");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
servicesName.sort();
|
||||||
|
return servicesName;
|
||||||
|
}
|
||||||
|
|
||||||
ErrorCode ContainersModel::removeAllContainers()
|
ErrorCode ContainersModel::removeAllContainers()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ public slots:
|
||||||
|
|
||||||
QString getCurrentlyProcessedContainerName();
|
QString getCurrentlyProcessedContainerName();
|
||||||
QJsonObject getCurrentlyProcessedContainerConfig();
|
QJsonObject getCurrentlyProcessedContainerConfig();
|
||||||
|
QStringList getAllInstalledServicesName(const int serverIndex);
|
||||||
|
|
||||||
ErrorCode removeAllContainers();
|
ErrorCode removeAllContainers();
|
||||||
ErrorCode removeCurrentlyProcessedContainer();
|
ErrorCode removeCurrentlyProcessedContainer();
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,15 @@ PageType {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
text: name
|
text: name
|
||||||
descriptionText: hostName
|
descriptionText: {
|
||||||
|
var servicesNameString = ""
|
||||||
|
var servicesName = ContainersModel.getAllInstalledServicesName(index)
|
||||||
|
for (var i = 0; i < servicesName.length; i++) {
|
||||||
|
servicesNameString += servicesName[i] + " · "
|
||||||
|
}
|
||||||
|
|
||||||
|
return servicesNameString + hostName
|
||||||
|
}
|
||||||
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
rightImageSource: "qrc:/images/controls/chevron-right.svg"
|
||||||
|
|
||||||
clickedFunction: function() {
|
clickedFunction: function() {
|
||||||
|
|
|
||||||
|
|
@ -91,11 +91,15 @@ PageType {
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicButtonType {
|
BasicButtonType {
|
||||||
|
Layout.topMargin: 16
|
||||||
|
Layout.leftMargin: -8
|
||||||
|
implicitHeight: 32
|
||||||
|
|
||||||
defaultColor: "transparent"
|
defaultColor: "transparent"
|
||||||
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
|
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
|
||||||
pressedColor: Qt.rgba(1, 1, 1, 0.12)
|
pressedColor: Qt.rgba(1, 1, 1, 0.12)
|
||||||
disabledColor: "#878B91"
|
disabledColor: "#878B91"
|
||||||
textColor: "#D7D8DB"
|
textColor: "#FBB26A"
|
||||||
|
|
||||||
text: showContent ? qsTr("Collapse content") : qsTr("Show content")
|
text: showContent ? qsTr("Collapse content") : qsTr("Show content")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue