refs #6082 redirect
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-08-18 08:52:35 +02:00
parent c2d70fb367
commit 7c377fb5c5
3 changed files with 28 additions and 4 deletions

View File

@ -58,6 +58,14 @@
Home Home
</vn-item-section> </vn-item-section>
</a> </a>
<a class="vn-item" onclick="redirect(route)">
<vn-item-section avatar>
<vn-icon icon="move_up"></vn-icon>
</vn-item-section>
<vn-item-section translate>
Lilium
</vn-item-section>
</a>
<a class="vn-item" <a class="vn-item"
ng-repeat="mod in ::$ctrl.modules" ng-repeat="mod in ::$ctrl.modules"
ui-sref="{{::mod.route.state}}"> ui-sref="{{::mod.route.state}}">

View File

@ -31,6 +31,26 @@ export class Layout extends Component {
window.location.reload(); window.location.reload();
} }
async redirect(route) {
if (route.path === '/dashboard') {
const url = await getUrl('');
window.location.href = url;
return;
}
let section = route.path.substring(1);
section = section.substring(0, section.indexOf('/'));
if (route.params && route.params.id) {
const url = await getUrl(`${section}/${route.params.id}/summary`);
window.location.href = url;
return;
}
const url = await getUrl(section + '/index');
window.location.href = url;
}
$onDestroy() { $onDestroy() {
this.vnToken.stopRenewer(); this.vnToken.stopRenewer();
} }

View File

@ -7,8 +7,4 @@
class="menu" class="menu"
ng-class="{shown: $ctrl.shown}" ng-class="{shown: $ctrl.shown}"
ng-transclude> ng-transclude>
<button
icon="more_up"
onclick="redirect()" >
</button>
</div> </div>