fixed issue of EnergyCategory in admin and updated README of admin

pull/82/MERGE
13621160019@163.com 2021-11-26 20:05:01 +08:00
parent 27f9bb8629
commit d937acd1bb
2 changed files with 23 additions and 6 deletions

18
admin/README.md vendored
View File

@ -14,6 +14,16 @@ nginx-1.18.0 or later
In this section, you will install myems-admin on Docker. In this section, you will install myems-admin on Docker.
* replace ~~127.0.0.1:8000~~ in nginx.conf with actual **HOST** ip and port of myems-api
```bash
cd myems/admin
nano nginx.conf
```
```bash
proxy_pass http://127.0.0.1:8000/;
```
* Build a Docker image * Build a Docker image
```bash ```bash
cd myems/admin cd myems/admin
@ -141,6 +151,8 @@ sudo nano /var/www/html/admin/app/api.js
## References ## References
1. https://myems.io [1]. https://myems.io
2. https://dev.mysql.com/doc/connector-python/en/
3. https://nginx.org/ [2]. https://dev.mysql.com/doc/connector-python/en/
[3]. https://nginx.org/

View File

@ -1,7 +1,13 @@
'use strict'; 'use strict';
app.controller('EnergyCategoryController', function($scope, $translate,$uibModal, CategoryService,toaster,SweetAlert) { app.controller('EnergyCategoryController', function($scope,
$window,
$translate,
$uibModal,
CategoryService,
toaster,
SweetAlert) {
$scope.cur_user = JSON.parse($window.localStorage.getItem("myems_admin_ui_current_user"));
$scope.getAllCategories = function() { $scope.getAllCategories = function() {
CategoryService.getAllCategories(function (response) { CategoryService.getAllCategories(function (response) {
if (angular.isDefined(response.status) && response.status === 200) { if (angular.isDefined(response.status) && response.status === 200) {
@ -10,7 +16,6 @@ app.controller('EnergyCategoryController', function($scope, $translate,$uibModal
$scope.categories = []; $scope.categories = [];
} }
}); });
}; };
$scope.addCategory = function() { $scope.addCategory = function() {