Giter Site home page Giter Site logo

Extendable bundle? about openplatform HOT 5 OPEN

totaljs avatar totaljs commented on June 14, 2024
Extendable bundle?

from openplatform.

Comments (5)

petersirka avatar petersirka commented on June 14, 2024

Hi @Invincible83,
we have added a small support for extending setup interface.

Quick summary:

  • create a new plugin (your own)
  • add a type exports.type = 'setup';
  • and then you should see your plugin in the setup UI

from openplatform.

Invincible83 avatar Invincible83 commented on June 14, 2024

Hello,

Nice. This is extactly what I mean. Is there something else I should do? I'm trying it and this is where I get, as far. (I used the profiles plugin from openplatform-application for testing)

This is the openplatform directory structure

bundles/openplatform.bundle
plugins/profiles/index.js
plugins/profiles/public/index.html
plugins/profiles/...

index.js

exports.icon = 'ti ti-totaljs';
exports.name = '@(Profiles)';
exports.position = 2;
exports.permissions = [{ id: 'profiles', name: 'Profiles' }];
exports.visible = user => user.sa || user.permissions.includes('profiles');
exports.type = 'setup'; // extends the `setup` plugin
exports.routes = [
	{ url: '/profiles/{id}/', html: 'detail' }
];

exports.install = function() {
	ROUTE('+API    /api/    -profiles    *Profiles   --> list');
};

It kind of works. I have profiles link in setup menu. Yet, when I click on it, I get this errors in the console

mytesting.com/_profiles/pages/setup.html?language=en 404 (Not Found)
jC: invalid response for IMPORT("/_profiles/pages/setup.html")  [{…}]

Sorry to bother you,
Thank you

from openplatform.

petersirka avatar petersirka commented on June 14, 2024

I tested it. I don't know about it, but you must move the file /public/index.html to /public/pages/index.html and it will work. Be careful with API endpoints, they must be in the form /setup/.

from openplatform.

Invincible83 avatar Invincible83 commented on June 14, 2024

Can you please upload your testing version?

As far I see, there https://github.com/totaljs/openplatform/blob/master/plugins/setup/index.js#L55-L63 is no obj.routes even in setup/index.html it's counting on it. https://github.com/totaljs/openplatform/blob/master/plugins/setup/index.html#L80C1-L86

And there is static setup.html. I believe this should be index.html. https://github.com/totaljs/openplatform/blob/master/plugins/setup/index.html#L79

from openplatform.

Invincible83 avatar Invincible83 commented on June 14, 2024

Sure, so I had some time to spare and did some tests. I found that my suspicions were correct. It's the /setup.html in the component. The second I changed it to /index.html , it started working.

https://github.com/totaljs/openplatform/blob/master/plugins/setup/index.html#L79C95-L79C112

from openplatform.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.