mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-21 22:48:44 +00:00
QQQ-38 Initial build of app home page widgets
This commit is contained in:
@ -36,6 +36,7 @@ import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Supplier;
|
||||
import com.kingsrook.qqq.backend.core.actions.async.AsyncJobManager;
|
||||
import com.kingsrook.qqq.backend.core.actions.dashboard.WidgetDataLoader;
|
||||
import com.kingsrook.qqq.backend.core.actions.metadata.MetaDataAction;
|
||||
import com.kingsrook.qqq.backend.core.actions.metadata.ProcessMetaDataAction;
|
||||
import com.kingsrook.qqq.backend.core.actions.metadata.TableMetaDataAction;
|
||||
@ -278,6 +279,8 @@ public class QJavalinImplementation
|
||||
});
|
||||
});
|
||||
|
||||
get("/widget/{name}", QJavalinImplementation::widget);
|
||||
|
||||
////////////////////
|
||||
// process routes //
|
||||
////////////////////
|
||||
@ -662,6 +665,27 @@ public class QJavalinImplementation
|
||||
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Load the data for a widget of a given name.
|
||||
*******************************************************************************/
|
||||
private static void widget(Context context)
|
||||
{
|
||||
try
|
||||
{
|
||||
InsertInput insertInput = new InsertInput(qInstance);
|
||||
setupSession(context, insertInput);
|
||||
|
||||
Object widgetData = new WidgetDataLoader().execute(qInstance, insertInput.getSession(), context.pathParam("name"));
|
||||
context.result(JsonUtils.toJson(widgetData));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
handleException(context, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
Reference in New Issue
Block a user