mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 05:20:46 +08:00
feat(settings): move IM bot to top-level menu
Remove the legacy Plugins-tab registrations, keep the channel-logo navigation, and harden upgrade/package verification.
This commit is contained in:
parent
892e18db77
commit
1ce8126edb
30 changed files with 815 additions and 842 deletions
|
|
@ -16,7 +16,6 @@ import {
|
|||
} from '../../channel-card-meta.js';
|
||||
import {
|
||||
DINGTALK_ENDPOINTS,
|
||||
DINGTALK_RPC_CHANNEL,
|
||||
connectionTestFeedback,
|
||||
formatRemaining,
|
||||
normalizeProvisioning,
|
||||
|
|
@ -29,9 +28,6 @@ import { installDingtalkStyles } from './styles.js';
|
|||
|
||||
const ACTIVE_PROVISION_STATES = new Set(['pending', 'scanned', 'authorizing', 'creating', 'connecting']);
|
||||
|
||||
export const name = 'dingtalk-settings';
|
||||
export const inject = ['slots', 'connection'];
|
||||
|
||||
function DingtalkIcon({ size = 28 }) {
|
||||
return h('svg', {
|
||||
width: size,
|
||||
|
|
@ -864,16 +860,3 @@ export function DingtalkSettingsTab({ rpcCall }) {
|
|||
})
|
||||
: null)));
|
||||
}
|
||||
|
||||
export function apply(ctx) {
|
||||
ctx.effect(() => installDingtalkStyles(), 'dingtalk-settings: install client styles');
|
||||
const rpcCall = (endpoint, payload, signal) =>
|
||||
ctx.connection.rpc.call(DINGTALK_RPC_CHANNEL, endpoint, payload, signal);
|
||||
ctx.slots.inject('settings.plugins.tab', () => ctx.slots.register({
|
||||
name: 'settings.plugins.tab',
|
||||
id: 'dingtalk',
|
||||
order: 40,
|
||||
label: '钉钉',
|
||||
inject: () => ({ rpcCall }),
|
||||
}, DingtalkSettingsTab));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export const DINGTALK_STYLE_ID = 'xmanrui-dsh-dingtalk-settings';
|
||||
export const DINGTALK_STYLE_ID = 'xmanrui-dsh-im-dingtalk-settings';
|
||||
|
||||
const CSS = String.raw`
|
||||
.ddt-page {
|
||||
|
|
@ -126,7 +126,7 @@ export function installDingtalkStyles() {
|
|||
const existing = document.querySelector(`style[data-plugin-css="${DINGTALK_STYLE_ID}"]`);
|
||||
if (existing) return () => {};
|
||||
const style = document.createElement('style');
|
||||
style.dataset.plugin = '@xmanrui/dsh-dingtalk';
|
||||
style.dataset.plugin = '@xmanrui/dsh-im';
|
||||
style.dataset.pluginCss = DINGTALK_STYLE_ID;
|
||||
style.textContent = CSS;
|
||||
document.head.appendChild(style);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue