add basic view
parent
fe6ef9d639
commit
7629745dd0
|
|
@ -59,7 +59,6 @@
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
//! [0]
|
|
||||||
class Cluster
|
class Cluster
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -89,12 +88,10 @@ private:
|
||||||
int m_cpus;
|
int m_cpus;
|
||||||
int m_memory;
|
int m_memory;
|
||||||
};
|
};
|
||||||
//! [0]
|
|
||||||
|
|
||||||
typedef QList<Cluster> ClusterList;
|
typedef QList<Cluster> ClusterList;
|
||||||
typedef QHash<QString, Cluster> ClusterHash;
|
typedef QHash<QString, Cluster> ClusterHash;
|
||||||
|
|
||||||
//! [1]
|
|
||||||
class ClusterModel : public QAbstractListModel
|
class ClusterModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -115,6 +112,5 @@ public:
|
||||||
private:
|
private:
|
||||||
ClusterList clusterList;
|
ClusterList clusterList;
|
||||||
};
|
};
|
||||||
//! [1]
|
|
||||||
|
|
||||||
#endif // CLUSTER_H
|
#endif // CLUSTER_H
|
||||||
|
|
|
||||||
238
gui/window.cpp
238
gui/window.cpp
|
|
@ -81,6 +81,7 @@
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFontDialog>
|
#include <QFontDialog>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
|
||||||
#ifndef QT_NO_TERMWIDGET
|
#ifndef QT_NO_TERMWIDGET
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
@ -88,16 +89,82 @@
|
||||||
#include "qtermwidget.h"
|
#include "qtermwidget.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! [0]
|
|
||||||
Window::Window()
|
Window::Window()
|
||||||
{
|
{
|
||||||
trayIconIcon = new QIcon(":/images/minikube.png");
|
trayIconIcon = new QIcon(":/images/minikube.png");
|
||||||
checkForMinikube();
|
checkForMinikube();
|
||||||
|
isBasicView = true;
|
||||||
|
|
||||||
|
stackedWidget = new QStackedWidget;
|
||||||
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
|
dashboardProcess = 0;
|
||||||
|
|
||||||
createClusterGroupBox();
|
createClusterGroupBox();
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
createTrayIcon();
|
createTrayIcon();
|
||||||
|
|
||||||
|
createBasicView();
|
||||||
|
createAdvancedView();
|
||||||
|
trayIcon->show();
|
||||||
|
updateButtons();
|
||||||
|
layout->addWidget(stackedWidget);
|
||||||
|
setLayout(layout);
|
||||||
|
resize(200, 250);
|
||||||
|
|
||||||
|
|
||||||
|
setWindowTitle(tr("minikube"));
|
||||||
|
setWindowIcon(*trayIconIcon);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::createBasicView()
|
||||||
|
{
|
||||||
|
basicStartButton = new QPushButton(tr("Start"));
|
||||||
|
basicStopButton = new QPushButton(tr("Stop"));
|
||||||
|
basicDeleteButton = new QPushButton(tr("Delete"));
|
||||||
|
basicRefreshButton = new QPushButton(tr("Refresh"));
|
||||||
|
basicSSHButton = new QPushButton(tr("SSH"));
|
||||||
|
basicDashboardButton = new QPushButton(tr("Dashboard"));
|
||||||
|
QPushButton *advancedViewButton = new QPushButton(tr("Advanced View"));
|
||||||
|
|
||||||
|
QVBoxLayout *buttonLayout = new QVBoxLayout;
|
||||||
|
QGroupBox *catBox = new QGroupBox(tr("Clusters"));
|
||||||
|
catBox->setLayout(buttonLayout);
|
||||||
|
buttonLayout->addWidget(basicStartButton);
|
||||||
|
buttonLayout->addWidget(basicStopButton);
|
||||||
|
buttonLayout->addWidget(basicDeleteButton);
|
||||||
|
buttonLayout->addWidget(basicRefreshButton);
|
||||||
|
buttonLayout->addWidget(basicSSHButton);
|
||||||
|
buttonLayout->addWidget(basicDashboardButton);
|
||||||
|
buttonLayout->addWidget(advancedViewButton);
|
||||||
|
catBox->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||||
|
stackedWidget->addWidget(catBox);
|
||||||
|
|
||||||
|
connect(basicSSHButton, &QAbstractButton::clicked, this, &Window::sshConsole);
|
||||||
|
connect(basicDashboardButton, &QAbstractButton::clicked, this, &Window::dashboardBrowser);
|
||||||
|
connect(basicStartButton, &QAbstractButton::clicked, this, &Window::startSelectedMinikube);
|
||||||
|
connect(basicStopButton, &QAbstractButton::clicked, this, &Window::stopMinikube);
|
||||||
|
connect(basicDeleteButton, &QAbstractButton::clicked, this, &Window::deleteMinikube);
|
||||||
|
connect(basicRefreshButton, &QAbstractButton::clicked, this, &Window::updateClusters);
|
||||||
|
connect(advancedViewButton, &QAbstractButton::clicked, this, &Window::toAdvancedView);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::toAdvancedView()
|
||||||
|
{
|
||||||
|
isBasicView = false;
|
||||||
|
stackedWidget->setCurrentIndex(1);
|
||||||
|
resize(600, 400);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::toBasicView()
|
||||||
|
{
|
||||||
|
isBasicView = true;
|
||||||
|
stackedWidget->setCurrentIndex(0);
|
||||||
|
resize(200, 250);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::createAdvancedView()
|
||||||
|
{
|
||||||
connect(sshButton, &QAbstractButton::clicked, this, &Window::sshConsole);
|
connect(sshButton, &QAbstractButton::clicked, this, &Window::sshConsole);
|
||||||
connect(dashboardButton, &QAbstractButton::clicked, this, &Window::dashboardBrowser);
|
connect(dashboardButton, &QAbstractButton::clicked, this, &Window::dashboardBrowser);
|
||||||
connect(startButton, &QAbstractButton::clicked, this, &Window::startSelectedMinikube);
|
connect(startButton, &QAbstractButton::clicked, this, &Window::startSelectedMinikube);
|
||||||
|
|
@ -107,30 +174,17 @@ Window::Window()
|
||||||
connect(createButton, &QAbstractButton::clicked, this, &Window::initMachine);
|
connect(createButton, &QAbstractButton::clicked, this, &Window::initMachine);
|
||||||
connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &Window::messageClicked);
|
connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &Window::messageClicked);
|
||||||
|
|
||||||
dashboardProcess = 0;
|
clusterGroupBox->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||||
|
stackedWidget->addWidget(clusterGroupBox);
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout;
|
|
||||||
mainLayout->addWidget(clusterGroupBox);
|
|
||||||
setLayout(mainLayout);
|
|
||||||
|
|
||||||
trayIcon->show();
|
|
||||||
|
|
||||||
setWindowTitle(tr("minikube"));
|
|
||||||
setWindowIcon(*trayIconIcon);
|
|
||||||
resize(600, 400);
|
|
||||||
}
|
}
|
||||||
//! [0]
|
|
||||||
|
|
||||||
//! [1]
|
|
||||||
void Window::setVisible(bool visible)
|
void Window::setVisible(bool visible)
|
||||||
{
|
{
|
||||||
minimizeAction->setEnabled(visible);
|
minimizeAction->setEnabled(visible);
|
||||||
restoreAction->setEnabled(!visible);
|
restoreAction->setEnabled(!visible);
|
||||||
QDialog::setVisible(visible);
|
QDialog::setVisible(visible);
|
||||||
}
|
}
|
||||||
//! [1]
|
|
||||||
|
|
||||||
//! [2]
|
|
||||||
void Window::closeEvent(QCloseEvent *event)
|
void Window::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_OSX
|
#ifdef Q_OS_OSX
|
||||||
|
|
@ -148,16 +202,13 @@ void Window::closeEvent(QCloseEvent *event)
|
||||||
event->ignore();
|
event->ignore();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//! [2]
|
|
||||||
|
|
||||||
//! [6]
|
|
||||||
void Window::messageClicked()
|
void Window::messageClicked()
|
||||||
{
|
{
|
||||||
QMessageBox::information(0, tr("Systray"),
|
QMessageBox::information(0, tr("Systray"),
|
||||||
tr("Sorry, I already gave what help I could.\n"
|
tr("Sorry, I already gave what help I could.\n"
|
||||||
"Maybe you should try asking a human?"));
|
"Maybe you should try asking a human?"));
|
||||||
}
|
}
|
||||||
//! [6]
|
|
||||||
|
|
||||||
void Window::createActions()
|
void Window::createActions()
|
||||||
{
|
{
|
||||||
|
|
@ -240,15 +291,13 @@ ClusterList Window::getClusters()
|
||||||
ClusterList clusters;
|
ClusterList clusters;
|
||||||
QStringList args = { "profile", "list", "-o", "json" };
|
QStringList args = { "profile", "list", "-o", "json" };
|
||||||
QString text;
|
QString text;
|
||||||
bool success = sendMinikubeCommand(args, text);
|
sendMinikubeCommand(args, text);
|
||||||
QStringList lines;
|
QStringList lines;
|
||||||
if (success) {
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||||
lines = text.split("\n", Qt::SkipEmptyParts);
|
lines = text.split("\n", Qt::SkipEmptyParts);
|
||||||
#else
|
#else
|
||||||
lines = text.split("\n", QString::SkipEmptyParts);
|
lines = text.split("\n", QString::SkipEmptyParts);
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
for (int i = 0; i < lines.size(); i++) {
|
for (int i = 0; i < lines.size(); i++) {
|
||||||
QString line = lines.at(i);
|
QString line = lines.at(i);
|
||||||
QJsonParseError error;
|
QJsonParseError error;
|
||||||
|
|
@ -257,58 +306,67 @@ ClusterList Window::getClusters()
|
||||||
qDebug() << error.errorString();
|
qDebug() << error.errorString();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (json.isObject()) {
|
if (!json.isObject()) {
|
||||||
QJsonObject par = json.object();
|
continue;
|
||||||
QJsonArray a = par["valid"].toArray();
|
}
|
||||||
for (int j = 0; j < a.size(); j++) {
|
QJsonObject par = json.object();
|
||||||
QJsonObject obj = a[j].toObject();
|
QJsonArray a = par["valid"].toArray();
|
||||||
QString name;
|
QJsonArray b = par["invalid"].toArray();
|
||||||
if (obj.contains("Name")) {
|
for (int i = 0; i < b.size(); i++) {
|
||||||
name = obj["Name"].toString();
|
a.append(b[i]);
|
||||||
}
|
}
|
||||||
if (name.isEmpty()) {
|
for (int i = 0; i < a.size(); i++) {
|
||||||
continue;
|
QJsonObject obj = a[i].toObject();
|
||||||
}
|
Cluster cluster = createClusterObject(obj);
|
||||||
Cluster cluster(name);
|
clusters << cluster;
|
||||||
if (obj.contains("Status")) {
|
|
||||||
QString status = obj["Status"].toString();
|
|
||||||
cluster.setStatus(status);
|
|
||||||
}
|
|
||||||
if (!obj.contains("Config")) {
|
|
||||||
clusters << cluster;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
QJsonObject config = obj["Config"].toObject();
|
|
||||||
if (config.contains("CPUs")) {
|
|
||||||
int cpus = config["CPUs"].toInt();
|
|
||||||
cluster.setCpus(cpus);
|
|
||||||
}
|
|
||||||
if (config.contains("Memory")) {
|
|
||||||
int memory = config["Memory"].toInt();
|
|
||||||
cluster.setMemory(memory);
|
|
||||||
}
|
|
||||||
if (config.contains("Driver")) {
|
|
||||||
QString driver = config["Driver"].toString();
|
|
||||||
cluster.setDriver(driver);
|
|
||||||
}
|
|
||||||
if (!config.contains("KubernetesConfig")) {
|
|
||||||
clusters << cluster;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
QJsonObject k8sConfig = config["KubernetesConfig"].toObject();
|
|
||||||
if (k8sConfig.contains("ContainerRuntime")) {
|
|
||||||
QString containerRuntime = k8sConfig["ContainerRuntime"].toString();
|
|
||||||
cluster.setContainerRuntime(containerRuntime);
|
|
||||||
}
|
|
||||||
clusters << cluster;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return clusters;
|
return clusters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Cluster Window::createClusterObject(QJsonObject obj)
|
||||||
|
{
|
||||||
|
QString name;
|
||||||
|
if (obj.contains("Name")) {
|
||||||
|
name = obj["Name"].toString();
|
||||||
|
}
|
||||||
|
Cluster cluster(name);
|
||||||
|
if (obj.contains("Status")) {
|
||||||
|
QString status = obj["Status"].toString();
|
||||||
|
cluster.setStatus(status);
|
||||||
|
}
|
||||||
|
if (!obj.contains("Config")) {
|
||||||
|
return cluster;
|
||||||
|
}
|
||||||
|
QJsonObject config = obj["Config"].toObject();
|
||||||
|
if (config.contains("CPUs")) {
|
||||||
|
int cpus = config["CPUs"].toInt();
|
||||||
|
cluster.setCpus(cpus);
|
||||||
|
}
|
||||||
|
if (config.contains("Memory")) {
|
||||||
|
int memory = config["Memory"].toInt();
|
||||||
|
cluster.setMemory(memory);
|
||||||
|
}
|
||||||
|
if (config.contains("Driver")) {
|
||||||
|
QString driver = config["Driver"].toString();
|
||||||
|
cluster.setDriver(driver);
|
||||||
|
}
|
||||||
|
if (!config.contains("KubernetesConfig")) {
|
||||||
|
return cluster;
|
||||||
|
}
|
||||||
|
QJsonObject k8sConfig = config["KubernetesConfig"].toObject();
|
||||||
|
if (k8sConfig.contains("ContainerRuntime")) {
|
||||||
|
QString containerRuntime = k8sConfig["ContainerRuntime"].toString();
|
||||||
|
cluster.setContainerRuntime(containerRuntime);
|
||||||
|
}
|
||||||
|
return cluster;
|
||||||
|
}
|
||||||
|
|
||||||
QString Window::selectedCluster()
|
QString Window::selectedCluster()
|
||||||
{
|
{
|
||||||
|
if (isBasicView) {
|
||||||
|
return "minikube";
|
||||||
|
}
|
||||||
QModelIndex index = clusterListView->currentIndex();
|
QModelIndex index = clusterListView->currentIndex();
|
||||||
QVariant variant = index.data(Qt::DisplayRole);
|
QVariant variant = index.data(Qt::DisplayRole);
|
||||||
if (variant.isNull()) {
|
if (variant.isNull()) {
|
||||||
|
|
@ -356,12 +414,13 @@ void Window::createClusterGroupBox()
|
||||||
createButton = new QPushButton(tr("Create"));
|
createButton = new QPushButton(tr("Create"));
|
||||||
sshButton = new QPushButton(tr("SSH"));
|
sshButton = new QPushButton(tr("SSH"));
|
||||||
dashboardButton = new QPushButton(tr("Dashboard"));
|
dashboardButton = new QPushButton(tr("Dashboard"));
|
||||||
|
QPushButton *basicViewButton = new QPushButton(tr("Basic View"));
|
||||||
updateButtons();
|
connect(basicViewButton, &QAbstractButton::clicked, this, &Window::toBasicView);
|
||||||
|
|
||||||
QHBoxLayout *topButtonLayout = new QHBoxLayout;
|
QHBoxLayout *topButtonLayout = new QHBoxLayout;
|
||||||
topButtonLayout->addWidget(createButton);
|
topButtonLayout->addWidget(createButton);
|
||||||
topButtonLayout->addWidget(refreshButton);
|
topButtonLayout->addWidget(refreshButton);
|
||||||
|
topButtonLayout->addWidget(basicViewButton);
|
||||||
topButtonLayout->addSpacing(340);
|
topButtonLayout->addSpacing(340);
|
||||||
|
|
||||||
QHBoxLayout *bottomButtonLayout = new QHBoxLayout;
|
QHBoxLayout *bottomButtonLayout = new QHBoxLayout;
|
||||||
|
|
@ -379,6 +438,40 @@ void Window::createClusterGroupBox()
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::updateButtons()
|
void Window::updateButtons()
|
||||||
|
{
|
||||||
|
if (isBasicView) {
|
||||||
|
updateBasicButtons();
|
||||||
|
} else {
|
||||||
|
updateAdvancedButtons();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::updateBasicButtons()
|
||||||
|
{
|
||||||
|
Cluster *cluster = new Cluster();
|
||||||
|
ClusterList list = getClusters();
|
||||||
|
for (int i = 0; i < list.length(); i++) {
|
||||||
|
Cluster curr = list[i];
|
||||||
|
if (curr.name() != "minikube") {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
cluster = &curr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
bool exists = cluster->name() == "minikube";
|
||||||
|
bool isRunning = exists && cluster->status() == "Running";
|
||||||
|
basicStartButton->setEnabled(isRunning == false);
|
||||||
|
basicStopButton->setEnabled(isRunning == true);
|
||||||
|
basicDeleteButton->setEnabled(exists == true);
|
||||||
|
basicDashboardButton->setEnabled(isRunning == true);
|
||||||
|
#if __linux__
|
||||||
|
basicSSHButton->setEnabled(isRunning == true);
|
||||||
|
#else
|
||||||
|
basicSSHButton->setEnabled(false);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::updateAdvancedButtons()
|
||||||
{
|
{
|
||||||
QString cluster = selectedCluster();
|
QString cluster = selectedCluster();
|
||||||
if (cluster.isEmpty()) {
|
if (cluster.isEmpty()) {
|
||||||
|
|
@ -441,6 +534,7 @@ bool Window::sendMinikubeCommand(QStringList cmds, QString &text)
|
||||||
text = process->readAllStandardOutput();
|
text = process->readAllStandardOutput();
|
||||||
if (success) {
|
if (success) {
|
||||||
} else {
|
} else {
|
||||||
|
qDebug() << text;
|
||||||
qDebug() << process->readAllStandardError();
|
qDebug() << process->readAllStandardError();
|
||||||
}
|
}
|
||||||
delete process;
|
delete process;
|
||||||
|
|
@ -631,7 +725,7 @@ void Window::sshConsole()
|
||||||
console->setTerminalFont(font);
|
console->setTerminalFont(font);
|
||||||
console->setColorScheme("Tango");
|
console->setColorScheme("Tango");
|
||||||
console->setShellProgram(program);
|
console->setShellProgram(program);
|
||||||
QStringList args = { "ssh" };
|
QStringList args = { "ssh", "-p", selectedCluster() };
|
||||||
console->setArgs(args);
|
console->setArgs(args);
|
||||||
console->startShellProgram();
|
console->startShellProgram();
|
||||||
|
|
||||||
|
|
|
||||||
107
gui/window.h
107
gui/window.h
|
|
@ -56,6 +56,7 @@
|
||||||
|
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
#include <QFormLayout>
|
#include <QFormLayout>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
|
||||||
#ifndef QT_NO_SYSTEMTRAYICON
|
#ifndef QT_NO_SYSTEMTRAYICON
|
||||||
|
|
||||||
|
|
@ -79,7 +80,6 @@ QT_END_NAMESPACE
|
||||||
|
|
||||||
#include "cluster.h"
|
#include "cluster.h"
|
||||||
|
|
||||||
//! [0]
|
|
||||||
class Window : public QDialog
|
class Window : public QDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
@ -98,53 +98,84 @@ private slots:
|
||||||
void dashboardClose();
|
void dashboardClose();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createActionGroupBox();
|
// Tray icon
|
||||||
void createActions();
|
|
||||||
void createTrayIcon();
|
void createTrayIcon();
|
||||||
void startMinikube(QStringList args);
|
void createActions();
|
||||||
void startSelectedMinikube();
|
QAction *minimizeAction;
|
||||||
void stopMinikube();
|
QAction *restoreAction;
|
||||||
void deleteMinikube();
|
QAction *quitAction;
|
||||||
ClusterList getClusters();
|
QSystemTrayIcon *trayIcon;
|
||||||
QString selectedCluster();
|
QMenu *trayIconMenu;
|
||||||
void setSelectedCluster(QString cluster);
|
QIcon *trayIconIcon;
|
||||||
QTableView *clusterListView;
|
|
||||||
void createClusterGroupBox();
|
|
||||||
QGroupBox *clusterGroupBox;
|
|
||||||
ClusterModel *clusterModel;
|
|
||||||
ClusterHash getClusterHash();
|
|
||||||
bool sendMinikubeCommand(QStringList cmds);
|
|
||||||
bool sendMinikubeCommand(QStringList cmds, QString &text);
|
|
||||||
void updateClusters();
|
|
||||||
void askCustom();
|
|
||||||
void askName();
|
|
||||||
QComboBox *driverComboBox;
|
|
||||||
QComboBox *containerRuntimeComboBox;
|
|
||||||
void initMachine();
|
|
||||||
void sshConsole();
|
|
||||||
void dashboardBrowser();
|
|
||||||
void checkForMinikube();
|
|
||||||
void outputFailedStart(QString text);
|
|
||||||
QLabel *createLabel(QString title, QString text, QFormLayout *form, bool isLink);
|
|
||||||
QPushButton *sshButton;
|
|
||||||
QPushButton *dashboardButton;
|
|
||||||
QProcess *dashboardProcess;
|
|
||||||
|
|
||||||
|
// Basic view
|
||||||
|
void createBasicView();
|
||||||
|
void toBasicView();
|
||||||
|
void updateBasicButtons();
|
||||||
|
void basicStartMinikube();
|
||||||
|
void basicStopMinikube();
|
||||||
|
void basicDeleteMinikube();
|
||||||
|
void basicRefreshMinikube();
|
||||||
|
void basicSSHMinikube();
|
||||||
|
void basicDashboardMinikube();
|
||||||
|
QPushButton *basicStartButton;
|
||||||
|
QPushButton *basicStopButton;
|
||||||
|
QPushButton *basicDeleteButton;
|
||||||
|
QPushButton *basicRefreshButton;
|
||||||
|
QPushButton *basicSSHButton;
|
||||||
|
QPushButton *basicDashboardButton;
|
||||||
|
|
||||||
|
// Advanced view
|
||||||
|
void createAdvancedView();
|
||||||
|
void toAdvancedView();
|
||||||
|
void createClusterGroupBox();
|
||||||
|
void updateAdvancedButtons();
|
||||||
QPushButton *startButton;
|
QPushButton *startButton;
|
||||||
QPushButton *stopButton;
|
QPushButton *stopButton;
|
||||||
QPushButton *deleteButton;
|
QPushButton *deleteButton;
|
||||||
QPushButton *refreshButton;
|
QPushButton *refreshButton;
|
||||||
QPushButton *createButton;
|
QPushButton *createButton;
|
||||||
|
QPushButton *sshButton;
|
||||||
|
QPushButton *dashboardButton;
|
||||||
|
QGroupBox *clusterGroupBox;
|
||||||
|
|
||||||
QAction *minimizeAction;
|
// Cluster table
|
||||||
QAction *restoreAction;
|
QString selectedCluster();
|
||||||
QAction *quitAction;
|
void setSelectedCluster(QString cluster);
|
||||||
|
ClusterHash getClusterHash();
|
||||||
|
ClusterList getClusters();
|
||||||
|
void updateClusters();
|
||||||
|
ClusterModel *clusterModel;
|
||||||
|
QTableView *clusterListView;
|
||||||
|
|
||||||
QSystemTrayIcon *trayIcon;
|
|
||||||
QMenu *trayIconMenu;
|
// Create cluster
|
||||||
QIcon *trayIconIcon;
|
void askCustom();
|
||||||
|
void askName();
|
||||||
|
QComboBox *driverComboBox;
|
||||||
|
QComboBox *containerRuntimeComboBox;
|
||||||
|
|
||||||
|
// Commands
|
||||||
|
void startMinikube(QStringList args);
|
||||||
|
void startSelectedMinikube();
|
||||||
|
void stopMinikube();
|
||||||
|
void deleteMinikube();
|
||||||
|
bool sendMinikubeCommand(QStringList cmds);
|
||||||
|
bool sendMinikubeCommand(QStringList cmds, QString &text);
|
||||||
|
void initMachine();
|
||||||
|
void sshConsole();
|
||||||
|
void dashboardBrowser();
|
||||||
|
Cluster createClusterObject(QJsonObject obj);
|
||||||
|
QProcess *dashboardProcess;
|
||||||
|
|
||||||
|
// Error messaging
|
||||||
|
void outputFailedStart(QString text);
|
||||||
|
QLabel *createLabel(QString title, QString text, QFormLayout *form, bool isLink);
|
||||||
|
|
||||||
|
void checkForMinikube();
|
||||||
|
QStackedWidget *stackedWidget;
|
||||||
|
bool isBasicView;
|
||||||
};
|
};
|
||||||
//! [0]
|
|
||||||
|
|
||||||
#endif // QT_NO_SYSTEMTRAYICON
|
#endif // QT_NO_SYSTEMTRAYICON
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue