ui: add group member count

This commit is contained in:
undefined committed 2026-04-18 01:22:16 +08:00
1 parent eb8c9cb656
commit 4a372ea0e3
10 files changed
+21 -18

No files matched your search

+5 -5
View File
@@ -5,16 +5,16 @@
"main": "base.mjs", "main": "base.mjs",
"repository": "https://github.com/hydro-dev/Hydro", "repository": "https://github.com/hydro-dev/Hydro",
"dependencies": { "dependencies": {
"@antfu/eslint-config": "^8.0.0", "@antfu/eslint-config": "^8.2.0",
"@eslint-react/eslint-plugin": "^4.2.3", "@eslint-react/eslint-plugin": "^4.2.3",
"@typescript-eslint/eslint-plugin": "^8.58.0", "@typescript-eslint/eslint-plugin": "^8.58.2",
"@typescript-eslint/parser": "^8.58.0", "@typescript-eslint/parser": "^8.58.2",
"eslint-plugin-de-morgan": "^2.1.1", "eslint-plugin-de-morgan": "^2.1.1",
"eslint-plugin-github": "^6.0.0", "eslint-plugin-github": "^6.0.0",
"eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-hooks": "^7.1.0",
"eslint-plugin-react-refresh": "^0.5.2", "eslint-plugin-react-refresh": "^0.5.2",
"eslint-plugin-simple-import-sort": "^12.1.1", "eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^17.4.0" "globals": "^17.5.0"
}, },
"peerDependencies": { "peerDependencies": {
"eslint": ">= 9" "eslint": ">= 9"
+1 -1
View File
@@ -10,7 +10,7 @@
"dependencies": { "dependencies": {
"@hydrooj/utils": "workspace:^", "@hydrooj/utils": "workspace:^",
"@koa/router": "^15.4.0", "@koa/router": "^15.4.0",
"@mongodb-js/saslprep": "^1.4.6", "@mongodb-js/saslprep": "^1.4.8",
"emoji-regex": "^10.6.0", "emoji-regex": "^10.6.0",
"fs-extra": "^11.3.4", "fs-extra": "^11.3.4",
"koa": "^3.2.0", "koa": "^3.2.0",
+3 -3
View File
@@ -9,11 +9,11 @@
"@hydrooj/common": "workspace:^", "@hydrooj/common": "workspace:^",
"@hydrooj/utils": "workspace:^", "@hydrooj/utils": "workspace:^",
"@opentelemetry/api": "^1.9.1", "@opentelemetry/api": "^1.9.1",
"@opentelemetry/exporter-trace-otlp-http": "^0.214.0", "@opentelemetry/exporter-trace-otlp-http": "^0.215.0",
"@opentelemetry/sdk-node": "^0.214.0", "@opentelemetry/sdk-node": "^0.215.0",
"@zip.js/zip.js": "^2.8.26", "@zip.js/zip.js": "^2.8.26",
"cac": "^7.0.0", "cac": "^7.0.0",
"p-queue": "^9.1.1", "p-queue": "^9.1.2",
"schemastery": "^3.18.0", "schemastery": "^3.18.0",
"semver": "^7.7.4", "semver": "^7.7.4",
"shell-quote": "^1.8.3", "shell-quote": "^1.8.3",
+1 -1
View File
@@ -28,7 +28,7 @@
"@zip.js/zip.js": "^2.8.26", "@zip.js/zip.js": "^2.8.26",
"adm-zip": "0.5.16", "adm-zip": "0.5.16",
"cac": "^7.0.0", "cac": "^7.0.0",
"cordis": "4.0.0-rc.2", "cordis": "4.0.0-rc.3",
"csv-stringify": "^6.7.0", "csv-stringify": "^6.7.0",
"emoji-regex": "^10.6.0", "emoji-regex": "^10.6.0",
"emojis-list": "2.1.0", "emojis-list": "2.1.0",
@@ -41,7 +41,7 @@ function initTimePicker(input: HTMLInputElement) {
}).on('mousedown', (e) => { }).on('mousedown', (e) => {
e.preventDefault(); e.preventDefault();
$input.val(time).trigger('change'); $input.val(time).trigger('change');
closeDropdown(); closeDropdown(); // eslint-disable-line no-use-before-define
}).on('mouseenter', function () { }).on('mouseenter', function () {
$(this).css('background', 'var(--highlight-color, #e8f0fe)'); $(this).css('background', 'var(--highlight-color, #e8f0fe)');
}).on('mouseleave', function () { }).on('mouseleave', function () {
+1 -1
View File
@@ -51,7 +51,7 @@
"clean-webpack-plugin": "^4.0.0", "clean-webpack-plugin": "^4.0.0",
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"copy-webpack-plugin": "^14.0.0", "copy-webpack-plugin": "^14.0.0",
"cordis": "4.0.0-rc.2", "cordis": "4.0.0-rc.3",
"core-js": "^3.49.0", "core-js": "^3.49.0",
"core-js-compat": "^3.49.0", "core-js-compat": "^3.49.0",
"css-loader": "^7.1.4", "css-loader": "^7.1.4",
@@ -51,13 +51,16 @@ const page = new NamedPage('domain_group', () => {
const gid = ele.getAttribute('data-gid'); const gid = ele.getAttribute('data-gid');
targets[gid] = input; targets[gid] = input;
let loaded = false; let loaded = false;
const save = _.debounce(() => update(gid, input.value()), 500);
input.onChange(() => { input.onChange(() => {
if (input.value().length && !loaded) { if (input.value().length && !loaded) {
loaded = true; loaded = true;
$(ele).closest('tr').find('.group-member-count').text(`${input.value().length} ${i18n('members')}`);
return; return;
} }
if (!loaded) return; if (!loaded) return;
update(gid, input.value()); $(ele).closest('tr').find('.group-member-count').text(`${input.value().length} ${i18n('members')}`);
save();
}); });
}); });
@@ -36,7 +36,7 @@
<input type="checkbox" data-checkbox-group="group" data-checkbox-range> <input type="checkbox" data-checkbox-group="group" data-checkbox-range>
</label> </label>
</td> </td>
<td class="col--group">{{ gdoc.name }}</td> <td class="col--group">{{ gdoc.name }}<br><small class="supplementary group-member-count">{{ gdoc.uids.length }} {{ _('members') }}</small></td>
<td class="col--user"><input type="text" value="{{ gdoc.uids.join(',') }}" data-gid="{{ gdoc.name }}"></input></td> <td class="col--user"><input type="text" value="{{ gdoc.uids.join(',') }}" data-gid="{{ gdoc.name }}"></input></td>
</tr> </tr>
{%- endfor -%} {%- endfor -%}
+3 -3
View File
@@ -9,13 +9,13 @@
}, },
"dependencies": { "dependencies": {
"@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-react": "^6.0.1",
"react": "^19.2.4", "react": "^19.2.5",
"react-dom": "^19.2.4" "react-dom": "^19.2.5"
}, },
"devDependencies": { "devDependencies": {
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react-swc": "^4.3.0", "@vitejs/plugin-react-swc": "^4.3.0",
"vite": "^8.0.3" "vite": "^8.0.8"
} }
} }
+1 -1
View File
@@ -9,7 +9,7 @@
"preferUnplugged": true, "preferUnplugged": true,
"dependencies": { "dependencies": {
"@hydrooj/utils": "workspace:^", "@hydrooj/utils": "workspace:^",
"jsdom": "^29.0.1", "jsdom": "^29.0.2",
"superagent-charset": "^1.2.0", "superagent-charset": "^1.2.0",
"superagent-proxy": "^3.0.0" "superagent-proxy": "^3.0.0"
}, },