├── .env ├── LICENSE.txt ├── README.md ├── docker-compose.yml ├── init-db.sql ├── mikrofront ├── Dockerfile ├── dist │ └── html │ │ ├── 118.752d2f2f0022849f.js │ │ ├── 130.15d81349c878944b.js │ │ ├── 182.550b6560498517dc.js │ │ ├── 184.92d77b34464ba5c1.js │ │ ├── 204.17b1994c1608037c.js │ │ ├── 325.f9ddbfb6c670511e.js │ │ ├── 381.071d8c2d068b86cb.js │ │ ├── 385.e6d21669bdca6045.js │ │ ├── 390.0263e82f7304a035.js │ │ ├── 391.94be3a07e48126fb.js │ │ ├── 3rdpartylicenses.txt │ │ ├── 435.50aa5b7f2908d6f4.js │ │ ├── 467.45b165e0dfec22c9.js │ │ ├── 573.6779ebc34aa91ab9.js │ │ ├── 578.f4499d6cb3ea793c.js │ │ ├── 631.bd7178888196a3c5.js │ │ ├── 633.7075e3558e175ba4.js │ │ ├── 650.f6cfc04317581a12.js │ │ ├── 703.3d45fd8c410598ea.js │ │ ├── 71.fe0ee86dd4c7f8c2.js │ │ ├── 80.afe9810ec5b397f8.js │ │ ├── 813.00e775001ef777e2.js │ │ ├── 84.6bde8408b4fba658.js │ │ ├── 858.5a69ea3e2ca72256.js │ │ ├── 981.f603d68fbb84d0cc.js │ │ ├── 983.18b3499f015bcd56.js │ │ ├── 987.96f768e3ee10d3ce.js │ │ ├── assets │ │ ├── angular.ico │ │ ├── favicon.ico │ │ ├── images │ │ │ └── angular.jpg │ │ ├── img │ │ │ ├── avatars │ │ │ │ ├── 1.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ ├── 4.jpg │ │ │ │ ├── 5.jpg │ │ │ │ ├── 6.jpg │ │ │ │ ├── 7.jpg │ │ │ │ ├── 8.jpg │ │ │ │ └── 9.jpg │ │ │ ├── brand │ │ │ │ ├── logo-MIkroWizard-big-color.svg │ │ │ │ ├── logo-MIkroWizard-big-white.svg │ │ │ │ ├── logo-MIkroWizard-small-color.svg │ │ │ │ ├── logo-MIkroWizard-small-white.svg │ │ │ │ ├── mikrowizard-full.jpg │ │ │ │ └── mikrowizard-full.png │ │ │ ├── chip.png │ │ │ ├── loading.svg │ │ │ └── tcpip.png │ │ └── res │ │ │ ├── atom-one-dark.css │ │ │ └── highlight.min.js │ │ ├── common.a4ef334c5064572b.js │ │ ├── fa-brands-400.5f7c5bb77eae788b.ttf │ │ ├── fa-brands-400.9210030c21e68a90.woff2 │ │ ├── fa-regular-400.02ad4ff91ef84f65.woff2 │ │ ├── fa-regular-400.570a165b064c1468.ttf │ │ ├── fa-solid-900.0b5caff7ad4bc179.ttf │ │ ├── fa-solid-900.3eae9857c06e9372.woff2 │ │ ├── index.html │ │ ├── main.02d9ac6df5703bb2.js │ │ ├── polyfills.41dcf967a271c007.js │ │ ├── runtime.9299dd698873f109.js │ │ ├── styles.8e9f5f54183385e4.css │ │ └── version.json ├── front-update.py ├── mwcrontab ├── nginx.conf └── reqs.txt ├── mikroman ├── Dockerfile ├── init.sh ├── initpy.py ├── reqs.txt ├── server-conf.json ├── server-conf.json.template └── testdb.py └── prepare.sh /.env: -------------------------------------------------------------------------------- 1 | MW_DB_NAME=mikrowizard_db 2 | MW_DB_USER=mikrowizard_user 3 | MW_DB_PASSWORD=securepassword 4 | MW_SERVER_IP=127.0.0.1 5 | MW_RAD_SECRET=your_rad_secret 6 | MW_encryptKey=bN0PJaVMpV7e4NGE8cLF3FECgY_nofYDuBtlLxX7pWg= 7 | CONF_PATH=/opt/mikrowizard/conf 8 | FIRMWARE_PATH=/opt/mikrowizard/firmware 9 | BACKUPS_PATH=/opt/mikrowizard/backups 10 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 MikroWizard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MikroWizard Deployment 2 | 3 | This repository provides a full Docker-based setup for deploying MikroWizard services, including **MikroMan** (backend) and **MikroFront** (frontend), along with the necessary database and Redis stack. 4 | 5 | --- 6 | 7 | ## Repository Structure 8 | 9 | ``` 10 | ├── mikrofront/ # MikroFront service files 11 | ├── mikroman/ # MikroMan service files 12 | ├── docker-compose.yml # Main Docker Compose file 13 | ├── init-db.sql # Database initialization script 14 | ├── prepare.sh # Script to prepare host machine 15 | ├── .env # Configuration file for environment variables 16 | ``` 17 | 18 | --- 19 | 20 | ## Prerequisites 21 | 22 | 1. **Docker**: Ensure Docker is installed on your machine. 23 | - Installation guide: [Docker Documentation](https://docs.docker.com/get-docker/) 24 | 2. **Docker Compose**: Ensure Docker Compose is installed. 25 | - Installation guide: [Docker Compose Documentation](https://docs.docker.com/compose/install/) 26 | 27 | --- 28 | 29 | ## Setup Instructions 30 | 31 | ### Step 1: Clone the Repository 32 | 33 | ```bash 34 | git clone https://github.com/MikroWizard/docker-compose-deployment.git mikrowizard 35 | cd mikrowizard 36 | ``` 37 | 38 | ### Step 2: Configure Environment Variables 39 | 40 | Edit the `.env` file to set the appropriate values for your environment: 41 | 42 | ```env 43 | DB_NAME=mikrowizard 44 | DB_USER=postgres 45 | DB_PASSWORD=your_password 46 | DB_HOST=host.docker.internal 47 | SERVER_IP=127.0.0.1 48 | RAD_SECRET=mysecret 49 | ``` 50 | 51 | Ensure you replace `your_password` and other placeholders with actual values. 52 | 53 | ### Step 3: Prepare Host Machine 54 | 55 | Run the `prepare.sh` script to create required directories and files: 56 | 57 | ```bash 58 | chmod +x prepare.sh 59 | ./prepare.sh 60 | ``` 61 | 62 | This script will: 63 | 64 | - Create the `conf`, `firmware`, and `backups` folders on the host machine. 65 | - Ensure proper permissions. 66 | - Create the needed configuration Files 67 | 68 | 69 | Download Latest release of frontend and extract its content to `mikrofront/dist` folder 70 | Find latest release from following url: 71 | https://github.com/MikroWizard/mikrofront/releases 72 | 73 | ```bash 74 | cd mikrofront/dist/ 75 | wget https://github.com/MikroWizard/mikrofront/releases/download/1.0.2-stable/mikrofront-1.0.2.tar.gz 76 | tar xvzf mikrofront*.tar.gz 77 | ``` 78 | - To verify the contents make sure there is a `html` folder inside `mikrofront/dist` folder with lots of html,js files 79 | 80 | ### Step 4: Start the Services 81 | 82 | Use Docker Compose to build and start the services: 83 | 84 | ```bash 85 | docker compose up --build 86 | ``` 87 | 88 | This command will: 89 | 90 | - Build the Docker images for MikroMan and MikroFront. 91 | - Start the PostgreSQL database, Redis stack, and MikroWizard services. 92 | 93 | ### Step 5: Access the Application 94 | 95 | - **Frontend**: Open [http://localhost](http://localhost) in your browser. 96 | - **Backend**: Accessible through configured API endpoints. 97 | 98 | --- 99 | 100 | ## Database Initialization 101 | 102 | 1. The database is initialized automatically using the `init-db.sql` script during container startup. 103 | 2. Ensure the database extensions and migrations are applied: 104 | - UUID extension is enabled. 105 | - `dbmigrate.py` script creates required tables. 106 | 107 | --- 108 | 109 | ## Customization 110 | 111 | ### Environment Variables 112 | 113 | All environment variables are centralized in the `.env` file. Update these values to customize your deployment. 114 | 115 | ### Volume Mapping 116 | 117 | Host directories `conf`, `firmware`, and `backups` are mapped to container paths: 118 | 119 | - `conf`: Configuration files. 120 | - `firmware`: Stores firmware files. 121 | - `backups`: Stores database and system backups. 122 | 123 | --- 124 | 125 | ## Troubleshooting 126 | 127 | ### Common Issues 128 | 129 | 1. **Database Connection Errors**: 130 | - Verify the `DB_HOST` in `.env` points to `host.docker.internal` or the appropriate host leave it 127.0.0.1 for default installation. 131 | 2. **Permission Denied**: 132 | - Ensure you have execution permissions for `prepare.sh`. 133 | 134 | ### Logs 135 | 136 | Check logs for debugging: 137 | 138 | ```bash 139 | docker-compose logs -f 140 | ``` 141 | 142 | --- 143 | 144 | ## Contributions 145 | 146 | Contributions are welcome! Submit issues or pull requests to improve the deployment process. 147 | 148 | --- 149 | 150 | ## License 151 | 152 | This repository is licensed under the MIT License. 153 | 154 | --- 155 | 156 | ## Contact 157 | 158 | For any inquiries, contact the MikroWizard team at [info@mikrowizard.com](mailto\:info@mikrowizard.com). 159 | 160 | 161 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | 2 | version: '3.9' 3 | 4 | services: 5 | postgres: 6 | image: postgres:latest 7 | container_name: postgres 8 | environment: 9 | POSTGRES_USER: ${MW_DB_USER} 10 | POSTGRES_PASSWORD: ${MW_DB_PASSWORD} 11 | POSTGRES_DB: ${MW_DB_NAME} 12 | PGUSER: ${MW_DB_USER} 13 | volumes: 14 | - db_data:/var/lib/postgresql/data 15 | - ./init-db.sql:/docker-entrypoint-initdb.d/init.sql 16 | ports: 17 | - "5432:5432" 18 | healthcheck: 19 | test: [ "CMD-SHELL", "pg_isready -q -U ${MW_DB_USER} -d ${MW_DB_NAME}" ] 20 | interval: 5s 21 | timeout: 5s 22 | retries: 50 23 | 24 | redis: 25 | image: redis/redis-stack-server:latest 26 | ports: 27 | - "6379:6379" 28 | 29 | mikroman: 30 | build: 31 | context: ./mikroman 32 | dockerfile: Dockerfile 33 | network_mode: "host" 34 | entrypoint: bash -c "cd /app && ./init.sh" 35 | environment: 36 | - MW_SERVER_IP=${MW_SERVER_IP} 37 | - MW_RAD_SECRET=${MW_RAD_SECRET} 38 | - MW_DB_PASSWORD=${MW_DB_PASSWORD} 39 | - MW_DB_USER=${MW_DB_USER} 40 | - MW_DB_NAME=${MW_DB_NAME} 41 | - MW_encryptKey=${MW_encryptKey} 42 | volumes: 43 | - ${CONF_PATH}:/conf 44 | - ${FIRMWARE_PATH}:/conf/firmware 45 | - ${BACKUPS_PATH}:/conf/backups 46 | extra_hosts: 47 | - "host.docker.internal:host-gateway" 48 | depends_on: 49 | postgres: 50 | condition: service_healthy 51 | env_file: .env 52 | 53 | 54 | 55 | mikrofront: 56 | build: 57 | context: ./mikrofront 58 | dockerfile: Dockerfile 59 | ports: 60 | - "80:80" 61 | volumes: 62 | - ./mikrofront/nginx.conf:/etc/nginx/conf.d/default.conf 63 | - ${CONF_PATH}:/conf 64 | depends_on: 65 | - mikroman 66 | extra_hosts: 67 | - "host.docker.internal:host-gateway" 68 | volumes: 69 | db_data: 70 | -------------------------------------------------------------------------------- /init-db.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; 3 | -------------------------------------------------------------------------------- /mikrofront/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM nginx:latest 3 | 4 | RUN apt-get update && apt-get -y install cron 5 | RUN touch /var/log/cron.log 6 | COPY reqs.txt /reqs.txt 7 | 8 | RUN set -ex \ 9 | && buildDeps=' \ 10 | build-essential \ 11 | gcc \ 12 | ' \ 13 | && deps=' \ 14 | htop \ 15 | ' \ 16 | && apt-get install -y python3 python3-dev pip $buildDeps $deps --no-install-recommends && pip install -r /reqs.txt --break-system-packages 17 | COPY front-update.py / 18 | COPY mwcrontab /etc/cron.d/mwcrontab 19 | RUN chmod 0644 /etc/cron.d/mwcrontab 20 | 21 | RUN crontab /etc/cron.d/mwcrontab 22 | 23 | COPY dist/html /usr/share/nginx/html 24 | COPY nginx.conf /etc/nginx/conf.d/default.conf 25 | 26 | EXPOSE 80 27 | CMD cron;nginx -g "daemon off;" 28 | -------------------------------------------------------------------------------- /mikrofront/dist/html/118.752d2f2f0022849f.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[118],{5118:(v,i,t)=>{t.r(i),t.d(i,{PagesModule:()=>f});var m=t(177),c=t(7062),r=t(3042),d=t(5050),g=t(2234),a=t(4438);const h=[{path:"404",component:r.X,data:{title:"Page 404"}},{path:"500",component:d.y,data:{title:"Page 500"}},{path:"login",component:g.X,data:{title:"Login Page"}}];let u=(()=>{class o{static#t=this.\u0275fac=function(s){return new(s||o)};static#o=this.\u0275mod=a.$C({type:o});static#a=this.\u0275inj=a.G2t({imports:[c.iI.forChild(h),c.iI]})}return o})();var n=t(8921),e=t(4662),l=t(9417);let f=(()=>{class o{static#t=this.\u0275fac=function(s){return new(s||o)};static#o=this.\u0275mod=a.$C({type:o});static#a=this.\u0275inj=a.G2t({imports:[m.MD,u,n.Dw2,n.tmq,n.pc9,e.op,n.tHK,l.YN,l.X1]})}return o})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/130.15d81349c878944b.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[130],{9130:(fe,y,h)=>{h.d(y,{qD:()=>ce});var S=h(967);function I(e,t,n){const r=function E(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}(e,n.timeZone,n.locale);return"formatToParts"in r?function $(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if("timeZoneName"===n[r].type)return n[r].value}(r,t):function P(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}(r,t)}const X={year:0,month:1,day:2,hour:3,minute:4,second:5},D={};function M(e,t,n,r,i,o,s){const u=new Date(0);return u.setUTCFullYear(e,t,n),u.setUTCHours(r,i,o,s),u}const Y=36e5,v=6e4,T={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function d(e,t,n){if(!e)return 0;let i,o,r=T.timezoneZ.exec(e);if(r)return 0;if(r=T.timezoneHH.exec(e),r)return i=parseInt(r[1],10),O(i)?-i*Y:NaN;if(r=T.timezoneHHMM.exec(e),r){i=parseInt(r[2],10);const s=parseInt(r[3],10);return O(i,s)?(o=Math.abs(i)*Y+s*v,"+"===r[1]?-o:o):NaN}if(function G(e){if(z[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),z[e]=!0,!0}catch{return!1}}(e)){t=new Date(t||Date.now());const s=n?t:function j(e){return M(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}(t),u=g(s,e);return-(n?u:function R(e,t,n){let i=e.getTime()-t;const o=g(new Date(i),n);if(t===o)return t;i-=o-t;const s=g(new Date(i),n);return o===s?o:Math.max(o,s)}(t,u,e))}return NaN}function g(e,t){const n=function L(e,t){const n=function W(e){if(!D[e]){const t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z"));D[e]="06/25/2014, 00:00:00"===t||"\u200e06\u200e/\u200e25\u200e/\u200e2014\u200e \u200e00\u200e:\u200e00\u200e:\u200e00"===t?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return D[e]}(t);return"formatToParts"in n?function k(e,t){try{const n=e.formatToParts(t),r=[];for(let i=0;i=0?o:1e3+o,r-i}function O(e,t){return-23<=e&&e<=23&&(null==t||0<=t&&t<=59)}const z={},B={X:function(e,t,n){const r=N(n.timeZone,e);if(0===r)return"Z";switch(t){case"X":return x(r);case"XXXX":case"XX":return l(r);default:return l(r,":")}},x:function(e,t,n){const r=N(n.timeZone,e);switch(t){case"x":return x(r);case"xxxx":case"xx":return l(r);default:return l(r,":")}},O:function(e,t,n){const r=N(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+function J(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+t+m(o,2)}(r,":");default:return"GMT"+l(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return I("short",e,n);default:return I("long",e,n)}}};function N(e,t){const n=e?d(e,t,!0)/6e4:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function m(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length0?"-":"+",r=Math.abs(e);return n+m(Math.floor(r/60),2)+t+m(Math.floor(r%60),2)}function x(e,t){return e%60==0?(e>0?"-":"+")+m(Math.abs(e)/60,2):l(e,t)}function C(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const w=36e5,U=6e4,V=2,a={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/};function _(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===e)return new Date(NaN);const n=null==t.additionalDigits?V:Number(t.additionalDigits);if(2!==n&&1!==n&&0!==n)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))return new Date(e.getTime());if("number"==typeof e||"[object Number]"===Object.prototype.toString.call(e))return new Date(e);if("[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);const r=function K(e){const t={};let r,n=a.dateTimePattern.exec(e);if(n?(t.date=n[1],r=n[3]):(n=a.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const i=a.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}(e),{year:i,restDateString:o}=function ee(e,t){if(e){const n=a.YYY[t],r=a.YYYYY[t];let i=a.YYYY.exec(e)||r.exec(e);if(i){const o=i[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(i=a.YY.exec(e)||n.exec(e),i){const o=i[1];return{year:100*parseInt(o,10),restDateString:e.slice(o.length)}}}return{year:null}}(r.date,n),s=function te(e,t){if(null===t)return null;let n,r,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=a.MM.exec(e);if(o)return n=new Date(0),r=parseInt(o[1],10)-1,b(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(o=a.DDD.exec(e),o){n=new Date(0);const s=parseInt(o[1],10);return function oe(e,t){if(t<1)return!1;const n=Z(e);return!(n&&t>366||!n&&t>365)}(t,s)?(n.setUTCFullYear(t,0,s),n):new Date(NaN)}if(o=a.MMDD.exec(e),o){n=new Date(0),r=parseInt(o[1],10)-1;const s=parseInt(o[2],10);return b(t,r,s)?(n.setUTCFullYear(t,r,s),n):new Date(NaN)}if(o=a.Www.exec(e),o)return i=parseInt(o[1],10)-1,F(i)?H(t,i):new Date(NaN);if(o=a.WwwD.exec(e),o){i=parseInt(o[1],10)-1;const s=parseInt(o[2],10)-1;return F(i,s)?H(t,i,s):new Date(NaN)}return null}(o,i);if(null===s||isNaN(s.getTime()))return new Date(NaN);if(s){const u=s.getTime();let f,c=0;if(r.time&&(c=function ne(e){let t,n,r=a.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),p(t)?t%24*w:NaN;if(r=a.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),p(t,n)?t%24*w+n*U:NaN;if(r=a.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const i=parseFloat(r[3].replace(",","."));return p(t,n,i)?t%24*w+n*U+1e3*i:NaN}return null}(r.time),null===c||isNaN(c)))return new Date(NaN);if(r.timeZone||t.timeZone){if(f=d(r.timeZone||t.timeZone,new Date(u+c)),isNaN(f))return new Date(NaN)}else f=C(new Date(u+c)),f=C(new Date(u+c+f));return new Date(u+c+f)}return new Date(NaN)}function H(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const o=7*t+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+o),r}const re=[31,28,31,30,31,30,31,31,30,31,30,31],ie=[31,29,31,30,31,30,31,31,30,31,30,31];function Z(e){return e%400==0||e%4==0&&e%100!=0}function b(e,t,n){if(t<0||t>11)return!1;if(null!=n){if(n<1)return!1;const r=Z(e);if(r&&n>ie[t]||!r&&n>re[t])return!1}return!0}function F(e,t){return!(e<0||e>52||null!=t&&(t<0||t>6))}function p(e,t,n){return!(e<0||e>=25||null!=t&&(t<0||t>=60)||null!=n&&(n<0||n>=60))}const se=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ce(e,t,n,r){return function ae(e,t,n={}){const r=(t=String(t)).match(se);if(r){const i=_(n.originalDate||e,n);t=r.reduce(function(o,s){if("'"===s[0])return o;const u=o.indexOf(s),c="'"===o[u-1],f=o.replace(s,"'"+B[s[0]](i,s,n)+"'");return c?f.substring(0,u-1)+f.substring(u+1):f},t)}return(0,S.GP)(e,t,n)}(function ue(e,t,n){const r=d(t,e=_(e,n),!0),i=new Date(e.getTime()-r),o=new Date(0);return o.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),o.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),o}(e,t,{timeZone:(r={...r,timeZone:t,originalDate:e}).timeZone}),n,r)}}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/182.550b6560498517dc.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[182],{5182:(W,j,m)=>{m.r(j),m.d(j,{AuthModule:()=>J});var C=m(177),d=m(8921),u=m(7062),g=m(7390),M=m(9130),e=m(4438),F=m(9492),x=m(1170),h=m(9417),f=m(6467),v=m(9631),_=m(5084),y=m(4869),T=m(6600);const k=()=>["Local","Mikrowizard"];function A(t,r){if(1&t&&(e.j41(0,"mat-option",31),e.EFF(1),e.k0s()),2&t){const i=r.$implicit;e.Y8G("value",i),e.R7$(),e.SpI(" ",i," ")}}function I(t,r){if(1&t&&(e.j41(0,"mat-option",31),e.EFF(1),e.k0s()),2&t){const i=r.$implicit;e.Y8G("value",i),e.R7$(),e.SpI(" ",i," ")}}function E(t,r){1&t&&e.EFF(0),2&t&&e.SpI(" ",r.item.index," ")}function R(t,r){1&t&&e.nrm(0,"i",34)}function N(t,r){1&t&&e.nrm(0,"i",35)}function D(t,r){if(1&t&&(e.DNE(0,R,1,0,"i",32)(1,N,1,0,"i",33),e.EFF(2)),2&t){const i=r.item.name,s=r.item;e.Y8G("ngIf","local"==s.stype),e.R7$(),e.Y8G("ngIf","radius"==s.stype),e.R7$(),e.SpI(" ",i," ")}}function w(t,r){1&t&&e.EFF(0),2&t&&e.SpI(" ",r.item.devip," ")}function G(t,r){1&t&&e.EFF(0),2&t&&e.SpI(" ",r.item.username," ")}function S(t,r){if(1&t&&(e.j41(0,"div"),e.EFF(1),e.k0s()),2&t){const i=r.item.by;e.R7$(),e.JRh(i)}}function z(t,r){1&t&&e.EFF(0),2&t&&e.SpI(" ",r.item.ip," ")}function V(t,r){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const i=e.XpG().item.duration;e.R7$(),e.JRh(i)}}function B(t,r){if(1&t&&(e.j41(0,"span"),e.EFF(1),e.k0s()),2&t){const i=e.XpG().item;e.R7$(),e.JRh(i.message)}}function Y(t,r){if(1&t&&e.DNE(0,V,2,1,"span",36)(1,B,2,1,"span",36),2&t){const i=r.item;e.Y8G("ngIf","failed"!=i.ltype),e.R7$(),e.Y8G("ngIf","failed"==i.ltype)}}function U(t,r){1&t&&(e.j41(0,"c-badge",40),e.EFF(1," Logged In"),e.k0s())}function L(t,r){1&t&&(e.j41(0,"c-badge",41),e.EFF(1," Logged Out"),e.k0s())}function H(t,r){1&t&&(e.j41(0,"c-badge",42),e.EFF(1," Failed"),e.k0s())}function X(t,r){if(1&t&&e.DNE(0,U,2,0,"c-badge",37)(1,L,2,0,"c-badge",38)(2,H,2,0,"c-badge",39),2&t){const i=r.item.ltype;e.Y8G("ngIf","loggedin"==i),e.R7$(),e.Y8G("ngIf","loggedout"==i),e.R7$(),e.Y8G("ngIf","failed"==i)}}function $(t,r){1&t&&e.EFF(0),2&t&&e.SpI(" ",r.item.created," ")}const P=[{path:"",component:(()=>{class t{constructor(i,s,n,o){this.data_provider=i,this.router=s,this.login_checker=n,this.route=o,this.tz="UTC",this.devid=0,this.filters={devid:!1,ip:"",devip:"",user:"",state:"All",server:"All",connection_type:"All",start_time:!1,end_time:!1},this.filters_visible=!1,this.connection_types=[],this.source=[],this.columns=[],this.loading=!0,this.rows=[],this.sorting={enabled:!0,multiSorting:!0},this.paging={enabled:!0,page:1,pageSize:10,pageSizes:[5,10,25,50],display:g.sE.ADVANCED},this.columnMenu={enabled:!0,sort:!0,columnsManager:!0},this.infoPanel={enabled:!0,infoDialog:!1,columnsManager:!0,schemaManager:!0},this.rowSelection={enabled:!0,type:g.AU.CHECKBOX,mode:g.fL.MULTIPLE};var l=this;this.login_checker.isLoggedIn()||setTimeout(function(){l.router.navigate(["login"])},100),this.data_provider.getSessionInfo().then(c=>{l.uid=c.uid,l.uname=c.name,l.tz=c.tz,"admin"!=c.role&&setTimeout(function(){l.router.navigate(["/user/dashboard"])},100)})}reinitgrid(i,s){"start"==i?this.filters.start_time=s.target.value:"end"==i?this.filters.end_time=s.target.value:"ip"==i?this.filters.ip=s:"devip"==i?this.filters.devip=s:"user"==i?this.filters.user=s:"connection_type"==i?this.filters.connection_type=s:"state"==i?this.filters.state=s:"server"==i&&(this.filters.server=s),this.initGridTable()}secondsToString(p){var s=Math.floor(p/31536e3),o=0,l="";s&&o<2&&(l+=s+"y ",o++);var a=Math.floor((p%=31536e3)/86400);a&&o<2&&(l+=a+"d ",o++);var c=Math.floor((p%=86400)/3600);c&&o<2&&(l+=c+"h ",o++);var b=Math.floor((p%=3600)/60);return b&&o<2&&(l+=b+"m ",o++),(p%=60)&&o<2&&(l+=p+"s ",o++),l}ngOnInit(){this.devid=Number(this.route.snapshot.paramMap.get("devid")),this.devid>0&&(this.filters.devid=this.devid),this.initGridTable()}onSelectedRows(i){this.rows=i,this.Selectedrows=i.map(s=>s.source.id)}removefilter(i){delete this.filters[i],this.initGridTable()}toggleCollapse(){this.filters_visible=!this.filters_visible}logger(i){console.dir(i)}initGridTable(){var i=this;this.data_provider.get_auth_logs(this.filters).then(s=>{let n=1;this.source=s.map(o=>(o.index=n,i.connection_types.includes(o.by)||i.connection_types.push(o.by),o.sessionid?(o.stype="radius",o.duration=0!=o.ended?i.secondsToString(o.ended-o.started):"live"):(o.stype="local",o.duration="Local Access"),o.created=(0,M.qD)(o.created.split(".")[0]+".000Z",i.tz,"yyyy-MM-dd HH:mm:ss XXX"),n+=1,o)),this.loading=!1})}static#e=this.\u0275fac=function(s){return new(s||t)(e.rXU(F.C),e.rXU(u.Ix),e.rXU(x.T),e.rXU(u.nX))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["ng-component"]],decls:89,vars:26,consts:[["picker1",""],["picker2",""],["multiSelect",""],["xs",""],[1,"mb-4"],["xs","",3,"lg"],["cButton","","color","primary",1,"me-1",3,"click"],[1,"fa-solid","fa-filter","mr-1"],["cCollapse","",3,"visible"],["xs","",1,"example-form",3,"lg"],["matInput","",3,"dateChange","ngModelChange","matDatepicker","ngModel"],["matIconSuffix","",3,"for"],["placeholder","Connection Type",3,"ngModelChange","ngModel"],["value","All"],[3,"value",4,"ngFor","ngForOf"],["placeholder","State",3,"ngModelChange","ngModel"],["value","loggedin"],["value","loggedout"],["value","failed"],["placeholder","Server",3,"ngModelChange","ngModel"],["matInput","",3,"ngModelChange","ngModel"],[3,"source","paging","columnMenu","sorting","infoPanel","autoResizeWidth"],["header","#No","type","NUMBER","field","index","width","25","align","CENTER"],["header","Device Name","field","name"],["header","Device IP","field","devip"],["header","Username","field","username"],["header","With","field","by"],["header","IP Address","field","ip"],["header","Time/Msg","field","duration"],["header","State","field","ltype",3,"width"],["header","Date","field","created"],[3,"value"],["cTooltip","local user","style","color: rgb(255, 42, 0); margin-right: 3px;font-size: .7em;","class","fa-solid fa-user-tie",4,"ngIf"],["cTooltip","Update failed","style","color: rgb(9, 97, 20); margin-right: 3px;font-size: .7em;","class","fa-solid fa-server",4,"ngIf"],["cTooltip","local user",1,"fa-solid","fa-user-tie",2,"color","rgb(255, 42, 0)","margin-right","3px","font-size",".7em"],["cTooltip","Update failed",1,"fa-solid","fa-server",2,"color","rgb(9, 97, 20)","margin-right","3px","font-size",".7em"],[4,"ngIf"],["color","success",4,"ngIf"],["color","warning",4,"ngIf"],["color","danger",4,"ngIf"],["color","success"],["color","warning"],["color","danger"]],template:function(s,n){if(1&s){const o=e.RV6();e.j41(0,"c-row")(1,"c-col",3)(2,"c-card",4)(3,"c-card-header")(4,"c-row")(5,"c-col",5),e.EFF(6," Authentication Logs "),e.k0s(),e.j41(7,"c-col",5)(8,"button",6),e.bIt("click",function(){return e.eBV(o),e.Njj(n.toggleCollapse())}),e.nrm(9,"i",7),e.EFF(10,"Filter"),e.k0s()()()(),e.j41(11,"c-card-body")(12,"c-row")(13,"div",8)(14,"c-col",9)(15,"mat-form-field")(16,"mat-label"),e.EFF(17,"Start date"),e.k0s(),e.j41(18,"input",10),e.bIt("dateChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("start",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.start_time,a)||(n.filters.start_time=a),e.Njj(a)}),e.k0s(),e.nrm(19,"mat-datepicker-toggle",11)(20,"mat-datepicker",null,0),e.k0s(),e.j41(22,"mat-form-field")(23,"mat-label"),e.EFF(24,"End date"),e.k0s(),e.j41(25,"input",10),e.bIt("dateChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("end",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.end_time,a)||(n.filters.end_time=a),e.Njj(a)}),e.k0s(),e.nrm(26,"mat-datepicker-toggle",11)(27,"mat-datepicker",null,1),e.k0s(),e.j41(29,"mat-form-field")(30,"mat-label"),e.EFF(31,"Connection Type"),e.k0s(),e.j41(32,"mat-select",12,2),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("connection_type",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.connection_type,a)||(n.filters.connection_type=a),e.Njj(a)}),e.j41(34,"mat-option",13),e.EFF(35,"All"),e.k0s(),e.DNE(36,A,2,2,"mat-option",14),e.k0s()(),e.j41(37,"mat-form-field")(38,"mat-label"),e.EFF(39,"Select action"),e.k0s(),e.j41(40,"mat-select",15,2),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("state",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.state,a)||(n.filters.state=a),e.Njj(a)}),e.j41(42,"mat-option",13),e.EFF(43,"All"),e.k0s(),e.j41(44,"mat-option",16),e.EFF(45," Logged In "),e.k0s(),e.j41(46,"mat-option",17),e.EFF(47," Logged Out "),e.k0s(),e.j41(48,"mat-option",18),e.EFF(49," Failed "),e.k0s()()(),e.j41(50,"mat-form-field")(51,"mat-label"),e.EFF(52,"Server"),e.k0s(),e.j41(53,"mat-select",19,2),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("server",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.server,a)||(n.filters.server=a),e.Njj(a)}),e.j41(55,"mat-option",13),e.EFF(56,"All"),e.k0s(),e.DNE(57,I,2,2,"mat-option",14),e.k0s()(),e.j41(58,"mat-form-field")(59,"mat-label"),e.EFF(60,"Device IP"),e.k0s(),e.j41(61,"input",20),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("devip",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.devip,a)||(n.filters.devip=a),e.Njj(a)}),e.k0s()(),e.j41(62,"mat-form-field")(63,"mat-label"),e.EFF(64,"IP/MAC"),e.k0s(),e.j41(65,"input",20),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("ip",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.ip,a)||(n.filters.ip=a),e.Njj(a)}),e.k0s()(),e.j41(66,"mat-form-field")(67,"mat-label"),e.EFF(68,"Username"),e.k0s(),e.j41(69,"input",20),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("user",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.user,a)||(n.filters.user=a),e.Njj(a)}),e.k0s()()()()(),e.j41(70,"gui-grid",21)(71,"gui-grid-column",22),e.DNE(72,E,1,1,"ng-template"),e.k0s(),e.j41(73,"gui-grid-column",23),e.DNE(74,D,3,3,"ng-template"),e.k0s(),e.j41(75,"gui-grid-column",24),e.DNE(76,w,1,1,"ng-template"),e.k0s(),e.j41(77,"gui-grid-column",25),e.DNE(78,G,1,1,"ng-template"),e.k0s(),e.j41(79,"gui-grid-column",26),e.DNE(80,S,2,1,"ng-template"),e.k0s(),e.j41(81,"gui-grid-column",27),e.DNE(82,z,1,1,"ng-template"),e.k0s(),e.j41(83,"gui-grid-column",28),e.DNE(84,Y,2,2,"ng-template"),e.k0s(),e.j41(85,"gui-grid-column",29),e.DNE(86,X,3,3,"ng-template"),e.k0s(),e.j41(87,"gui-grid-column",30),e.DNE(88,$,1,1,"ng-template"),e.k0s()()()()()()}if(2&s){const o=e.sdS(21),l=e.sdS(28);e.R7$(5),e.Y8G("lg",11),e.R7$(2),e.Y8G("lg",1),e.R7$(6),e.Y8G("visible",n.filters_visible),e.R7$(),e.Y8G("lg",12),e.R7$(4),e.Y8G("matDatepicker",o),e.R50("ngModel",n.filters.start_time),e.R7$(),e.Y8G("for",o),e.R7$(6),e.Y8G("matDatepicker",l),e.R50("ngModel",n.filters.end_time),e.R7$(),e.Y8G("for",l),e.R7$(6),e.R50("ngModel",n.filters.connection_type),e.R7$(4),e.Y8G("ngForOf",n.connection_types),e.R7$(4),e.R50("ngModel",n.filters.state),e.R7$(13),e.R50("ngModel",n.filters.server),e.R7$(4),e.Y8G("ngForOf",e.lJ4(25,k)),e.R7$(4),e.R50("ngModel",n.filters.devip),e.R7$(4),e.R50("ngModel",n.filters.ip),e.R7$(4),e.R50("ngModel",n.filters.user),e.R7$(),e.Y8G("source",n.source)("paging",n.paging)("columnMenu",n.columnMenu)("sorting",n.sorting)("infoPanel",n.infoPanel)("autoResizeWidth",!0),e.R7$(15),e.Y8G("width",110)}},dependencies:[d.iby,d.qHy,d.lMi,C.Sq,C.bT,d.gLf,d.oMR,h.me,h.BC,h.vS,d._fv,g.V1,g.fz,d.DcD,f.rl,f.nJ,f.yw,v.fg,_.Vh,_.bZ,_.bU,y.VO,T.wT,d.nSt],styles:[".example-form{--mat-form-field-container-height: 36px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-filled-with-label-container-padding-top: 6px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-select-arrow-transform: none;--mdc-checkbox-state-layer-size: 28px;--mat-checkbox-touch-target-display: none;--mdc-switch-state-layer-size: 28px;--mdc-radio-state-layer-size: 28px;--mat-radio-touch-target-display: none;--mdc-list-list-item-one-line-container-height: 24px;--mdc-list-list-item-two-line-container-height: 48px;--mdc-list-list-item-three-line-container-height: 56px;--mat-list-list-item-leading-icon-start-space: 16px;--mat-list-list-item-leading-icon-end-space: 32px;--mat-paginator-container-size: 40px;--mat-paginator-form-field-container-height: 36px;--mat-paginator-form-field-container-vertical-padding: 6px;--mdc-text-button-container-height: 24px;--mdc-filled-button-container-height: 24px;--mdc-outlined-button-container-height: 24px;--mdc-protected-button-container-height: 24px;--mat-text-button-touch-target-display: none;--mat-filled-button-touch-target-display: none;--mat-protected-button-touch-target-display: none;--mat-outlined-button-touch-target-display: none;--mat-fab-touch-target-display: none;--mat-fab-small-touch-target-display: none;--mat-table-header-container-height: 40px;--mat-table-footer-container-height: 36px;--mat-table-row-item-container-height: 36px;--mat-expansion-header-collapsed-state-height: 36px;--mat-expansion-header-expanded-state-height: 48px;--mat-stepper-header-height: 42px;--mat-toolbar-standard-height: 52px;--mat-toolbar-mobile-height: 44px;--mat-tree-node-min-height: 28px;--mat-standard-button-toggle-height: 24px;--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls{--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 40px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:8px}.example-form .mat-mdc-chip.mat-mdc-standard-chip{--mdc-chip-container-height: 24px}.example-form .mdc-list-item__start,.example-form .mdc-list-item__end{--mdc-radio-state-layer-size: 28px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-one-line{height:40px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines{height:56px}.example-form .mat-mdc-tab-header{--mdc-secondary-navigation-tab-container-height: 32px}.example-form .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 28px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:2px}.example-form .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-floating-label{display:inline}.example-form mat-form-field *{font-size:13px!important}.example-form .mat-mdc-form-field-infix{width:150px}:host .legend small{font-size:x-small}\n"],encapsulation:2})}return t})(),data:{title:$localize`Authentication Logs`}}];let O=(()=>{class t{static#e=this.\u0275fac=function(s){return new(s||t)};static#t=this.\u0275mod=e.$C({type:t});static#i=this.\u0275inj=e.G2t({imports:[u.iI.forChild(P),u.iI]})}return t})(),J=(()=>{class t{static#e=this.\u0275fac=function(s){return new(s||t)};static#t=this.\u0275mod=e.$C({type:t});static#i=this.\u0275inj=e.G2t({imports:[O,d.Dw2,C.MD,d.pc9,h.YN,d.tmq,g.uM,d.G95,f.RG,v.fS,_.X6,y.Ve,d.EJq]})}return t})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/325.f9ddbfb6c670511e.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[325],{8325:(A,g,c)=>{c.r(g),c.d(g,{DevicesGroupModule:()=>$});var _=c(177),l=c(8921),p=c(7062),m=c(7390),e=c(4438),b=c(9492),f=c(1170),d=c(9417);function h(o,s){1&o&&e.EFF(0),2&o&&e.SpI(" ",s.item.name," ")}function G(o,s){1&o&&e.eu8(0)}function M(o,s){1&o&&(e.j41(0,"c-badge",38),e.EFF(1,"All Devices"),e.k0s())}function v(o,s){1&o&&(e.j41(0,"c-badge",38),e.EFF(1,"0 Members"),e.k0s())}function C(o,s){if(1&o&&(e.j41(0,"c-badge",38),e.EFF(1),e.k0s()),2&o){const t=e.XpG(2).item.array_agg;e.R7$(),e.SpI("",t.length," Members")}}function j(o,s){if(1&o&&e.DNE(0,v,2,0,"c-badge",39)(1,C,2,1,"c-badge",39),2&o){const t=e.XpG(),n=t.item.array_agg;e.Y8G("ngIf",null==n[0]&&1!=t.item.id),e.R7$(),e.Y8G("ngIf",null!=n[0])}}function k(o,s){if(1&o&&e.DNE(0,G,1,0,"ng-container",37)(1,M,2,0,"ng-template",null,3,e.C5r)(3,j,2,2,"ng-template",null,4,e.C5r),2&o){const t=s.item,n=e.sdS(2),i=e.sdS(4);e.Y8G("ngIf",1==t.id)("ngIfThen",n)("ngIfElse",i)}}function D(o,s){1&o&&e.EFF(0),2&o&&e.SpI(" ",s.item.created," ")}function w(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",40),e.bIt("click",function(){const i=e.eBV(t).item,r=e.XpG();return e.Njj(r.editAddGroup(i,"showedit"))}),e.nrm(1,"i",41),e.k0s(),e.j41(2,"button",42),e.bIt("click",function(){const i=e.eBV(t).item,r=e.XpG();return e.Njj(r.show_members(i.id))}),e.nrm(3,"i",43),e.k0s(),e.j41(4,"button",44),e.bIt("click",function(){const i=e.eBV(t).item,r=e.XpG();return e.Njj(r.show_delete_group(i))}),e.nrm(5,"i",45),e.k0s()}if(2&o){const t=s.item.id;e.Y8G("disabled",1==t),e.R7$(2),e.Y8G("disabled",1==t),e.R7$(2),e.Y8G("disabled",1==t)}}function N(o,s){1&o&&e.EFF(0),2&o&&e.SpI(" \xa0 ",s.item.name," ")}function R(o,s){1&o&&e.EFF(0),2&o&&e.SpI(" ",s.item.ip," ")}function F(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",46),e.bIt("click",function(){const i=e.eBV(t).item,r=e.XpG();return e.Njj(r.remove_from_group(i.id))}),e.nrm(1,"i",45),e.k0s()}}function E(o,s){if(1&o&&(e.j41(0,"button",47),e.nrm(1,"i",45),e.EFF(2),e.k0s()),2&o){const t=e.XpG();e.R7$(2),e.SpI("Delete ",t.MemberRows.length," Selected")}}function T(o,s){1&o&&e.EFF(0),2&o&&e.SpI(" \xa0 ",s.item.name," ")}function I(o,s){1&o&&e.EFF(0),2&o&&e.SpI(" ",s.item.ip," ")}function V(o,s){1&o&&e.EFF(0),2&o&&e.SpI(" ",s.item.mac," ")}function S(o,s){if(1&o){const t=e.RV6();e.j41(0,"gui-grid",23),e.bIt("selectedRows",function(i){e.eBV(t);const r=e.XpG();return e.Njj(r.onSelectedRowsNewMembers(i))}),e.j41(1,"gui-grid-column",48),e.DNE(2,T,1,1,"ng-template"),e.k0s(),e.j41(3,"gui-grid-column",25),e.DNE(4,I,1,1,"ng-template"),e.k0s(),e.j41(5,"gui-grid-column",49),e.DNE(6,V,1,1,"ng-template"),e.k0s()()}if(2&o){const t=e.XpG();e.Y8G("autoResizeWidth",!0)("searching",t.searching)("source",t.availbleMembers)("columnMenu",t.columnMenu)("sorting",t.sorting)("infoPanel",t.infoPanel)("rowSelection",t.rowSelection)("autoResizeWidth",!0)("paging",t.paging)}}function y(o,s){if(1&o){const t=e.RV6();e.j41(0,"button",9),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.add_new_members())}),e.EFF(1),e.k0s()}if(2&o){const t=e.XpG();e.R7$(),e.SpI("Add ",t.NewMemberRows.length,"")}}function B(o,s){if(1&o&&(e.qex(0),e.j41(1,"span"),e.EFF(2," Are you sure that you want to delete "),e.j41(3,"b",50),e.EFF(4),e.k0s(),e.EFF(5,"? "),e.k0s(),e.nrm(6,"br"),e.j41(7,"p",51),e.EFF(8," All Related Configuration will be deleted/Modified :"),e.nrm(9,"br"),e.EFF(10," * User Permision Related to this group"),e.nrm(11,"br"),e.EFF(12," * Tasks including this Group"),e.nrm(13,"br"),e.k0s(),e.bVm()),2&o){const t=e.XpG();e.R7$(4),e.JRh(t.currentGroup.name)}}const z=[{path:"",component:(()=>{class o{constructor(t,n,i){this.data_provider=t,this.router=n,this.login_checker=i,this.source=[],this.columns=[],this.loading=!0,this.MemberRows=[],this.NewMemberRows=[],this.ConfirmModalVisible=!1,this.ConfirmAction="delete",this.EditGroupModalVisible=!1,this.NewMemberModalVisible=!1,this.groupMembers=[],this.availbleMembers=[],this.currentGroup={array_agg:[],created:"",id:0,name:""},this.DefaultCurrentGroup={array_agg:[],created:"",id:0,name:""},this.sorting={enabled:!0,multiSorting:!0},this.searching={enabled:!0,placeholder:"Search Devices"},this.paging={enabled:!0,page:1,pageSize:10,pageSizes:[5,10,25,50],display:m.sE.ADVANCED},this.columnMenu={enabled:!0,sort:!0,columnsManager:!0},this.infoPanel={enabled:!0,infoDialog:!1,columnsManager:!0,schemaManager:!0},this.rowSelection={enabled:!0,type:m.AU.CHECKBOX,mode:m.fL.MULTIPLE};var r=this;this.login_checker.isLoggedIn()||setTimeout(function(){r.router.navigate(["login"])},100),this.data_provider.getSessionInfo().then(a=>{r.uid=a.uid,r.uname=a.name,"admin"!=a.role&&setTimeout(function(){r.router.navigate(["/user/dashboard"])},100)})}ngOnInit(){this.initGridTable()}show_members(t){this.router.navigate(["devices",{id:t}])}show_delete_group(t){this.currentGroup=t,this.ConfirmModalVisible=!0,this.ConfirmAction="delete"}delete_group(){var t=this;this.data_provider.delete_group(this.currentGroup.id).then(n=>{t.initGridTable(),t.ConfirmModalVisible=!1})}onSelectedRowsMembers(t){this.MemberRows=t,this.SelectedMemberRows=t.map(n=>n.source.id)}onSelectedRowsNewMembers(t){this.NewMemberRows=t,this.SelectedNewMemberRows=t.map(n=>n.source.id)}add_new_members(){this.currentGroup.array_agg=[...new Set(this.currentGroup.array_agg.concat(this.SelectedNewMemberRows))],this.groupMembers=[...new Set(this.groupMembers.concat(this.NewMemberRows.map(n=>n.source)))],this.NewMemberModalVisible=!1}remove_from_group(t){this.currentGroup.array_agg=this.currentGroup.array_agg.filter(i=>i!=t),this.groupMembers=this.groupMembers.filter(i=>i.id!=t)}save_group(){var t=this;this.data_provider.update_save_group(this.currentGroup).then(n=>{t.initGridTable(),t.EditGroupModalVisible=!1})}editAddGroup(t,n){var i=this;if("showadd"==n)return this.currentGroup={...this.DefaultCurrentGroup},this.groupMembers=[],void(this.EditGroupModalVisible=!0);this.currentGroup=t,this.groupMembers=[],this.data_provider.get_devgroup_members(t.id).then(r=>{i.groupMembers=r,i.currentGroup={...t},i.currentGroup.array_agg=t.array_agg.filter(u=>null!=u),i.EditGroupModalVisible=!0})}show_new_member_form(){this.NewMemberModalVisible=!0;var t=this;t.availbleMembers=[],this.SelectedNewMemberRows=[],this.NewMemberRows=[],t.data_provider.get_dev_list({group_id:!1,search:!1,page:!1,size:1e4}).then(i=>{t.availbleMembers=i.filter(r=>!t.currentGroup.array_agg.includes(r.id)),t.NewMemberModalVisible=!0})}logger(t){console.dir(t)}initGridTable(){this.data_provider.get_devgroup_list().then(t=>{this.source=t,this.loading=!1})}static#e=this.\u0275fac=function(n){return new(n||o)(e.rXU(b.C),e.rXU(p.Ix),e.rXU(f.T))};static#t=this.\u0275cmp=e.VBU({type:o,selectors:[["ng-component"]],decls:82,vars:29,consts:[["EditGroupModal",""],["NewMemberModal",""],["ConfirmModal",""],["Default",""],["NotDefault",""],["xs",""],[1,"mb-4"],["xs","",3,"lg"],["xs","",2,"text-align","right",3,"lg"],["cButton","","color","primary",3,"click"],[1,"fa-solid","fa-plus"],[3,"source","columnMenu","sorting","infoPanel","autoResizeWidth"],["header","Name","field","name"],["header","Devices","field","array_agg","align","CENTER"],["header","Create Time","field","created"],["header","Actions","field","action"],["backdrop","static","size","lg","id","EditGroupModal",3,"visibleChange","visible"],["cModalTitle",""],["cButtonClose","",3,"cModalToggle"],[1,"mb-3"],[1,"mb-3",3,"cFormFloating"],["cFormControl","","id","floatingInput","placeholder","Group Name",3,"ngModelChange","ngModel"],["cLabel","","for","floatingInput"],[3,"selectedRows","autoResizeWidth","searching","source","columnMenu","sorting","infoPanel","rowSelection","paging"],["header","Member Name","field","name"],["header","perm Name","field","ip"],["header","Actions","width","120","field","action"],["style","margin: 10px 0;","cButton","","color","danger","size","sm",4,"ngIf"],["cButton","","color","secondary",3,"cModalToggle"],["backdrop","static","size","lg","id","NewMemberModal",3,"visibleChange","visible"],["cButtonClose","",3,"click"],[3,"autoResizeWidth","searching","source","columnMenu","sorting","infoPanel","rowSelection","paging","selectedRows",4,"ngIf"],["cButton","","color","primary",3,"click",4,"ngIf"],["cButton","","color","secondary",3,"click"],["backdrop","static","id","ConfirmModal",3,"visibleChange","visible"],[4,"ngIf"],["cButton","","color","danger",3,"click"],[4,"ngIf","ngIfThen","ngIfElse"],["color","info"],["color","info",4,"ngIf"],["cButton","","color","warning","size","sm",1,"mx-1",3,"click","disabled"],[1,"fa-regular","fa-pen-to-square"],["cButton","","color","info","size","sm",1,"mx-1",3,"click","disabled"],[1,"fa-regular","fa-eye"],["cButton","","color","danger","size","sm",1,"mx-1",3,"click","disabled"],[1,"fa-regular","fa-trash-can"],["cButton","","color","danger","size","sm",3,"click"],["cButton","","color","danger","size","sm",2,"margin","10px 0"],["header","Group Name","field","name"],["header","perm Name","field","mac"],[1,"text-danger-emphasis"],[1,"text-danger"]],template:function(n,i){if(1&n){const r=e.RV6();e.j41(0,"c-row")(1,"c-col",5)(2,"c-card",6)(3,"c-card-header")(4,"c-row")(5,"c-col",7),e.EFF(6," Device Groups "),e.k0s(),e.j41(7,"c-col",8)(8,"button",9),e.bIt("click",function(){return e.eBV(r),e.Njj(i.editAddGroup({},"showadd"))}),e.nrm(9,"i",10),e.k0s()()()(),e.j41(10,"c-card-body")(11,"gui-grid",11)(12,"gui-grid-column",12),e.DNE(13,h,1,1,"ng-template"),e.k0s(),e.j41(14,"gui-grid-column",13),e.DNE(15,k,5,3,"ng-template"),e.k0s(),e.j41(16,"gui-grid-column",14),e.DNE(17,D,1,1,"ng-template"),e.k0s(),e.j41(18,"gui-grid-column",15),e.DNE(19,w,6,3,"ng-template"),e.k0s()()()()()(),e.j41(20,"c-modal",16,0),e.mxI("visibleChange",function(a){return e.eBV(r),e.DH7(i.EditGroupModalVisible,a)||(i.EditGroupModalVisible=a),e.Njj(a)}),e.j41(22,"c-modal-header")(23,"h5",17),e.EFF(24," Group Edit"),e.k0s(),e.nrm(25,"button",18),e.k0s(),e.j41(26,"c-modal-body")(27,"c-input-group",19)(28,"div",20)(29,"input",21),e.mxI("ngModelChange",function(a){return e.eBV(r),e.DH7(i.currentGroup.name,a)||(i.currentGroup.name=a),e.Njj(a)}),e.k0s(),e.j41(30,"label",22),e.EFF(31,"Group Name"),e.k0s()()(),e.j41(32,"c-input-group",19)(33,"h5"),e.EFF(34,"Group Members :"),e.k0s(),e.j41(35,"gui-grid",23),e.bIt("selectedRows",function(a){return e.eBV(r),e.Njj(i.onSelectedRowsMembers(a))}),e.j41(36,"gui-grid-column",24),e.DNE(37,N,1,1,"ng-template"),e.k0s(),e.j41(38,"gui-grid-column",25),e.DNE(39,R,1,1,"ng-template"),e.k0s(),e.j41(40,"gui-grid-column",26),e.DNE(41,F,2,0,"ng-template"),e.k0s()(),e.nrm(42,"br"),e.DNE(43,E,3,1,"button",27),e.k0s(),e.nrm(44,"hr"),e.j41(45,"button",9),e.bIt("click",function(){return e.eBV(r),e.Njj(i.show_new_member_form())}),e.EFF(46,"+ Add new Members"),e.k0s()(),e.j41(47,"c-modal-footer")(48,"button",9),e.bIt("click",function(){return e.eBV(r),e.Njj(i.save_group())}),e.EFF(49,"save"),e.k0s(),e.j41(50,"button",28),e.EFF(51," Close "),e.k0s()()(),e.j41(52,"c-modal",29,1),e.mxI("visibleChange",function(a){return e.eBV(r),e.DH7(i.NewMemberModalVisible,a)||(i.NewMemberModalVisible=a),e.Njj(a)}),e.j41(54,"c-modal-header")(55,"h5",17),e.EFF(56,"Members not in Group"),e.k0s(),e.j41(57,"button",30),e.bIt("click",function(){return e.eBV(r),e.Njj(i.NewMemberModalVisible=!i.NewMemberModalVisible)}),e.k0s()(),e.j41(58,"c-modal-body")(59,"c-input-group",19)(60,"h5"),e.EFF(61,"Members Availble to add:"),e.k0s(),e.DNE(62,S,7,9,"gui-grid",31),e.nrm(63,"br"),e.k0s(),e.nrm(64,"hr"),e.k0s(),e.j41(65,"c-modal-footer"),e.DNE(66,y,2,1,"button",32),e.j41(67,"button",33),e.bIt("click",function(){return e.eBV(r),e.Njj(i.NewMemberModalVisible=!i.NewMemberModalVisible)}),e.EFF(68," Close "),e.k0s()()(),e.j41(69,"c-modal",34,2),e.mxI("visibleChange",function(a){return e.eBV(r),e.DH7(i.ConfirmModalVisible,a)||(i.ConfirmModalVisible=a),e.Njj(a)}),e.j41(71,"c-modal-header")(72,"h5",17),e.EFF(73," Are You Sure?"),e.k0s(),e.nrm(74,"button",18),e.k0s(),e.j41(75,"c-modal-body"),e.DNE(76,B,14,1,"ng-container",35),e.k0s(),e.j41(77,"c-modal-footer")(78,"button",36),e.bIt("click",function(){return e.eBV(r),e.Njj(i.delete_group())}),e.EFF(79,"Confirm"),e.k0s(),e.j41(80,"button",28),e.EFF(81," Close "),e.k0s()()()}if(2&n){const r=e.sdS(21),u=e.sdS(70);e.R7$(5),e.Y8G("lg",10),e.R7$(2),e.Y8G("lg",2),e.R7$(4),e.Y8G("source",i.source)("columnMenu",i.columnMenu)("sorting",i.sorting)("infoPanel",i.infoPanel)("autoResizeWidth",!0),e.R7$(9),e.R50("visible",i.EditGroupModalVisible),e.R7$(5),e.Y8G("cModalToggle",r.id),e.R7$(3),e.Y8G("cFormFloating",!0),e.R7$(),e.R50("ngModel",i.currentGroup.name),e.R7$(6),e.Y8G("autoResizeWidth",!0)("searching",i.searching)("source",i.groupMembers)("columnMenu",i.columnMenu)("sorting",i.sorting)("infoPanel",i.infoPanel)("rowSelection",i.rowSelection)("autoResizeWidth",!0)("paging",i.paging),e.R7$(8),e.Y8G("ngIf",0!=i.MemberRows.length),e.R7$(7),e.Y8G("cModalToggle",r.id),e.R7$(2),e.R50("visible",i.NewMemberModalVisible),e.R7$(10),e.Y8G("ngIf",i.NewMemberModalVisible),e.R7$(4),e.Y8G("ngIf",0!=i.NewMemberRows.length),e.R7$(3),e.R50("visible",i.ConfirmModalVisible),e.R7$(5),e.Y8G("cModalToggle",u.id),e.R7$(2),e.Y8G("ngIf","delete"==i.ConfirmAction),e.R7$(4),e.Y8G("cModalToggle",u.id)}},dependencies:[l.iby,l.qHy,l.lMi,_.bT,l.gLf,l.oMR,d.me,d.BC,d.vS,l.l_X,l.e$m,l.YJZ,l.fvw,l._fv,l.UjT,m.V1,m.fz,l.Jyz,l.zfW,l.s$3,l.epl,l.L$K,l.VtU,l.nSt],encapsulation:2})}return o})(),data:{title:$localize`Device Group`}}];let Y=(()=>{class o{static#e=this.\u0275fac=function(n){return new(n||o)};static#t=this.\u0275mod=e.$C({type:o});static#o=this.\u0275inj=e.G2t({imports:[p.iI.forChild(z),p.iI]})}return o})(),$=(()=>{class o{static#e=this.\u0275fac=function(n){return new(n||o)};static#t=this.\u0275mod=e.$C({type:o});static#o=this.\u0275inj=e.G2t({imports:[Y,l.Dw2,_.MD,l.pc9,d.YN,l.tHK,l.tmq,l.ayw,m.uM,l.G95,l.Q_q,l.EJq]})}return o})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/381.071d8c2d068b86cb.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[381],{7381:(V,b,d)=>{d.r(b),d.d(b,{SyslogModule:()=>G});var _=d(177),c=d(8921),v=d(4983),p=d(7062),g=d(7390),C=d(9130),t=d(4438),S=d(9492),w=d(1170),h=d(9417),x=d(9631),f=d(6467),y=d(4869),j=d(6600),u=d(5084);function M(i,m){if(1&i&&(t.j41(0,"mat-option",24),t.EFF(1),t.k0s()),2&i){const e=m.$implicit;t.Y8G("value",e),t.R7$(),t.SpI(" ",e," ")}}function k(i,m){if(1&i&&(t.j41(0,"mat-option",24),t.EFF(1),t.k0s()),2&i){const e=m.$implicit;t.Y8G("value",e),t.R7$(),t.SpI(" ",e," ")}}function F(i,m){1&i&&t.EFF(0),2&i&&t.SpI(" ",m.item.index," ")}function E(i,m){if(1&i&&(t.j41(0,"div",25)(1,"span",26),t.EFF(2),t.k0s(),t.j41(3,"span",27),t.EFF(4),t.k0s()()),2&i){const e=m.item.username,l=m.item;t.R7$(2),t.JRh(e),t.R7$(2),t.Lme("",l.first_name," ",l.last_name,"")}}function z(i,m){1&i&&t.EFF(0),2&i&&t.SpI(" ",m.item.section," ")}function R(i,m){1&i&&t.EFF(0),2&i&&t.SpI(" ",m.item.action," ")}function T(i,m){1&i&&t.EFF(0),2&i&&t.SpI(" ",m.item.ip," ")}function I(i,m){1&i&&t.EFF(0),2&i&&t.SpI(" ",m.item.created," ")}const D=[{path:"",component:(()=>{class i{constructor(e,l,n,a){this.data_provider=e,this.router=l,this.route=n,this.login_checker=a,this.tz="UTC",this.filters={start_time:!1,end_time:!1,section:"All",action:"All",ip:""},this.event_section=[],this.event_action=[],this.filters_visible=!1,this.source=[],this.columns=[],this.loading=!0,this.rows=[],this.userid=0,this.sorting={enabled:!0,multiSorting:!0},this.rowDetail={enabled:!0,template:s=>`\n\t\t\t
\n\t\t\t

System Log :

\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
Section${s.section}
Action${s.action}
Time${s.created}
\n\t\t\t\t

User Detail :\n\t\t\t\t

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
User${s.username}
FirstName${s.first_name}
LastName${s.last_name}
IP${s.ip}
Agent
${s.agent}
\n\t\t\t\t
data
\n\t\t\t\t\n\t\t\t\t\t${s.data}\n\t\t\t\t\n\t\t\t
`},this.paging={enabled:!0,page:1,pageSize:10,pageSizes:[5,10,25,50],display:g.sE.ADVANCED},this.columnMenu={enabled:!0,sort:!0,columnsManager:!0},this.infoPanel={enabled:!0,infoDialog:!1,columnsManager:!0,schemaManager:!0},this.rowSelection={enabled:!0,type:g.AU.CHECKBOX,mode:g.fL.MULTIPLE};var r=this;this.login_checker.isLoggedIn()||setTimeout(function(){r.router.navigate(["login"])},100),this.data_provider.getSessionInfo().then(s=>{r.uid=s.uid,r.uname=s.name,r.tz=s.tz,"admin"!=s.role&&setTimeout(function(){r.router.navigate(["/user/dashboard"])},100)})}ngOnInit(){this.userid=Number(this.route.snapshot.paramMap.get("userid")),this.userid>0&&(this.filters.userid=this.userid),this.initGridTable()}toggleCollapse(){this.filters_visible=!this.filters_visible}logger(e){console.dir(e)}reinitgrid(e,l){"start"==e?this.filters.start_time=l.target.value:"end"==e?this.filters.end_time=l.target.value:"section"==e?this.filters.section=l:"action"==e?this.filters.action=l:"ip"==e&&(this.filters.ip=l),this.initGridTable()}initGridTable(){var e=this;e.event_section=[],e.event_action=[],this.data_provider.get_syslog(this.filters).then(l=>{let n=1;this.source=l.map(a=>(a.index=n,e.event_section.includes(a.section)||e.event_section.push(a.section),e.event_action.includes(a.action)||e.event_action.push(a.action),a.created=(0,C.qD)(a.created.split(".")[0]+".000Z",e.tz,"yyyy-MM-dd HH:mm:ss XXX"),n+=1,a)),this.loading=!1})}static#t=this.\u0275fac=function(l){return new(l||i)(t.rXU(S.C),t.rXU(p.Ix),t.rXU(p.nX),t.rXU(w.T))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["ng-component"]],decls:62,vars:24,consts:[["picker1",""],["picker2",""],["multiSelect",""],["xs",""],[1,"mb-4"],["xs","",3,"lg"],["cButton","","color","primary",1,"me-1",3,"click"],[1,"fa-solid","fa-filter","mr-1"],["cCollapse","",3,"visible"],["xs","",1,"example-form",3,"lg"],["matInput","",3,"dateChange","ngModelChange","matDatepicker","ngModel"],["matIconSuffix","",3,"for"],["placeholder","Event Section",3,"ngModelChange","ngModel"],["value","All"],[3,"value",4,"ngFor","ngForOf"],["placeholder","Event action",3,"ngModelChange","ngModel"],["matInput","",3,"ngModelChange","ngModel"],["wid","",3,"rowDetail","horizontalGrid","rowHeight","source","columnMenu","paging","sorting","infoPanel","autoResizeWidth"],["header","#No","type","NUMBER","field","index","width","1","align","CENTER"],["header","username","field","username"],["header","Section","field","section"],["header","action","field","action"],["header","ip","field","ip"],["header","Time","field","created"],[3,"value"],[1,"gui-dev-info"],[1,"gui-dev-info-name"],[1,"gui-dev-info-ip"]],template:function(l,n){if(1&l){const a=t.RV6();t.j41(0,"c-row")(1,"c-col",3)(2,"c-card",4)(3,"c-card-header")(4,"c-row")(5,"c-col",5),t.EFF(6," Devices "),t.k0s(),t.j41(7,"c-col",5)(8,"button",6),t.bIt("click",function(){return t.eBV(a),t.Njj(n.toggleCollapse())}),t.nrm(9,"i",7),t.EFF(10,"Filter"),t.k0s()()()(),t.j41(11,"c-card-body")(12,"c-row")(13,"div",8)(14,"c-col",9)(15,"mat-form-field")(16,"mat-label"),t.EFF(17,"Start date"),t.k0s(),t.j41(18,"input",10),t.bIt("dateChange",function(o){return t.eBV(a),t.Njj(n.reinitgrid("start",o))}),t.mxI("ngModelChange",function(o){return t.eBV(a),t.DH7(n.filters.start_time,o)||(n.filters.start_time=o),t.Njj(o)}),t.k0s(),t.nrm(19,"mat-datepicker-toggle",11)(20,"mat-datepicker",null,0),t.k0s(),t.j41(22,"mat-form-field")(23,"mat-label"),t.EFF(24,"End date"),t.k0s(),t.j41(25,"input",10),t.bIt("dateChange",function(o){return t.eBV(a),t.Njj(n.reinitgrid("end",o))}),t.mxI("ngModelChange",function(o){return t.eBV(a),t.DH7(n.filters.end_time,o)||(n.filters.end_time=o),t.Njj(o)}),t.k0s(),t.nrm(26,"mat-datepicker-toggle",11)(27,"mat-datepicker",null,1),t.k0s(),t.j41(29,"mat-form-field")(30,"mat-label"),t.EFF(31,"Select section"),t.k0s(),t.j41(32,"mat-select",12,2),t.bIt("ngModelChange",function(o){return t.eBV(a),t.Njj(n.reinitgrid("section",o))}),t.mxI("ngModelChange",function(o){return t.eBV(a),t.DH7(n.filters.section,o)||(n.filters.section=o),t.Njj(o)}),t.j41(34,"mat-option",13),t.EFF(35,"All"),t.k0s(),t.DNE(36,M,2,2,"mat-option",14),t.k0s()(),t.j41(37,"mat-form-field")(38,"mat-label"),t.EFF(39,"Select action"),t.k0s(),t.j41(40,"mat-select",15,2),t.bIt("ngModelChange",function(o){return t.eBV(a),t.Njj(n.reinitgrid("action",o))}),t.mxI("ngModelChange",function(o){return t.eBV(a),t.DH7(n.filters.action,o)||(n.filters.action=o),t.Njj(o)}),t.j41(42,"mat-option",13),t.EFF(43,"All"),t.k0s(),t.DNE(44,k,2,2,"mat-option",14),t.k0s()(),t.j41(45,"mat-form-field")(46,"mat-label"),t.EFF(47,"IP"),t.k0s(),t.j41(48,"input",16),t.bIt("ngModelChange",function(o){return t.eBV(a),t.Njj(n.reinitgrid("ip",o))}),t.mxI("ngModelChange",function(o){return t.eBV(a),t.DH7(n.filters.ip,o)||(n.filters.ip=o),t.Njj(o)}),t.k0s()()()()(),t.j41(49,"gui-grid",17)(50,"gui-grid-column",18),t.DNE(51,F,1,1,"ng-template"),t.k0s(),t.j41(52,"gui-grid-column",19),t.DNE(53,E,5,3,"ng-template"),t.k0s(),t.j41(54,"gui-grid-column",20),t.DNE(55,z,1,1,"ng-template"),t.k0s(),t.j41(56,"gui-grid-column",21),t.DNE(57,R,1,1,"ng-template"),t.k0s(),t.j41(58,"gui-grid-column",22),t.DNE(59,T,1,1,"ng-template"),t.k0s(),t.j41(60,"gui-grid-column",23),t.DNE(61,I,1,1,"ng-template"),t.k0s()()()()()()}if(2&l){const a=t.sdS(21),r=t.sdS(28);t.R7$(5),t.Y8G("lg",11),t.R7$(2),t.Y8G("lg",1),t.R7$(6),t.Y8G("visible",n.filters_visible),t.R7$(),t.Y8G("lg",12),t.R7$(4),t.Y8G("matDatepicker",a),t.R50("ngModel",n.filters.start_time),t.R7$(),t.Y8G("for",a),t.R7$(6),t.Y8G("matDatepicker",r),t.R50("ngModel",n.filters.end_time),t.R7$(),t.Y8G("for",r),t.R7$(6),t.R50("ngModel",n.filters.section),t.R7$(4),t.Y8G("ngForOf",n.event_section),t.R7$(4),t.R50("ngModel",n.filters.action),t.R7$(4),t.Y8G("ngForOf",n.event_action),t.R7$(4),t.R50("ngModel",n.filters.ip),t.R7$(),t.Y8G("rowDetail",n.rowDetail)("horizontalGrid",!0)("rowHeight",52)("source",n.source)("columnMenu",n.columnMenu)("paging",n.paging)("sorting",n.sorting)("infoPanel",n.infoPanel)("autoResizeWidth",!0)}},dependencies:[c.iby,c.qHy,c.lMi,_.Sq,c.gLf,c.oMR,h.me,h.BC,h.vS,c._fv,g.V1,g.fz,c.DcD,x.fg,f.rl,f.nJ,f.yw,y.VO,j.wT,u.Vh,u.bZ,u.bU],styles:[":host .legend small{font-size:x-small}.log-detail{padding:30px 10px;box-sizing:border-box}.log-detail h1{font-size:2em;font-weight:700;margin:0;padding:0}.log-detail small{position:relative;top:-7px;padding:0;font-weight:700;font-size:1.1em}.log-detail table{width:100%;border-collapse:collapse!important;margin:5px 0 0;padding:0;background-color:#ffffff29!important;color:#000}.log-detail th{text-align:left}.log-detail th,.log-detail td{border:1px solid rgba(255,255,255,.2901960784)!important;padding:.3rem!important}.gui-close-icon-wrapper .gui-close-icon:after,.gui-close-icon-wrapper .gui-close-icon:before{background-color:#fff!important}.log-detail code{padding:5px!important;display:block;background:#1d1f21;color:#c5c8c6;border-bottom-left-radius:3px;border-bottom-right-radius:3px;width:100%;min-height:unset!important;height:100px!important;overflow-y:scroll!important}.log-detail .code-title{background-color:#393e42!important;width:100%;padding:2px 15px;display:inline-block;margin-top:10px;color:#d2d2d2;border-top-left-radius:3px;border-top-right-radius:3px;font-weight:700}.gui-row-detail{height:100%}.gui-dev-info{display:inline-flex;flex-direction:column;align-items:stretch;align-content:center;justify-content:center;white-space:normal;line-height:17px}.gui-dev-info-name{font-weight:700}.gui-dev-info-ip{color:#525252;font-style:italic;font-size:13px;overflow:hidden}.gui-row-detail>div{height:100%}.gui-row-detail .log-detail{height:100%}.gui-structure{min-height:550px}.example-form{--mat-form-field-container-height: 36px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-filled-with-label-container-padding-top: 6px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-select-arrow-transform: none;--mdc-checkbox-state-layer-size: 28px;--mat-checkbox-touch-target-display: none;--mdc-switch-state-layer-size: 28px;--mdc-radio-state-layer-size: 28px;--mat-radio-touch-target-display: none;--mdc-list-list-item-one-line-container-height: 24px;--mdc-list-list-item-two-line-container-height: 48px;--mdc-list-list-item-three-line-container-height: 56px;--mat-list-list-item-leading-icon-start-space: 16px;--mat-list-list-item-leading-icon-end-space: 32px;--mat-paginator-container-size: 40px;--mat-paginator-form-field-container-height: 36px;--mat-paginator-form-field-container-vertical-padding: 6px;--mdc-text-button-container-height: 24px;--mdc-filled-button-container-height: 24px;--mdc-outlined-button-container-height: 24px;--mdc-protected-button-container-height: 24px;--mat-text-button-touch-target-display: none;--mat-filled-button-touch-target-display: none;--mat-protected-button-touch-target-display: none;--mat-outlined-button-touch-target-display: none;--mat-fab-touch-target-display: none;--mat-fab-small-touch-target-display: none;--mat-table-header-container-height: 40px;--mat-table-footer-container-height: 36px;--mat-table-row-item-container-height: 36px;--mat-expansion-header-collapsed-state-height: 36px;--mat-expansion-header-expanded-state-height: 48px;--mat-stepper-header-height: 42px;--mat-toolbar-standard-height: 52px;--mat-toolbar-mobile-height: 44px;--mat-tree-node-min-height: 28px;--mat-standard-button-toggle-height: 24px;--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls{--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 40px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:8px}.example-form .mat-mdc-chip.mat-mdc-standard-chip{--mdc-chip-container-height: 24px}.example-form .mdc-list-item__start,.example-form .mdc-list-item__end{--mdc-radio-state-layer-size: 28px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-one-line{height:40px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines{height:56px}.example-form .mat-mdc-tab-header{--mdc-secondary-navigation-tab-container-height: 32px}.example-form .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 28px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:2px}.example-form .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-floating-label{display:inline}.example-form mat-form-field *{font-size:13px!important}.example-form .mat-mdc-form-field-infix{width:150px}\n"],encapsulation:2})}return i})(),data:{title:$localize`Mikrowizard System Logs`}}];let N=(()=>{class i{static#t=this.\u0275fac=function(l){return new(l||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[p.iI.forChild(D),p.iI]})}return i})(),G=(()=>{class i{static#t=this.\u0275fac=function(l){return new(l||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[N,c.Dw2,_.MD,c.pc9,h.YN,c.tmq,g.uM,c.G95,c.krp,x.fS,f.RG,y.Ve,v.An,u.X6]})}return i})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/391.94be3a07e48126fb.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[391],{8391:(V,_,m)=>{m.r(_),m.d(_,{AccModule:()=>G});var b=m(177),c=m(8921),g=m(7062),p=m(7390),v=m(9130),t=m(4438),j=m(9492),M=m(1170),h=m(9417),f=m(6467),x=m(9631),u=m(5084),C=m(4869),y=m(6600);function k(i,s){if(1&i&&(t.j41(0,"mat-option",25),t.EFF(1),t.k0s()),2&i){const e=s.$implicit;t.Y8G("value",e),t.R7$(),t.SpI(" ",e," ")}}function F(i,s){if(1&i&&(t.j41(0,"mat-option",25),t.EFF(1),t.k0s()),2&i){const e=s.$implicit;t.Y8G("value",e),t.R7$(),t.SpI(" ",e," ")}}function w(i,s){1&i&&t.EFF(0),2&i&&t.SpI(" ",s.item.index," ")}function E(i,s){1&i&&t.EFF(0),2&i&&t.SpI(" ",s.item.name," ")}function A(i,s){1&i&&t.EFF(0),2&i&&t.SpI(" ",s.item.devip," ")}function D(i,s){1&i&&t.EFF(0),2&i&&t.SpI(" ",s.item.username," ")}function I(i,s){if(1&i&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&i){const e=s.item.action;t.R7$(),t.JRh(e)}}function R(i,s){1&i&&t.EFF(0),2&i&&t.SpI(" ",s.item.section," ")}function T(i,s){1&i&&t.EFF(0),2&i&&t.SpI(" ",s.item.created," ")}function N(i,s){1&i&&t.EFF(0),2&i&&t.SpI(" ",s.item.message," ")}const S=[{path:"",component:(()=>{class i{constructor(e,r,n,o){this.data_provider=e,this.router=r,this.route=n,this.login_checker=o,this.filters={devid:!1,ip:"",command:"",user:!1,state:"all",with:"all",start_time:!1,end_time:!1},this.filters_visible=!1,this.event_action=[],this.event_section=[],this.source=[],this.columns=[],this.loading=!0,this.rows=[],this.devid=0,this.sorting={enabled:!0,multiSorting:!0},this.rowDetail={enabled:!0,template:d=>`\n\t\t\t
\n\t\t\t\t

${d.name}

\n\t\t\t\t${d.devip}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
User Address${d.address}
User Name${d.username}
Connection Type${d.ctype}
Section${d.section}
Exec time${d.created}
\n\t\t\t\t
Executed Config
\n\t\t\t\t\n\t\t\t\t\t${d.config}\n\t\t\t\t\n\t\t\t
`},this.paging={enabled:!0,page:1,pageSize:10,pageSizes:[5,10,25,50],display:p.sE.ADVANCED},this.columnMenu={enabled:!0,sort:!0,columnsManager:!0},this.infoPanel={enabled:!0,infoDialog:!1,columnsManager:!0,schemaManager:!0},this.rowSelection={enabled:!0,type:p.AU.CHECKBOX,mode:p.fL.MULTIPLE};var l=this;this.login_checker.isLoggedIn()||setTimeout(function(){l.router.navigate(["login"])},100),this.data_provider.getSessionInfo().then(d=>{l.uid=d.uid,l.uname=d.name,l.tz=d.tz,"admin"!=d.role&&setTimeout(function(){l.router.navigate(["/user/dashboard"])},100)})}reinitgrid(e,r){"start"==e?this.filters.start_time=r.target.value:"end"==e?this.filters.end_time=r.target.value:"ip"==e?this.filters.ip=r:"section"==e?this.filters.section=r:"config"==e?this.filters.config=r:"action"==e&&(this.filters.action=r),this.initGridTable()}ngOnInit(){this.devid=Number(this.route.snapshot.paramMap.get("devid")),this.devid>0&&(this.filters.devid=this.devid),this.initGridTable()}OnDestroy(){}onSelectedRows(e){this.rows=e,this.Selectedrows=e.map(r=>r.source.id)}removefilter(e){delete this.filters[e],this.initGridTable()}toggleCollapse(){this.filters_visible=!this.filters_visible}logger(e){console.dir(e)}initGridTable(){var e=this;this.data_provider.get_account_logs(this.filters).then(r=>{let n=1;this.source=r.map(o=>(o.index=n,e.event_section.includes(o.section)||e.event_section.push(o.section),e.event_action.includes(o.action)||e.event_action.push(o.action),o.created=(0,v.qD)(o.created.split(".")[0]+".000Z",e.tz,"yyyy-MM-dd HH:mm:ss XXX"),n+=1,o)),this.loading=!1})}static#t=this.\u0275fac=function(r){return new(r||i)(t.rXU(j.C),t.rXU(g.Ix),t.rXU(g.nX),t.rXU(M.T))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["ng-component"]],decls:70,vars:24,consts:[["picker1",""],["picker2",""],["multiSelect",""],["xs",""],[1,"mb-4"],["xs","",3,"lg"],["cButton","","color","primary",1,"me-1",3,"click"],[1,"fa-solid","fa-filter","mr-1"],["cCollapse","",3,"visible"],["xs","",1,"example-form",3,"lg"],["matInput","",3,"dateChange","ngModelChange","matDatepicker","ngModel"],["matIconSuffix","",3,"for"],["placeholder","Event Section",3,"ngModelChange","ngModel"],["value","All"],[3,"value",4,"ngFor","ngForOf"],["matInput","",3,"ngModelChange","ngModel"],[3,"rowDetail","source","columnMenu","paging","sorting","infoPanel","autoResizeWidth"],["header","#No","type","NUMBER","field","index","width","25","align","CENTER"],["header","Device Name","field","name"],["header","Device IP","field","devip"],["header","Username","field","username"],["header","Action","field","action"],["header","Section","field","section"],["header","Date","field","created"],["header","Message","field","message",3,"enabled"],[3,"value"]],template:function(r,n){if(1&r){const o=t.RV6();t.j41(0,"c-row")(1,"c-col",3)(2,"c-card",4)(3,"c-card-header")(4,"c-row")(5,"c-col",5),t.EFF(6," Accunting Logs "),t.k0s(),t.j41(7,"c-col",5)(8,"button",6),t.bIt("click",function(){return t.eBV(o),t.Njj(n.toggleCollapse())}),t.nrm(9,"i",7),t.EFF(10,"Filter"),t.k0s()()()(),t.j41(11,"c-card-body")(12,"c-row")(13,"div",8)(14,"c-col",9)(15,"mat-form-field")(16,"mat-label"),t.EFF(17,"Start date"),t.k0s(),t.j41(18,"input",10),t.bIt("dateChange",function(a){return t.eBV(o),t.Njj(n.reinitgrid("start",a))}),t.mxI("ngModelChange",function(a){return t.eBV(o),t.DH7(n.filters.start_time,a)||(n.filters.start_time=a),t.Njj(a)}),t.k0s(),t.nrm(19,"mat-datepicker-toggle",11)(20,"mat-datepicker",null,0),t.k0s(),t.j41(22,"mat-form-field")(23,"mat-label"),t.EFF(24,"End date"),t.k0s(),t.j41(25,"input",10),t.bIt("dateChange",function(a){return t.eBV(o),t.Njj(n.reinitgrid("end",a))}),t.mxI("ngModelChange",function(a){return t.eBV(o),t.DH7(n.filters.end_time,a)||(n.filters.end_time=a),t.Njj(a)}),t.k0s(),t.nrm(26,"mat-datepicker-toggle",11)(27,"mat-datepicker",null,1),t.k0s(),t.j41(29,"mat-form-field")(30,"mat-label"),t.EFF(31,"Select section"),t.k0s(),t.j41(32,"mat-select",12,2),t.bIt("ngModelChange",function(a){return t.eBV(o),t.Njj(n.reinitgrid("section",a))}),t.mxI("ngModelChange",function(a){return t.eBV(o),t.DH7(n.filters.section,a)||(n.filters.section=a),t.Njj(a)}),t.j41(34,"mat-option",13),t.EFF(35,"All"),t.k0s(),t.DNE(36,k,2,2,"mat-option",14),t.k0s()(),t.j41(37,"mat-form-field")(38,"mat-label"),t.EFF(39,"Select action"),t.k0s(),t.j41(40,"mat-select",12,2),t.bIt("ngModelChange",function(a){return t.eBV(o),t.Njj(n.reinitgrid("action",a))}),t.mxI("ngModelChange",function(a){return t.eBV(o),t.DH7(n.filters.action,a)||(n.filters.action=a),t.Njj(a)}),t.j41(42,"mat-option",13),t.EFF(43,"All"),t.k0s(),t.DNE(44,F,2,2,"mat-option",14),t.k0s()(),t.j41(45,"mat-form-field")(46,"mat-label"),t.EFF(47,"Config"),t.k0s(),t.j41(48,"input",15),t.bIt("ngModelChange",function(a){return t.eBV(o),t.Njj(n.reinitgrid("config",a))}),t.mxI("ngModelChange",function(a){return t.eBV(o),t.DH7(n.filters.config,a)||(n.filters.config=a),t.Njj(a)}),t.k0s()(),t.j41(49,"mat-form-field")(50,"mat-label"),t.EFF(51,"IP"),t.k0s(),t.j41(52,"input",15),t.bIt("ngModelChange",function(a){return t.eBV(o),t.Njj(n.reinitgrid("ip",a))}),t.mxI("ngModelChange",function(a){return t.eBV(o),t.DH7(n.filters.ip,a)||(n.filters.ip=a),t.Njj(a)}),t.k0s()()()()(),t.j41(53,"gui-grid",16)(54,"gui-grid-column",17),t.DNE(55,w,1,1,"ng-template"),t.k0s(),t.j41(56,"gui-grid-column",18),t.DNE(57,E,1,1,"ng-template"),t.k0s(),t.j41(58,"gui-grid-column",19),t.DNE(59,A,1,1,"ng-template"),t.k0s(),t.j41(60,"gui-grid-column",20),t.DNE(61,D,1,1,"ng-template"),t.k0s(),t.j41(62,"gui-grid-column",21),t.DNE(63,I,2,1,"ng-template"),t.k0s(),t.j41(64,"gui-grid-column",22),t.DNE(65,R,1,1,"ng-template"),t.k0s(),t.j41(66,"gui-grid-column",23),t.DNE(67,T,1,1,"ng-template"),t.k0s(),t.j41(68,"gui-grid-column",24),t.DNE(69,N,1,1,"ng-template"),t.k0s()()()()()()}if(2&r){const o=t.sdS(21),l=t.sdS(28);t.R7$(5),t.Y8G("lg",11),t.R7$(2),t.Y8G("lg",1),t.R7$(6),t.Y8G("visible",n.filters_visible),t.R7$(),t.Y8G("lg",12),t.R7$(4),t.Y8G("matDatepicker",o),t.R50("ngModel",n.filters.start_time),t.R7$(),t.Y8G("for",o),t.R7$(6),t.Y8G("matDatepicker",l),t.R50("ngModel",n.filters.end_time),t.R7$(),t.Y8G("for",l),t.R7$(6),t.R50("ngModel",n.filters.section),t.R7$(4),t.Y8G("ngForOf",n.event_section),t.R7$(4),t.R50("ngModel",n.filters.action),t.R7$(4),t.Y8G("ngForOf",n.event_action),t.R7$(4),t.R50("ngModel",n.filters.config),t.R7$(4),t.R50("ngModel",n.filters.ip),t.R7$(),t.Y8G("rowDetail",n.rowDetail)("source",n.source)("columnMenu",n.columnMenu)("paging",n.paging)("sorting",n.sorting)("infoPanel",n.infoPanel)("autoResizeWidth",!0),t.R7$(15),t.Y8G("enabled",!1)}},dependencies:[c.iby,c.qHy,c.lMi,b.Sq,c.gLf,c.oMR,h.me,h.BC,h.vS,c._fv,p.V1,p.fz,c.DcD,f.rl,f.nJ,f.yw,x.fg,u.Vh,u.bZ,u.bU,C.VO,y.wT],styles:[":host .legend small{font-size:x-small}.gui-drawer-content{background-color:#efefef!important}.log-detail{padding:30px 10px;box-sizing:border-box}.log-detail h1{font-size:2em;font-weight:700;margin:0;padding:0}.log-detail small{position:relative;top:-7px;padding:0;font-weight:700;font-size:1.1em}.log-detail table{width:100%;border-collapse:collapse!important;margin:0;padding:0;background-color:#fff!important}.log-detail th{text-align:left}.log-detail th,.log-detail td{border:1px solid #dfdfdf!important;padding:1rem!important}.gui-row-detail>div{height:100%}.gui-row-detail .log-detail{height:100%}.gui-structure{min-height:550px}.log-detail code{padding:5px!important;display:block;background:#1d1f21;color:#c5c8c6;border-bottom-left-radius:3px;border-bottom-right-radius:3px;width:100%}.log-detail .code-title{background-color:#393e42!important;width:100%;padding:2px 15px;display:inline-block;margin-top:10px;color:#d2d2d2;border-top-left-radius:3px;border-top-right-radius:3px;font-weight:700}.example-form{--mat-form-field-container-height: 36px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-filled-with-label-container-padding-top: 6px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-select-arrow-transform: none;--mdc-checkbox-state-layer-size: 28px;--mat-checkbox-touch-target-display: none;--mdc-switch-state-layer-size: 28px;--mdc-radio-state-layer-size: 28px;--mat-radio-touch-target-display: none;--mdc-list-list-item-one-line-container-height: 24px;--mdc-list-list-item-two-line-container-height: 48px;--mdc-list-list-item-three-line-container-height: 56px;--mat-list-list-item-leading-icon-start-space: 16px;--mat-list-list-item-leading-icon-end-space: 32px;--mat-paginator-container-size: 40px;--mat-paginator-form-field-container-height: 36px;--mat-paginator-form-field-container-vertical-padding: 6px;--mdc-text-button-container-height: 24px;--mdc-filled-button-container-height: 24px;--mdc-outlined-button-container-height: 24px;--mdc-protected-button-container-height: 24px;--mat-text-button-touch-target-display: none;--mat-filled-button-touch-target-display: none;--mat-protected-button-touch-target-display: none;--mat-outlined-button-touch-target-display: none;--mat-fab-touch-target-display: none;--mat-fab-small-touch-target-display: none;--mat-table-header-container-height: 40px;--mat-table-footer-container-height: 36px;--mat-table-row-item-container-height: 36px;--mat-expansion-header-collapsed-state-height: 36px;--mat-expansion-header-expanded-state-height: 48px;--mat-stepper-header-height: 42px;--mat-toolbar-standard-height: 52px;--mat-toolbar-mobile-height: 44px;--mat-tree-node-min-height: 28px;--mat-standard-button-toggle-height: 24px;--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls{--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 40px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:8px}.example-form .mat-mdc-chip.mat-mdc-standard-chip{--mdc-chip-container-height: 24px}.example-form .mdc-list-item__start,.example-form .mdc-list-item__end{--mdc-radio-state-layer-size: 28px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-one-line{height:40px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines{height:56px}.example-form .mat-mdc-tab-header{--mdc-secondary-navigation-tab-container-height: 32px}.example-form .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 28px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:2px}.example-form .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-floating-label{display:inline}.example-form mat-form-field *{font-size:13px!important}.example-form .mat-mdc-form-field-infix{width:150px}\n"],encapsulation:2})}return i})(),data:{title:$localize`Accounting Logs`}}];let z=(()=>{class i{static#t=this.\u0275fac=function(r){return new(r||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[g.iI.forChild(S),g.iI]})}return i})(),G=(()=>{class i{static#t=this.\u0275fac=function(r){return new(r||i)};static#e=this.\u0275mod=t.$C({type:i});static#i=this.\u0275inj=t.G2t({imports:[z,c.Dw2,b.MD,c.pc9,h.YN,c.tmq,c.tHK,c.tmq,p.uM,c.G95,f.RG,x.fS,u.X6,C.Ve]})}return i})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/631.bd7178888196a3c5.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[631],{9631:(L,M,a)=>{a.d(M,{Oh:()=>x,fg:()=>I,fS:()=>T});var h=a(4085),d=a(6860),s=a(4438),b=a(983),v=a(1413);const y=(0,d.BQ)({passive:!0});let w=(()=>{class n{constructor(e,t){this._platform=e,this._ngZone=t,this._monitoredElements=new Map}monitor(e){if(!this._platform.isBrowser)return b.w;const t=(0,h.i8)(e),i=this._monitoredElements.get(t);if(i)return i.subject;const r=new v.B,o="cdk-text-field-autofilled",u=l=>{"cdk-text-field-autofill-start"!==l.animationName||t.classList.contains(o)?"cdk-text-field-autofill-end"===l.animationName&&t.classList.contains(o)&&(t.classList.remove(o),this._ngZone.run(()=>r.next({target:l.target,isAutofilled:!1}))):(t.classList.add(o),this._ngZone.run(()=>r.next({target:l.target,isAutofilled:!0})))};return this._ngZone.runOutsideAngular(()=>{t.addEventListener("animationstart",u,y),t.classList.add("cdk-text-field-autofill-monitored")}),this._monitoredElements.set(t,{subject:r,unlisten:()=>{t.removeEventListener("animationstart",u,y)}}),r}stopMonitoring(e){const t=(0,h.i8)(e),i=this._monitoredElements.get(t);i&&(i.unlisten(),i.subject.complete(),t.classList.remove("cdk-text-field-autofill-monitored"),t.classList.remove("cdk-text-field-autofilled"),this._monitoredElements.delete(t))}ngOnDestroy(){this._monitoredElements.forEach((e,t)=>this.stopMonitoring(t))}static#e=this.\u0275fac=function(t){return new(t||n)(s.KVO(d.OD),s.KVO(s.SKi))};static#t=this.\u0275prov=s.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),A=(()=>{class n{static#e=this.\u0275fac=function(t){return new(t||n)};static#t=this.\u0275mod=s.$C({type:n});static#i=this.\u0275inj=s.G2t({})}return n})();var m=a(9417),f=a(6600),_=a(6467);const x=new s.nKC("MAT_INPUT_VALUE_ACCESSOR"),H=["button","checkbox","file","hidden","image","radio","range","reset","submit"];let R=0,I=(()=>{class n{get disabled(){return this._disabled}set disabled(e){this._disabled=(0,h.he)(e),this.focused&&(this.focused=!1,this.stateChanges.next())}get id(){return this._id}set id(e){this._id=e||this._uid}get required(){return this._required??this.ngControl?.control?.hasValidator(m.k0.required)??!1}set required(e){this._required=(0,h.he)(e)}get type(){return this._type}set type(e){this._type=e||"text",this._validateType(),!this._isTextarea&&(0,d.MU)().has(this._type)&&(this._elementRef.nativeElement.type=this._type)}get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}get value(){return this._inputValueAccessor.value}set value(e){e!==this.value&&(this._inputValueAccessor.value=e,this.stateChanges.next())}get readonly(){return this._readonly}set readonly(e){this._readonly=(0,h.he)(e)}get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}constructor(e,t,i,r,o,u,l,S,F,E){this._elementRef=e,this._platform=t,this.ngControl=i,this._autofillMonitor=S,this._formField=E,this._uid="mat-input-"+R++,this.focused=!1,this.stateChanges=new v.B,this.controlType="mat-input",this.autofilled=!1,this._disabled=!1,this._type="text",this._readonly=!1,this._neverEmptyInputTypes=["date","datetime","datetime-local","month","time","week"].filter(g=>(0,d.MU)().has(g)),this._iOSKeyupListener=g=>{const c=g.target;!c.value&&0===c.selectionStart&&0===c.selectionEnd&&(c.setSelectionRange(1,1),c.setSelectionRange(0,0))};const p=this._elementRef.nativeElement,C=p.nodeName.toLowerCase();this._inputValueAccessor=l||p,this._previousNativeValue=this.value,this.id=this.id,t.IOS&&F.runOutsideAngular(()=>{e.nativeElement.addEventListener("keyup",this._iOSKeyupListener)}),this._errorStateTracker=new f.X0(u,i,o,r,this.stateChanges),this._isServer=!this._platform.isBrowser,this._isNativeSelect="select"===C,this._isTextarea="textarea"===C,this._isInFormField=!!E,this._isNativeSelect&&(this.controlType=p.multiple?"mat-native-select-multiple":"mat-native-select")}ngAfterViewInit(){this._platform.isBrowser&&this._autofillMonitor.monitor(this._elementRef.nativeElement).subscribe(e=>{this.autofilled=e.isAutofilled,this.stateChanges.next()})}ngOnChanges(){this.stateChanges.next()}ngOnDestroy(){this.stateChanges.complete(),this._platform.isBrowser&&this._autofillMonitor.stopMonitoring(this._elementRef.nativeElement),this._platform.IOS&&this._elementRef.nativeElement.removeEventListener("keyup",this._iOSKeyupListener)}ngDoCheck(){this.ngControl&&(this.updateErrorState(),null!==this.ngControl.disabled&&this.ngControl.disabled!==this.disabled&&(this.disabled=this.ngControl.disabled,this.stateChanges.next())),this._dirtyCheckNativeValue(),this._dirtyCheckPlaceholder()}focus(e){this._elementRef.nativeElement.focus(e)}updateErrorState(){this._errorStateTracker.updateErrorState()}_focusChanged(e){e!==this.focused&&(this.focused=e,this.stateChanges.next())}_onInput(){}_dirtyCheckNativeValue(){const e=this._elementRef.nativeElement.value;this._previousNativeValue!==e&&(this._previousNativeValue=e,this.stateChanges.next())}_dirtyCheckPlaceholder(){const e=this._getPlaceholder();if(e!==this._previousPlaceholder){const t=this._elementRef.nativeElement;this._previousPlaceholder=e,e?t.setAttribute("placeholder",e):t.removeAttribute("placeholder")}}_getPlaceholder(){return this.placeholder||null}_validateType(){H.indexOf(this._type)}_isNeverEmpty(){return this._neverEmptyInputTypes.indexOf(this._type)>-1}_isBadInput(){let e=this._elementRef.nativeElement.validity;return e&&e.badInput}get empty(){return!(this._isNeverEmpty()||this._elementRef.nativeElement.value||this._isBadInput()||this.autofilled)}get shouldLabelFloat(){if(this._isNativeSelect){const e=this._elementRef.nativeElement,t=e.options[0];return this.focused||e.multiple||!this.empty||!!(e.selectedIndex>-1&&t&&t.label)}return this.focused||!this.empty}setDescribedByIds(e){e.length?this._elementRef.nativeElement.setAttribute("aria-describedby",e.join(" ")):this._elementRef.nativeElement.removeAttribute("aria-describedby")}onContainerClick(){this.focused||this.focus()}_isInlineSelect(){const e=this._elementRef.nativeElement;return this._isNativeSelect&&(e.multiple||e.size>1)}static#e=this.\u0275fac=function(t){return new(t||n)(s.rXU(s.aKT),s.rXU(d.OD),s.rXU(m.vO,10),s.rXU(m.cV,8),s.rXU(m.j4,8),s.rXU(f.es),s.rXU(x,10),s.rXU(w),s.rXU(s.SKi),s.rXU(_.xb,8))};static#t=this.\u0275dir=s.FsC({type:n,selectors:[["input","matInput",""],["textarea","matInput",""],["select","matNativeControl",""],["input","matNativeControl",""],["textarea","matNativeControl",""]],hostAttrs:[1,"mat-mdc-input-element"],hostVars:18,hostBindings:function(t,i){1&t&&s.bIt("focus",function(){return i._focusChanged(!0)})("blur",function(){return i._focusChanged(!1)})("input",function(){return i._onInput()}),2&t&&(s.Mr5("id",i.id)("disabled",i.disabled)("required",i.required),s.BMQ("name",i.name||null)("readonly",i.readonly&&!i._isNativeSelect||null)("aria-invalid",i.empty&&i.required?null:i.errorState)("aria-required",i.required)("id",i.id),s.AVh("mat-input-server",i._isServer)("mat-mdc-form-field-textarea-control",i._isInFormField&&i._isTextarea)("mat-mdc-form-field-input-control",i._isInFormField)("mdc-text-field__input",i._isInFormField)("mat-mdc-native-select-inline",i._isInlineSelect()))},inputs:{disabled:"disabled",id:"id",placeholder:"placeholder",name:"name",required:"required",type:"type",errorStateMatcher:"errorStateMatcher",userAriaDescribedBy:[s.Mj6.None,"aria-describedby","userAriaDescribedBy"],value:"value",readonly:"readonly"},exportAs:["matInput"],standalone:!0,features:[s.Jv_([{provide:_.qT,useExisting:n}]),s.OA$]})}return n})(),T=(()=>{class n{static#e=this.\u0275fac=function(t){return new(t||n)};static#t=this.\u0275mod=s.$C({type:n});static#i=this.\u0275inj=s.G2t({imports:[f.yE,_.RG,_.RG,A,f.yE]})}return n})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/633.7075e3558e175ba4.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[633],{8633:(q,v,m)=>{m.r(v),m.d(v,{DevLogsModule:()=>Q});var _=m(177),g=m(9417),c=m(8921),x=m(4983),f=m(7062),p=m(7390),b=m(9130),y=m(6977),F=m(1413),e=m(4438),k=m(9492),j=m(1170),C=m(9631),u=m(6467),D=m(4869),w=m(6600),h=m(5084);const E=()=>["Critical","Warning","Error","info"];function M(t,l){if(1&t&&(e.j41(0,"mat-option",17),e.EFF(1),e.k0s()),2&t){const i=l.$implicit;e.Y8G("value",i),e.R7$(),e.SpI(" ",i," ")}}function R(t,l){if(1&t){const i=e.RV6();e.j41(0,"mat-form-field")(1,"mat-label"),e.EFF(2,"Select event type"),e.k0s(),e.j41(3,"mat-select",28,2),e.bIt("ngModelChange",function(n){e.eBV(i);const o=e.XpG();return e.Njj(o.reinitgrid("detail",n))}),e.mxI("ngModelChange",function(n){e.eBV(i);const o=e.XpG();return e.DH7(o.filters.detail,n)||(o.filters.detail=n),e.Njj(n)}),e.j41(5,"mat-option"),e.nrm(6,"ngx-mat-select-search",29),e.k0s(),e.DNE(7,M,2,2,"mat-option",15),e.k0s()()}if(2&t){const i=e.XpG();e.R7$(3),e.Y8G("multiple",!0),e.R50("ngModel",i.filters.detail),e.R7$(3),e.Y8G("showToggleAllCheckbox",!0)("formControl",i.bankMultiFilterCtrl),e.R7$(),e.Y8G("ngForOf",i.event_types_filtered)}}function L(t,l){if(1&t&&(e.j41(0,"mat-option",17),e.EFF(1),e.k0s()),2&t){const i=l.$implicit;e.Y8G("value",i),e.R7$(),e.SpI(" ",i," ")}}function I(t,l){1&t&&e.EFF(0),2&t&&e.SpI(" ",l.item.index," ")}function T(t,l){if(1&t&&(e.j41(0,"c-badge",33),e.EFF(1),e.k0s()),2&t){const i=e.XpG().item.level;e.R7$(),e.JRh(i)}}function G(t,l){if(1&t&&(e.j41(0,"c-badge",34),e.EFF(1),e.k0s()),2&t){const i=e.XpG().item.level;e.R7$(),e.JRh(i)}}function N(t,l){if(1&t&&(e.j41(0,"c-badge",34),e.EFF(1),e.k0s()),2&t){const i=e.XpG().item.level;e.R7$(),e.JRh(i)}}function z(t,l){if(1&t&&(e.j41(0,"c-badge",35),e.EFF(1),e.k0s()),2&t){const i=e.XpG().item.level;e.R7$(),e.JRh(i)}}function $(t,l){if(1&t&&e.DNE(0,T,2,1,"c-badge",30)(1,G,2,1,"c-badge",31)(2,N,2,1,"c-badge",31)(3,z,2,1,"c-badge",32),2&t){const i=l.item.level;e.Y8G("ngIf","Critical"==i),e.R7$(),e.Y8G("ngIf","Error"==i),e.R7$(),e.Y8G("ngIf","Warning"==i),e.R7$(),e.Y8G("ngIf","info"==i)}}function S(t,l){1&t&&e.EFF(0),2&t&&e.SpI(" ",l.item.detail," ")}function Y(t,l){if(1&t&&(e.j41(0,"div",36),e.EFF(1),e.k0s()),2&t){const i=l.item.comment;e.R7$(),e.SpI(" ",i," ")}}function X(t,l){1&t&&e.EFF(0),2&t&&e.SpI(" ",l.item.src," ")}function V(t,l){1&t&&(e.j41(0,"c-badge",38),e.EFF(1,"Fixed"),e.k0s())}function B(t,l){1&t&&(e.j41(0,"c-badge",33),e.EFF(1,"Not Fixed"),e.k0s())}function H(t,l){if(1&t&&e.DNE(0,V,2,0,"c-badge",37)(1,B,2,0,"c-badge",30),2&t){const i=l.item.status;e.Y8G("ngIf",1==i),e.R7$(),e.Y8G("ngIf",1!=i)}}function U(t,l){1&t&&(e.j41(0,"c-badge",43),e.EFF(1,"Event"),e.k0s())}function A(t,l){1&t&&(e.j41(0,"c-badge",44),e.EFF(1,"Fixed"),e.k0s())}function J(t,l){if(1&t&&(e.j41(0,"div",40)(1,"span"),e.DNE(2,U,2,0,"c-badge",41),e.EFF(3),e.k0s(),e.j41(4,"span"),e.DNE(5,A,2,0,"c-badge",42),e.EFF(6),e.k0s()()),2&t){const i=e.XpG(),r=i.item.eventtime,n=i.item;e.R7$(2),e.Y8G("ngIf",1==n.status),e.R7$(),e.SpI(" ",r,""),e.R7$(2),e.Y8G("ngIf",1==n.status),e.R7$(),e.SpI(" ",n.fixtime,"")}}function O(t,l){if(1&t&&(e.j41(0,"div"),e.EFF(1),e.k0s()),2&t){const i=e.XpG().item.eventtime;e.R7$(),e.SpI(" ",i,"")}}function P(t,l){if(1&t&&e.DNE(0,J,7,4,"div",39)(1,O,2,1,"div",12),2&t){const i=l.item;e.Y8G("ngIf",i.fixtime),e.R7$(),e.Y8G("ngIf",!i.fixtime)}}function W(t,l){if(1&t&&(e.j41(0,"div",36)(1,"span",45),e.EFF(2),e.k0s(),e.j41(3,"span",46),e.EFF(4),e.k0s()()),2&t){const i=l.item.name,r=l.item;e.R7$(2),e.JRh(i),e.R7$(2),e.JRh(r.devip)}}const Z=[{path:"",component:(()=>{class t{constructor(i,r,n,o){this.data_provider=i,this.router=r,this.route=n,this.login_checker=o,this.tz="UTC",this.filters={start_time:!1,end_time:!1,detail:[],level:!1,comment:"",status:"all"},this.event_types=[],this.event_types_filtered=[],this.filters_visible=!1,this.source=[],this.columns=[],this.loading=!0,this.rows=[],this.devid=0,this.sorting={enabled:!0,multiSorting:!0},this.bankMultiFilterCtrl=new g.MJ(""),this._onDestroy=new F.B,this.rowDetail={enabled:!0,template:s=>`\n\t\t\t
\n\t\t\t

Device :

\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
Device Name${s.name}
Device IP${s.devip}
Device MAC${s.mac}
\n\t\t\t\t

Alert Detail :\n\t\t\t\t\n\t\t\t\t

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t
Event${s.detail}
Event Status${s.status?"Fixed":"Not Fixed"}
Event Category${s.eventtype}
Exec time${s.eventtime}
Detail${s.comment}
Source${s.src}
\n\t\t\t
`},this.paging={enabled:!0,page:1,pageSize:10,pageSizes:[5,10,25,50],display:p.sE.ADVANCED},this.columnMenu={enabled:!0,sort:!0,columnsManager:!0},this.infoPanel={enabled:!0,infoDialog:!1,columnsManager:!0,schemaManager:!0},this.rowSelection={enabled:!0,type:p.AU.CHECKBOX,mode:p.fL.MULTIPLE};var d=this;this.login_checker.isLoggedIn()||setTimeout(function(){d.router.navigate(["login"])},100),this.data_provider.getSessionInfo().then(s=>{d.uid=s.uid,d.uname=s.name,d.tz=s.tz,"admin"!=s.role&&setTimeout(function(){d.router.navigate(["/user/dashboard"])},100)})}ngOnInit(){var i=this;this.devid=Number(this.route.snapshot.paramMap.get("devid")),this.devid>0&&(this.filters.devid=this.devid),this.initGridTable(),this.bankMultiFilterCtrl.valueChanges.pipe((0,y.Q)(this._onDestroy)).subscribe(()=>{let r=this.bankMultiFilterCtrl.value;r||(this.event_types_filtered=this.event_types),i.event_types_filtered=i.event_types_filtered.filter(n=>n.toLowerCase().indexOf(r.toLowerCase())>-1),console.dir(i.event_types_filtered)})}toggleCollapse(){this.filters_visible=!this.filters_visible}logger(i){console.dir(i)}reinitgrid(i,r){"start"==i?this.filters.start_time=r.target.value:"end"==i?this.filters.end_time=r.target.value:"detail"==i?this.filters.detail=r:"level"==i?this.filters.level=r:"comment"==i?this.filters.comment=r:"status"==i&&(this.filters.status=r),this.initGridTable()}initGridTable(){var i=this;this.data_provider.get_dev_logs(this.filters).then(r=>{let n=1;this.source=r.map(o=>(o.index=n,o.detail.indexOf("Link Down")>=0?o.detail="Link Down":o.detail.indexOf("Link Up")>=0&&(o.detail="Link Up"),i.event_types.includes(o.detail)||i.event_types.push(o.detail),o.eventtime=(0,b.qD)(o.eventtime.split(".")[0]+".000Z",i.tz,"yyyy-MM-dd HH:mm:ss XXX"),o.fixtime&&(o.fixtime=(0,b.qD)(o.fixtime.split(".")[0]+".000Z",i.tz,"yyyy-MM-dd HH:mm:ss XXX")),n+=1,o)),i.event_types_filtered=i.event_types,console.dir(this.source),this.loading=!1})}static#e=this.\u0275fac=function(r){return new(r||t)(e.rXU(k.C),e.rXU(f.Ix),e.rXU(f.nX),e.rXU(j.T))};static#t=this.\u0275cmp=e.VBU({type:t,selectors:[["ng-component"]],decls:70,vars:27,consts:[["picker1",""],["picker2",""],["multiSelect",""],["xs",""],[1,"mb-4"],["xs","",3,"lg"],["cButton","","color","primary",1,"me-1",3,"click"],[1,"fa-solid","fa-filter","mr-1"],["cCollapse","",3,"visible"],["xs","",1,"example-form",3,"lg"],["matInput","",3,"dateChange","ngModelChange","matDatepicker","ngModel"],["matIconSuffix","",3,"for"],[4,"ngIf"],["placeholder","Event Level",3,"ngModelChange","ngModel"],["value","All"],[3,"value",4,"ngFor","ngForOf"],["placeholder","Event Status",3,"ngModelChange","ngModel"],[3,"value"],["matInput","",3,"ngModelChange","ngModel"],["wid","",3,"rowDetail","horizontalGrid","rowHeight","source","columnMenu","paging","sorting","infoPanel","autoResizeWidth"],["header","#No","type","NUMBER","field","index","width","1","align","CENTER"],["header","level","width","90","wid","","field","level"],["header","Event","width","200","field","detail"],["header","Detail","field","comment"],["header","Source","width","90","field","src"],["header","status","width","100","field","status","align","CENTER"],["header","eventtime","width","220","field","eventtime"],["header","Device","width","200","field","name"],["placeholder","Event Type",3,"ngModelChange","multiple","ngModel"],["placeholderLabel","Find type...",3,"showToggleAllCheckbox","formControl"],["style","cursor: pointer; font-weight: normal","color","danger",4,"ngIf"],["style","cursor: pointer; font-weight: normal","color","warning",4,"ngIf"],["style","cursor: pointer; font-weight: normal; min-width: 60px;","color","info",4,"ngIf"],["color","danger",2,"cursor","pointer","font-weight","normal"],["color","warning",2,"cursor","pointer","font-weight","normal"],["color","info",2,"cursor","pointer","font-weight","normal","min-width","60px"],[1,"gui-dev-info"],["style"," cursor: pointer; font-weight: normal","color","success",4,"ngIf"],["color","success",2,"cursor","pointer","font-weight","normal"],["class","fixed_time",4,"ngIf"],[1,"fixed_time"],["color","danger","style","font-size: 0.65em!important;padding: 3px 5px;","size","sm","shape","rounded-pill",4,"ngIf"],["color","success","style","font-size: 0.65em!important;padding: 3px 5px;","size","sm","shape","rounded-pill",4,"ngIf"],["color","danger","size","sm","shape","rounded-pill",2,"font-size","0.65em!important","padding","3px 5px"],["color","success","size","sm","shape","rounded-pill",2,"font-size","0.65em!important","padding","3px 5px"],[1,"gui-dev-info-name"],[1,"gui-dev-info-ip"]],template:function(r,n){if(1&r){const o=e.RV6();e.j41(0,"c-row")(1,"c-col",3)(2,"c-card",4)(3,"c-card-header")(4,"c-row")(5,"c-col",5),e.EFF(6," Device LOGS "),e.k0s(),e.j41(7,"c-col",5)(8,"button",6),e.bIt("click",function(){return e.eBV(o),e.Njj(n.toggleCollapse())}),e.nrm(9,"i",7),e.EFF(10,"Filter"),e.k0s()()()(),e.j41(11,"c-card-body")(12,"c-row")(13,"div",8)(14,"c-col",9)(15,"mat-form-field")(16,"mat-label"),e.EFF(17,"Start date"),e.k0s(),e.j41(18,"input",10),e.bIt("dateChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("start",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.start_time,a)||(n.filters.start_time=a),e.Njj(a)}),e.k0s(),e.nrm(19,"mat-datepicker-toggle",11)(20,"mat-datepicker",null,0),e.k0s(),e.j41(22,"mat-form-field")(23,"mat-label"),e.EFF(24,"End date"),e.k0s(),e.j41(25,"input",10),e.bIt("dateChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("end",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.end_time,a)||(n.filters.end_time=a),e.Njj(a)}),e.k0s(),e.nrm(26,"mat-datepicker-toggle",11)(27,"mat-datepicker",null,1),e.k0s(),e.DNE(29,R,8,5,"mat-form-field",12),e.j41(30,"mat-form-field")(31,"mat-label"),e.EFF(32,"Select event type"),e.k0s(),e.j41(33,"mat-select",13,2),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("level",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.level,a)||(n.filters.level=a),e.Njj(a)}),e.j41(35,"mat-option",14),e.EFF(36,"All"),e.k0s(),e.DNE(37,L,2,2,"mat-option",15),e.k0s()(),e.j41(38,"mat-form-field")(39,"mat-label"),e.EFF(40,"Status"),e.k0s(),e.j41(41,"mat-select",16,2),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("status",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.status,a)||(n.filters.status=a),e.Njj(a)}),e.j41(43,"mat-option",14),e.EFF(44,"All"),e.k0s(),e.j41(45,"mat-option",17),e.EFF(46,"Fixed"),e.k0s(),e.j41(47,"mat-option",17),e.EFF(48,"Not Fixed"),e.k0s()()(),e.j41(49,"mat-form-field")(50,"mat-label"),e.EFF(51,"Comment"),e.k0s(),e.j41(52,"input",18),e.bIt("ngModelChange",function(a){return e.eBV(o),e.Njj(n.reinitgrid("comment",a))}),e.mxI("ngModelChange",function(a){return e.eBV(o),e.DH7(n.filters.comment,a)||(n.filters.comment=a),e.Njj(a)}),e.k0s()()()()(),e.j41(53,"gui-grid",19)(54,"gui-grid-column",20),e.DNE(55,I,1,1,"ng-template"),e.k0s(),e.j41(56,"gui-grid-column",21),e.DNE(57,$,4,4,"ng-template"),e.k0s(),e.j41(58,"gui-grid-column",22),e.DNE(59,S,1,1,"ng-template"),e.k0s(),e.j41(60,"gui-grid-column",23),e.DNE(61,Y,2,1,"ng-template"),e.k0s(),e.j41(62,"gui-grid-column",24),e.DNE(63,X,1,1,"ng-template"),e.k0s(),e.j41(64,"gui-grid-column",25),e.DNE(65,H,2,2,"ng-template"),e.k0s(),e.j41(66,"gui-grid-column",26),e.DNE(67,P,2,2,"ng-template"),e.k0s(),e.j41(68,"gui-grid-column",27),e.DNE(69,W,5,2,"ng-template"),e.k0s()()()()()()}if(2&r){const o=e.sdS(21),d=e.sdS(28);e.R7$(5),e.Y8G("lg",11),e.R7$(2),e.Y8G("lg",1),e.R7$(6),e.Y8G("visible",n.filters_visible),e.R7$(),e.Y8G("lg",12),e.R7$(4),e.Y8G("matDatepicker",o),e.R50("ngModel",n.filters.start_time),e.R7$(),e.Y8G("for",o),e.R7$(6),e.Y8G("matDatepicker",d),e.R50("ngModel",n.filters.end_time),e.R7$(),e.Y8G("for",d),e.R7$(3),e.Y8G("ngIf",n.event_types_filtered.length>0),e.R7$(4),e.R50("ngModel",n.filters.level),e.R7$(4),e.Y8G("ngForOf",e.lJ4(26,E)),e.R7$(4),e.R50("ngModel",n.filters.status),e.R7$(4),e.Y8G("value",!0),e.R7$(2),e.Y8G("value",!1),e.R7$(5),e.R50("ngModel",n.filters.comment),e.R7$(),e.Y8G("rowDetail",n.rowDetail)("horizontalGrid",!0)("rowHeight",52)("source",n.source)("columnMenu",n.columnMenu)("paging",n.paging)("sorting",n.sorting)("infoPanel",n.infoPanel)("autoResizeWidth",!0)}},dependencies:[c.iby,c.qHy,c.lMi,_.Sq,_.bT,c.gLf,c.oMR,g.me,g.BC,g.l_,g.vS,c._fv,p.V1,p.fz,c.DcD,c.nSt,C.fg,u.rl,u.nJ,u.yw,D.VO,w.wT,x.U9,h.Vh,h.bZ,h.bU],styles:[":host .legend small{font-size:x-small}.log-detail{padding:30px 10px;box-sizing:border-box}.log-detail h1{font-size:2em;font-weight:700;margin:0;padding:0}.log-detail small{position:relative;top:-7px;padding:0;font-weight:700;font-size:1.1em}.log-detail table{width:100%;border-collapse:collapse!important;margin:5px 0 0;padding:0;background-color:#ffffff29!important;color:#000}.log-detail th{text-align:left}.log-detail th,.log-detail td{border:1px solid rgba(255,255,255,.2901960784)!important;padding:.5rem!important}.gui-close-icon-wrapper .gui-close-icon:after,.gui-close-icon-wrapper .gui-close-icon:before{background-color:#fff!important}.log-detail code{padding:5px!important;display:block;background:#1d1f21;color:#c5c8c6;border-bottom-left-radius:3px;border-bottom-right-radius:3px;width:100%}.log-detail .code-title{background-color:#393e42!important;width:100%;padding:2px 15px;display:inline-block;margin-top:10px;color:#d2d2d2;border-top-left-radius:3px;border-top-right-radius:3px;font-weight:700}.gui-row-detail{height:100%}.gui-dev-info{display:inline-flex;flex-direction:column;align-items:stretch;align-content:center;justify-content:center;white-space:normal;line-height:17px}.gui-dev-info-name{font-weight:700}.gui-dev-info-ip{color:#525252;font-style:italic;font-size:13px;overflow:hidden}.gui-row-detail>div{height:100%}.gui-row-detail .log-detail{height:100%}.gui-structure{min-height:550px}.fixed_time{display:flex;flex-direction:column-reverse;padding:1px 0}.example-form{--mat-form-field-container-height: 36px;--mat-form-field-filled-label-display: none;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-filled-with-label-container-padding-top: 6px;--mat-form-field-filled-with-label-container-padding-bottom: 6px;--mat-select-arrow-transform: none;--mdc-checkbox-state-layer-size: 28px;--mat-checkbox-touch-target-display: none;--mdc-switch-state-layer-size: 28px;--mdc-radio-state-layer-size: 28px;--mat-radio-touch-target-display: none;--mdc-list-list-item-one-line-container-height: 24px;--mdc-list-list-item-two-line-container-height: 48px;--mdc-list-list-item-three-line-container-height: 56px;--mat-list-list-item-leading-icon-start-space: 16px;--mat-list-list-item-leading-icon-end-space: 32px;--mat-paginator-container-size: 40px;--mat-paginator-form-field-container-height: 36px;--mat-paginator-form-field-container-vertical-padding: 6px;--mdc-text-button-container-height: 24px;--mdc-filled-button-container-height: 24px;--mdc-outlined-button-container-height: 24px;--mdc-protected-button-container-height: 24px;--mat-text-button-touch-target-display: none;--mat-filled-button-touch-target-display: none;--mat-protected-button-touch-target-display: none;--mat-outlined-button-touch-target-display: none;--mat-fab-touch-target-display: none;--mat-fab-small-touch-target-display: none;--mat-table-header-container-height: 40px;--mat-table-footer-container-height: 36px;--mat-table-row-item-container-height: 36px;--mat-expansion-header-collapsed-state-height: 36px;--mat-expansion-header-expanded-state-height: 48px;--mat-stepper-header-height: 42px;--mat-toolbar-standard-height: 52px;--mat-toolbar-mobile-height: 44px;--mat-tree-node-min-height: 28px;--mat-standard-button-toggle-height: 24px;--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls{--mat-icon-button-touch-target-display: none}.example-form .mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 40px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:8px}.example-form .mat-mdc-chip.mat-mdc-standard-chip{--mdc-chip-container-height: 24px}.example-form .mdc-list-item__start,.example-form .mdc-list-item__end{--mdc-radio-state-layer-size: 28px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-one-line,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-one-line{height:40px}.example-form .mat-mdc-list-item.mdc-list-item--with-leading-avatar.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-checkbox.mdc-list-item--with-two-lines,.example-form .mat-mdc-list-item.mdc-list-item--with-leading-icon.mdc-list-item--with-two-lines{height:56px}.example-form .mat-mdc-tab-header{--mdc-secondary-navigation-tab-container-height: 32px}.example-form .mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 28px;width:var(--mdc-icon-button-state-layer-size);height:var(--mdc-icon-button-state-layer-size);padding:2px}.example-form .mat-mdc-text-field-wrapper:not(.mdc-text-field--outlined) .mat-mdc-floating-label{display:inline}.example-form mat-form-field *{font-size:13px!important}.example-form .mat-mdc-form-field-infix{width:150px}\n"],encapsulation:2})}return t})(),data:{title:$localize`Device Logs`}}];let K=(()=>{class t{static#e=this.\u0275fac=function(r){return new(r||t)};static#t=this.\u0275mod=e.$C({type:t});static#i=this.\u0275inj=e.G2t({imports:[f.iI.forChild(Z),f.iI]})}return t})(),Q=(()=>{class t{static#e=this.\u0275fac=function(r){return new(r||t)};static#t=this.\u0275mod=e.$C({type:t});static#i=this.\u0275inj=e.G2t({imports:[K,c.Dw2,_.MD,c.pc9,g.X1,g.YN,c.tHK,c.tmq,c.ayw,p.uM,c.G95,c.EJq,C.fS,u.RG,D.Ve,x.An,h.X6]})}return t})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/650.f6cfc04317581a12.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[650],{5650:(at,g,l)=>{l.r(g),l.d(g,{DashboardModule:()=>ot});var h=l(177),p=l(9417),e=l(8921),k=l(4858),b=l(7062),C=l(9130),t=l(4438),y=l(9492),j=l(1170),v=l(3801);function R(a,n){1&a&&t.nrm(0,"i",38)}function x(a,n){1&a&&t.nrm(0,"i",39)}function T(a,n){1&a&&t.nrm(0,"i",40)}function E(a,n){1&a&&t.nrm(0,"i",41)}function D(a,n){1&a&&t.nrm(0,"i",42)}function I(a,n){if(1&a&&(t.j41(0,"c-card",2)(1,"c-card-header"),t.EFF(2,"Past 24 Hour Statics"),t.k0s(),t.j41(3,"c-card-body")(4,"c-row")(5,"c-col",24)(6,"c-row")(7,"c-col",25)(8,"c-widget-stat-f",26),t.DNE(9,R,1,0,"ng-template",27),t.k0s()(),t.j41(10,"c-col",25)(11,"c-widget-stat-f",28),t.DNE(12,x,1,0,"ng-template",27),t.k0s()(),t.j41(13,"c-col",25)(14,"c-widget-stat-f",26),t.DNE(15,T,1,0,"ng-template",27),t.k0s()(),t.j41(16,"c-col",25)(17,"c-widget-stat-f",29),t.DNE(18,E,1,0,"ng-template",27),t.k0s()(),t.j41(19,"c-col",25)(20,"c-widget-stat-f",30),t.DNE(21,D,1,0,"ng-template",27),t.k0s()()()()()(),t.j41(22,"c-card-footer",31)(23,"c-col",22)(24,"c-row")(25,"c-col",24)(26,"c-row")(27,"c-col",32)(28,"div",33)(29,"div",34),t.EFF(30,"Total users"),t.k0s(),t.j41(31,"div",35),t.EFF(32),t.k0s()()(),t.j41(33,"c-col",32)(34,"div",36)(35,"div",34),t.EFF(36,"Total Devices"),t.k0s(),t.j41(37,"div",35),t.EFF(38),t.k0s()()(),t.j41(39,"c-col",32)(40,"div",37)(41,"div",34),t.EFF(42,"Total Events"),t.k0s(),t.j41(43,"div",35),t.EFF(44),t.k0s()()(),t.j41(45,"c-col",32)(46,"div",37)(47,"div",34),t.EFF(48,"Total Auth Logs"),t.k0s(),t.j41(49,"div",35),t.EFF(50),t.k0s()()(),t.j41(51,"c-col",32)(52,"div",37)(53,"div",34),t.EFF(54,"Total Acc Logs"),t.k0s(),t.j41(55,"div",35),t.EFF(56),t.k0s()()()()()()()()()),2&a){const o=t.XpG(2);t.R7$(8),t.FS9("value",o.stats.FailedLogins),t.Y8G("title","Failed Logins"),t.R7$(3),t.FS9("value",o.stats.SuccessfulLogins),t.Y8G("title","Success Logins"),t.R7$(3),t.FS9("value",o.stats.Critical),t.Y8G("title","Critical Events"),t.R7$(3),t.FS9("value",o.stats.Warning),t.Y8G("title","Warning Events"),t.R7$(3),t.FS9("value",o.stats.Info),t.Y8G("title","Info Events"),t.R7$(12),t.JRh(o.stats.Users),t.R7$(6),t.JRh(o.stats.Devices),t.R7$(6),t.JRh(o.stats.Events),t.R7$(6),t.JRh(o.stats.Auth),t.R7$(6),t.JRh(o.stats.Acc)}}function G(a,n){if(1&a&&(t.j41(0,"c-row")(1,"c-col",22),t.DNE(2,I,57,15,"c-card",23),t.k0s()()),2&a){const o=t.XpG();t.R7$(2),t.Y8G("ngIf",o.stats)}}function $(a,n){1&a&&(t.j41(0,"span",53),t.nrm(1,"i",54),t.EFF(2,"Copy"),t.k0s())}function M(a,n){if(1&a){const o=t.RV6();t.j41(0,"div",44)(1,"div",47)(2,"code",48),t.EFF(3,"Serial:"),t.k0s(),t.j41(4,"small",49),t.bIt("click",function(){t.eBV(o);const i=t.XpG(2);return t.Njj(i.copy_this())}),t.EFF(5),t.k0s(),t.DNE(6,$,3,0,"span",50),t.k0s(),t.j41(7,"c-badge",51),t.EFF(8,"Not Registred"),t.k0s(),t.j41(9,"a",52),t.EFF(10,"Learn how to register and get automatic updates!"),t.k0s()()}if(2&a){const o=t.XpG(2);t.R7$(4),t.Y8G("cdkCopyToClipboard",o.stats.serial),t.R7$(),t.JRh(o.stats.serial),t.R7$(),t.Y8G("ngIf",o.copy_msg)}}function w(a,n){1&a&&(t.j41(0,"div",44)(1,"c-badge",55),t.EFF(2,"Unable connect to server/Check server internet connection"),t.k0s()())}function Y(a,n){1&a&&(t.j41(0,"span",60),t.nrm(1,"i",54),t.EFF(2,"Copy"),t.k0s())}function N(a,n){1&a&&(t.j41(0,"c-badge",61),t.EFF(1,"Manual update"),t.k0s())}function B(a,n){1&a&&(t.j41(0,"c-badge",61),t.EFF(1,"Auto update"),t.k0s())}function V(a,n){if(1&a){const o=t.RV6();t.j41(0,"div",44)(1,"div",47)(2,"code",48),t.EFF(3,"Serial:"),t.k0s(),t.j41(4,"small",49),t.bIt("click",function(){t.eBV(o);const i=t.XpG(2);return t.Njj(i.copy_this())}),t.EFF(5),t.k0s(),t.DNE(6,Y,3,0,"span",56),t.k0s(),t.j41(7,"c-badge",57),t.EFF(8,"Registred"),t.k0s(),t.j41(9,"c-badge",58),t.EFF(10),t.k0s(),t.DNE(11,N,2,0,"c-badge",59)(12,B,2,0,"c-badge",59),t.k0s()}if(2&a){const o=t.XpG(2);t.R7$(4),t.Y8G("cdkCopyToClipboard",o.stats.serial),t.R7$(),t.JRh(o.stats.serial),t.R7$(),t.Y8G("ngIf",o.copy_msg),t.R7$(4),t.SpI("License Type : ",o.stats.license,""),t.R7$(),t.Y8G("ngIf","auto"!=o.stats.update_mode),t.R7$(),t.Y8G("ngIf","auto"==o.stats.update_mode)}}function S(a,n){1&a&&t.nrm(0,"i",68)}function z(a,n){if(1&a){const o=t.RV6();t.j41(0,"button",69),t.bIt("click",function(){t.eBV(o);const i=t.XpG(3);return t.Njj(i.showConfirmModal("update_mikroman"))}),t.nrm(1,"i",70),t.EFF(2," Update availble "),t.k0s()}}function L(a,n){1&a&&t.nrm(0,"i",68)}function X(a,n){if(1&a){const o=t.RV6();t.j41(0,"button",69),t.bIt("click",function(){t.eBV(o);const i=t.XpG(3);return t.Njj(i.showConfirmModal("update_mikrofront"))}),t.nrm(1,"i",70),t.EFF(2," Update availble "),t.k0s()}}function U(a,n){if(1&a&&(t.j41(0,"div",44)(1,"span",62)(2,"c-badge",63),t.EFF(3),t.k0s(),t.DNE(4,S,1,0,"i",64)(5,z,3,0,"button",65),t.k0s(),t.j41(6,"span",66)(7,"c-badge",67),t.EFF(8),t.k0s(),t.DNE(9,L,1,0,"i",64)(10,X,3,0,"button",65),t.k0s()()),2&a){const o=t.XpG(2);t.R7$(2),t.Y8G("color",o.stats.update_available?"success":"secondary"),t.R7$(),t.SpI("Your Mikroman version : ",o.stats.version," "),t.R7$(),t.Y8G("ngIf",o.stats.update_inprogress),t.R7$(),t.Y8G("ngIf","auto"!=o.stats.update_mode&&o.stats.update_available&&!o.stats.update_inprogress),t.R7$(2),t.Y8G("color",o.stats.front_update_available?"success":"secondary"),t.R7$(),t.SpI("Your Mikrofront version : ",o.front_version," "),t.R7$(),t.Y8G("ngIf",o.stats.front_update_inprogress),t.R7$(),t.Y8G("ngIf","auto"!=o.stats.update_mode&&o.stats.front_update_available&&!o.stats.front_update_inprogress)}}function A(a,n){if(1&a&&(t.j41(0,"c-col",15)(1,"c-card",43)(2,"div",44)(3,"h4",45),t.EFF(4,"Version and Serial information"),t.k0s()(),t.DNE(5,M,11,3,"div",46)(6,w,3,0,"div",46)(7,V,13,6,"div",46)(8,U,11,8,"div",46),t.k0s()()),2&a){const o=t.XpG();t.R7$(5),t.Y8G("ngIf",!o.stats.license),t.R7$(),t.Y8G("ngIf","connection_error"==o.stats.license),t.R7$(),t.Y8G("ngIf","connection_error"!=o.stats.license),t.R7$(),t.Y8G("ngIf","connection_error"!=o.stats.license)}}function J(a,n){if(1&a&&(t.j41(0,"c-carousel-item",76),t.nrm(1,"img",77),t.j41(2,"div",78)(3,"h5"),t.EFF(4),t.k0s(),t.nrm(5,"p",79),t.k0s()()),2&a){const o=n.$implicit;t.R7$(),t.FS9("alt",o.title),t.Y8G("src",o.media_content,t.B4B),t.R7$(3),t.JRh(o.title),t.R7$(),t.Y8G("innerHTML",o.summery,t.npT)}}function H(a,n){if(1&a&&(t.j41(0,"c-card",71)(1,"c-carousel",72),t.nrm(2,"c-carousel-indicators"),t.j41(3,"c-carousel-inner"),t.DNE(4,J,6,4,"c-carousel-item",73),t.k0s(),t.nrm(5,"c-carousel-control",74)(6,"c-carousel-control",75),t.k0s()()),2&a){const o=t.XpG();t.R7$(),t.Y8G("dark",!0)("animate",!1)("wrap",!1)("interval",1e6),t.R7$(3),t.Y8G("ngForOf",o.stats.blog)}}function P(a,n){1&a&&(t.j41(0,"h5",80),t.EFF(1,"Please Confirm Mikroman Update"),t.k0s())}function W(a,n){1&a&&(t.j41(0,"h5",80),t.EFF(1,"Please Confirm MikroFront Update"),t.k0s())}function K(a,n){if(1&a&&(t.j41(0,"div")(1,"p"),t.EFF(2,"Are you sure you want to apply latest Mikroman Update "),t.j41(3,"code",81)(4,"b"),t.EFF(5),t.k0s()(),t.EFF(6,"?"),t.k0s(),t.j41(7,"p"),t.EFF(8,"By updating Mikroman the MikroFront update is also get checked and applyed"),t.k0s(),t.j41(9,"p"),t.EFF(10,"If you made any special changes to configuration files or python files it will be removed automaticlaly"),t.k0s()()),2&a){const o=t.XpG();t.R7$(5),t.SpI(" ver ",o.stats.latest_version,"")}}function O(a,n){1&a&&(t.j41(0,"div")(1,"code",48),t.EFF(2,"Applying the update will cause reload of the server couple of times"),t.k0s()())}function Q(a,n){if(1&a&&(t.j41(0,"div")(1,"p"),t.EFF(2,"Are you sure you want to apply latest MikroFront Update "),t.j41(3,"code",81)(4,"b"),t.EFF(5),t.k0s()(),t.EFF(6,"?"),t.k0s()()),2&a){const o=t.XpG();t.R7$(5),t.SpI(" ver ",o.stats.front_latest_version,"")}}function Z(a,n){1&a&&(t.j41(0,"div")(1,"code",48),t.EFF(2,"Applying the update will cause reload of the page,"),t.nrm(3,"br"),t.EFF(4," Also please make sure you have the latest Mikroman before updating MikroFront. Updating to latest MikroFront without getting latest Mikroman can cause problems"),t.k0s()())}const q=[{path:"",component:(()=>{class a{constructor(o,r,i){this.data_provider=o,this.router=r,this.login_checker=i,this.copy_msg=!1,this.ConfirmModalVisible=!1,this.action="",this.front_version=l(8330).version,this.trafficRadioGroup=new p.J3({trafficRadio:new p.hs("5m")}),this.chart_data={},this.Chartoptions={responsive:!0,plugins:{tooltip:{callbacks:{label:function(s){const u=["bit","Kib","Mib","Gib","Tib"];var f=s.parsed.y;let d=0;for(;f>=1024&&d=1024&&m=1024&&m{c.uid=s.uid,c.uname=s.name,c.tz=s.tz})}ngOnInit(){this.options=this.Chartoptions,this.initStats(),this.initTrafficChart()}initTrafficChart(){var o=this;this.data_provider.dashboard_traffic(this.delta).then(r=>{let i=r.data.labels.map(c=>(0,C.qD)(c.split(".")[0]+".000Z",o.tz,"yyyy-MM-dd HH:mm:ss"));o.chart_data={datasets:r.data.datasets,labels:i}})}initStats(){var o=this;this.data_provider.dashboard_stats(!0,this.front_version).then(r=>{o.stats=r})}copy_this(){this.copy_msg=!0,setTimeout(()=>{this.copy_msg=!1},3e3)}setTrafficPeriod(o){this.trafficRadioGroup.setValue({trafficRadio:o}),this.delta=o,this.initTrafficChart()}showConfirmModal(o){this.action=o,this.ConfirmModalVisible=!0}ConfirmAction(){var o=this;this.data_provider.apply_update(this.action).then(r=>{"success"==r.status&&("update_mikroman"==o.action&&(o.stats.update_inprogress=!0),"update_mikrofront"==o.action&&(o.stats.front_update_inprogress=!0),o.action="",o.ConfirmModalVisible=!1)})}static#t=this.\u0275fac=function(r){return new(r||a)(t.rXU(y.C),t.rXU(b.Ix),t.rXU(j.T))};static#o=this.\u0275cmp=t.VBU({type:a,selectors:[["ng-component"]],decls:43,vars:16,consts:[["ConfirmModal",""],[4,"ngIf"],[1,"mb-1"],["sm","5"],["id","traffic",1,"card-title","mb-0"],["sm","7",1,"d-none","d-md-block"],[3,"formGroup"],["role","group",1,"float-end","me-3"],["formControlName","trafficRadio","type","radio","value","5m",1,"btn-check"],["cButton","","cFormCheckLabel","","color","secondary","variant","outline",3,"click"],["formControlName","trafficRadio","type","radio","value","1h",1,"btn-check"],["formControlName","trafficRadio","type","radio","value","daily",1,"btn-check"],["formControlName","trafficRadio","type","radio","value","live",1,"btn-check"],["type","line",3,"data","options","height"],["xl","6","lg","12","class","h-100","style","min-height: 160px!important;display: grid",4,"ngIf"],["xl","6","lg","12",1,"h-100",2,"min-height","160px!important","display","grid"],["class","h-100","style","padding: 0!important;margin: 0!important;",4,"ngIf"],["backdrop","static","size","lg","id","ConfirmModal",3,"visibleChange","visible"],["cModalTitle","",4,"ngIf"],["cButtonClose","",3,"cModalToggle"],["cButton","","color","primary",3,"click"],["cButton","","color","secondary",3,"cModalToggle"],["xs",""],["class","mb-1",4,"ngIf"],["md","12","xl","12","xs","12"],[1,"mb-sm-1","mb-0"],["color","danger","padding","",1,"mb-1",3,"title","value"],["cTemplateId","widgetIconTemplate"],["color","success","padding","",1,"mb-1",3,"title","value"],["color","warning","padding","",1,"mb-1",3,"title","value"],["color","info","padding","",1,"mb-1",3,"title","value"],[1,"pb-0"],[1,"mb-0","pb-0"],[1,"border-start","border-start-4","border-start-info","pt-1","px-3","mb-1"],[1,"text-medium-emphasis","small"],[1,"fs-6","fw-semibold"],[1,"border-start","border-start-4","border-start-warning","pt-1","px-3","mb-1"],[1,"border-start","border-start-4","border-start-success","pt-1","px-3","mb-1"],[1,"fa-solid","fa-person-circle-exclamation",2,"font-size","2em"],[1,"fa-solid","fa-arrow-right-to-bracket",2,"font-size","2em"],[1,"fa-solid","fa-skull-crossbones",2,"font-size","2em"],[1,"fa-solid","fa-triangle-exclamation",2,"font-size","2em"],[1,"fa-solid","fa-circle-info",2,"font-size","2em"],[1,"mb-1","p-1","h-100",2,"padding-left","5px!important"],[1,"my-1"],[2,"display","inline-block"],["class","my-1",4,"ngIf"],[2,"display","inline-block","margin-right","5px"],[2,"padding","0!important"],[2,"background-color","#ccc","padding","5px","border-radius","5px","cursor","pointer",3,"click","cdkCopyToClipboard"],["style","color: #fff!important;","class","badge text-bg-success",4,"ngIf"],["color","danger"],["target","_blank","href","http://MikroWizard.com",1,"mx-1"],[1,"badge","text-bg-success",2,"color","#fff!important"],[1,"fa-solid","fa-check"],["color","danger",1,"mx-1"],["style","color: #fff!important;","class","badge text-bg-success mx-1",4,"ngIf"],["color","success"],["color","info",1,"mx-1"],["color","info",4,"ngIf"],[1,"badge","text-bg-success","mx-1",2,"color","#fff!important"],["color","info"],[2,"font-size","0.9rem","display","inline-block","margin-right","5px"],[2,"margin","0!important","padding","8px","height","27px",3,"color"],["class","fa-solid fa-spinner fa-spin",4,"ngIf"],["cButton","","color","warning","size","sm","style","font-size: 0.75em;position: relative;left: -4px;top: 1px;border-top-left-radius: 0;border-bottom-left-radius: 0;height: 27px;",3,"click",4,"ngIf"],[2,"font-size","0.9rem","display","inline-block"],["color","secondary",2,"padding","8px","height","27px",3,"color"],[1,"fa-solid","fa-spinner","fa-spin"],["cButton","","color","warning","size","sm",2,"font-size","0.75em","position","relative","left","-4px","top","1px","border-top-left-radius","0","border-bottom-left-radius","0","height","27px",3,"click"],[1,"fa-regular","fa-hand-pointer","fa-beat-fade"],[1,"h-100",2,"padding","0!important","margin","0!important"],[3,"dark","animate","wrap","interval"],["style","display: flex;",4,"ngFor","ngForOf"],["caption","Previous","direction","prev",3,"routerLink"],["caption","Next","direction","next",3,"routerLink"],[2,"display","flex"],["loading","lazy","height","150px",1,"d-block",2,"float","left",3,"src","alt"],[2,"padding","20px"],[2,"max-width","90%",3,"innerHTML"],["cModalTitle",""],[2,"padding","0 !important"]],template:function(r,i){if(1&r){const c=t.RV6();t.DNE(0,G,3,1,"c-row",1),t.j41(1,"c-card",2)(2,"c-card-body")(3,"c-row")(4,"c-col",3)(5,"h4",4),t.EFF(6,"Total Devices Traffic"),t.k0s()(),t.j41(7,"c-col",5)(8,"form",6)(9,"c-button-group",7),t.nrm(10,"input",8),t.j41(11,"label",9),t.bIt("click",function(){return t.eBV(c),t.Njj(i.setTrafficPeriod("5m"))}),t.EFF(12,"5 Minues"),t.k0s(),t.nrm(13,"input",10),t.j41(14,"label",9),t.bIt("click",function(){return t.eBV(c),t.Njj(i.setTrafficPeriod("1h"))}),t.EFF(15,"Hourly"),t.k0s(),t.nrm(16,"input",11),t.j41(17,"label",9),t.bIt("click",function(){return t.eBV(c),t.Njj(i.setTrafficPeriod("daily"))}),t.EFF(18,"Daily"),t.k0s(),t.nrm(19,"input",12),t.j41(20,"label",9),t.bIt("click",function(){return t.eBV(c),t.Njj(i.setTrafficPeriod("live"))}),t.EFF(21,"Live"),t.k0s()()()()(),t.nrm(22,"c-chart",13),t.k0s()(),t.j41(23,"c-row"),t.DNE(24,A,9,4,"c-col",14),t.j41(25,"c-col",15),t.DNE(26,H,7,5,"c-card",16),t.k0s()(),t.j41(27,"c-modal",17,0),t.mxI("visibleChange",function(s){return t.eBV(c),t.DH7(i.ConfirmModalVisible,s)||(i.ConfirmModalVisible=s),t.Njj(s)}),t.j41(29,"c-modal-header"),t.DNE(30,P,2,0,"h5",18)(31,W,2,0,"h5",18),t.nrm(32,"button",19),t.k0s(),t.j41(33,"c-modal-body"),t.DNE(34,K,11,1,"div",1)(35,O,3,0,"div",1)(36,Q,7,1,"div",1)(37,Z,5,0,"div",1),t.k0s(),t.j41(38,"c-modal-footer")(39,"button",20),t.bIt("click",function(){return t.eBV(c),t.Njj(i.ConfirmAction())}),t.EFF(40," submit"),t.k0s(),t.j41(41,"button",21),t.EFF(42," Close "),t.k0s()()()}if(2&r){const c=t.sdS(28);t.Y8G("ngIf",i.stats),t.R7$(8),t.Y8G("formGroup",i.trafficRadioGroup),t.R7$(14),t.Y8G("data",i.chart_data)("options",i.options)("height",250),t.R7$(2),t.Y8G("ngIf",i.stats),t.R7$(2),t.Y8G("ngIf",i.stats),t.R7$(),t.R50("visible",i.ConfirmModalVisible),t.R7$(3),t.Y8G("ngIf","update_mikroman"==i.action),t.R7$(),t.Y8G("ngIf","update_mikrofront"==i.action),t.R7$(),t.Y8G("cModalToggle",c.id),t.R7$(2),t.Y8G("ngIf","update_mikroman"==i.action),t.R7$(),t.Y8G("ngIf","update_mikroman"==i.action),t.R7$(),t.Y8G("ngIf","update_mikrofront"==i.action),t.R7$(),t.Y8G("ngIf","update_mikrofront"==i.action),t.R7$(4),t.Y8G("cModalToggle",c.id)}},dependencies:[b.Wk,e.iby,e.qHy,e.Rjr,e.lMi,e.AOl,h.Sq,h.bT,e.gLf,e.oMR,p.qT,p.me,p.Fm,p.BC,p.cb,p.j4,p.JD,e._fv,e.UjT,e.ptL,e.Z7S,k.j,e.gUq,e.vwk,e.Itg,e.cXP,e.Bnb,e.nSt,v.dF,e.Jyz,e.zfW,e.s$3,e.epl,e.L$K,e.VtU],encapsulation:2})}return a})(),data:{title:$localize`Dashboard`}}];let tt=(()=>{class a{static#t=this.\u0275fac=function(r){return new(r||a)};static#o=this.\u0275mod=t.$C({type:a});static#a=this.\u0275inj=t.G2t({imports:[b.iI.forChild(q),b.iI]})}return a})(),ot=(()=>{class a{static#t=this.\u0275fac=function(r){return new(r||a)};static#o=this.\u0275mod=t.$C({type:a});static#a=this.\u0275inj=t.G2t({imports:[tt,e.Dw2,e.L7X,h.MD,e.pc9,e.Emn,p.X1,e.tmq,e.tmq,e.ayw,k.u,e.RlG,e.EJq,v.FQ,e.Q_q]})}return a})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/703.3d45fd8c410598ea.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[703],{6703:(x,_,m)=>{m.r(_),m.d(_,{PermissionsModule:()=>S});var p=m(177),d=m(9417),r=m(8921),g=m(4662),f=m(7062),u=m(7390),h=m(7630),e=m(4438),b=m(9492),k=m(1170);const F=()=>["api","ftp","password","read","romon","sniff","telnet","tikapp","winbox"],C=()=>["dude","local","policy","reboot","rest-api","sensitive","ssh","test","web","write"];function T(n,a){1&n&&e.EFF(0),2&n&&e.SpI(" \xa0 ",a.item.name," ")}function j(n,a){if(1&n&&(e.j41(0,"c-badge",32),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.key)}}function M(n,a){if(1&n&&(e.qex(0),e.DNE(1,j,2,1,"c-badge",31),e.bVm()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t.value)}}function E(n,a){if(1&n&&(e.j41(0,"div",30),e.DNE(1,M,2,1,"ng-container",25),e.nI1(2,"keyvalue"),e.k0s()),2&n){const t=a.item;e.R7$(),e.Y8G("ngForOf",e.bMT(2,1,t.perms))}}function R(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",33),e.bIt("click",function(){const i=e.eBV(t).item,s=e.XpG();return e.Njj(s.editAddTask(i,"edit"))}),e.nrm(1,"i",34),e.k0s(),e.j41(2,"button",35),e.bIt("click",function(){const i=e.eBV(t).item,s=e.XpG();return e.Njj(s.confirm_delete(i))}),e.nrm(3,"i",36),e.k0s()}}function P(n,a){if(1&n&&(e.j41(0,"h5",23),e.EFF(1),e.k0s()),2&n){const t=e.XpG();e.R7$(),e.SpI("Editing Permission ",t.SelectedPerm.name,"")}}function v(n,a){1&n&&(e.j41(0,"h5",23),e.EFF(1,"Adding new Permission Rule"),e.k0s())}function G(n,a){if(1&n){const t=e.RV6();e.j41(0,"c-form-check",37)(1,"input",38),e.mxI("ngModelChange",function(i){const s=e.eBV(t).$implicit,c=e.XpG();return e.DH7(c.perms[s],i)||(c.perms[s]=i),e.Njj(i)}),e.k0s(),e.j41(2,"label",39),e.EFF(3),e.k0s()()}if(2&n){const t=a.$implicit,o=e.XpG();e.Y8G("switch",!0),e.R7$(),e.R50("ngModel",o.perms[t]),e.R7$(2),e.JRh(t)}}function I(n,a){if(1&n){const t=e.RV6();e.j41(0,"c-form-check",37)(1,"input",38),e.mxI("ngModelChange",function(i){const s=e.eBV(t).$implicit,c=e.XpG();return e.DH7(c.perms[s],i)||(c.perms[s]=i),e.Njj(i)}),e.k0s(),e.j41(2,"label",39),e.EFF(3),e.k0s()()}if(2&n){const t=a.$implicit,o=e.XpG();e.Y8G("switch",!0),e.R7$(),e.R50("ngModel",o.perms[t]),e.R7$(2),e.JRh(t)}}function w(n,a){if(1&n&&(e.j41(0,"c-badge",41),e.EFF(1),e.k0s()),2&n){const t=a.$implicit,o=e.XpG(2);e.R7$(),e.JRh(o.get_member_by_id(t).name)}}function V(n,a){if(1&n&&(e.qex(0),e.DNE(1,w,2,1,"c-badge",40),e.bVm()),2&n){const t=e.XpG();e.R7$(),e.Y8G("ngForOf",t.splitids(t.SelectedPermItems))}}function $(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",6),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.submit("add"))}),e.EFF(1,"Add"),e.k0s()}}function y(n,a){if(1&n){const t=e.RV6();e.j41(0,"button",6),e.bIt("click",function(){e.eBV(t);const i=e.XpG();return e.Njj(i.submit("edit"))}),e.EFF(1,"save"),e.k0s()}}function D(n,a){if(1&n&&(e.j41(0,"c-badge",32),e.EFF(1),e.k0s()),2&n){const t=e.XpG().$implicit;e.R7$(),e.JRh(t.key)}}function N(n,a){if(1&n&&(e.qex(0),e.DNE(1,D,2,1,"c-badge",31),e.bVm()),2&n){const t=a.$implicit;e.R7$(),e.Y8G("ngIf",t.value)}}const Y=[{path:"",component:(()=>{class n{constructor(t,o,i){this.data_provider=t,this.router=o,this.login_checker=i,this.source=[],this.columns=[],this.loading=!0,this.rows=[],this.SelectedPerm={},this.SelectedPermItems="",this.EditTaskModalVisible=!1,this.DeleteConfirmModalVisible=!1,this.Members="",this.SelectedMembers=[],this.action="add",this.permid=0,this.permname="",this.perms={api:!1,ftp:!1,password:!1,read:!1,romon:!1,sniff:!1,telnet:!1,tikapp:!1,winbox:!1,dude:!1,local:!1,policy:!1,reboot:!1,"rest-api":!1,sensitive:!1,ssh:!1,test:!1,web:!1,write:!1},this.toasterForm={autohide:!0,delay:3e3,position:"fixed",fade:!0,closeButton:!0},this.sorting={enabled:!0,multiSorting:!0},this.paging={enabled:!0,page:1,pageSize:10,pageSizes:[5,10,25,50],display:u.sE.ADVANCED},this.columnMenu={enabled:!0,sort:!0,columnsManager:!0};var s=this;this.login_checker.isLoggedIn()||setTimeout(function(){s.router.navigate(["login"])},100),this.data_provider.getSessionInfo().then(l=>{s.uid=l.uid,s.uname=l.name,"admin"!=l.role&&setTimeout(function(){s.router.navigate(["/user/dashboard"])},100)})}show_toast(t,o,i){const{...s}={...this.toasterForm,color:i,title:t,body:o};this.viewChildren.first.addToast(h.y,s,{}).instance.closeButton=s.closeButton}ngOnInit(){this.initGridTable()}submit(t){var o=this;"add"==t?this.data_provider.create_perm(o.permname,o.perms).then(i=>{"failed"!=i.status?(o.initGridTable(),this.EditTaskModalVisible=!1):o.show_toast("Error",i.err,"danger")}):this.data_provider.edit_perm(o.permid,o.permname,o.perms).then(i=>{"failed"!=i.status?(o.initGridTable(),this.EditTaskModalVisible=!1):o.show_toast("Error",i.err,"danger")})}editAddTask(t,o){if("showadd"==o)return this.permname=t.name,this.perms={api:!1,ftp:!1,password:!1,read:!1,romon:!1,sniff:!1,telnet:!1,tikapp:!1,winbox:!1,dude:!1,local:!1,policy:!1,reboot:!1,"rest-api":!1,sensitive:!1,ssh:!1,test:!1,web:!1,write:!1},this.permid=0,this.action="add",void(this.EditTaskModalVisible=!0);this.action="edit",this.permname=t.name,this.perms=t.perms,this.permid=t.id,this.EditTaskModalVisible=!0}splitids(t=""){return t.split(",")}get_member_by_id(t){return this.Members.find(o=>o.id==t)}confirm_delete(t="",o=!1){if(o){var i=this;this.data_provider.delete_perm(i.SelectedPerm.id).then(s=>{if("error"in s&&s.error.indexOf("Unauthorized"))i.show_toast("Error","You are not authorized to perform this action","danger");else{if("failed"==s.status)return void i.show_toast("Error",s.err,"danger");i.initGridTable(),i.DeleteConfirmModalVisible=!1}})}else this.SelectedPerm={...t},this.DeleteConfirmModalVisible=!0}logger(t){console.dir(t)}initGridTable(){var t=this;this.data_provider.get_perms(1,10,"").then(c=>{t.source=c.map(l=>l),t.loading=!1})}static#e=this.\u0275fac=function(o){return new(o||n)(e.rXU(b.C),e.rXU(f.Ix),e.rXU(k.T))};static#t=this.\u0275cmp=e.VBU({type:n,selectors:[["ng-component"]],viewQuery:function(o,i){if(1&o&&e.GBs(r.E0T,5),2&o){let s;e.mGM(s=e.lsd())&&(i.viewChildren=s)}},decls:80,vars:31,consts:[["EditTaskModal",""],["DeleteConfirmModal",""],["xs",""],[1,"mb-4"],["xs","",3,"lg"],["xs","",2,"text-align","right",3,"lg"],["cButton","","color","primary",3,"click"],[1,"fa-solid","fa-plus"],[3,"rowHeight","autoResizeWidth","source","columnMenu","sorting","paging"],["header","Name","field","name"],["width","auto","header","Perms","field","perms"],["header","Actions","width","120","field","action"],["backdrop","static","size","lg","id","EditTaskModal",3,"visibleChange","visible"],["cModalTitle","",4,"ngIf"],["cButtonClose","",3,"cModalToggle"],[1,"mb-3",3,"cFormFloating"],["cFormControl","","id","floatingInput","placeholder","permname",3,"ngModelChange","ngModel"],["cLabel","","for","floatingInput"],[3,"switch",4,"ngFor","ngForOf"],[4,"ngIf"],["cButton","","color","primary",3,"click",4,"ngIf"],["cButton","","color","secondary",3,"cModalToggle"],["backdrop","static","id","DeleteConfirmModal",3,"visibleChange","visible"],["cModalTitle",""],[2,"width","100%"],[4,"ngFor","ngForOf"],[2,"padding","0!important"],["cButton","","color","danger",3,"click"],["cButton","","color","info",3,"cModalToggle"],["position","fixed","placement","top-end"],[2,"text-wrap","initial"],["class","m-1","color","success",4,"ngIf"],["color","success",1,"m-1"],["cButton","","color","warning","size","sm",1,"mx-1",3,"click"],[1,"fa-regular","fa-pen-to-square"],["cButton","","color","danger","size","sm",3,"click"],[1,"fa-regular","fa-trash-can"],[3,"switch"],["cFormCheckInput","","type","checkbox",3,"ngModelChange","ngModel"],["cFormCheckLabel",""],["class","mx-1","color","dark",4,"ngFor","ngForOf"],["color","dark",1,"mx-1"]],template:function(o,i){if(1&o){const s=e.RV6();e.j41(0,"c-row")(1,"c-col",2)(2,"c-card",3)(3,"c-card-header")(4,"c-row")(5,"c-col",4),e.EFF(6," Permissions "),e.k0s(),e.j41(7,"c-col",5)(8,"button",6),e.bIt("click",function(){return e.eBV(s),e.Njj(i.editAddTask({},"showadd"))}),e.nrm(9,"i",7),e.k0s()()()(),e.j41(10,"c-card-body")(11,"gui-grid",8)(12,"gui-grid-column",9),e.DNE(13,T,1,1,"ng-template"),e.k0s(),e.j41(14,"gui-grid-column",10),e.DNE(15,E,3,3,"ng-template"),e.k0s(),e.j41(16,"gui-grid-column",11),e.DNE(17,R,4,0,"ng-template"),e.k0s()()()()()(),e.j41(18,"c-modal-header")(19,"c-modal",12,0),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.EditTaskModalVisible,l)||(i.EditTaskModalVisible=l),e.Njj(l)}),e.j41(21,"c-modal-header"),e.DNE(22,P,2,1,"h5",13)(23,v,2,0,"h5",13),e.nrm(24,"button",14),e.k0s(),e.j41(25,"c-modal-body")(26,"div",15)(27,"input",16),e.mxI("ngModelChange",function(l){return e.eBV(s),e.DH7(i.permname,l)||(i.permname=l),e.Njj(l)}),e.k0s(),e.j41(28,"label",17),e.EFF(29,"Name"),e.k0s()(),e.j41(30,"c-row")(31,"c-col"),e.DNE(32,G,4,3,"c-form-check",18),e.k0s(),e.j41(33,"c-col"),e.DNE(34,I,4,3,"c-form-check",18),e.k0s()(),e.DNE(35,V,2,1,"ng-container",19),e.k0s(),e.j41(36,"c-modal-footer"),e.DNE(37,$,2,0,"button",20)(38,y,2,0,"button",20),e.j41(39,"button",21),e.EFF(40," Close "),e.k0s()()(),e.j41(41,"c-modal",22,1),e.mxI("visibleChange",function(l){return e.eBV(s),e.DH7(i.DeleteConfirmModalVisible,l)||(i.DeleteConfirmModalVisible=l),e.Njj(l)}),e.j41(43,"c-modal-header")(44,"h5",23),e.EFF(45),e.k0s(),e.nrm(46,"button",14),e.k0s(),e.j41(47,"c-modal-body"),e.EFF(48," Are you sure that You want to delete following Permission? "),e.nrm(49,"br")(50,"br"),e.j41(51,"table",24)(52,"tr")(53,"td")(54,"b"),e.EFF(55,"Permission name : "),e.k0s(),e.EFF(56),e.k0s()(),e.j41(57,"tr")(58,"td"),e.DNE(59,N,2,1,"ng-container",25),e.nI1(60,"keyvalue"),e.k0s()(),e.j41(61,"tr")(62,"td")(63,"p")(64,"code",26)(65,"b"),e.EFF(66,"Warning:"),e.k0s(),e.EFF(67," ALL Given "),e.j41(68,"b"),e.EFF(69,"device access"),e.k0s(),e.EFF(70," related to this permision in Users Section "),e.j41(71,"b"),e.EFF(72,"will be deleted"),e.k0s(),e.EFF(73," for each user"),e.k0s()()()()()(),e.j41(74,"c-modal-footer")(75,"button",27),e.bIt("click",function(){return e.eBV(s),e.Njj(i.confirm_delete("",!0))}),e.EFF(76," Yes,Delete! "),e.k0s(),e.j41(77,"button",28),e.EFF(78," Close "),e.k0s()()(),e.nrm(79,"c-toaster",29),e.k0s()}if(2&o){const s=e.sdS(20),c=e.sdS(42);e.R7$(5),e.Y8G("lg",10),e.R7$(2),e.Y8G("lg",2),e.R7$(4),e.Y8G("rowHeight",82)("autoResizeWidth",!0)("source",i.source)("columnMenu",i.columnMenu)("sorting",i.sorting)("autoResizeWidth",!0)("paging",i.paging),e.R7$(8),e.R50("visible",i.EditTaskModalVisible),e.R7$(3),e.Y8G("ngIf","edit"==i.action),e.R7$(),e.Y8G("ngIf","add"==i.action),e.R7$(),e.Y8G("cModalToggle",s.id),e.R7$(2),e.Y8G("cFormFloating",!0),e.R7$(),e.R50("ngModel",i.permname),e.R7$(5),e.Y8G("ngForOf",e.lJ4(29,F)),e.R7$(2),e.Y8G("ngForOf",e.lJ4(30,C)),e.R7$(),e.Y8G("ngIf",i.SelectedMembers.length>0&&i.EditTaskModalVisible),e.R7$(2),e.Y8G("ngIf","add"==i.action),e.R7$(),e.Y8G("ngIf","edit"==i.action),e.R7$(),e.Y8G("cModalToggle",s.id),e.R7$(2),e.R50("visible",i.DeleteConfirmModalVisible),e.R7$(4),e.SpI("Confirm delete ",i.SelectedPerm.name,""),e.R7$(),e.Y8G("cModalToggle",c.id),e.R7$(10),e.SpI("",i.SelectedPerm.name," "),e.R7$(3),e.Y8G("ngForOf",e.bMT(60,27,i.SelectedPerm.perms)),e.R7$(18),e.Y8G("cModalToggle",c.id)}},dependencies:[r.iby,r.qHy,r.lMi,p.Sq,p.bT,r.gLf,r.oMR,r.E0T,r.akk,r.cy2,r.iQ3,r.l_X,r.e$m,r.YJZ,r._fv,r.UjT,u.V1,u.fz,r.Jyz,r.zfW,r.s$3,r.epl,r.L$K,r.VtU,d.me,d.Zm,d.BC,d.vS,r.nSt,p.lG],encapsulation:2})}return n})(),data:{title:$localize`Permissions`}}];let B=(()=>{class n{static#e=this.\u0275fac=function(o){return new(o||n)};static#t=this.\u0275mod=e.$C({type:n});static#i=this.\u0275inj=e.G2t({imports:[f.iI.forChild(Y),f.iI]})}return n})(),S=(()=>{class n{static#e=this.\u0275fac=function(o){return new(o||n)};static#t=this.\u0275mod=e.$C({type:n});static#i=this.\u0275inj=e.G2t({imports:[B,r.Dw2,r.Ied,g.op,r.jr_,p.MD,r.pc9,r.MBE,r.tHK,r.tmq,r.ayw,u.uM,r.Q_q,d.YN,r.EJq]})}return n})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/angular.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/angular.ico -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/favicon.ico -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/images/angular.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/images/angular.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/1.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/2.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/3.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/4.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/5.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/6.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/7.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/8.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/avatars/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/avatars/9.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/brand/logo-MIkroWizard-big-color.svg: -------------------------------------------------------------------------------- 1 | 2 | 15 | 17 | 20 | 24 | 28 | 29 | 38 | 39 | 57 | 60 | 68 | 71 | 77 | 80 | 86 | 90 | 97 | 100 | 107 | 110 | 117 | 120 | 128 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 147 | 155 | 158 | 164 | 165 | 168 | 175 | 178 | 185 | 186 | 190 | 197 | 200 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 239 | 240 | 249 | 250 | 251 | 252 | 253 | -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/brand/logo-MIkroWizard-big-white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/brand/logo-MIkroWizard-small-color.svg: -------------------------------------------------------------------------------- 1 | 2 | 15 | 17 | 20 | 24 | 28 | 29 | 38 | 47 | 56 | 65 | 74 | 83 | 92 | 101 | 110 | 111 | 129 | 132 | 140 | 143 | 149 | 152 | 158 | 162 | 169 | 172 | 179 | 182 | 189 | 192 | 200 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 220 | 228 | 231 | 237 | 238 | 241 | 248 | 251 | 258 | 259 | 263 | 270 | 273 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 312 | 313 | 322 | 323 | 324 | 325 | 326 | -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/brand/logo-MIkroWizard-small-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 15 | 17 | 20 | 24 | 28 | 29 | 38 | 47 | 56 | 65 | 74 | 83 | 92 | 101 | 110 | 111 | 129 | 132 | 140 | 143 | 149 | 152 | 158 | 162 | 169 | 172 | 179 | 182 | 189 | 192 | 200 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 220 | 228 | 231 | 237 | 238 | 241 | 248 | 251 | 258 | 259 | 263 | 270 | 273 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 312 | 313 | 322 | 323 | 324 | 325 | 326 | -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/brand/mikrowizard-full.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/brand/mikrowizard-full.jpg -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/brand/mikrowizard-full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/brand/mikrowizard-full.png -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/chip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/chip.png -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/loading.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/img/tcpip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/assets/img/tcpip.png -------------------------------------------------------------------------------- /mikrofront/dist/html/assets/res/atom-one-dark.css: -------------------------------------------------------------------------------- 1 | pre code.hljs { 2 | display: block; 3 | overflow-x: auto; 4 | padding: 1em 5 | } 6 | code.hljs { 7 | padding: 3px 5px 8 | } 9 | /* 10 | 11 | Atom One Dark by Daniel Gamage 12 | Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax 13 | 14 | base: #282c34 15 | mono-1: #abb2bf 16 | mono-2: #818896 17 | mono-3: #5c6370 18 | hue-1: #56b6c2 19 | hue-2: #61aeee 20 | hue-3: #c678dd 21 | hue-4: #98c379 22 | hue-5: #e06c75 23 | hue-5-2: #be5046 24 | hue-6: #d19a66 25 | hue-6-2: #e6c07b 26 | 27 | */ 28 | .hljs { 29 | color: #abb2bf; 30 | background: #282c34 31 | } 32 | .hljs-comment, 33 | .hljs-quote { 34 | color: #5c6370; 35 | font-style: italic 36 | } 37 | .hljs-doctag, 38 | .hljs-keyword, 39 | .hljs-formula { 40 | color: #c678dd 41 | } 42 | .hljs-section, 43 | .hljs-name, 44 | .hljs-selector-tag, 45 | .hljs-deletion, 46 | .hljs-subst { 47 | color: #e06c75 48 | } 49 | .hljs-literal { 50 | color: #56b6c2 51 | } 52 | .hljs-string, 53 | .hljs-regexp, 54 | .hljs-addition, 55 | .hljs-attribute, 56 | .hljs-meta .hljs-string { 57 | color: #98c379 58 | } 59 | .hljs-attr, 60 | .hljs-variable, 61 | .hljs-template-variable, 62 | .hljs-type, 63 | .hljs-selector-class, 64 | .hljs-selector-attr, 65 | .hljs-selector-pseudo, 66 | .hljs-number { 67 | color: #d19a66 68 | } 69 | .hljs-symbol, 70 | .hljs-bullet, 71 | .hljs-link, 72 | .hljs-meta, 73 | .hljs-selector-id, 74 | .hljs-title { 75 | color: #61aeee 76 | } 77 | .hljs-built_in, 78 | .hljs-title.class_, 79 | .hljs-class .hljs-title { 80 | color: #e6c07b 81 | } 82 | .hljs-emphasis { 83 | font-style: italic 84 | } 85 | .hljs-strong { 86 | font-weight: bold 87 | } 88 | .hljs-link { 89 | text-decoration: underline 90 | } -------------------------------------------------------------------------------- /mikrofront/dist/html/common.a4ef334c5064572b.js: -------------------------------------------------------------------------------- 1 | "use strict";(self.webpackChunkmikrowizard=self.webpackChunkmikrowizard||[]).push([[76],{7630:(h,p,r)=>{r.d(p,{y:()=>a});var t=r(4438),n=r(8921),l=r(177);const u=["*"];function _(i,s){1&i&&t.nrm(0,"i",8)}function f(i,s){1&i&&t.nrm(0,"i",9)}function m(i,s){1&i&&t.nrm(0,"i",10)}let a=(()=>{class i extends n.d3n{constructor(e,o,c,d){super(e,o,c,d),this.hostElement=e,this.renderer=o,this.toasterService=c,this.changeDetectorRef=d,this.closeButton=!0,this.title="",this.body=""}static#t=this.\u0275fac=function(o){return new(o||i)(t.rXU(t.aKT),t.rXU(t.sFG),t.rXU(n.W9m),t.rXU(t.gRc))};static#e=this.\u0275cmp=t.VBU({type:i,selectors:[["app-toast-simple"]],inputs:{closeButton:"closeButton",title:"title",body:"body"},standalone:!0,features:[t.Jv_([{provide:n.d3n,useExisting:(0,t.Rfq)(()=>i)}]),t.Vt3,t.aNF],ngContentSelectors:u,decls:12,vars:7,consts:[["toastBody",""],[3,"closeButton"],["style","color:#e55353","class","fa-solid fa-xmark mx-1",4,"ngIf"],["style","color:#3399ff","class","fa-solid fa-exclamation mx-1",4,"ngIf"],["style","color:#f9b115","class","fa-solid fa-triangle-exclamation mx-1",4,"ngIf"],[2,"line-height","1"],[3,"cToastClose"],[1,"mb-1",2,"color","#fff"],[1,"fa-solid","fa-xmark","mx-1",2,"color","#e55353"],[1,"fa-solid","fa-exclamation","mx-1",2,"color","#3399ff"],[1,"fa-solid","fa-triangle-exclamation","mx-1",2,"color","#f9b115"]],template:function(o,c){if(1&o&&(t.NAR(),t.qex(0),t.j41(1,"c-toast-header",1),t.DNE(2,_,1,0,"i",2)(3,f,1,0,"i",3)(4,m,1,0,"i",4),t.j41(5,"strong",5),t.EFF(6),t.k0s()(),t.j41(7,"c-toast-body",6,0)(9,"p",7),t.EFF(10),t.k0s(),t.SdG(11),t.k0s(),t.bVm()),2&o){const d=t.sdS(8);t.R7$(),t.Y8G("closeButton",c.closeButton),t.R7$(),t.Y8G("ngIf","danger"==c.color),t.R7$(),t.Y8G("ngIf","info"==c.color),t.R7$(),t.Y8G("ngIf","warning"==c.color),t.R7$(2),t.JRh(c.title),t.R7$(),t.Y8G("cToastClose",d.toast),t.R7$(3),t.SpI("",c.body," ")}},dependencies:[n.eY7,n.jS2,n.T5C,l.MD,l.bT],styles:["[_nghost-%COMP%]{display:block;overflow:hidden}"]})}return i})()},3801:(h,p,r)=>{r.d(p,{FQ:()=>m,dF:()=>f});var t=r(177),n=r(4438);class l{constructor(i,s){this._document=s;const e=this._textarea=this._document.createElement("textarea"),o=e.style;o.position="fixed",o.top=o.opacity="0",o.left="-999em",e.setAttribute("aria-hidden","true"),e.value=i,e.readOnly=!0,(this._document.fullscreenElement||this._document.body).appendChild(e)}copy(){const i=this._textarea;let s=!1;try{if(i){const e=this._document.activeElement;i.select(),i.setSelectionRange(0,i.value.length),s=this._document.execCommand("copy"),e&&e.focus()}}catch{}return s}destroy(){const i=this._textarea;i&&(i.remove(),this._textarea=void 0)}}let u=(()=>{class a{constructor(s){this._document=s}copy(s){const e=this.beginCopy(s),o=e.copy();return e.destroy(),o}beginCopy(s){return new l(s,this._document)}static#t=this.\u0275fac=function(e){return new(e||a)(n.KVO(t.qQ))};static#e=this.\u0275prov=n.jDH({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();const _=new n.nKC("CDK_COPY_TO_CLIPBOARD_CONFIG");let f=(()=>{class a{constructor(s,e,o){this._clipboard=s,this._ngZone=e,this.text="",this.attempts=1,this.copied=new n.bkB,this._pending=new Set,o&&null!=o.attempts&&(this.attempts=o.attempts)}copy(s=this.attempts){if(s>1){let e=s;const o=this._clipboard.beginCopy(this.text);this._pending.add(o);const c=()=>{const d=o.copy();d||! --e||this._destroyed?(this._currentTimeout=null,this._pending.delete(o),o.destroy(),this.copied.emit(d)):this._currentTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(c,1))};c()}else this.copied.emit(this._clipboard.copy(this.text))}ngOnDestroy(){this._currentTimeout&&clearTimeout(this._currentTimeout),this._pending.forEach(s=>s.destroy()),this._pending.clear(),this._destroyed=!0}static#t=this.\u0275fac=function(e){return new(e||a)(n.rXU(u),n.rXU(n.SKi),n.rXU(_,8))};static#e=this.\u0275dir=n.FsC({type:a,selectors:[["","cdkCopyToClipboard",""]],hostBindings:function(e,o){1&e&&n.bIt("click",function(){return o.copy()})},inputs:{text:[n.Mj6.None,"cdkCopyToClipboard","text"],attempts:[n.Mj6.None,"cdkCopyToClipboardAttempts","attempts"]},outputs:{copied:"cdkCopyToClipboardCopied"}})}return a})(),m=(()=>{class a{static#t=this.\u0275fac=function(e){return new(e||a)};static#e=this.\u0275mod=n.$C({type:a});static#o=this.\u0275inj=n.G2t({})}return a})()}}]); -------------------------------------------------------------------------------- /mikrofront/dist/html/fa-brands-400.5f7c5bb77eae788b.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/fa-brands-400.5f7c5bb77eae788b.ttf -------------------------------------------------------------------------------- /mikrofront/dist/html/fa-brands-400.9210030c21e68a90.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/fa-brands-400.9210030c21e68a90.woff2 -------------------------------------------------------------------------------- /mikrofront/dist/html/fa-regular-400.02ad4ff91ef84f65.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/fa-regular-400.02ad4ff91ef84f65.woff2 -------------------------------------------------------------------------------- /mikrofront/dist/html/fa-regular-400.570a165b064c1468.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/fa-regular-400.570a165b064c1468.ttf -------------------------------------------------------------------------------- /mikrofront/dist/html/fa-solid-900.0b5caff7ad4bc179.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/fa-solid-900.0b5caff7ad4bc179.ttf -------------------------------------------------------------------------------- /mikrofront/dist/html/fa-solid-900.3eae9857c06e9372.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MikroWizard/docker-compose-deployment/19dc11edc35eab7b232fa3af6199449981e4954c/mikrofront/dist/html/fa-solid-900.3eae9857c06e9372.woff2 -------------------------------------------------------------------------------- /mikrofront/dist/html/runtime.9299dd698873f109.js: -------------------------------------------------------------------------------- 1 | (()=>{"use strict";var e,m={},v={};function r(e){var c=v[e];if(void 0!==c)return c.exports;var a=v[e]={exports:{}};return m[e](a,a.exports,r),a.exports}r.m=m,e=[],r.O=(c,a,n,d)=>{if(!a){var t=1/0;for(f=0;f=d)&&Object.keys(r.O).every(p=>r.O[p](a[i]))?a.splice(i--,1):(l=!1,d0&&e[f-1][2]>d;f--)e[f]=e[f-1];e[f]=[a,n,d]},r.d=(e,c)=>{for(var a in c)r.o(c,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:c[a]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((c,a)=>(r.f[a](e,c),c),[])),r.u=e=>(76===e?"common":e)+"."+{71:"fe0ee86dd4c7f8c2",76:"a4ef334c5064572b",80:"afe9810ec5b397f8",84:"6bde8408b4fba658",118:"752d2f2f0022849f",130:"15d81349c878944b",182:"550b6560498517dc",184:"92d77b34464ba5c1",204:"17b1994c1608037c",325:"f9ddbfb6c670511e",381:"071d8c2d068b86cb",385:"e6d21669bdca6045",390:"0263e82f7304a035",391:"94be3a07e48126fb",435:"50aa5b7f2908d6f4",467:"45b165e0dfec22c9",573:"6779ebc34aa91ab9",578:"f4499d6cb3ea793c",631:"bd7178888196a3c5",633:"7075e3558e175ba4",650:"f6cfc04317581a12",703:"3d45fd8c410598ea",813:"00e775001ef777e2",858:"5a69ea3e2ca72256",981:"f603d68fbb84d0cc",983:"18b3499f015bcd56",987:"96f768e3ee10d3ce"}[e]+".js",r.miniCssF=e=>{},r.o=(e,c)=>Object.prototype.hasOwnProperty.call(e,c),(()=>{var e={},c="mikrowizard:";r.l=(a,n,d,f)=>{if(e[a])e[a].push(n);else{var t,l;if(void 0!==d)for(var i=document.getElementsByTagName("script"),u=0;u{t.onerror=t.onload=null,clearTimeout(s);var h=e[a];if(delete e[a],t.parentNode&&t.parentNode.removeChild(t),h&&h.forEach(y=>y(p)),g)return g(p)},s=setTimeout(b.bind(null,void 0,{type:"timeout",target:t}),12e4);t.onerror=b.bind(null,t.onerror),t.onload=b.bind(null,t.onload),l&&document.head.appendChild(t)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:c=>c},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="",(()=>{var e={121:0};r.f.j=(n,d)=>{var f=r.o(e,n)?e[n]:void 0;if(0!==f)if(f)d.push(f[2]);else if(121!=n){var t=new Promise((o,b)=>f=e[n]=[o,b]);d.push(f[2]=t);var l=r.p+r.u(n),i=new Error;r.l(l,o=>{if(r.o(e,n)&&(0!==(f=e[n])&&(e[n]=void 0),f)){var b=o&&("load"===o.type?"missing":o.type),s=o&&o.target&&o.target.src;i.message="Loading chunk "+n+" failed.\n("+b+": "+s+")",i.name="ChunkLoadError",i.type=b,i.request=s,f[1](i)}},"chunk-"+n,n)}else e[n]=0},r.O.j=n=>0===e[n];var c=(n,d)=>{var i,u,[f,t,l]=d,o=0;if(f.some(s=>0!==e[s])){for(i in t)r.o(t,i)&&(r.m[i]=t[i]);if(l)var b=l(r)}for(n&&n(d);o=2: 128 | print("Already running") 129 | exit() 130 | try: 131 | next_hour = (time.time() // 3600 + 1) * 3600 132 | sleep_time = next_hour - time.time() 133 | 134 | res=get_serial_from_api() 135 | hwid=res['serial'] 136 | username=res['username'] 137 | version=get_version_from_file() 138 | 139 | params={ 140 | "serial_number": hwid, 141 | "username": username.strip(), 142 | "front":True, 143 | "version": version 144 | } 145 | url="https://mikrowizard.com/wp-json/mikrowizard/v1/get_update" 146 | # send post request to server mikrowizard.com with params in json 147 | response = requests.post(url, json=params) 148 | # get response from server 149 | res = response 150 | try: 151 | if res.status_code == 200: 152 | res=res.json() 153 | if 'token' in res: 154 | params={ 155 | "token":res['token'], 156 | "file_name":res['filename'], 157 | "username":username.strip(), 158 | "front":True 159 | } 160 | log.info("Update available/Downloading...") 161 | else: 162 | log.info("Update not available") 163 | time.sleep(sleep_time) 164 | continue 165 | except Exception as e: 166 | log.error(e) 167 | 168 | # check if filename exist in /app/py and checksum is same then dont continue 169 | if check_sha256("/usr/share/nginx/"+res['filename'], res['sha256']): 170 | log.error("Checksum match, File exist") 171 | extract_zip_reload("/usr/share/nginx/"+res['filename'],"/usr/share/nginx/") 172 | time.sleep(sleep_time) 173 | continue 174 | download_url="https://mikrowizard.com/wp-json/mikrowizard/v1/download_update" 175 | # send post request to server mikrowizard.com with params in json 176 | r = requests.post(download_url,json=params,stream=True) 177 | if "invalid" in r.text or r.text=='false': 178 | log.error(r) 179 | log.error("Invalid response") 180 | time.sleep(30) 181 | continue 182 | with open("/usr/share/nginx/"+res['filename'], 'wb') as fd: 183 | for chunk in r.iter_content(chunk_size=128): 184 | fd.write(chunk) 185 | if check_sha256("/usr/share/nginx/"+res['filename'], res['sha256']): 186 | log.error("Update downloaded") 187 | log.error("/usr/share/nginx/"+res['filename']) 188 | extract_zip_reload("/usr/share/nginx/"+res['filename'],"/usr/share/nginx/") 189 | else: 190 | log.error("Checksum not match") 191 | os.remove("/usr/share/nginx/"+res['filename']) 192 | time.sleep(sleep_time) 193 | except Exception as e: 194 | log.error(e) 195 | time.sleep(30) 196 | 197 | 198 | if __name__ == '__main__': 199 | main() 200 | 201 | -------------------------------------------------------------------------------- /mikrofront/mwcrontab: -------------------------------------------------------------------------------- 1 | # must be ended with a new line "LF" (Unix) and not "CRLF" (Windows) 2 | * * * * * /usr/bin/python3 /front-update.py > /var/log/cron.log 2>&1 3 | # An empty line is required at the end of this file for a valid cron file. 4 | -------------------------------------------------------------------------------- /mikrofront/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | sendfile on; 4 | default_type application/octet-stream; 5 | 6 | gzip on; 7 | gzip_http_version 1.1; 8 | gzip_disable "MSIE [1-6]\."; 9 | gzip_min_length 256; 10 | gzip_vary on; 11 | gzip_proxied expired no-cache no-store private auth; 12 | gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; 13 | gzip_comp_level 9; 14 | 15 | root /usr/share/nginx/html; 16 | 17 | location / { 18 | try_files $uri $uri/ /index.html =404; 19 | } 20 | location /api { 21 | proxy_pass http://host.docker.internal:8181; 22 | 23 | proxy_set_header Host $http_host; 24 | proxy_set_header X-Real-IP $realip_remote_addr; 25 | proxy_set_header X-Forwarded-Proto $scheme; 26 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 27 | 28 | proxy_http_version 1.1; 29 | proxy_set_header Connection ""; 30 | } 31 | location /api/frontver { 32 | add_header Cache-Control 'no-store'; 33 | add_header Cache-Control 'no-cache'; 34 | expires 0; 35 | index version.json; 36 | alias /usr/share/nginx/html; 37 | } 38 | } -------------------------------------------------------------------------------- /mikrofront/reqs.txt: -------------------------------------------------------------------------------- 1 | cryptography==3.4.8 2 | Requests==2.32.2 3 | psutil==5.9.0 -------------------------------------------------------------------------------- /mikroman/Dockerfile: -------------------------------------------------------------------------------- 1 | 2 | FROM python:3.11-slim-bullseye 3 | 4 | WORKDIR /app 5 | 6 | RUN apt-get update 7 | RUN apt-get -y install cron 8 | RUN apt-get install -y iputils-ping 9 | RUN apt-get install -y net-tools 10 | RUN apt-get install -y git 11 | 12 | RUN touch /var/log/cron.log 13 | RUN git clone https://github.com/MikroWizard/mikroman.git /app 14 | 15 | RUN set -ex \ 16 | && buildDeps=' \ 17 | build-essential \ 18 | gcc \ 19 | ' \ 20 | && deps=' \ 21 | htop \ 22 | ' \ 23 | && apt-get install -y $buildDeps git $deps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ 24 | && pip install uWSGI==2.0.22 \ 25 | && pip install -r /app/reqs.txt 26 | 27 | 28 | RUN mkdir -p /conf 29 | RUN cp /app/conf/loginscript.sh /etc/profile 30 | COPY server-conf.json /conf/ 31 | ARG AM_I_IN_A_DOCKER_CONTAINER=Yes 32 | COPY init.sh /app/ 33 | COPY initpy.py /app/ 34 | COPY testdb.py /app/ 35 | 36 | RUN chmod +x /app/init.sh 37 | 38 | # background spooler dir 39 | RUN mkdir /tmp/pysrv_spooler 40 | 41 | # we don't need this file with Docker but uwsgi looks for it 42 | RUN echo `date +%s` >/app/VERSION 43 | 44 | EXPOSE 80 45 | 46 | 47 | # our server config file 48 | # - you should write your own config file and put OUTSIDE the repository 49 | # since the config file contains secrets 50 | # - here I use the sample template from repo 51 | # - it is also possible to override the config with env variables, either here 52 | # or in Amazon ECS or Kubernetes configuration 53 | #COPY /app/real-server-config.json /app/real-server-config.json 54 | # ENV PYSRV_DATABASE_HOST host.docker.internal 55 | # ENV PYSRV_REDIS_HOST host.docker.internal 56 | # ENV PYSRV_DATABASE_PASSWORD x 57 | 58 | # build either a production or dev image 59 | 60 | ARG BUILDMODE=production 61 | ENV ENVBUILDMODE=$BUILDMODE 62 | 63 | RUN echo "BUILDMODE $ENVBUILDMODE" 64 | 65 | # run in shell mode with ENV expansion 66 | RUN cd /app && bash init.sh 67 | 68 | 69 | -------------------------------------------------------------------------------- /mikroman/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # test if it is in build mode! 4 | if [[ -z "${AM_I_IN_A_DOCKER_CONTAINER}" ]]; then 5 | echo "Starting Mikroman ..." 6 | else 7 | exit 0 8 | fi 9 | 10 | 11 | # First Check if db is ready and accepting connections 12 | 13 | python3 /app/testdb.py 14 | 15 | # Check if the Python script ran successfully 16 | if [ $? -ne 0 ]; then 17 | echo "An error occurred while executing the SQL commands." 18 | exit 1 19 | else 20 | echo "Good News! Database is Running. :)" 21 | fi 22 | 23 | CONTAINER_ALREADY_STARTED="CONTAINER_ALREADY_STARTED_PLACEHOLDER" 24 | if [ ! -e $CONTAINER_ALREADY_STARTED ]; then 25 | echo "-- Initializing the mikroman for first run --" 26 | 27 | # YOUR_JUST_ONCE_LOGIC_HERE 28 | cd /app && export PYTHONPATH=/app/py && export PYSRV_CONFIG_PATH=/conf/server-conf.json && python3 scripts/dbmigrate.py 29 | 30 | cat << EOF1 | tee init.sql >/dev/null 31 | INSERT INTO public.tasks( signal, name, status) VALUES ( 100, 'check-update', false); 32 | INSERT INTO public.tasks( signal, name, status) VALUES ( 110, 'upgrade-firmware', false); 33 | INSERT INTO public.tasks( signal, name, status) VALUES ( 120, 'backup', false); 34 | INSERT INTO public.tasks( signal, name, status) VALUES ( 130, 'scanner', false); 35 | INSERT INTO public.tasks( signal, name, status) VALUES ( 140, 'downloader', false); 36 | INSERT INTO public.tasks( signal, name, status) VALUES ( 150, 'firmware-service', false); 37 | INSERT INTO public.tasks( signal, name, status) VALUES ( 160, 'snipet-exec', false); 38 | INSERT INTO public.sysconfig( key, value) VALUES ( 'scan_mode', 'mac'); 39 | INSERT INTO public.sysconfig( key, value) VALUES ( 'mac_scan_interval', '5'); 40 | INSERT INTO public.sysconfig( key, value) VALUES ( 'ip_scan_interval', '4'); 41 | INSERT INTO public.sysconfig( key, value) VALUES ( 'old_firmware_action', 'keep'); 42 | INSERT INTO public.sysconfig( key, value) VALUES ( 'default_user', ''); 43 | INSERT INTO public.sysconfig( key, value) VALUES ( 'default_password', ''); 44 | INSERT INTO public.sysconfig( key, value) VALUES ( 'old_version', ''); 45 | INSERT INTO public.sysconfig( key, value) VALUES ( 'latest_version', ''); 46 | INSERT INTO public.sysconfig( key, value) VALUES ( 'default_ip', '${MW_SERVER_IP}'); 47 | INSERT INTO public.sysconfig( key, value) VALUES ( 'rad_secret', '${MW_RAD_SECRET}'); 48 | INSERT INTO public.sysconfig( key, value) VALUES ( 'system_url', 'http://${MW_SERVER_IP}'); 49 | INSERT INTO public.sysconfig( key, value) VALUES ( 'force_perms', 'True'); 50 | INSERT INTO public.sysconfig( key, value) VALUES ( 'force_radius', 'True'); 51 | INSERT INTO public.sysconfig( key, value) VALUES ( 'force_syslog', 'True'); 52 | INSERT INTO public.sysconfig( key, value) VALUES ( 'safe_install', 'True'); 53 | INSERT INTO public.sysconfig( key, value) VALUES ( 'timezone', 'UTC'); 54 | INSERT INTO public.sysconfig( key, value) VALUES ( 'username', ''); 55 | INSERT INTO public.sysconfig( key, value) VALUES ( 'install_date', ''); 56 | INSERT INTO public.sysconfig( key, value) VALUES ( 'all_ip', ''); 57 | INSERT INTO public.device_groups( id, name ) VALUES (1, 'Default'); 58 | INSERT INTO public.users(username, first_name, last_name,email, role) VALUES ('system', 'system', '','system@localhost', 'disabled'); 59 | INSERT INTO public.users(id,username, password, first_name, last_name, email, role,adminperms) VALUES ('37cc36e0-afec-4545-9219-94655805868b','mikrowizard', '\$pbkdf2-sha256\$29000\$yVnr/d9b6917j7G2tlYqRQ$.8fbnLorUGGt6z8SZK9t7Q5WHrRnmKIYL.RW5IkyZLo', 'admin','admin','admin@localhost', 'admin','{"device": "full", "device_group": "full", "task": "full", "backup": "full", "snippet": "full", "accounting": "full", "authentication": "full", "users": "full", "permissions": "full", "settings": "full", "system_backup": "full"}'); 60 | INSERT INTO public.permissions(id, name, perms) VALUES (1, 'full', '{"api": true, "ftp": true, "password": true, "read": true, "romon": true, "sniff": true, "telnet": true, "tikapp": true, "winbox": true, "dude": true, "local": true, "policy": true, "reboot": true, "rest-api": true, "sensitive": true, "ssh": true, "test": true, "web": true, "write": true}'); 61 | INSERT INTO public.permissions(id, name, perms) VALUES (2, 'read', '{"api": true, "ftp": false, "password": true, "read": true, "romon": true, "sniff": true, "telnet": true, "tikapp": true, "winbox": true, "dude": false, "local": true, "policy": false, "reboot": true, "rest-api": true, "sensitive": true, "ssh": true, "test": true, "web": true, "write": false}'); 62 | INSERT INTO public.permissions(id, name, perms) VALUES (3, 'write', '{"api": true, "dude": false, "ftp": false, "local": true, "password": true, "policy": false, "read": true, "reboot": true, "rest-api": true, "romon": true, "sensitive": true, "sniff": true, "ssh": true, "telnet": true, "test": true, "tikapp": true, "web": true, "winbox": true, "write": true}'); 63 | INSERT INTO public.user_group_perm_rel(group_id, user_id, perm_id) VALUES ( 1, '37cc36e0-afec-4545-9219-94655805868b', 1); 64 | EOF1 65 | # Run the Python script 66 | python3 /app/initpy.py 67 | 68 | # Check if the Python script ran successfully 69 | if [ $? -ne 0 ]; then 70 | echo "An error occurred while executing the SQL commands." 71 | else 72 | touch $CONTAINER_ALREADY_STARTED 73 | echo "SQL commands executed successfully." 74 | fi 75 | cron 76 | uwsgi --ini /app/conf/uwsgi.ini:uwsgi-production --touch-reload=/app/reload 77 | else 78 | cron 79 | uwsgi --ini /app/conf/uwsgi.ini:uwsgi-production --touch-reload=/app/reload 80 | fi 81 | -------------------------------------------------------------------------------- /mikroman/initpy.py: -------------------------------------------------------------------------------- 1 | import json 2 | import psycopg2 3 | 4 | # Step 1: Read connection details from server.json 5 | with open('/conf/server-conf.json') as f: 6 | config = json.load(f) 7 | 8 | # Step 2: Connect to the PostgreSQL database 9 | try: 10 | conn = psycopg2.connect( 11 | dbname=config['PYSRV_DATABASE_NAME'], 12 | user=config['PYSRV_DATABASE_USER'], 13 | password=config['PYSRV_DATABASE_PASSWORD'], 14 | host=config['PYSRV_DATABASE_HOST_POSTGRESQL'], 15 | port=config['PYSRV_DATABASE_PORT'] 16 | ) 17 | cursor = conn.cursor() 18 | print("Connected to the database successfully.") 19 | 20 | # Step 3: Read the SQL commands from the SQL file 21 | with open('init.sql', 'r') as sql_file: 22 | sql_commands = sql_file.read() 23 | 24 | # Step 4: Execute the SQL commands 25 | cursor.execute(sql_commands) 26 | if cursor.description: # Check if there are results 27 | # Fetch all results 28 | results = cursor.fetchall() 29 | # Print each row of results 30 | for row in results: 31 | print(row) 32 | conn.commit() # Commit the changes if it's not a SELECT query 33 | print("Executed SQL commands successfully.") 34 | 35 | except Exception as e: 36 | print(f"An error occurred: {e}") 37 | exit(1) 38 | finally: 39 | # Close the database connection 40 | if cursor: 41 | cursor.close() 42 | if conn: 43 | conn.close() 44 | print("Database connection closed.") 45 | -------------------------------------------------------------------------------- /mikroman/reqs.txt: -------------------------------------------------------------------------------- 1 | Flask==2.3.2 2 | Flask-Session2==1.3.1 3 | passlib==1.7.4 4 | peewee==3.16.2 5 | peewee-migrate==1.7.1 6 | psycopg2-binary==2.9.6 7 | pytz==2022.7.1 8 | redis==4.5.4 9 | uwsgidecorators==1.1.0 10 | beautifulsoup4==4.10.0 11 | #chardet==4.0.0 12 | click==8.1.7 13 | #click==8.0.3 14 | cron_descriptor==1.4.0 15 | cron_validator==1.0.8 16 | cryptography==3.4.8 17 | feedparser==6.0.11 18 | librouteros==3.2.1 19 | nagiosplugin==1.3.3 20 | paramiko==2.9.3 21 | pexpect==4.9.0 22 | pycryptodome==3.20.0 23 | pyrad==2.4 24 | python_crontab==3.0.0 25 | Requests==2.32.2 26 | #setuptools==59.6.0 27 | uvloop==0.19.0 28 | netifaces==0.11.0 -------------------------------------------------------------------------------- /mikroman/server-conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "python server config template - rename me", 3 | "PYSRV_IS_PRODUCTION": "1", 4 | "PYSRV_DATABASE_HOST": "127.0.0.1", 5 | "PYSRV_DATABASE_HOST_POSTGRESQL": "127.0.0.1", 6 | "PYSRV_DATABASE_PORT": "5432", 7 | "PYSRV_DATABASE_NAME": "mikrowizard_db", 8 | "PYSRV_DATABASE_USER": "mikrowizard_user", 9 | "PYSRV_DATABASE_PASSWORD": "securepassword", 10 | "PYSRV_CRYPT_KEY": "bN0PJaVMpV7e4NGE8cLF3FECgY_nofYDuBtlLxX7pWg=", 11 | "PYSRV_BACKUP_FOLDER":"/backups/", 12 | "PYSRV_FIRM_FOLDER":"/firms/", 13 | "PYSRV_COOKIE_HTTPS_ONLY": false, 14 | "PYSRV_REDIS_HOST": "127.0.0.1:6379", 15 | "PYSRV_DOMAIN_NAME": "", 16 | "PYSRV_CORS_ALLOW_ORIGIN": "*" 17 | } 18 | -------------------------------------------------------------------------------- /mikroman/server-conf.json.template: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "name": "python server config template - rename me", 4 | "PYSRV_IS_PRODUCTION": "1", 5 | "PYSRV_DATABASE_HOST": "127.0.0.1", 6 | "PYSRV_DATABASE_PORT": "5432", 7 | "PYSRV_DATABASE_NAME": "${MW_DB_NAME}", 8 | "PYSRV_DATABASE_USER": "${MW_DB_USER}", 9 | "PYSRV_DATABASE_PASSWORD": "${MW_DB_PASSWORD}", 10 | "PYSRV_CRYPT_KEY": "${MW_encryptKey}", 11 | "PYSRV_COOKIE_HTTPS_ONLY": false, 12 | "PYSRV_REDIS_HOST": "127.0.0.1:6379", 13 | "PYSRV_CORS_ALLOW_ORIGIN": "*" 14 | } 15 | -------------------------------------------------------------------------------- /mikroman/testdb.py: -------------------------------------------------------------------------------- 1 | import psycopg2 2 | import time 3 | import os 4 | import json 5 | 6 | # Step 1: Read connection details from server.json 7 | 8 | def wait_for_postgres(): 9 | try: 10 | with open('/conf/server-conf.json') as f: 11 | config = json.load(f) 12 | db_name = config['PYSRV_DATABASE_NAME'] 13 | db_user = config['PYSRV_DATABASE_USER'] 14 | db_password = config['PYSRV_DATABASE_PASSWORD'] 15 | db_host = config['PYSRV_DATABASE_HOST_POSTGRESQL'] 16 | db_port = config['PYSRV_DATABASE_PORT'] 17 | 18 | except Exception as e: 19 | print(f"An error occurred: {e}") 20 | exit(1) 21 | print(f"Waiting for PostgreSQL database {db_name} to become available...") 22 | while True: 23 | try: 24 | conn = psycopg2.connect( 25 | dbname=db_name, 26 | user=db_user, 27 | password=db_password, 28 | host=db_host, 29 | port=db_port 30 | ) 31 | conn.close() 32 | print("PostgreSQL is ready!") 33 | break 34 | except psycopg2.OperationalError as e: 35 | print(f"Database not ready yet. Retrying in 5 seconds...\nError: {e}") 36 | time.sleep(5) 37 | 38 | wait_for_postgres() 39 | -------------------------------------------------------------------------------- /prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Load environment variables 4 | set -a 5 | source .env 6 | set +a 7 | export MW_encryptKey=$(python3 -c 'import os; import base64; print(base64.urlsafe_b64encode(os.urandom(32)).decode("utf-8"))') 8 | # Create directories dynamically based on the environment variables 9 | sudo mkdir -p "${CONF_PATH}" 10 | sudo mkdir -p "${FIRMWARE_PATH}" 11 | sudo mkdir -p "${BACKUPS_PATH}" 12 | sed -i "s/.*MW_encryptKey.*/MW_encryptKey=${MW_encryptKey}/" .env 13 | 14 | echo "Required directories created:" 15 | echo "Conf: ${CONF_PATH}" 16 | echo "Firmware: ${FIRMWARE_PATH}" 17 | echo "Backups: ${BACKUPS_PATH}" 18 | 19 | echo "Your configuration:" 20 | 21 | 22 | cat << EOF1 | sudo tee ${CONF_PATH}/server-conf.json >/dev/null 23 | { 24 | "name": "python server config template - rename me", 25 | "PYSRV_IS_PRODUCTION": "1", 26 | "PYSRV_DATABASE_HOST": "127.0.0.1", 27 | "PYSRV_DATABASE_HOST_POSTGRESQL": "127.0.0.1", 28 | "PYSRV_DATABASE_PORT": "5432", 29 | "PYSRV_DATABASE_NAME": "${MW_DB_NAME}", 30 | "PYSRV_DATABASE_USER": "${MW_DB_USER}", 31 | "PYSRV_DATABASE_PASSWORD": "${MW_DB_PASSWORD}", 32 | "PYSRV_CRYPT_KEY": "${MW_encryptKey}", 33 | "PYSRV_BACKUP_FOLDER":"/backups/", 34 | "PYSRV_FIRM_FOLDER":"/firms/", 35 | "PYSRV_COOKIE_HTTPS_ONLY": false, 36 | "PYSRV_REDIS_HOST": "127.0.0.1:6379", 37 | "PYSRV_DOMAIN_NAME": "", 38 | "PYSRV_CORS_ALLOW_ORIGIN": "*" 39 | } 40 | EOF1 41 | 42 | cat << EOF2 | sudo tee ./mikroman/server-conf.json >/dev/null 43 | { 44 | "name": "python server config template - rename me", 45 | "PYSRV_IS_PRODUCTION": "1", 46 | "PYSRV_DATABASE_HOST": "127.0.0.1", 47 | "PYSRV_DATABASE_HOST_POSTGRESQL": "127.0.0.1", 48 | "PYSRV_DATABASE_PORT": "5432", 49 | "PYSRV_DATABASE_NAME": "${MW_DB_NAME}", 50 | "PYSRV_DATABASE_USER": "${MW_DB_USER}", 51 | "PYSRV_DATABASE_PASSWORD": "${MW_DB_PASSWORD}", 52 | "PYSRV_CRYPT_KEY": "${MW_encryptKey}", 53 | "PYSRV_BACKUP_FOLDER":"/backups/", 54 | "PYSRV_FIRM_FOLDER":"/firms/", 55 | "PYSRV_COOKIE_HTTPS_ONLY": false, 56 | "PYSRV_REDIS_HOST": "127.0.0.1:6379", 57 | "PYSRV_DOMAIN_NAME": "", 58 | "PYSRV_CORS_ALLOW_ORIGIN": "*" 59 | } 60 | EOF2 61 | 62 | echo "Stored in : ${CONF_PATH}/server-conf.json" 63 | --------------------------------------------------------------------------------