diff --git a/composer.json b/composer.json index fde9cd0d..e76af613 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,8 @@ "Admin\\Admin\\": "src/Admin/src/", "Admin\\Page\\": "src/Page/src/", "Admin\\Dashboard\\": "src/Dashboard/src/", - "Admin\\Setting\\": "src/Setting/src/" + "Admin\\Setting\\": "src/Setting/src/", + "Admin\\Fixtures\\": "data/doctrine/fixtures" } }, "autoload-dev": { diff --git a/config/autoload/authentication.global.php b/config/autoload/authentication.global.php index bd0d546b..f8f71cf0 100644 --- a/config/autoload/authentication.global.php +++ b/config/autoload/authentication.global.php @@ -8,7 +8,7 @@ 'doctrine' => [ 'authentication' => [ 'orm_default' => [ - 'object_manager' => 'doctrine.entitymanager.orm_default', + 'object_manager' => 'doctrine.entity_manager.orm_default', 'identity_class' => Admin::class, 'identity_property' => 'identity', 'credential_property' => 'password', diff --git a/config/cli-config.php b/config/cli-config.php index c39570bd..7385bed1 100644 --- a/config/cli-config.php +++ b/config/cli-config.php @@ -13,7 +13,4 @@ $entityManager = $container->get(EntityManager::class); -// register enum type for doctrine -$entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); - return DependencyFactory::fromEntityManager($config, new ExistingEntityManager($entityManager)); diff --git a/data/doctrine/fixtures/AdminLoader.php b/data/doctrine/fixtures/AdminLoader.php index d374d188..e930470e 100644 --- a/data/doctrine/fixtures/AdminLoader.php +++ b/data/doctrine/fixtures/AdminLoader.php @@ -6,6 +6,7 @@ use Admin\Admin\Entity\Admin; use Admin\Admin\Entity\AdminRole; +use Admin\Admin\Enum\AdminRoleEnum; use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Common\DataFixtures\FixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -24,7 +25,7 @@ public function load(ObjectManager $manager): void ->setFirstName('Dotkernel') ->setLastName('Admin') ->addRole( - $manager->getRepository(AdminRole::class)->findOneBy(['name' => AdminRole::ROLE_SUPERUSER]) + $manager->getRepository(AdminRole::class)->findOneBy(['name' => AdminRoleEnum::Superuser]) ); $manager->persist($admin); diff --git a/data/doctrine/fixtures/AdminRoleLoader.php b/data/doctrine/fixtures/AdminRoleLoader.php index 745be811..d34dfdde 100644 --- a/data/doctrine/fixtures/AdminRoleLoader.php +++ b/data/doctrine/fixtures/AdminRoleLoader.php @@ -5,6 +5,7 @@ namespace Admin\Fixtures; use Admin\Admin\Entity\AdminRole; +use Admin\Admin\Enum\AdminRoleEnum; use Doctrine\Common\DataFixtures\FixtureInterface; use Doctrine\Persistence\ObjectManager; @@ -13,10 +14,10 @@ class AdminRoleLoader implements FixtureInterface public function load(ObjectManager $manager): void { $manager->persist( - (new AdminRole())->setName(AdminRole::ROLE_SUPERUSER) + (new AdminRole())->setName(AdminRoleEnum::Superuser) ); $manager->persist( - (new AdminRole())->setName(AdminRole::ROLE_ADMIN) + (new AdminRole())->setName(AdminRoleEnum::Admin) ); $manager->flush(); diff --git a/data/doctrine/migrations/Version20240627134952.php b/data/doctrine/migrations/Version20250310084727.php similarity index 64% rename from data/doctrine/migrations/Version20240627134952.php rename to data/doctrine/migrations/Version20250310084727.php index 243eed9d..3daad313 100644 --- a/data/doctrine/migrations/Version20240627134952.php +++ b/data/doctrine/migrations/Version20250310084727.php @@ -10,7 +10,7 @@ /** * Auto-generated Migration: Please modify to your needs! */ -final class Version20240627134952 extends AbstractMigration +final class Version20250310084727 extends AbstractMigration { public function getDescription(): string { @@ -20,11 +20,11 @@ public function getDescription(): string public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE admin (uuid BINARY(16) NOT NULL, identity VARCHAR(100) NOT NULL, firstName VARCHAR(255) DEFAULT NULL, lastName VARCHAR(255) DEFAULT NULL, password VARCHAR(100) NOT NULL, status ENUM(\'pending\', \'active\'), created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_880E0D766A95E9C4 (identity), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); + $this->addSql('CREATE TABLE admin (uuid BINARY(16) NOT NULL, identity VARCHAR(100) NOT NULL, firstName VARCHAR(255) DEFAULT NULL, lastName VARCHAR(255) DEFAULT NULL, password VARCHAR(100) NOT NULL, status ENUM(\'active\', \'inactive\') DEFAULT \'active\' NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_880E0D766A95E9C4 (identity), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); $this->addSql('CREATE TABLE admin_roles (userUuid BINARY(16) NOT NULL, roleUuid BINARY(16) NOT NULL, INDEX IDX_1614D53DD73087E9 (userUuid), INDEX IDX_1614D53D88446210 (roleUuid), PRIMARY KEY(userUuid, roleUuid)) DEFAULT CHARACTER SET utf8mb4'); - $this->addSql('CREATE TABLE admin_login (uuid BINARY(16) NOT NULL, adminIp VARCHAR(50) DEFAULT NULL, country VARCHAR(50) DEFAULT NULL, continent VARCHAR(50) DEFAULT NULL, organization VARCHAR(50) DEFAULT NULL, deviceType VARCHAR(20) DEFAULT NULL, deviceBrand VARCHAR(20) DEFAULT NULL, deviceModel VARCHAR(40) DEFAULT NULL, isMobile ENUM(\'yes\', \'no\'), osName VARCHAR(20) DEFAULT NULL, osVersion VARCHAR(20) DEFAULT NULL, osPlatform VARCHAR(20) DEFAULT NULL, clientType VARCHAR(20) DEFAULT NULL, clientName VARCHAR(40) DEFAULT NULL, clientEngine VARCHAR(20) DEFAULT NULL, clientVersion VARCHAR(20) DEFAULT NULL, loginStatus ENUM(\'success\', \'fail\'), identity VARCHAR(100) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); - $this->addSql('CREATE TABLE admin_role (uuid BINARY(16) NOT NULL, name VARCHAR(30) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_7770088A5E237E06 (name), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); - $this->addSql('CREATE TABLE settings (uuid BINARY(16) NOT NULL, identifier VARCHAR(50) NOT NULL, value LONGTEXT NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, admin_uuid BINARY(16) DEFAULT NULL, INDEX IDX_E545A0C5F166D246 (admin_uuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); + $this->addSql('CREATE TABLE admin_login (uuid BINARY(16) NOT NULL, adminIp VARCHAR(50) DEFAULT NULL, country VARCHAR(50) DEFAULT NULL, continent VARCHAR(50) DEFAULT NULL, organization VARCHAR(50) DEFAULT NULL, deviceType VARCHAR(20) DEFAULT NULL, deviceBrand VARCHAR(20) DEFAULT NULL, deviceModel VARCHAR(40) DEFAULT NULL, isMobile ENUM(\'yes\', \'no\') DEFAULT NULL, osName VARCHAR(20) DEFAULT NULL, osVersion VARCHAR(20) DEFAULT NULL, osPlatform VARCHAR(20) DEFAULT NULL, clientType VARCHAR(20) DEFAULT NULL, clientName VARCHAR(40) DEFAULT NULL, clientEngine VARCHAR(20) DEFAULT NULL, clientVersion VARCHAR(20) DEFAULT NULL, loginStatus ENUM(\'success\', \'fail\') DEFAULT NULL, identity VARCHAR(100) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); + $this->addSql('CREATE TABLE admin_role (uuid BINARY(16) NOT NULL, name ENUM(\'admin\', \'superuser\') DEFAULT \'admin\', created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); + $this->addSql('CREATE TABLE settings (uuid BINARY(16) NOT NULL, identifier ENUM(\'table_admin_list_selected_columns\', \'table_admin_list_logins_selected_columns\') NOT NULL, value LONGTEXT NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, admin_uuid BINARY(16) DEFAULT NULL, INDEX IDX_E545A0C5F166D246 (admin_uuid), PRIMARY KEY(uuid)) DEFAULT CHARACTER SET utf8mb4'); $this->addSql('ALTER TABLE admin_roles ADD CONSTRAINT FK_1614D53DD73087E9 FOREIGN KEY (userUuid) REFERENCES admin (uuid)'); $this->addSql('ALTER TABLE admin_roles ADD CONSTRAINT FK_1614D53D88446210 FOREIGN KEY (roleUuid) REFERENCES admin_role (uuid)'); $this->addSql('ALTER TABLE settings ADD CONSTRAINT FK_E545A0C5F166D246 FOREIGN KEY (admin_uuid) REFERENCES admin (uuid)'); diff --git a/public/images/loading-sm.gif b/public/images/loading-sm.gif index 44e3b7a0..e69de29b 100644 Binary files a/public/images/loading-sm.gif and b/public/images/loading-sm.gif differ diff --git a/public/images/loading.gif b/public/images/loading.gif index 0ea146c0..e69de29b 100644 Binary files a/public/images/loading.gif and b/public/images/loading.gif differ diff --git a/public/js/app.js b/public/js/app.js index 54582345..e64ad8ca 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1,4 +1,12 @@ -(()=>{var t={556:(t,e,n)=>{var i=n(616),r=n(364);void 0===r.$&&(r.$=i),void 0===r.jQuery&&(r.jQuery=i),t.exports=i},364:(t,e,n)=>{"use strict";t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return t}()},290:(t,e,n)=>{var i,r,o;!function(s,a,l){r=[n(556)],i=function(t){"use strict";var e,n,i,r,o,c,h,u,d,f,p,g,m,v,b,y,_,x,w,k,C,S,M,T,A,E,O,D,L,P,R={},I=0;e=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:l,normalRangeMax:l,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:l,chartRangeMax:l,chartRangeMinX:l,chartRangeMaxX:l,tooltipFormat:new i(' {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:l,nullColor:l,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:l,chartRangeMin:l,chartRangeClip:!1,colorMap:l,tooltipFormat:new i(' {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new i(' {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:l,thresholdValue:0,chartRangeMax:l,chartRangeMin:l,chartRangeClip:!1,tooltipFormat:new i("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:l,tooltipFormat:new i("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new i(' {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:l,targetColor:"#4a2",chartRangeMax:l,chartRangeMin:l,tooltipFormat:new i("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},A='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;box-sizing: content-box;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',n=function(){var e,n;return e=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(e.prototype=t.extend(new arguments[0],arguments[arguments.length-1]),e._super=arguments[0].prototype):e.prototype=arguments[arguments.length-1],arguments.length>2&&((n=Array.prototype.slice.call(arguments,1,-1)).unshift(e.prototype),t.extend.apply(t,n))):e.prototype=arguments[0],e.prototype.cls=e,e},t.SPFormatClass=i=n({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(t,e){this.format=t,this.fclass=e},render:function(t,e,n){var i,r,o,s,a,c=this,h=t;return this.format.replace(this.fre,(function(){return r=arguments[1],o=arguments[3],(i=c.precre.exec(r))?(a=i[2],r=i[1]):a=!1,(s=h[r])===l?"":o&&e&&e[o]?e[o].get?e[o].get(s)||s:e[o][s]||s:(d(s)&&(s=n.get("numberFormatter")?n.get("numberFormatter")(s):m(s,a,n.get("numberDigitGroupCount"),n.get("numberDigitGroupSep"),n.get("numberDecimalMark"))),s)}))}}),t.spformat=function(t,e){return new i(t,e)},r=function(t,e,n){return tn?n:t},o=function(t,e){var n;return 2===e?(n=a.floor(t.length/2),t.length%2?t[n]:(t[n-1]+t[n])/2):t.length%2?(n=(t.length*e+e)/4)%1?(t[a.floor(n)]+t[a.floor(n)-1])/2:t[n-1]:(n=(t.length*e+2)/4)%1?(t[a.floor(n)]+t[a.floor(n)-1])/2:t[n-1]},c=function(t){var e;switch(t){case"undefined":t=l;break;case"null":t=null;break;case"true":t=!0;break;case"false":t=!1;break;default:t==(e=parseFloat(t))&&(t=e)}return t},h=function(t){var e,n=[];for(e=t.length;e--;)n[e]=c(t[e]);return n},u=function(t,e){var n,i,r=[];for(n=0,i=t.length;n0;a-=i)e.splice(a,0,r);return e.join("")},f=function(t,e,n){var i;for(i=e.length;i--;)if((!n||null!==e[i])&&e[i]!==t)return!1;return!0},g=function(e){return t.isArray(e)?e:[e]},p=function(t){var e,n;if(s.createStyleSheet)try{return void(s.createStyleSheet().cssText=t)}catch(t){n=!0}(e=s.createElement("style")).type="text/css",s.getElementsByTagName("head")[0].appendChild(e),n?s.styleSheets[s.styleSheets.length-1].cssText=t:e["string"==typeof s.body.style.WebkitAppearance?"innerText":"innerHTML"]=t},t.fn.simpledraw=function(e,n,i,r){var o,a;if(i&&(o=this.data("_jqs_vcanvas")))return o;if(!1===t.fn.sparkline.canvas)return!1;if(t.fn.sparkline.canvas===l){var c=s.createElement("canvas");if(c.getContext&&c.getContext("2d"))t.fn.sparkline.canvas=function(t,e,n,i){return new D(t,e,n,i)};else{if(!s.namespaces||s.namespaces.v)return t.fn.sparkline.canvas=!1,!1;s.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),t.fn.sparkline.canvas=function(t,e,n,i){return new L(t,e,n)}}}return e===l&&(e=t(this).innerWidth()),n===l&&(n=t(this).innerHeight()),o=t.fn.sparkline.canvas(e,n,this,r),(a=t(this).data("_jqs_mhandler"))&&a.registerCanvas(o),o},t.fn.cleardraw=function(){var t=this.data("_jqs_vcanvas");t&&t.reset()},t.RangeMapClass=v=n({init:function(t){var e,n,i=[];for(e in t)t.hasOwnProperty(e)&&"string"==typeof e&&e.indexOf(":")>-1&&((n=e.split(":"))[0]=0===n[0].length?-1/0:parseFloat(n[0]),n[1]=0===n[1].length?1/0:parseFloat(n[1]),n[2]=t[e],i.push(n));this.map=t,this.rangelist=i||!1},get:function(t){var e,n,i,r=this.rangelist;if((i=this.map[t])!==l)return i;if(r)for(e=r.length;e--;)if((n=r[e])[0]<=t&&n[1]>=t)return n[2];return l}}),t.range_map=function(t){return new v(t)},b=n({init:function(e,n){var i=t(e);this.$el=i,this.options=n,this.currentPageX=0,this.currentPageY=0,this.el=e,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!n.get("disableTooltips"),this.highlightEnabled=!n.get("disableHighlight")},registerSparkline:function(t){this.splist.push(t),this.over&&this.updateDisplay()},registerCanvas:function(e){var n=t(e.canvas);this.canvas=e,this.$canvas=n,n.mouseenter(t.proxy(this.mouseenter,this)),n.mouseleave(t.proxy(this.mouseleave,this)),n.click(t.proxy(this.mouseclick,this))},reset:function(t){this.splist=[],this.tooltip&&t&&(this.tooltip.remove(),this.tooltip=l)},mouseclick:function(e){var n=t.Event("sparklineClick");n.originalEvent=e,n.sparklines=this.splist,this.$el.trigger(n)},mouseenter:function(e){t(s.body).unbind("mousemove.jqs"),t(s.body).bind("mousemove.jqs",t.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=e.pageX,this.currentPageY=e.pageY,this.currentEl=e.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new y(this.options),this.tooltip.updatePosition(e.pageX,e.pageY)),this.updateDisplay()},mouseleave:function(){t(s.body).unbind("mousemove.jqs");var e,n=this.splist,i=n.length,r=!1;for(this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null),e=0;e