在哪里为Meteor应用程序放置单独的管理界面? [英] Where to put a separate admin interface for a Meteor app?

查看:104
本文介绍了在哪里为Meteor应用程序放置单独的管理界面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Meteor应用程序构建一个智能包,该应用程序基于智能包的功能提供一些监视功能和其他工具.有关更多详细信息,请阅读此问题.

I'm trying to build a smart package for Meteor app that provides some monitoring capabilities and other tools based on the features of the smart package. For more details read this question.

无论如何,我正在尝试找出为该程序包创建管理界面的最佳方法,该程序本身将在Meteor中运行.理想情况下,我希望与天文台类似,但该软件包可以控制网站的其他部分(甚至在其他端口上.)

In any case, I'm trying to figure out the best way to create an admin interface for this package, which will of course be itself running in Meteor. Ideally, I'd like something similar to observatory, except on a separate part of the site that the package can control (or even on a different port.)

天文台人员解决此问题的方式非常巧妙-他们在主应用程序页面上只有一个弹出div,可提供必要的信息.我认为这很好,但不是在应用程序上显示界面的最佳方法.使用路由的问题在于,流行的流星路由器每个人都使用,并且已开发出更好的Meteor路由器(例如Chris Mather在 Devshop 5 )中尚未发布.

The way the observatory folks have tackled this problem is pretty ingenious - they just have a popup div on the main app page that provides the necessary information. That's fine, but not the optimal way for revealing the interface on an app, in my opinion. The problem with using routes is that the popular Meteor router that everyone uses doesn't support more than one "stack" of pages, and better Meteor routers that have been developed (such as by Chris Mather in Devshop 5) haven't been released yet.

有人可以提出解决这个问题的好方法吗?理想情况下,我的程序包只能够在站点的单独部分(例如/admin)上呈现其自己的管理模板.

Can anyone suggest a good approach to tackle this problem? Ideally my package would just be able to render its own admin templates on a separate part of the site such as /admin.

推荐答案

正如James Hatfield所指出的,Iron-Router现在支持多种布局.对于那些现在遇到这个问题的人,这是处理多重布局方案的最佳方法.

As James Hatfield pointed out, Iron-Router now supports multiple layouts. For those hitting this thread now, this is the best way to handle the multiple layout scenario.

Router.map ->
  @route 'home',
    layoutTemplate: 'homeLayout'
    path: '/'

  @route 'dashboard',
    layoutTemplate: 'dashboardLayout'

这篇关于在哪里为Meteor应用程序放置单独的管理界面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆