This commit is contained in:
2022-01-16 21:38:47 +01:00
parent 2496ffba16
commit 9e86edcbdd
4 changed files with 39 additions and 12 deletions
@@ -6,7 +6,7 @@ export default {
install(app: ZeroPluginOptions)
{
app.route({ name: 'settings', path: '/settings', component: () => import('./settings.vue') });
app.route({ name: 'demo', path: '/settings/demo', component: () => import('./demo.vue') });
//app.route({ name: 'demo', path: '/settings/demo', component: () => import('./demo.vue') });
app.schema('demo', () => import('./demo'));
}
@@ -45,17 +45,17 @@
this.groups = useUiStore().settingGroups;
this.appCount = useAppStore().applications.length;
if (!this.groups[1].items.find(x => x.alias === 'demo'))
{
this.groups[1].items.push({
alias: "demo",
description: "Demo all editor components",
icon: "fth-box",
isPlugin: true,
name: "Components",
url: "/settings/demo"
});
}
//if (!this.groups[1].items.find(x => x.alias === 'demo'))
//{
// this.groups[1].items.push({
// alias: "demo",
// description: "Demo all editor components",
// icon: "fth-box",
// isPlugin: true,
// name: "Components",
// url: "/settings/demo"
// });
//}
}
}
</script>
@@ -94,6 +94,11 @@
var config = { system: this.$route.query['zero.scope'] == 'system' };
const response = !this.isCreate ? await api.update(this.model, config) : await api.create(this.model, config);
await form.handle(response);
if (response.success)
{
this.model = response.data;
}
},
+22
View File
@@ -134,6 +134,23 @@ public class ZeroContext : IZeroContext
/// <inheritdoc />
public void Remove<T>() => ValueCollection.Remove<T>();
/// <inheritdoc />
public void SetScope(Application app)
{
// TODO this is only used for console app as we do not have an HttpRequest there
// needs to be deleted and definitely replaced
_resolved = true;
IsBackofficeRequest = false;
BackofficeUser = new ClaimsPrincipal();
IsLoggedIntoBackoffice = false;
Application = app;
AppId = app.Id;
Store.ResolvedDatabase = Application.Database;
Scope = new(Store, Store.ResolvedDatabase, Application);
}
/// <inheritdoc />
public ZeroContextScope CreateScope(Application app)
@@ -279,6 +296,11 @@ public interface IZeroContext
/// </summary>
void Remove<T>();
/// <summary>
/// Manually set a scope
/// </summary>
void SetScope(Application app);
/// <summary>
/// Scope the current context to a specific application database
/// </summary>