akveo / blur-admin

AngularJS Bootstrap Admin Panel Framework
http://akveo.github.io/blur-admin/
Other
11.37k stars 3.09k forks source link

How to use third party libraries inside blur-admin ? #132

Open chanakaDe opened 8 years ago

chanakaDe commented 8 years ago

Actually this is a question. Not an issue. Think I want to use another library in this project. In this case as example, I want to use https://github.com/evanplaice/jquery-csv/ and also https://notifyjs.com/. So I have to add javascript files and also some css files. So how can I do that ? Some libraries are not available via Bower and those kind of package management system too. We have to manually add them. Is that possible in your admin template ?

chanakaDe commented 8 years ago

And also how to implement login system ? Basically app loads the index.html. And we have to add a login file before that. How can I do that in this new application structure ? Please help me on this. Do you have a sample code implemented a login ?

vazh commented 8 years ago

@chanakaDe actually it's mostly possible if the libraries did not have issues with angular. you only need to inject it directly inside html files. right before/after gulp-inject part.

about login. try looking at the issues, some have made questions about them, and i've already answered it. i'll give you a link later.

chanakaDe commented 8 years ago

@vazh I figured out how to use third party libraries and also found issues on login page. And it's better if anyone can make a working login page and share the link. And also have another question. I'm from University of Westminster and I'm making an ERP like system using this as my third year project. So I want to authenticate all the routes. So users cannot access certain routes. So how can I do this ?

Imagine there are users. Admin is 1 , and normal users are 2. (access level) So no 2 users cannot access some routes. So how can I implement this ? It's really grateful if you can help me :+1:

vazh commented 8 years ago

made it so everytime a uses clicks a page url, it runs a service that checks if that user have access to those pages.

chanakaDe commented 8 years ago

@vazh Sorry for asking a lot from you. I got the idea you told me. But how to implement that kind of a service and where to use that ? Can you show me an example please. Because i'm working on login issue and this issue a lot. More than 2 weeks now and still no good :-1: If you can give a little help, it's so nice. Even a github gist is enough :+1:

vazh commented 8 years ago

@chanakaDe sorry for the long reply, put it inside run. something like this with ui-router

(function () {
  'use strict';

  angular
    .module('BlurAdmin')
    .run(runBlock);

  /** @ngInject */
  function runBlock(AuthService, SweetAlert, $rootScope, $state) {
    var stateChangeStart = $rootScope.$on('$stateChangeStart', function (event, toState) {
          AuthService.checkAuth(toState.name).then(function (response) {
            if (response) {
            // do something or not if true;
            } else {
            event.preventDefault();
            SweetAlert.swal("Denied", "You Don't Have Access to this Page", "error");
            $state.go('dashboard');
            }
          });
    });

  }
})();

kind of looks like that, and be advised i did not try this before, only put what is on my mind. ui-router login authentication @stackoverflow and look at this stackoverflow, i think its going to help you a lot

zhujinhu21 commented 7 years ago

@chanakaDe how did you use third party libraries inside blur-admin

dodomui commented 7 years ago

@zhujinhu21 I am beginner too. What I did is based on @vazh guide line + my understanding. I put tag to include the library i want. Hope this does help you.

If I am not doing the right way hope others can point out.

tuannh2 commented 6 years ago

Sorry, but Can you explain details for how to add third party libraries inside blur-admin? By example for "devextreme".

Thank you so much!

wuzhenda commented 6 years ago

I think just you just need to add the js lib in the index.html as some already exists