404 handled in app; fix later

This commit is contained in:
2021-09-29 13:30:07 +02:00
parent 8bfdb3af23
commit 96eadd3ffb
3 changed files with 25 additions and 24 deletions
+2 -18
View File
@@ -21,14 +21,14 @@ namespace zero.Core.Routing
if (route == null)
{
return HandleFail(httpContext, values);
return null;
}
RouteProviderEndpoint endpoint = Routes.MapEndpoint(route);
if (endpoint == null)
{
return HandleFail(httpContext, values);
return null;
}
values["zero.route"] = route;
@@ -36,21 +36,5 @@ namespace zero.Core.Routing
values["action"] = endpoint.Action;
return values;
}
RouteValueDictionary HandleFail(HttpContext httpContext, RouteValueDictionary values)
{
NotFoundRoute notFound = Routes.NotFound(httpContext);
if (notFound != null)
{
httpContext.Response.StatusCode = 404;
values["zero.route"] = notFound;
values["controller"] = notFound.Controller;
values["action"] = notFound.Action;
return values;
}
return null;
}
}
}
+17 -6
View File
@@ -2,12 +2,23 @@
<div v-if="visible" class="editor-infos">
<div class="ui-box is-light editor-infos-aside">
<slot name="before"></slot>
<ui-property v-if="value.id && value.lastModifiedDate" field="lastModifiedDate" label="@ui.modifiedDate">
<ui-date v-model="value.lastModifiedDate" />
</ui-property>
<ui-property v-if="value.id" label="@ui.createdDate" field="createdDate">
<ui-date v-model="value.createdDate" />
</ui-property>
<template v-if="value && value.id">
<ui-property v-if="value.lastModifiedDate" field="lastModifiedDate" label="@ui.modifiedDate">
<ui-date v-model="value.lastModifiedDate" />
</ui-property>
<ui-property label="@ui.createdDate" field="createdDate">
<ui-date v-model="value.createdDate" />
</ui-property>
<ui-property label="@ui.entityfields.alias" field="alias">
{{value.alias}}
</ui-property>
<ui-property label="@ui.entityfields.sort" field="sort">
{{value.sort}}
</ui-property>
<ui-property v-if="value.key" label="@ui.entityfields.key" field="key">
{{value.key}}
</ui-property>
</template>
<slot name="after"></slot>
</div>
</div>
@@ -109,6 +109,12 @@
"parsedinput": {
"placeholder": "Enter a value",
"placeholder_output": "ID"
},
"entityfields": {
"key": "Key",
"alias": "Alias",
"sort": "Sort",
"hash": "Hash"
}
},