adminforth 2.2.0-next.1 → 2.2.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -284,13 +284,13 @@ async function writeTemplateFiles(dirname, cwd, options) {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
async function installDependencies(ctx, cwd) {
|
|
287
|
-
const
|
|
288
|
-
const
|
|
289
|
-
|
|
287
|
+
const isWindows = process.platform === 'win32';
|
|
288
|
+
const npmCmd = isWindows ? 'npm.cmd' : 'npm';
|
|
289
|
+
|
|
290
290
|
const customDir = ctx.customDir;
|
|
291
291
|
const res = await Promise.all([
|
|
292
|
-
await execAsync(`${
|
|
293
|
-
await execAsync(`${
|
|
292
|
+
await execAsync(`${npmCmd} install`, { cwd, env: { PATH: process.env.PATH } }),
|
|
293
|
+
await execAsync(`${npmCmd} install`, { cwd: customDir, env: { PATH: process.env.PATH } }),
|
|
294
294
|
]);
|
|
295
295
|
// console.log(chalk.dim(`Dependencies installed in ${cwd} and ${customDir}: \n${res[0].stdout}${res[1].stdout}`));
|
|
296
296
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
const spaPath = path.join(import.meta.dirname, 'dist', 'spa');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
if (fs.existsSync(spaPath)){
|
|
9
|
+
console.log('Installing SPA dependencies...');
|
|
10
|
+
execSync('npm ci', { cwd: spaPath, stdio: 'inherit' });
|
|
11
|
+
console.log('Installed spa dependencies');
|
|
12
|
+
} else {
|
|
13
|
+
console.log('SPA dependencies not found');
|
|
14
|
+
console.log('current directory', import.meta.dirname);
|
|
15
|
+
}
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
</td>
|
|
85
85
|
</tr>
|
|
86
86
|
|
|
87
|
-
<tr @
|
|
87
|
+
<tr @click="onClick($event,row)"
|
|
88
88
|
v-else v-for="(row, rowI) in rows" :key="`row_${row._primaryKeyValue}`"
|
|
89
89
|
ref="rowRefs"
|
|
90
90
|
class="bg-lightListTable dark:bg-darkListTable border-lightListBorder dark:border-gray-700 hover:bg-lightListTableRowHover dark:hover:bg-darkListTableRowHover"
|
|
@@ -457,50 +457,48 @@ function onSortButtonClick(event, field) {
|
|
|
457
457
|
|
|
458
458
|
const clickTarget = ref(null);
|
|
459
459
|
|
|
460
|
-
async function onClick(e,
|
|
461
|
-
if
|
|
460
|
+
async function onClick(e,row) {
|
|
461
|
+
if(clickTarget.value === e.target) return;
|
|
462
462
|
clickTarget.value = e.target;
|
|
463
463
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
464
464
|
if (window.getSelection().toString()) return;
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
e.metaKey ||
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
465
|
+
else {
|
|
466
|
+
if (row._clickUrl === null) {
|
|
467
|
+
// user asked to nothing on click
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
if (e.ctrlKey || e.metaKey || row._clickUrl?.includes('target=_blank')) {
|
|
471
|
+
|
|
472
|
+
if (row._clickUrl) {
|
|
473
|
+
window.open(row._clickUrl, '_blank');
|
|
474
|
+
} else {
|
|
475
|
+
window.open(
|
|
476
|
+
router.resolve({
|
|
477
|
+
name: 'resource-show',
|
|
478
|
+
params: {
|
|
479
|
+
resourceId: props.resource.resourceId,
|
|
480
|
+
primaryKey: row._primaryKeyValue,
|
|
481
|
+
},
|
|
482
|
+
}).href,
|
|
483
|
+
'_blank'
|
|
484
|
+
);
|
|
485
|
+
}
|
|
477
486
|
} else {
|
|
478
|
-
|
|
479
|
-
|
|
487
|
+
if (row._clickUrl) {
|
|
488
|
+
if (row._clickUrl.startsWith('http')) {
|
|
489
|
+
document.location.href = row._clickUrl;
|
|
490
|
+
} else {
|
|
491
|
+
router.push(row._clickUrl);
|
|
492
|
+
}
|
|
493
|
+
} else {
|
|
494
|
+
router.push({
|
|
480
495
|
name: 'resource-show',
|
|
481
496
|
params: {
|
|
482
497
|
resourceId: props.resource.resourceId,
|
|
483
498
|
primaryKey: row._primaryKeyValue,
|
|
484
499
|
},
|
|
485
|
-
})
|
|
486
|
-
'_blank'
|
|
487
|
-
);
|
|
488
|
-
}
|
|
489
|
-
} else {
|
|
490
|
-
if (row._clickUrl) {
|
|
491
|
-
if (row._clickUrl.startsWith('http')) {
|
|
492
|
-
document.location.href = row._clickUrl;
|
|
493
|
-
} else {
|
|
494
|
-
router.push(row._clickUrl);
|
|
500
|
+
});
|
|
495
501
|
}
|
|
496
|
-
} else {
|
|
497
|
-
router.push({
|
|
498
|
-
name: 'resource-show',
|
|
499
|
-
params: {
|
|
500
|
-
resourceId: props.resource.resourceId,
|
|
501
|
-
primaryKey: row._primaryKeyValue,
|
|
502
|
-
},
|
|
503
|
-
});
|
|
504
502
|
}
|
|
505
503
|
}
|
|
506
504
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adminforth",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.11",
|
|
4
4
|
"description": "OpenSource Vue3 powered forth-generation admin panel",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"rollout-doc": "cd documentation && npm run build && npm run deploy",
|
|
21
21
|
"docs": "typedoc",
|
|
22
22
|
"--comment_postinstall": "postinstall executed after package installed in other project package and when we do npm ci in the package",
|
|
23
|
-
"postinstall": "
|
|
23
|
+
"postinstall": "node -e \"const fs=require('fs');const path=require('path');const spaPath=path.join(__dirname,'dist','spa');if(fs.existsSync(spaPath)){process.chdir(spaPath);require('child_process').execSync('npm ci',{stdio:'inherit'});console.log('installed spa dependencies');}\""
|
|
24
24
|
},
|
|
25
25
|
"release": {
|
|
26
26
|
"plugins": [
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"license": "ISC",
|
|
57
57
|
"type": "module",
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@babel/parser": "^7.27.
|
|
59
|
+
"@babel/parser": "^7.27.5",
|
|
60
60
|
"@clickhouse/client": "^1.4.0",
|
|
61
61
|
"@faker-js/faker": "^9.0.3",
|
|
62
62
|
"@inquirer/prompts": "^7.4.1",
|