diff --git a/Website/htdocs/mpmanager/packages/inensus/steama-meter/src/Services/SteamaSiteService.php b/Website/htdocs/mpmanager/packages/inensus/steama-meter/src/Services/SteamaSiteService.php index a18ef5143..aa219acdd 100644 --- a/Website/htdocs/mpmanager/packages/inensus/steama-meter/src/Services/SteamaSiteService.php +++ b/Website/htdocs/mpmanager/packages/inensus/steama-meter/src/Services/SteamaSiteService.php @@ -75,7 +75,7 @@ public function sync() 'mpm_mini_grid_id' => $miniGrid->id, 'hash' => $site['hash'], ]); - $this->updateGeographicalInformation($miniGrid->id, $site); + $this->createOrUpdateGeographicalInformation($miniGrid->id, $site); }); $syncCheck['data']->filter(function ($value) { @@ -83,7 +83,7 @@ public function sync() })->each(function ($site) { $miniGrid = is_null($site['relatedMiniGrid']) ? $this->creteRelatedMiniGrid($site) : $this->updateRelatedMiniGrid($site, $site['relatedMiniGrid']); - $this->updateGeographicalInformation($miniGrid->id, $site); + $this->createOrUpdateGeographicalInformation($miniGrid->id, $site); $site['registeredStmSite']->update([ 'site_id' => $site['id'], 'mpm_mini_grid_id' => $miniGrid->id, @@ -176,7 +176,7 @@ public function updateRelatedMiniGrid($site, $miniGrid) return $miniGrid->fresh(); } - public function updateGeographicalInformation($miniGridId, $site) + public function createOrUpdateGeographicalInformation($miniGridId, $site) { $geographicalInformation = $this->geographicalInformation->newQuery()->whereHasMorph( 'owner', @@ -187,9 +187,18 @@ static function ($q) use ($miniGridId) { )->first(); $points = $site['latitude'] === null ? config('steama.geoLocation') : $site['latitude'].','.$site['longitude']; - $geographicalInformation->update([ - 'points' => $points, - ]); + + if ($geographicalInformation) { + $geographicalInformation->update([ + 'points' => $points, + ]); + } else { + $this->geographicalInformation->create([ + 'owner_type' => 'mini-grid', + 'owner_id' => $miniGridId, + 'points' => $points, + ]); + } } public function checkLocationAvailability() diff --git a/Website/ui/src/ExportedRoutes.js b/Website/ui/src/ExportedRoutes.js index 0d1ac1ce0..de2b683c6 100644 --- a/Website/ui/src/ExportedRoutes.js +++ b/Website/ui/src/ExportedRoutes.js @@ -773,145 +773,28 @@ export const exportedRoutes = [ ], }, { - path: '/calin-meters', - component: ChildRouteWrapper, - meta: { - sidebar: { - enabled: true, - name: 'Calin Meter', - icon: 'bolt', - }, - }, - children: [ - { - path: 'calin-overview', - component: CalinMeterOverview, - meta: { - layout: 'default', - sidebar: { - enabled: true, - name: 'Overview', - }, - }, - }, - ], - }, - { - path: '/calin-smart-meters', - component: ChildRouteWrapper, - meta: { - sidebar: { - enabled: true, - name: 'CalinSmart Meter', - icon: 'bolt', - }, - }, - children: [ - { - path: 'calin-smart-overview', - component: CalinSmartMeterOverview, - meta: { - layout: 'default', - sidebar: { - enabled: true, - name: 'Overview', - }, - }, - }, - ], - }, - { - path: '/kelin-meters', - component: ChildRouteWrapper, + path: '/e-bikes', + component: EBikeList, meta: { + layout: 'default', sidebar: { enabled: true, - name: 'Kelin Meter', - icon: 'bolt', + name: 'E-Bikes', + icon: 'electric_bike', }, }, - children: [ - { - path: 'kelin-overview', - component: KelinMeterOverview, - meta: { - layout: 'default', - sidebar: { - enabled: true, - name: 'Overview', - }, - }, - }, - { - path: 'kelin-customer', - component: KelinMeterCustomerList, - meta: { - layout: 'default', - sidebar: { - enabled: true, - name: 'Customers', - }, - }, - }, - { - path: 'kelin-setting', - component: KelinMeterSettings, - meta: { - layout: 'default', - sidebar: { - enabled: true, - name: 'Settings', - }, - }, - }, - { - path: 'kelin-meter', - component: ChildRouteWrapper, - meta: { - sidebar: { - enabled: true, - name: 'Meters', - }, - }, - children: [ - { - path: '', - component: KelinMeterList, - meta: { - layout: 'default', - }, - }, - { - path: 'status/:meter', - component: KelinMeterStatus, - meta: { - layout: 'default', - }, - }, - { - path: 'daily-consumptions/:meter', - component: KelinMeterConsumptionDaily, - meta: { - layout: 'default', - }, - }, - { - path: 'minutely-consumptions/:meter', - component: KelinMeterConsumptionMinutely, - meta: { - layout: 'default', - }, - }, - ], - }, - ], }, + /** + * + * PLUGIN ROUTES + * + */ { path: '/spark-meters', component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 1, name: 'Spark Meter', icon: 'bolt', }, @@ -1016,7 +899,7 @@ export const exportedRoutes = [ component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 2, name: 'SteamaCo Meter', icon: 'bolt', }, @@ -1097,12 +980,146 @@ export const exportedRoutes = [ }, ], }, + { + path: '/calin-meters', + component: ChildRouteWrapper, + meta: { + sidebar: { + enabled_by_mpm_plugin_id: 3, + name: 'Calin Meter', + icon: 'bolt', + }, + }, + children: [ + { + path: 'calin-overview', + component: CalinMeterOverview, + meta: { + layout: 'default', + sidebar: { + enabled: true, + name: 'Overview', + }, + }, + }, + ], + }, + { + path: '/calin-smart-meters', + component: ChildRouteWrapper, + meta: { + sidebar: { + enabled_by_mpm_plugin_id: 4, + name: 'CalinSmart Meter', + icon: 'bolt', + }, + }, + children: [ + { + path: 'calin-smart-overview', + component: CalinSmartMeterOverview, + meta: { + layout: 'default', + sidebar: { + enabled: true, + name: 'Overview', + }, + }, + }, + ], + }, + { + path: '/kelin-meters', + component: ChildRouteWrapper, + meta: { + sidebar: { + enabled_by_mpm_plugin_id: 5, + name: 'Kelin Meter', + icon: 'bolt', + }, + }, + children: [ + { + path: 'kelin-overview', + component: KelinMeterOverview, + meta: { + layout: 'default', + sidebar: { + enabled: true, + name: 'Overview', + }, + }, + }, + { + path: 'kelin-customer', + component: KelinMeterCustomerList, + meta: { + layout: 'default', + sidebar: { + enabled: true, + name: 'Customers', + }, + }, + }, + { + path: 'kelin-setting', + component: KelinMeterSettings, + meta: { + layout: 'default', + sidebar: { + enabled: true, + name: 'Settings', + }, + }, + }, + { + path: 'kelin-meter', + component: ChildRouteWrapper, + meta: { + sidebar: { + enabled: true, + name: 'Meters', + }, + }, + children: [ + { + path: '', + component: KelinMeterList, + meta: { + layout: 'default', + }, + }, + { + path: 'status/:meter', + component: KelinMeterStatus, + meta: { + layout: 'default', + }, + }, + { + path: 'daily-consumptions/:meter', + component: KelinMeterConsumptionDaily, + meta: { + layout: 'default', + }, + }, + { + path: 'minutely-consumptions/:meter', + component: KelinMeterConsumptionMinutely, + meta: { + layout: 'default', + }, + }, + ], + }, + ], + }, { path: '/stron-meters', component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 6, name: 'Stron Meter', icon: 'bolt', }, @@ -1121,12 +1138,38 @@ export const exportedRoutes = [ }, ], }, + { + path: '/swifta-payment', + component: ChildRouteWrapper, + meta: { + sidebar: { + enabled_by_mpm_plugin_id: 7, + name: 'Swifta', + icon: 'money', + }, + }, + children: [ + { + path: 'swifta-payment-overview', + component: SwiftaOverview, + meta: { + layout: 'default', + sidebar: { + enabled: true, + name: 'Overview', + }, + }, + }, + ], + }, + // FIXME: Where is mpm_plugin_id = 8? + // Seems to be a plugin called "MesombPayment" { path: '/bulk-registration/bulk-registration', component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 9, name: 'Bulk Registration', icon: 'upload_file', }, @@ -1146,7 +1189,7 @@ export const exportedRoutes = [ component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 10, name: 'Viber Messaging', icon: 'message', }, @@ -1170,7 +1213,7 @@ export const exportedRoutes = [ component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 11, name: 'WaveMoney', icon: 'money', }, @@ -1212,7 +1255,7 @@ export const exportedRoutes = [ component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 12, name: 'MicroStar Meter', icon: 'bolt', }, @@ -1231,36 +1274,13 @@ export const exportedRoutes = [ }, ], }, - { - path: '/swifta-payment', - component: ChildRouteWrapper, - meta: { - sidebar: { - enabled: true, - name: 'Swifta', - icon: 'money', - }, - }, - children: [ - { - path: 'swifta-payment-overview', - component: SwiftaOverview, - meta: { - layout: 'default', - sidebar: { - enabled: true, - name: 'Overview', - }, - }, - }, - ], - }, + { path: '/sun-king-shs', component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 13, name: 'SunKing SHS', icon: 'bolt', }, @@ -1284,7 +1304,7 @@ export const exportedRoutes = [ component: ChildRouteWrapper, meta: { sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 14, name: 'GomeLong Meter', icon: 'bolt', }, @@ -1309,31 +1329,19 @@ export const exportedRoutes = [ meta: { layout: 'default', sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 15, name: 'Wavecom Payment Provider', icon: 'upload_file', }, }, }, - { - path: '/e-bikes', - component: EBikeList, - meta: { - layout: 'default', - sidebar: { - enabled: true, - name: 'E-Bikes', - icon: 'electric_bike', - }, - }, - }, { path: '/daly-bms', component: ChildRouteWrapper, meta: { layout: 'default', sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 16, name: 'Daly BMS', icon: 'charging_station', }, @@ -1358,7 +1366,7 @@ export const exportedRoutes = [ meta: { layout: 'default', sidebar: { - enabled: true, + enabled_by_mpm_plugin_id: 17, name: 'Angaza SHS', icon: 'bolt', }, diff --git a/Website/ui/src/modules/Agent/AgentTransactionDetail.vue b/Website/ui/src/modules/Agent/AgentTransactionDetail.vue index 6a44a6940..46cf5f6e0 100644 --- a/Website/ui/src/modules/Agent/AgentTransactionDetail.vue +++ b/Website/ui/src/modules/Agent/AgentTransactionDetail.vue @@ -54,7 +54,7 @@ diff --git a/Website/ui/src/plugins/kelin-meter/js/modules/Shared/Redirection.vue b/Website/ui/src/plugins/kelin-meter/js/modules/Shared/Redirection.vue deleted file mode 100644 index aec5f8850..000000000 --- a/Website/ui/src/plugins/kelin-meter/js/modules/Shared/Redirection.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - diff --git a/Website/ui/src/plugins/kelin-meter/js/modules/Shared/Widget.vue b/Website/ui/src/plugins/kelin-meter/js/modules/Shared/Widget.vue deleted file mode 100644 index 21336098e..000000000 --- a/Website/ui/src/plugins/kelin-meter/js/modules/Shared/Widget.vue +++ /dev/null @@ -1,479 +0,0 @@ - - - - - diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/CredentialRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/CredentialRepository.js index 1e6b5e79b..1e0c94b6f 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/CredentialRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/CredentialRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-credential` -import Client from '../../../../repositories/Client/AxiosClient' - export default { get() { return Client.get(`${resource}`) diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/CustomerRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/CustomerRepository.js index 03afd250c..c74ad84cd 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/CustomerRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/CustomerRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-customer` -import Client from '../../../../repositories/Client/AxiosClient' - export default { list() { return Client.get(`${resource}`) diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/DailyConsumptionRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/DailyConsumptionRepository.js index b5842e02b..fbc6a3128 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/DailyConsumptionRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/DailyConsumptionRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-meter/daily-consumptions` -import Client from '../../../../repositories/Client/AxiosClient' - export default { list() { return Client.get(`${resource}`) diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/MeterRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/MeterRepository.js index 6d7d24386..6aa80a99c 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/MeterRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/MeterRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-meter` -import Client from '../../../../repositories/Client/AxiosClient' - export default { list() { return Client.get(`${resource}`) diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/MinutelyConsumptionRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/MinutelyConsumptionRepository.js index cbb9dd36d..e58193ea1 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/MinutelyConsumptionRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/MinutelyConsumptionRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-meter/minutely-consumptions` -import Client from '../../../../repositories/Client/AxiosClient' - export default { list() { return Client.get(`${resource}`) diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/PaginatorRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/PaginatorRepository.js deleted file mode 100644 index de636b1c9..000000000 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/PaginatorRepository.js +++ /dev/null @@ -1,10 +0,0 @@ -import Client from '../../../../repositories/Client/AxiosClient' - -export default { - get(url, params) { - return Client.get(`${url}`, { params: params }) - }, - post(url, postData) { - return Client.post(`${url}`, postData) - }, -} diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/SettingRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/SettingRepository.js index 6edd7d7b1..ede081a70 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/SettingRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/SettingRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-setting` -import Client from '../../../../repositories/Client/AxiosClient' - export default { list() { return Client.get(`${resource}`) diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/StatusRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/StatusRepository.js index 2049f2424..09b4c70e3 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/StatusRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/StatusRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-meter/status` -import Client from '../../../../repositories/Client/AxiosClient' - export default { show(meterId) { return Client.get(`${resource}/${meterId}`) diff --git a/Website/ui/src/plugins/kelin-meter/js/repositories/SyncSettingRepository.js b/Website/ui/src/plugins/kelin-meter/js/repositories/SyncSettingRepository.js index 631ae5e41..b2708dafb 100644 --- a/Website/ui/src/plugins/kelin-meter/js/repositories/SyncSettingRepository.js +++ b/Website/ui/src/plugins/kelin-meter/js/repositories/SyncSettingRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/kelin-meters/kelin-setting/sync-setting` -import Client from '../../../../repositories/Client/AxiosClient' - export default { update(syncListPM) { return Client.put(`${resource}`, syncListPM) diff --git a/Website/ui/src/plugins/kelin-meter/js/routes.js b/Website/ui/src/plugins/kelin-meter/js/routes.js deleted file mode 100644 index 5fff7edd2..000000000 --- a/Website/ui/src/plugins/kelin-meter/js/routes.js +++ /dev/null @@ -1,48 +0,0 @@ -let routes = [ - { - path: '/kelin-meters/kelin-overview', - component: - require('./plugins/kelin-meter/js/components/Overview/Overview') - .default, - meta: { layout: 'default' }, - }, - { - path: '/kelin-meters/kelin-customer', - component: require('./plugins/kelin-meter/js/components/Customer/List') - .default, - meta: { layout: 'default' }, - }, - { - path: '/kelin-meters/kelin-meter', - component: require('./plugins/kelin-meter/js/components/Meter/List') - .default, - meta: { layout: 'default' }, - }, - { - path: '/kelin-meters/kelin-meter/status/:meter', - component: require('./plugins/kelin-meter/js/components/Meter/Status') - .default, - meta: { layout: 'default' }, - }, - { - path: '/kelin-meters/kelin-meter/daily-consumptions/:meter', - component: - require('./plugins/kelin-meter/js/components/Meter/Consumption/Daily') - .default, - meta: { layout: 'default' }, - }, - { - path: '/kelin-meters/kelin-meter/minutely-consumptions/:meter', - component: - require('./plugins/kelin-meter/js/components/Meter/Consumption/Minutely') - .default, - meta: { layout: 'default' }, - }, - { - path: '/kelin-meters/kelin-setting', - component: - require('./plugins/kelin-meter/js/components/Setting/Setting') - .default, - meta: { layout: 'default' }, - }, -] diff --git a/Website/ui/src/plugins/kelin-meter/js/services/CredentialService.js b/Website/ui/src/plugins/kelin-meter/js/services/CredentialService.js index fc22b4106..cbf8bdb22 100644 --- a/Website/ui/src/plugins/kelin-meter/js/services/CredentialService.js +++ b/Website/ui/src/plugins/kelin-meter/js/services/CredentialService.js @@ -1,4 +1,4 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' +import { ErrorHandler } from '@/Helpers/ErrorHander' import CredentialRepository from '../repositories/CredentialRepository' export class CredentialService { diff --git a/Website/ui/src/plugins/kelin-meter/js/services/CustomerService.js b/Website/ui/src/plugins/kelin-meter/js/services/CustomerService.js index 98098cb3d..874432b0e 100644 --- a/Website/ui/src/plugins/kelin-meter/js/services/CustomerService.js +++ b/Website/ui/src/plugins/kelin-meter/js/services/CustomerService.js @@ -1,5 +1,5 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' -import { EventBus } from '../eventbus' +import { ErrorHandler } from '@/Helpers/ErrorHander' +import { EventBus } from '@/shared/eventbus' import CustomerRepository from '../repositories/CustomerRepository' export class CustomerService { diff --git a/Website/ui/src/plugins/kelin-meter/js/services/MeterService.js b/Website/ui/src/plugins/kelin-meter/js/services/MeterService.js index 695a29ff3..bdfa315b5 100644 --- a/Website/ui/src/plugins/kelin-meter/js/services/MeterService.js +++ b/Website/ui/src/plugins/kelin-meter/js/services/MeterService.js @@ -1,4 +1,4 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' +import { ErrorHandler } from '@/Helpers/ErrorHander' import MeterRepository from '@/repositories/MeterRepository' export class MeterService { diff --git a/Website/ui/src/plugins/kelin-meter/js/services/PaginateService.js b/Website/ui/src/plugins/kelin-meter/js/services/PaginateService.js deleted file mode 100644 index 78a9f704b..000000000 --- a/Website/ui/src/plugins/kelin-meter/js/services/PaginateService.js +++ /dev/null @@ -1,61 +0,0 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' -import PaginatorRepository from '../repositories/PaginatorRepository' - -export class PaginateService { - constructor(url) { - this.repository = PaginatorRepository - this.paginator = { - url: url, - method: 'GET', - currentPage: 0, - totalPage: 0, - from: 0, - to: 0, - totalEntries: 0, - perPage: 15, - postData: null, - data: [], - } - } - - setPostData(data) { - this.paginator.postData = data - } - - nextPage() { - if (this.paginator.currentPage < this.paginator.totalPage) - this.paginator.currentPage++ - } - - prevPage() { - if (this.paginator.currentPage > 1) this.paginator.currentPage-- - } - - fromJson(data) { - this.paginator.from = data.meta.from - this.paginator.to = data.meta.to - this.paginator.totalPage = data.meta.last_page - this.paginator.currentPage = data.meta.current_page - this.paginator.totalEntries = data.meta.total - this.paginator.data = data.data - return this.paginator - } - - async loadPage(page, param = {}) { - param['page'] = page - param['per_page'] = this.paginator.perPage - try { - let response = await this.repository.get(this.paginator.url, param) - - if (response.status === 200) { - let data = response.data - return this.fromJson(data) - } else { - return new ErrorHandler(response.error, 'http', response.status) - } - } catch (e) { - let errorMessage = e.response.data.data.message - return new ErrorHandler(errorMessage, 'http') - } - } -} diff --git a/Website/ui/src/plugins/kelin-meter/js/services/SettingService.js b/Website/ui/src/plugins/kelin-meter/js/services/SettingService.js index 277c93ff2..2bb6c6adb 100644 --- a/Website/ui/src/plugins/kelin-meter/js/services/SettingService.js +++ b/Website/ui/src/plugins/kelin-meter/js/services/SettingService.js @@ -1,4 +1,4 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' +import { ErrorHandler } from '@/Helpers/ErrorHander' import { SyncSettingService } from './SyncSettingService' import SettingRepository from '../repositories/SettingRepository' diff --git a/Website/ui/src/plugins/kelin-meter/js/services/StatusService.js b/Website/ui/src/plugins/kelin-meter/js/services/StatusService.js index f40518cfa..e3e5eb595 100644 --- a/Website/ui/src/plugins/kelin-meter/js/services/StatusService.js +++ b/Website/ui/src/plugins/kelin-meter/js/services/StatusService.js @@ -1,4 +1,4 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' +import { ErrorHandler } from '@/Helpers/ErrorHander' import StatusRepository from '../repositories/StatusRepository' export class StatusService { diff --git a/Website/ui/src/plugins/kelin-meter/js/services/SyncSettingService.js b/Website/ui/src/plugins/kelin-meter/js/services/SyncSettingService.js index 013561363..c0e995cad 100644 --- a/Website/ui/src/plugins/kelin-meter/js/services/SyncSettingService.js +++ b/Website/ui/src/plugins/kelin-meter/js/services/SyncSettingService.js @@ -1,4 +1,4 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' +import { ErrorHandler } from '@/Helpers/ErrorHander' import SyncSettingRepository from '../repositories/SyncSettingRepository' export class SyncSettingService { diff --git a/Website/ui/src/plugins/micro-star-meter/js/Helpers/ErrorHander.js b/Website/ui/src/plugins/micro-star-meter/js/Helpers/ErrorHander.js deleted file mode 100644 index 253d91460..000000000 --- a/Website/ui/src/plugins/micro-star-meter/js/Helpers/ErrorHander.js +++ /dev/null @@ -1,14 +0,0 @@ -export class ErrorHandler { - constructor(_message, _type, _status_code) { - this.exception = { - message: _message, - type: _type, - status_code: _status_code, - } - this.throwException() - } - - throwException() { - throw this.exception - } -} diff --git a/Website/ui/src/plugins/micro-star-meter/js/eventbus.js b/Website/ui/src/plugins/micro-star-meter/js/eventbus.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/Website/ui/src/plugins/micro-star-meter/js/repositories/CertRepository.js b/Website/ui/src/plugins/micro-star-meter/js/repositories/CertRepository.js index 4198df92a..390027688 100644 --- a/Website/ui/src/plugins/micro-star-meter/js/repositories/CertRepository.js +++ b/Website/ui/src/plugins/micro-star-meter/js/repositories/CertRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/micro-star-meters/micro-star-cert` -import Client from '../../../../repositories/Client/AxiosClient' - export default { post(cert) { return Client.post(`${resource}`, cert) diff --git a/Website/ui/src/plugins/micro-star-meter/js/repositories/CredentialRepository.js b/Website/ui/src/plugins/micro-star-meter/js/repositories/CredentialRepository.js index 660cb063c..b20e8ed68 100644 --- a/Website/ui/src/plugins/micro-star-meter/js/repositories/CredentialRepository.js +++ b/Website/ui/src/plugins/micro-star-meter/js/repositories/CredentialRepository.js @@ -1,9 +1,8 @@ -import { baseUrl } from '../../../../repositories/Client/AxiosClient' +import { baseUrl } from '@/repositories/Client/AxiosClient' +import Client from '@/repositories/Client/AxiosClient' const resource = `${baseUrl}/api/micro-star-meters/micro-star-credential` -import Client from '../../../../repositories/Client/AxiosClient' - export default { get() { return Client.get(`${resource}`) diff --git a/Website/ui/src/plugins/micro-star-meter/js/routes.js b/Website/ui/src/plugins/micro-star-meter/js/routes.js deleted file mode 100644 index c3bba8e25..000000000 --- a/Website/ui/src/plugins/micro-star-meter/js/routes.js +++ /dev/null @@ -1,9 +0,0 @@ -let routes = [ - { - path: '/micro-star-meters/calin-overview', - component: - require('./plugins/micro-star/js/components/Overview/Overview') - .default, - meta: { layout: 'default' }, - }, -] diff --git a/Website/ui/src/plugins/micro-star-meter/js/services/CertService.js b/Website/ui/src/plugins/micro-star-meter/js/services/CertService.js index e1938d0a3..2947e6a6e 100644 --- a/Website/ui/src/plugins/micro-star-meter/js/services/CertService.js +++ b/Website/ui/src/plugins/micro-star-meter/js/services/CertService.js @@ -1,4 +1,4 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' +import { ErrorHandler } from '@/Helpers/ErrorHander' import CertRepository from '../repositories/CertRepository' export class CertService { diff --git a/Website/ui/src/plugins/micro-star-meter/js/services/CredentialService.js b/Website/ui/src/plugins/micro-star-meter/js/services/CredentialService.js index 0a3847c2d..4c5bc2abf 100644 --- a/Website/ui/src/plugins/micro-star-meter/js/services/CredentialService.js +++ b/Website/ui/src/plugins/micro-star-meter/js/services/CredentialService.js @@ -1,4 +1,4 @@ -import { ErrorHandler } from '../Helpers/ErrorHander' +import { ErrorHandler } from '@/Helpers/ErrorHander' import CredentialRepository from '../repositories/CredentialRepository' export class CredentialService { diff --git a/Website/ui/src/plugins/spark-meter/icons/authorized.png b/Website/ui/src/plugins/spark-meter/icons/authorized.png deleted file mode 100644 index 3183dfaa5..000000000 Binary files a/Website/ui/src/plugins/spark-meter/icons/authorized.png and /dev/null differ diff --git a/Website/ui/src/plugins/spark-meter/icons/unauthorized.png b/Website/ui/src/plugins/spark-meter/icons/unauthorized.png deleted file mode 100644 index 84eb15bfe..000000000 Binary files a/Website/ui/src/plugins/spark-meter/icons/unauthorized.png and /dev/null differ diff --git a/Website/ui/src/plugins/spark-meter/js/Helpers/ErrorHander.js b/Website/ui/src/plugins/spark-meter/js/Helpers/ErrorHander.js deleted file mode 100644 index 253d91460..000000000 --- a/Website/ui/src/plugins/spark-meter/js/Helpers/ErrorHander.js +++ /dev/null @@ -1,14 +0,0 @@ -export class ErrorHandler { - constructor(_message, _type, _status_code) { - this.exception = { - message: _message, - type: _type, - status_code: _status_code, - } - this.throwException() - } - - throwException() { - throw this.exception - } -} diff --git a/Website/ui/src/plugins/spark-meter/js/eventbus.js b/Website/ui/src/plugins/spark-meter/js/eventbus.js deleted file mode 100644 index 8fb4236e1..000000000 --- a/Website/ui/src/plugins/spark-meter/js/eventbus.js +++ /dev/null @@ -1,3 +0,0 @@ -import Vue from 'vue' - -export const EventBus = new Vue() diff --git a/Website/ui/src/plugins/spark-meter/js/modules/Customer/CustomerList.vue b/Website/ui/src/plugins/spark-meter/js/modules/Customer/CustomerList.vue index 02f0edb87..5f6137f43 100644 --- a/Website/ui/src/plugins/spark-meter/js/modules/Customer/CustomerList.vue +++ b/Website/ui/src/plugins/spark-meter/js/modules/Customer/CustomerList.vue @@ -95,19 +95,19 @@ - - - diff --git a/Website/ui/src/plugins/spark-meter/js/modules/Shared/Widget.vue b/Website/ui/src/plugins/spark-meter/js/modules/Shared/Widget.vue deleted file mode 100644 index 21336098e..000000000 --- a/Website/ui/src/plugins/spark-meter/js/modules/Shared/Widget.vue +++ /dev/null @@ -1,479 +0,0 @@ - - - - - diff --git a/Website/ui/src/plugins/spark-meter/js/modules/Site/SiteList.vue b/Website/ui/src/plugins/spark-meter/js/modules/Site/SiteList.vue index fc72e4017..9a07036c3 100644 --- a/Website/ui/src/plugins/spark-meter/js/modules/Site/SiteList.vue +++ b/Website/ui/src/plugins/spark-meter/js/modules/Site/SiteList.vue @@ -124,24 +124,24 @@ - - - diff --git a/Website/ui/src/plugins/steama-meter/js/modules/Shared/Redirection.vue b/Website/ui/src/plugins/steama-meter/js/modules/Shared/Redirection.vue deleted file mode 100644 index aec5f8850..000000000 --- a/Website/ui/src/plugins/steama-meter/js/modules/Shared/Redirection.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - diff --git a/Website/ui/src/plugins/steama-meter/js/modules/Site/SiteList.vue b/Website/ui/src/plugins/steama-meter/js/modules/Site/SiteList.vue index 90bc25454..690f4f900 100644 --- a/Website/ui/src/plugins/steama-meter/js/modules/Site/SiteList.vue +++ b/Website/ui/src/plugins/steama-meter/js/modules/Site/SiteList.vue @@ -40,24 +40,24 @@ -