#include "WidgetPage.h"

#include "pages/WidgetPageHome.h"
#include "pages/WidgetPageOverview.h"
#include "pages/WidgetPageRunning.h"
#include "pages/WidgetPageWeb.h"

std::shared_ptr<WidgetPage> WidgetPage::create(QWidget* parent, std::string name)
{
    std::shared_ptr<WidgetPage> w = nullptr;
    if (name == "系统总览")
    {
        w = std::make_shared<WidgetPageOverview>(parent);
    }
    else if (name == "运行监控")
    {
        w = std::make_shared<WidgetPageRunning>(parent);
    }
    else
    {
        w = std::make_shared<WidgetPageWeb>(parent, name);
    }

    return w;
}