bailinghub 0.8.0 → 0.9.0
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.
- package/README.en.md +6 -5
- package/README.md +6 -5
- package/docker-compose.images.yml +2 -2
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CHANGELOG.en.md +12 -1
- package/docs/CHANGELOG.md +12 -1
- package/docs/COMPATIBILITY.en.md +4 -0
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/MODEL_BILLING.en.md +123 -0
- package/docs/MODEL_BILLING.md +125 -0
- package/docs/PERIOD_ALLOWANCE_UPGRADE.en.md +31 -0
- package/docs/PERIOD_ALLOWANCE_UPGRADE.md +31 -0
- package/docs/README.en.md +5 -1
- package/docs/README.md +4 -0
- package/docs/RELEASE_NOTES_NEXT.en.md +4 -2
- package/docs/RELEASE_NOTES_NEXT.md +4 -2
- package/docs/RELEASE_NOTES_v0.9.0.en.md +45 -0
- package/docs/RELEASE_NOTES_v0.9.0.md +45 -0
- package/docs/UPGRADE_v0.9.0.en.md +54 -0
- package/docs/UPGRADE_v0.9.0.md +54 -0
- package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +4 -0
- package/package.json +1 -1
- package/scripts/check-doc-links.mjs +4 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +1 -0
- package/scripts/sdk-runtime-test.mjs +6 -0
- package/scripts/verify-billing-install-upgrade.mjs +225 -0
- package/scripts/verify-github-repo.mjs +1 -0
- package/sdk/node/README.md +17 -0
- package/sdk/node/examples/billing.mjs +21 -0
- package/sdk/node/package.json +5 -1
- package/sdk/node/src/index.mjs +2 -0
- package/sdk/node/src/usage.d.mts +74 -0
- package/sdk/node/src/usage.mjs +62 -0
- package/sdk/node/tests/usage-types.mts +23 -0
- package/sdk/node/tests/usage.test.mjs +81 -0
- package/sdk/php7/README.md +19 -2
- package/sdk/php7/examples/billing.php +27 -0
- package/sdk/php7/examples/well-known.php +1 -1
- package/sdk/php7/src/ToolSpec.php +1 -1
- package/sdk/php7/src/UsageClient.php +95 -0
- package/sdk/php7/src/UsageClientException.php +22 -0
- package/sdk/php7/tests/billing-core-http.php +59 -0
- package/sdk/php7/tests/usage-client.php +78 -0
- package/sql/063_usage_model_billing.sql +153 -0
- package/sql/064_period_plan_allowance.sql +25 -0
- package/sql/README.en.md +12 -4
- package/sql/README.md +14 -6
- package/src/app/auth.ts +2 -0
- package/src/app/oss-edition.ts +1 -0
- package/src/infrastructure/config/configstore.ts +6 -0
- package/src/modules/usage/allowance-reset.mysql.test.ts +122 -0
- package/src/modules/usage/billing-contracts.ts +59 -0
- package/src/modules/usage/billing-decimal.test.ts +22 -0
- package/src/modules/usage/billing-decimal.ts +36 -0
- package/src/modules/usage/billing-external.ts +39 -0
- package/src/modules/usage/billing-gateway.mysql.test.ts +24 -0
- package/src/modules/usage/billing-ledger.test.ts +51 -0
- package/src/modules/usage/billing-ledger.ts +104 -0
- package/src/modules/usage/billing-presentation.mysql.test.ts +95 -0
- package/src/modules/usage/billing-presentation.test.ts +49 -0
- package/src/modules/usage/billing-presentation.ts +34 -0
- package/src/modules/usage/billing-prices.mysql.test.ts +88 -0
- package/src/modules/usage/billing-repository.mysql.test.ts +181 -0
- package/src/modules/usage/billing-repository.ts +463 -0
- package/src/modules/usage/contracts.ts +49 -0
- package/src/modules/usage/dynamic-plan-models.mysql.test.ts +221 -0
- package/src/modules/usage/errors.ts +19 -0
- package/src/modules/usage/http.ts +85 -0
- package/src/modules/usage/identity-revocation.mysql.test.ts +286 -0
- package/src/modules/usage/identity.mysql.test.ts +120 -0
- package/src/modules/usage/identity.ts +303 -0
- package/src/modules/usage/issuer-sdk-billing.mysql.test.ts +92 -0
- package/src/modules/usage/model-gateway.mysql.test.ts +207 -0
- package/src/modules/usage/model-gateway.ts +229 -0
- package/src/modules/usage/model-tool-gateway.mysql.test.ts +137 -0
- package/src/modules/usage/model-tool-provider.test.ts +37 -0
- package/src/modules/usage/model-tool-provider.ts +110 -0
- package/src/modules/usage/model-tools.test.ts +36 -0
- package/src/modules/usage/model-tools.ts +62 -0
- package/src/modules/usage/period-allowance.mysql.test.ts +97 -0
- package/src/modules/usage/period.test.ts +26 -0
- package/src/modules/usage/period.ts +96 -0
- package/src/modules/usage/pricing.test.ts +178 -0
- package/src/modules/usage/pricing.ts +228 -0
- package/src/modules/usage/provider-failure.ts +37 -0
- package/src/modules/usage/provider-stream.test.ts +85 -0
- package/src/modules/usage/provider-stream.ts +77 -0
- package/src/modules/usage/provider.test.ts +67 -0
- package/src/modules/usage/provider.ts +142 -0
- package/src/modules/usage/repository.ts +539 -0
- package/src/modules/usage/service-availability.mysql.test.ts +68 -0
- package/src/modules/usage/service-availability.ts +13 -0
- package/src/modules/usage/service-delete.mysql.test.ts +87 -0
- package/src/modules/usage/stream-http.ts +32 -0
- package/src/modules/usage/test-harness.ts +108 -0
- package/src/modules/usage/usage-deletion.mysql.test.ts +312 -0
- package/src/modules/usage/usage-deletion.ts +119 -0
- package/src/modules/usage/validation.test.ts +18 -0
- package/src/modules/usage/validation.ts +33 -0
- package/src/routes/admin-billing-usage.ts +73 -0
- package/src/routes/admin-usage.ts +147 -0
- package/src/routes/admin.ts +4 -0
- package/src/routes/private.ts +8 -0
- package/web/connect/bailing-connect-php7.tgz +0 -0
- package/web/console/assets/Accounts-Bervi5JU.css +1 -0
- package/web/console/assets/Accounts-DnddhY6t.js +3 -0
- package/web/console/assets/{AgentClients-Bf7sUUs_.js → AgentClients-VInbD7JS.js} +1 -1
- package/web/console/assets/AgentTasks-B-1XklBg.js +2 -0
- package/web/console/assets/AgentTasks-BsG850Il.css +1 -0
- package/web/console/assets/{Approvals-BIbZvInm.js → Approvals-34qUPHf0.js} +1 -1
- package/web/console/assets/{Audit-KyPSmBdZ.js → Audit-BbVgkSm2.js} +1 -1
- package/web/console/assets/{BrandLockup-Sv5DU2G6.js → BrandLockup-DgscF28e.js} +1 -1
- package/web/console/assets/{Channels-B9n4fbxg.js → Channels-Bp-yuk8d.js} +1 -1
- package/web/console/assets/{ChatEntries-xsOCUXi_.js → ChatEntries-C9Ft60TS.js} +1 -1
- package/web/console/assets/{Clients-CI3DBDHf.js → Clients-NPldD-DD.js} +1 -1
- package/web/console/assets/{Cost-JgNXQPlN.js → Cost-DZcuB-EB.js} +1 -1
- package/web/console/assets/{Credentials-B5UUUdt0.js → Credentials-RTT7N6zl.js} +1 -1
- package/web/console/assets/{Diagnostics-BMGciWQb.js → Diagnostics-_LeK8cce.js} +1 -1
- package/web/console/assets/{Executors-CRbboOCZ.js → Executors-Bi7H8rIm.js} +1 -1
- package/web/console/assets/{HelpTip-i-KJhf5s.js → HelpTip-BfyWrxCE.js} +1 -1
- package/web/console/assets/{Kb-CgLNGjRp.js → Kb-BHamz8NP.js} +2 -2
- package/web/console/assets/{Login-C52JmXzx.js → Login-C1rJR-6w.js} +1 -1
- package/web/console/assets/{Projects-CDOvHPVS.js → Projects-BRA4a48v.js} +1 -1
- package/web/console/assets/Routes-CTC7U-fQ.js +124 -0
- package/web/console/assets/Routes-CyXV4Pba.css +1 -0
- package/web/console/assets/{Runs-DYNDXsqk.js → Runs-B_fa_BlD.js} +1 -1
- package/web/console/assets/{Setup-B91P6i1x.js → Setup-C1_d0mFy.js} +1 -1
- package/web/console/assets/Shell-CHEV6RGC.js +1 -0
- package/web/console/assets/Shell-ykb-tUfo.css +1 -0
- package/web/console/assets/{StorageBuckets-DkuDM0oX.js → StorageBuckets-DlG3ojhA.js} +1 -1
- package/web/console/assets/{SystemSettings-B7Mqj3k1.js → SystemSettings-DYo2gg6d.js} +1 -1
- package/web/console/assets/{SystemStatus-Db93b6dc.js → SystemStatus-DKCoUZlq.js} +1 -1
- package/web/console/assets/{Targets-CuuIYeZO.js → Targets-CdkG6BPR.js} +1 -1
- package/web/console/assets/{Tools-CHiqz9XZ.js → Tools-DVpCt0ox.js} +1 -1
- package/web/console/assets/Usage-CAeDGjrb.css +1 -0
- package/web/console/assets/Usage-DWCpLugC.js +1 -0
- package/web/console/assets/UsageAccess-B_Xq7ARW.js +1 -0
- package/web/console/assets/UsageAccess-CGGaWTuj.css +1 -0
- package/web/console/assets/UsageHelp-CSM4xO0K.css +1 -0
- package/web/console/assets/UsageHelp-t5ZG_f-e.js +1 -0
- package/web/console/assets/{index-QnmD7N7F.js → index-C6W4LWVV.js} +1 -1
- package/web/console/assets/{index-Fi9gkGxV.css → index-Cxuc9OCj.css} +1 -1
- package/web/console/assets/index-H1kfa0Mj.js +2 -0
- package/web/console/assets/{request-DeGya810.js → request-DLsP1_ot.js} +1 -1
- package/web/console/assets/{schema-BqlqLw1R.js → schema-BLOHvAJQ.js} +1 -1
- package/web/console/assets/{util-4bN2dv7B.js → util-CGVh2Jvr.js} +1 -1
- package/web/console/assets/{vendor-element-CZoEjZr8.js → vendor-element-BD089KxE.js} +1 -1
- package/web/console/assets/{vendor-mammoth-BUEEDX6A.js → vendor-mammoth-Bv-CZhmH.js} +1 -1
- package/web/console/index.html +3 -3
- package/web-admin/README.md +17 -0
- package/web-admin/src/components/UsageDeletionPreview.vue +44 -0
- package/web-admin/src/components/UsageHelp.vue +72 -0
- package/web-admin/src/components/UsageServiceReferences.vue +169 -0
- package/web-admin/src/layout/Shell.vue +22 -5
- package/web-admin/src/pages/Accounts.vue +3 -3
- package/web-admin/src/pages/AgentTasks.vue +2 -2
- package/web-admin/src/pages/Routes.vue +5 -1
- package/web-admin/src/pages/Usage.vue +2470 -0
- package/web-admin/src/pages/UsageAccess.vue +1147 -0
- package/web-admin/src/router.ts +8 -4
- package/web-admin/src/styles/base.css +57 -0
- package/web-admin/src/table-widths.ts +16 -1
- package/web-admin/src/usage-deletion.ts +40 -0
- package/web-admin/src/usage-management.ts +13 -0
- package/web-admin/src/usage-presentation.test.ts +21 -0
- package/web-admin/src/usage-presentation.ts +107 -0
- package/web-admin/src/usage-price-preview.test.ts +60 -0
- package/web-admin/src/usage-price-preview.ts +54 -0
- package/web-admin/tests/token-usage.browser.mjs +773 -0
- package/web-admin/tests/usage-access.browser.mjs +398 -0
- package/web/console/assets/Accounts-B4ePH5jp.css +0 -1
- package/web/console/assets/Accounts-BRCR3O0P.js +0 -3
- package/web/console/assets/AgentTasks--bqL_QKg.js +0 -2
- package/web/console/assets/AgentTasks-C8ox3TyS.css +0 -1
- package/web/console/assets/Routes-DkMIjMQA.css +0 -1
- package/web/console/assets/Routes-X9vHLpKW.js +0 -124
- package/web/console/assets/Shell-Bj6C8Hgo.css +0 -1
- package/web/console/assets/Shell-BsRa7bQQ.js +0 -1
- package/web/console/assets/index-UGvfF3Xr.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ns,c as mn}from"./vendor-element-
|
|
1
|
+
import{g as Ns,c as mn}from"./vendor-element-BD089KxE.js";var Ze={},Ni="1.13.8",Sa=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},tr=Array.prototype,Li=Object.prototype,Ba=typeof Symbol<"u"?Symbol.prototype:null,Ls=tr.push,lt=tr.slice,it=Li.toString,Ms=Li.hasOwnProperty,Kc=typeof ArrayBuffer<"u",qs=typeof DataView<"u",Ps=Array.isArray,ka=Object.keys,Wa=Object.create,Ra=Kc&&ArrayBuffer.isView,zs=isNaN,js=isFinite,Qc=!{toString:null}.propertyIsEnumerable("toString"),Oa=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Xs=Math.pow(2,53)-1;function ze(e,n){return n=n==null?e.length-1:+n,function(){for(var t=Math.max(arguments.length-n,0),r=Array(t),c=0;c<t;c++)r[c]=arguments[c+n];switch(n){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var i=Array(n+1);for(c=0;c<n;c++)i[c]=arguments[c];return i[n]=r,e.apply(this,i)}}function Dn(e){var n=typeof e;return n==="function"||n==="object"&&!!e}function Jc(e){return e===null}function Mi(e){return e===void 0}function qi(e){return e===!0||e===!1||it.call(e)==="[object Boolean]"}function eu(e){return!!(e&&e.nodeType===1)}function qe(e){var n="[object "+e+"]";return function(t){return it.call(t)===n}}const rr=qe("String"),Pi=qe("Number"),nu=qe("Date"),tu=qe("RegExp"),ru=qe("Error"),zi=qe("Symbol"),ji=qe("ArrayBuffer");var iu=qe("Function"),Vs=Sa.document&&Sa.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof Vs!="function"&&(iu=function(e){return typeof e=="function"||!1});const Me=iu,au=qe("Object");var ou=qs&&(!/\[native code\]/.test(String(DataView))||au(new DataView(new ArrayBuffer(8)))),Xi=typeof Map<"u"&&au(new Map),Hs=qe("DataView");function Gs(e){return e!=null&&Me(e.getInt8)&&ji(e.buffer)}const at=ou?Gs:Hs,vn=Ps||qe("Array");function xn(e,n){return e!=null&&Ms.call(e,n)}var Oi=qe("Arguments");(function(){Oi(arguments)||(Oi=function(e){return xn(e,"callee")})})();const ir=Oi;function cu(e){return!zi(e)&&js(e)&&!isNaN(parseFloat(e))}function Vi(e){return Pi(e)&&zs(e)}function Hi(e){return function(){return e}}function uu(e){return function(n){var t=e(n);return typeof t=="number"&&t>=0&&t<=Xs}}function su(e){return function(n){return n==null?void 0:n[e]}}const Kt=su("byteLength"),Zs=uu(Kt);var $s=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function Ys(e){return Ra?Ra(e)&&!at(e):Zs(e)&&$s.test(it.call(e))}const Gi=Kc?Ys:Hi(!1),Le=su("length");function Ks(e){for(var n={},t=e.length,r=0;r<t;++r)n[e[r]]=!0;return{contains:function(c){return n[c]===!0},push:function(c){return n[c]=!0,e.push(c)}}}function du(e,n){n=Ks(n);var t=Oa.length,r=e.constructor,c=Me(r)&&r.prototype||Li,i="constructor";for(xn(e,i)&&!n.contains(i)&&n.push(i);t--;)i=Oa[t],i in e&&e[i]!==c[i]&&!n.contains(i)&&n.push(i)}function Re(e){if(!Dn(e))return[];if(ka)return ka(e);var n=[];for(var t in e)xn(e,t)&&n.push(t);return Qc&&du(e,n),n}function lu(e){if(e==null)return!0;var n=Le(e);return typeof n=="number"&&(vn(e)||rr(e)||ir(e))?n===0:Le(Re(e))===0}function Zi(e,n){var t=Re(n),r=t.length;if(e==null)return!r;for(var c=Object(e),i=0;i<r;i++){var o=t[i];if(n[o]!==c[o]||!(o in c))return!1}return!0}function Fe(e){if(e instanceof Fe)return e;if(!(this instanceof Fe))return new Fe(e);this._wrapped=e}Fe.VERSION=Ni;Fe.prototype.value=function(){return this._wrapped};Fe.prototype.valueOf=Fe.prototype.toJSON=Fe.prototype.value;Fe.prototype.toString=function(){return String(this._wrapped)};function Ia(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Kt(e))}var Na="[object DataView]";function fu(e,n){for(var t=[{a:e,b:n}],r=[],c=[];t.length;){var i=t.pop();if(i===!0){r.pop(),c.pop();continue}if(e=i.a,n=i.b,e===n){if(e!==0||1/e===1/n)continue;return!1}if(e==null||n==null)return!1;if(e!==e){if(n!==n)continue;return!1}var o=typeof e;if(o!=="function"&&o!=="object"&&typeof n!="object")return!1;e instanceof Fe&&(e=e._wrapped),n instanceof Fe&&(n=n._wrapped);var a=it.call(e);if(a!==it.call(n))return!1;if(ou&&a=="[object Object]"&&at(e)){if(!at(n))return!1;a=Na}switch(a){case"[object RegExp]":case"[object String]":if(""+e==""+n)continue;return!1;case"[object Number]":t.push({a:+e,b:+n});continue;case"[object Date]":case"[object Boolean]":if(+e==+n)continue;return!1;case"[object Symbol]":if(Ba.valueOf.call(e)===Ba.valueOf.call(n))continue;return!1;case"[object ArrayBuffer]":case Na:t.push({a:Ia(e),b:Ia(n)});continue}var u=a==="[object Array]";if(!u&&Gi(e)){var h=Kt(e);if(h!==Kt(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)continue;u=!0}if(!u){if(typeof e!="object"||typeof n!="object")return!1;var b=e.constructor,m=n.constructor;if(b!==m&&!(Me(b)&&b instanceof b&&Me(m)&&m instanceof m)&&"constructor"in e&&"constructor"in n)return!1}for(var g=r.length;g--;)if(r[g]===e){if(c[g]===n)break;return!1}if(!(g>=0))if(r.push(e),c.push(n),t.push(!0),u){if(g=e.length,g!==n.length)return!1;for(;g--;)t.push({a:e[g],b:n[g]})}else{var f=Re(e),y;if(g=f.length,Re(n).length!==g)return!1;for(;g--;){if(y=f[g],!xn(n,y))return!1;t.push({a:e[y],b:n[y]})}}}return!0}function jn(e){if(!Dn(e))return[];var n=[];for(var t in e)n.push(t);return Qc&&du(e,n),n}function $i(e){var n=Le(e);return function(t){if(t==null)return!1;var r=jn(t);if(Le(r))return!1;for(var c=0;c<n;c++)if(!Me(t[e[c]]))return!1;return e!==gu||!Me(t[Yi])}}var Yi="forEach",hu="has",Ki=["clear","delete"],pu=["get",hu,"set"],Qs=Ki.concat(Yi,pu),gu=Ki.concat(pu),Js=["add"].concat(Ki,Yi,hu);const mu=Xi?$i(Qs):qe("Map"),bu=Xi?$i(gu):qe("WeakMap"),yu=Xi?$i(Js):qe("Set"),Du=qe("WeakSet");function kn(e){for(var n=Re(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=e[n[c]];return r}function vu(e){for(var n=Re(e),t=n.length,r=Array(t),c=0;c<t;c++)r[c]=[n[c],e[n[c]]];return r}function Qi(e){for(var n={},t=Re(e),r=0,c=t.length;r<c;r++)n[e[t[r]]]=t[r];return n}function ot(e){var n=[];for(var t in e)Me(e[t])&&n.push(t);return n.sort()}function Ji(e,n){return function(t){var r=arguments.length;if(n&&(t=Object(t)),r<2||t==null)return t;for(var c=1;c<r;c++)for(var i=arguments[c],o=e(i),a=o.length,u=0;u<a;u++){var h=o[u];(!n||t[h]===void 0)&&(t[h]=i[h])}return t}}const ea=Ji(jn),Pn=Ji(Re),na=Ji(jn,!0);function ed(){return function(){}}function xu(e){if(!Dn(e))return{};if(Wa)return Wa(e);var n=ed();n.prototype=e;var t=new n;return n.prototype=null,t}function _u(e,n){var t=xu(e);return n&&Pn(t,n),t}function Uu(e){return Dn(e)?vn(e)?e.slice():ea({},e):e}function Tu(e,n){return n(e),e}function ta(e){return vn(e)?e:[e]}Fe.toPath=ta;function ft(e){return Fe.toPath(e)}function ra(e,n){for(var t=n.length,r=0;r<t;r++){if(e==null)return;e=e[n[r]]}return t?e:void 0}function ia(e,n,t){var r=ra(e,ft(n));return Mi(r)?t:r}function wu(e,n){n=ft(n);for(var t=n.length,r=0;r<t;r++){var c=n[r];if(!xn(e,c))return!1;e=e[c]}return!!t}function ar(e){return e}function Bn(e){return e=Pn({},e),function(n){return Zi(n,e)}}function or(e){return e=ft(e),function(n){return ra(n,e)}}function ht(e,n,t){if(n===void 0)return e;switch(t??3){case 1:return function(r){return e.call(n,r)};case 3:return function(r,c,i){return e.call(n,r,c,i)};case 4:return function(r,c,i,o){return e.call(n,r,c,i,o)}}return function(){return e.apply(n,arguments)}}function Eu(e,n,t){return e==null?ar:Me(e)?ht(e,n,t):Dn(e)&&!vn(e)?Bn(e):or(e)}function cr(e,n){return Eu(e,n,1/0)}Fe.iteratee=cr;function je(e,n,t){return Fe.iteratee!==cr?Fe.iteratee(e,n):Eu(e,n,t)}function Au(e,n,t){n=je(n,t);for(var r=Re(e),c=r.length,i={},o=0;o<c;o++){var a=r[o];i[a]=n(e[a],a,e)}return i}function aa(){}function Cu(e){return e==null?aa:function(n){return ia(e,n)}}function Fu(e,n,t){var r=Array(Math.max(0,e));n=ht(n,t,1);for(var c=0;c<e;c++)r[c]=n(c);return r}function Qt(e,n){return n==null&&(n=e,e=0),e+Math.floor(Math.random()*(n-e+1))}const zn=Date.now||function(){return new Date().getTime()};function Su(e){var n=function(i){return e[i]},t="(?:"+Re(e).join("|")+")",r=RegExp(t),c=RegExp(t,"g");return function(i){return i=i==null?"":""+i,r.test(i)?i.replace(c,n):i}}const Bu={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},ku=Su(Bu),nd=Qi(Bu),Wu=Su(nd),Ru=Fe.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Fr=/(.)^/,td={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},rd=/\\|'|\r|\n|\u2028|\u2029/g;function id(e){return"\\"+td[e]}var ad=/^\s*(\w|\$)+\s*$/;function Ou(e,n,t){!n&&t&&(n=t),n=na({},n,Fe.templateSettings);var r=RegExp([(n.escape||Fr).source,(n.interpolate||Fr).source,(n.evaluate||Fr).source].join("|")+"|$","g"),c=0,i="__p+='";e.replace(r,function(h,b,m,g,f){return i+=e.slice(c,f).replace(rd,id),c=f+h.length,b?i+=`'+
|
|
2
2
|
((__t=(`+b+`))==null?'':_.escape(__t))+
|
|
3
3
|
'`:m?i+=`'+
|
|
4
4
|
((__t=(`+m+`))==null?'':__t)+
|
package/web/console/index.html
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>百灵中枢 · 控制台</title>
|
|
7
7
|
<style>html,body{background:#0a0b0d;color-scheme:dark}</style>
|
|
8
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
+
<script type="module" crossorigin src="./assets/index-H1kfa0Mj.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/vendor-vue-B2uhHUfE.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="./assets/vendor-element-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="./assets/vendor-element-BD089KxE.js">
|
|
11
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Cxuc9OCj.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="app"></div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 控制台界面约定
|
|
2
|
+
|
|
3
|
+
- “任务”是唯一独立的顶级工作入口。用户与用量、成本观测归入“运营管理”,与各接入入口分离;用量接入设置沿用“用户与用量”的导航选中状态。低频分组默认收起,访问时展开并保留用户选择。
|
|
4
|
+
- 列表页面使用 `el-card shadow="never"` 作为外层容器,标题与页面操作放在 `#header`,沿用全局背景、边框与内边距。
|
|
5
|
+
- 页签专属操作放在页签栏右侧,随当前页签切换,不另占一行工具栏。使用 `console-page-tabs` 与 `console-page-tabs-actions` 共用布局;窄屏空间不足时再换行。
|
|
6
|
+
- 常规配置使用右侧抽屉;字段较多的套餐编辑可使用完整页面。主页面原则上只保留标题旁的一个问号,按当前页签集中呈现相关说明,不在列表上方重复摆放解释性标题或文案。独立抽屉内按需提供上下文帮助;错误、凭证提醒与关键操作后果保持直接可见。问号使用统一的 `QuestionFilled` 图标。
|
|
7
|
+
- 表格列宽由 `src/table-widths.ts` 统一管理,页面不另做拖动处理。拖动结束、读取已保存列宽及容器尺寸变化时,都将列宽收敛到当前容器;不通过隐藏滚动条掩盖溢出或裁掉内容。
|
|
8
|
+
- 最后一列操作使用明确宽度、`align="right"`,可设置 `column-key="actions"`;统一规则也识别标题为“操作”的无数据字段列及既有无标题操作列,并固定到右侧。固定列的过大历史宽度同样受容器约束。
|
|
9
|
+
- 包含表格的 Grid 容器使用 `grid-template-columns: minmax(0, 1fr)`,Flex/Grid 子项按需设置 `min-width: 0`,避免内容反向撑大容器、使列宽收敛失效。
|
|
10
|
+
- 窄列中的长文本使用换行或省略提示,不以增加整个表格宽度换取单行展示。
|
|
11
|
+
|
|
12
|
+
## 用量配置删除
|
|
13
|
+
|
|
14
|
+
- 套餐、身份来源、账户的删除均先打开右侧占用预览,再提交带 `request_key` 与 `expected_revision` 的原请求;提交结果不明时沿用原请求核对,不能另建删除请求。
|
|
15
|
+
- 未开通过的套餐、未使用的身份来源与闲置组织账户可以删除。已有额度、登录身份、请求或其他历史关联时显示具体阻断原因,沿用停用;个人账户保留与原登录身份的绑定。
|
|
16
|
+
- 组织成员使用账户详情内的“移除”,保留原成员关联与历史记录。删除与移除均不清理历史用量。
|
|
17
|
+
- 删除接口在事务内重新检查占用,前端预览不替代后端校验。已删除标识不可复用,不通过恢复或更新重新创建。
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer :model-value="modelValue" :title="`${report?.kind === 'account' ? '移除' : '删除'}:${label}`" size="min(560px, 100vw)"
|
|
3
|
+
:close-on-click-modal="false" @update:model-value="emit('update:modelValue', $event)">
|
|
4
|
+
<div v-loading="loading" class="deletion-content">
|
|
5
|
+
<el-alert v-if="error" :title="error" type="error" :closable="false" />
|
|
6
|
+
<el-alert v-if="disabledReason" :title="disabledReason" type="info" :closable="false" />
|
|
7
|
+
<template v-if="report">
|
|
8
|
+
<el-alert :title="report.can_delete ? (report.kind === 'account' ? '当前可以移除' : '当前可以删除') : (report.kind === 'account' ? '当前不能直接移除' : '当前不能直接删除')"
|
|
9
|
+
:type="report.can_delete ? 'warning' : 'info'" :closable="false" />
|
|
10
|
+
<p>{{ report.effect }}</p>
|
|
11
|
+
<ul v-if="report.blockers.length">
|
|
12
|
+
<li v-for="item in report.blockers" :key="item.code">{{ item.message }} <span class="muted">({{ item.count }} {{ item.code === 'PLAN_CURRENT_ACCOUNTS' ? '个账户' : '项' }})</span></li>
|
|
13
|
+
</ul>
|
|
14
|
+
<p v-if="!report.can_delete" class="muted">{{ report.kind === 'plan' ? '请先为占用账户更换或停用其套餐,或等待到期。已换套餐、已到期、已停用的关联不影响删除;历史记录继续保留。' : report.kind === 'account' ? '请先停用账户,再刷新移除状态。历史套餐、凭证、请求和计量记录不会阻止移除;身份与历史会继续保留。' : '如需停止使用,请使用原页面的停用操作;历史关联仍会保留。' }}</p>
|
|
15
|
+
</template>
|
|
16
|
+
</div>
|
|
17
|
+
<template #footer>
|
|
18
|
+
<div class="deletion-actions">
|
|
19
|
+
<el-button @click="emit('update:modelValue', false)">关闭</el-button>
|
|
20
|
+
<el-button :disabled="busy" :loading="loading" @click="emit('refresh')">刷新占用</el-button>
|
|
21
|
+
<el-button type="danger" :disabled="busy || loading || !!error || !!disabledReason || !report?.can_delete"
|
|
22
|
+
@click="emit('delete')">{{ report?.kind === 'account' ? '确认移除' : '确认删除' }}</el-button>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
</el-drawer>
|
|
26
|
+
</template>
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import type { UsageDeletionReport } from '../usage-deletion';
|
|
29
|
+
defineProps<{
|
|
30
|
+
modelValue: boolean; label: string; report: UsageDeletionReport | null;
|
|
31
|
+
loading: boolean; busy: boolean; error: string; disabledReason?: string;
|
|
32
|
+
}>();
|
|
33
|
+
const emit = defineEmits<{
|
|
34
|
+
(e: 'update:modelValue', value: boolean): void;
|
|
35
|
+
(e: 'refresh'): void;
|
|
36
|
+
(e: 'delete'): void;
|
|
37
|
+
}>();
|
|
38
|
+
</script>
|
|
39
|
+
<style scoped>
|
|
40
|
+
.deletion-content { display: grid; gap: 16px; }
|
|
41
|
+
p, ul { margin: 0; line-height: 1.8; }
|
|
42
|
+
.muted { color: var(--el-text-color-secondary); }
|
|
43
|
+
.deletion-actions { display: flex; justify-content: flex-end; gap: 8px; }
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-popover
|
|
3
|
+
v-model:visible="open"
|
|
4
|
+
placement="top-start"
|
|
5
|
+
width="min(360px, calc(100vw - 40px))"
|
|
6
|
+
trigger="click"
|
|
7
|
+
>
|
|
8
|
+
<template #reference
|
|
9
|
+
><button
|
|
10
|
+
type="button"
|
|
11
|
+
class="usage-help"
|
|
12
|
+
:aria-label="title"
|
|
13
|
+
:aria-expanded="open"
|
|
14
|
+
@click.stop
|
|
15
|
+
@keydown.esc.stop="open = false"
|
|
16
|
+
>
|
|
17
|
+
<el-icon class="usage-help-icon"><QuestionFilled /></el-icon>
|
|
18
|
+
</button></template
|
|
19
|
+
>
|
|
20
|
+
<div class="help-title">{{ title }}</div>
|
|
21
|
+
<div class="help-body"><slot /></div>
|
|
22
|
+
</el-popover>
|
|
23
|
+
</template>
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { ref } from "vue";
|
|
26
|
+
import { QuestionFilled } from "@element-plus/icons-vue";
|
|
27
|
+
defineProps<{ title: string }>();
|
|
28
|
+
const open = ref(false);
|
|
29
|
+
</script>
|
|
30
|
+
<style scoped>
|
|
31
|
+
.usage-help {
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
padding: 0;
|
|
36
|
+
margin-left: 4px;
|
|
37
|
+
border: 0;
|
|
38
|
+
color: var(--el-text-color-placeholder);
|
|
39
|
+
background: transparent;
|
|
40
|
+
line-height: 1;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
vertical-align: -2px;
|
|
43
|
+
}
|
|
44
|
+
.usage-help-icon {
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
}
|
|
47
|
+
.usage-help:hover,
|
|
48
|
+
.usage-help:focus-visible {
|
|
49
|
+
color: var(--el-color-primary);
|
|
50
|
+
}
|
|
51
|
+
.usage-help:focus-visible {
|
|
52
|
+
outline: 2px solid var(--el-color-primary);
|
|
53
|
+
outline-offset: 3px;
|
|
54
|
+
}
|
|
55
|
+
.help-title {
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
font-size: 13px;
|
|
58
|
+
margin-bottom: 6px;
|
|
59
|
+
color: var(--el-text-color-primary);
|
|
60
|
+
}
|
|
61
|
+
.help-body {
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
line-height: 1.75;
|
|
64
|
+
color: var(--el-text-color-regular);
|
|
65
|
+
}
|
|
66
|
+
.help-body :deep(p) {
|
|
67
|
+
margin: 0 0 6px;
|
|
68
|
+
}
|
|
69
|
+
.help-body :deep(p:last-child) {
|
|
70
|
+
margin: 0;
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer
|
|
3
|
+
:model-value="modelValue"
|
|
4
|
+
:title="`删除模型服务:${label}`"
|
|
5
|
+
size="min(560px, 100vw)"
|
|
6
|
+
class="usage-references-drawer"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
9
|
+
>
|
|
10
|
+
<div v-loading="loading" class="references">
|
|
11
|
+
<el-alert v-if="error" :title="error" type="error" :closable="false" />
|
|
12
|
+
<template v-if="report">
|
|
13
|
+
<el-alert
|
|
14
|
+
title="删除后,该模型会从所有套餐及客户端可选列表中移除。"
|
|
15
|
+
type="warning"
|
|
16
|
+
:closable="false"
|
|
17
|
+
/>
|
|
18
|
+
<p class="explanation">
|
|
19
|
+
账户额度与历史用量保留。删至零个模型时,用户会看到“暂无可用模型”。
|
|
20
|
+
</p>
|
|
21
|
+
<section>
|
|
22
|
+
<h3>
|
|
23
|
+
将更新的套餐 <small>{{ report.plans.total }} 个</small>
|
|
24
|
+
</h3>
|
|
25
|
+
<p v-if="!report.plans.total" class="muted">
|
|
26
|
+
当前没有套餐包含此模型。
|
|
27
|
+
</p>
|
|
28
|
+
<div
|
|
29
|
+
v-for="plan in report.plans.items"
|
|
30
|
+
:key="plan.id"
|
|
31
|
+
class="reference-row"
|
|
32
|
+
>
|
|
33
|
+
<div>
|
|
34
|
+
<b>{{ plan.label }}</b
|
|
35
|
+
><code>{{ plan.id }}</code>
|
|
36
|
+
</div>
|
|
37
|
+
<el-button
|
|
38
|
+
v-if="canEditPlans"
|
|
39
|
+
link
|
|
40
|
+
type="primary"
|
|
41
|
+
:disabled="busy"
|
|
42
|
+
@click="emit('plan', plan.id)"
|
|
43
|
+
>查看套餐</el-button
|
|
44
|
+
>
|
|
45
|
+
</div>
|
|
46
|
+
<p v-if="report.plans.truncated" class="muted">
|
|
47
|
+
显示前 {{ report.plans.items.length }} 个;删除会从全部
|
|
48
|
+
{{ report.plans.total }} 个套餐中移除。
|
|
49
|
+
</p>
|
|
50
|
+
</section>
|
|
51
|
+
<p>
|
|
52
|
+
<b>{{ report.accounts.total }} 个账户关联上述套餐</b><br /><span
|
|
53
|
+
class="muted"
|
|
54
|
+
>账户仍然持有原套餐,无需逐个调整或重新开通。</span
|
|
55
|
+
>
|
|
56
|
+
</p>
|
|
57
|
+
<p>
|
|
58
|
+
<b>{{ report.requests.total }} 笔原请求记录保留</b><br /><span
|
|
59
|
+
class="muted"
|
|
60
|
+
>已发出的请求按原模型核对结果和计量,不会切换到其他模型或重复执行。</span
|
|
61
|
+
>
|
|
62
|
+
</p>
|
|
63
|
+
<p class="muted">
|
|
64
|
+
模型凭证与历史用量仍保留。若只想从某个套餐移除模型,请直接编辑该套餐。
|
|
65
|
+
</p>
|
|
66
|
+
</template>
|
|
67
|
+
</div>
|
|
68
|
+
<template #footer
|
|
69
|
+
><div class="drawer-actions">
|
|
70
|
+
<el-button @click="emit('update:modelValue', false)">取消</el-button>
|
|
71
|
+
<el-button :loading="loading" :disabled="busy" @click="emit('refresh')"
|
|
72
|
+
>刷新影响范围</el-button
|
|
73
|
+
>
|
|
74
|
+
<el-button
|
|
75
|
+
type="danger"
|
|
76
|
+
:loading="busy"
|
|
77
|
+
:disabled="busy || loading || !!error || !report?.deletable"
|
|
78
|
+
@click="emit('delete')"
|
|
79
|
+
>确认删除模型服务</el-button
|
|
80
|
+
>
|
|
81
|
+
</div></template
|
|
82
|
+
>
|
|
83
|
+
</el-drawer>
|
|
84
|
+
</template>
|
|
85
|
+
<script setup lang="ts">
|
|
86
|
+
import type { ServiceReferenceReport } from "../usage-management";
|
|
87
|
+
defineProps<{
|
|
88
|
+
modelValue: boolean;
|
|
89
|
+
label: string;
|
|
90
|
+
report: ServiceReferenceReport | null;
|
|
91
|
+
loading: boolean;
|
|
92
|
+
busy: boolean;
|
|
93
|
+
error: string;
|
|
94
|
+
canEditPlans: boolean;
|
|
95
|
+
}>();
|
|
96
|
+
const emit = defineEmits<{
|
|
97
|
+
(e: "update:modelValue", value: boolean): void;
|
|
98
|
+
(e: "refresh"): void;
|
|
99
|
+
(e: "delete"): void;
|
|
100
|
+
(e: "plan", id: string): void;
|
|
101
|
+
}>();
|
|
102
|
+
</script>
|
|
103
|
+
<style scoped>
|
|
104
|
+
.drawer-actions {
|
|
105
|
+
display: flex;
|
|
106
|
+
justify-content: flex-end;
|
|
107
|
+
gap: 8px;
|
|
108
|
+
flex-wrap: wrap;
|
|
109
|
+
}
|
|
110
|
+
.drawer-actions :deep(.el-button + .el-button) {
|
|
111
|
+
margin-left: 0;
|
|
112
|
+
}
|
|
113
|
+
.usage-references-drawer :deep(.el-drawer__footer) {
|
|
114
|
+
border-top: 1px solid var(--el-border-color-light);
|
|
115
|
+
padding: 16px 20px;
|
|
116
|
+
}
|
|
117
|
+
.references {
|
|
118
|
+
display: grid;
|
|
119
|
+
gap: 16px;
|
|
120
|
+
min-height: 100px;
|
|
121
|
+
}
|
|
122
|
+
.references h3 {
|
|
123
|
+
margin: 0 0 8px;
|
|
124
|
+
font-size: 15px;
|
|
125
|
+
}
|
|
126
|
+
.references small {
|
|
127
|
+
font-weight: 400;
|
|
128
|
+
color: var(--el-text-color-secondary);
|
|
129
|
+
margin-left: 8px;
|
|
130
|
+
}
|
|
131
|
+
.reference-row {
|
|
132
|
+
display: flex;
|
|
133
|
+
justify-content: space-between;
|
|
134
|
+
align-items: center;
|
|
135
|
+
gap: 20px;
|
|
136
|
+
padding: 12px 0;
|
|
137
|
+
border-bottom: 1px solid var(--el-border-color-lighter);
|
|
138
|
+
}
|
|
139
|
+
.reference-row > div {
|
|
140
|
+
min-width: 0;
|
|
141
|
+
}
|
|
142
|
+
.reference-row code {
|
|
143
|
+
display: block;
|
|
144
|
+
color: var(--el-text-color-secondary);
|
|
145
|
+
font-size: 11px;
|
|
146
|
+
overflow-wrap: anywhere;
|
|
147
|
+
margin-top: 4px;
|
|
148
|
+
}
|
|
149
|
+
.references p {
|
|
150
|
+
line-height: 1.65;
|
|
151
|
+
margin: 4px 0;
|
|
152
|
+
}
|
|
153
|
+
.muted {
|
|
154
|
+
color: var(--el-text-color-secondary);
|
|
155
|
+
font-size: 13px;
|
|
156
|
+
}
|
|
157
|
+
.explanation {
|
|
158
|
+
background: var(--el-fill-color-light);
|
|
159
|
+
padding: 12px;
|
|
160
|
+
border-radius: 8px;
|
|
161
|
+
}
|
|
162
|
+
@media (max-width: 600px) {
|
|
163
|
+
.reference-row {
|
|
164
|
+
align-items: flex-start;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
gap: 8px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
</style>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-container class="shell">
|
|
2
|
+
<el-container class="shell" :class="{ 'token-console': route.path === '/usage' || route.path === '/usage-access', 'mobile-nav-open': mobileNavOpen }">
|
|
3
|
+
<button v-if="mobileNavOpen && (route.path === '/usage' || route.path === '/usage-access')" class="mobile-nav-shade" aria-label="关闭导航" @click="mobileNavOpen = false" />
|
|
3
4
|
<el-aside width="220px" class="aside">
|
|
4
5
|
<BrandLockup class="brand" />
|
|
5
|
-
<el-menu ref="menuRef" :default-active="
|
|
6
|
+
<el-menu ref="menuRef" :default-active="activeMenuPath" :default-openeds="defaultOpeneds" router class="menu" @open="rememberGroupOpen" @close="rememberGroupClose">
|
|
6
7
|
<el-menu-item v-for="it in primaryPages" :key="it.path" :index="'/' + it.path" class="primary-item">
|
|
7
8
|
<el-icon><component :is="ICONS[it.path]" /></el-icon>
|
|
8
9
|
<span>{{ it.title }}</span>
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
|
|
22
23
|
<el-container>
|
|
23
24
|
<el-header class="topbar" height="52px">
|
|
25
|
+
<el-button v-if="route.path === '/usage' || route.path === '/usage-access'" class="mobile-nav-toggle" text :aria-expanded="mobileNavOpen" @click="mobileNavOpen = !mobileNavOpen">菜单</el-button>
|
|
24
26
|
<span class="page-title">{{ route.meta.title }}</span>
|
|
25
27
|
<span class="spacer" />
|
|
26
28
|
<span class="health" :class="{ bad: !healthy }">{{ healthy ? '中枢正常' : '中枢异常' }}</span>
|
|
@@ -96,15 +98,17 @@ import BrandLockup from '../components/BrandLockup.vue';
|
|
|
96
98
|
|
|
97
99
|
const s = useMe();
|
|
98
100
|
const route = useRoute();
|
|
101
|
+
const mobileNavOpen = ref(false);
|
|
102
|
+
watch(() => route.path, () => { mobileNavOpen.value = false; });
|
|
99
103
|
const router = useRouter();
|
|
100
104
|
const menuRef = ref<{ open: (index: string) => void } | null>(null);
|
|
101
105
|
|
|
102
106
|
const ICONS: Record<string, unknown> = {
|
|
103
|
-
kb: markRaw(Collection), runs: markRaw(Tickets), executors: markRaw(Monitor), cost: markRaw(Coin), routes: markRaw(Connection), targets: markRaw(Cpu),
|
|
107
|
+
kb: markRaw(Collection), runs: markRaw(Tickets), usage: markRaw(Coin), executors: markRaw(Monitor), cost: markRaw(Coin), routes: markRaw(Connection), targets: markRaw(Cpu),
|
|
104
108
|
tools: markRaw(SetUp), approvals: markRaw(Stamp), chat: markRaw(ChatDotRound), channels: markRaw(Promotion), projects: markRaw(Folder),
|
|
105
109
|
clients: markRaw(Key), 'agent-clients': markRaw(Connection), 'agent-tasks': markRaw(Lock), credentials: markRaw(Lock), storage: markRaw(Box), settings: markRaw(Brush), system: markRaw(InfoFilled), diagnostics: markRaw(Warning), accounts: markRaw(User), audit: markRaw(Document),
|
|
106
110
|
};
|
|
107
|
-
const GROUP_ORDER = ['场景配置', '接入入口', '能力装配', '运行', '基础资源', '系统管理'] as const;
|
|
111
|
+
const GROUP_ORDER = ['场景配置', '接入入口', '能力装配', '运行', '运营管理', '基础资源', '系统管理'] as const;
|
|
108
112
|
const DEFAULT_OPEN_GROUPS = new Set<string>(['场景配置', '接入入口', '能力装配', '运行']);
|
|
109
113
|
const CONFIG_CENTER_PATHS = new Set<string>(['credentials', 'storage', 'projects', 'settings', 'system', 'diagnostics', 'accounts']);
|
|
110
114
|
const MENU_OPEN_STORAGE_KEY = 'bailing:console:menu-open-groups:v1';
|
|
@@ -126,7 +130,8 @@ function readSavedOpenGroups(): Set<string> {
|
|
|
126
130
|
return new Set(DEFAULT_OPEN_GROUPS);
|
|
127
131
|
}
|
|
128
132
|
const savedOpenGroups = ref(readSavedOpenGroups());
|
|
129
|
-
const
|
|
133
|
+
const activeMenuPath = computed(() => route.path === '/usage-access' ? '/usage' : route.path);
|
|
134
|
+
const activeGroup = computed(() => PAGES.find((p) => '/' + p.path === activeMenuPath.value)?.group ?? '');
|
|
130
135
|
const defaultOpeneds = computed(() => {
|
|
131
136
|
const opened = new Set(savedOpenGroups.value);
|
|
132
137
|
if (activeGroup.value) opened.add(activeGroup.value);
|
|
@@ -354,4 +359,16 @@ async function onCmd(cmd: string): Promise<void> {
|
|
|
354
359
|
.demoBody code { font-family: var(--bz-mono); background: var(--el-fill-color-light); padding: 1px 4px; }
|
|
355
360
|
/* 内容区全宽铺满,与顶栏对齐——居中收口在超宽屏下跟全宽顶栏错位,反而奇怪。 */
|
|
356
361
|
.main { width: 100%; padding: 24px 28px; }
|
|
362
|
+
.mobile-nav-toggle,.mobile-nav-shade { display: none; }
|
|
363
|
+
@media(max-width:600px) {
|
|
364
|
+
.token-console > .aside { display:none; position:fixed; inset:0 auto 0 0; z-index:2201; }
|
|
365
|
+
.token-console.mobile-nav-open > .aside { display:flex; }
|
|
366
|
+
.token-console > .el-container { min-width:0; }
|
|
367
|
+
.token-console .main { padding:20px 16px; }
|
|
368
|
+
.token-console .topbar { gap:8px; padding:0 12px; }
|
|
369
|
+
.token-console .topbar .health,.token-console .topbar .top-action { display:none; }
|
|
370
|
+
.token-console .topbar .user { max-width:110px; overflow:hidden; white-space:nowrap; }
|
|
371
|
+
.token-console .mobile-nav-toggle { display:inline-flex; padding:0; }
|
|
372
|
+
.token-console .mobile-nav-shade { display:block; position:fixed; inset:0; z-index:2200; border:0; background:rgba(0,0,0,.5); }
|
|
373
|
+
}
|
|
357
374
|
</style>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<template #header>
|
|
4
4
|
<div class="head"><b>后台账号</b> <HelpTip title="后台账号 / 角色">
|
|
5
5
|
<p>后台账号只用于维护中枢控制台,不等同于业务系统用户,也不参与聊天/工具调用的业务身份。</p>
|
|
6
|
-
<p>角色决定可见板块与管理权限:<code>admin</code> 管全局配置,<code>kb_editor</code> 维护知识库,<code>viewer</code>
|
|
6
|
+
<p>角色决定可见板块与管理权限:<code>admin</code> 管全局配置,<code>kb_editor</code> 维护知识库,<code>viewer</code> 查看运行记录;<code>usage_operator</code> 管理AI额度,<code>usage_auditor</code> 只读消费明细。</p>
|
|
7
7
|
</HelpTip>
|
|
8
8
|
<el-button type="primary" style="margin-left: auto" @click="openCreate">新建账号</el-button></div>
|
|
9
9
|
</template>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<el-form-item label="显示名(可选)"><el-input v-model="form.display_name" /></el-form-item>
|
|
53
53
|
<el-form-item>
|
|
54
54
|
<template #label>角色 <span class="field-required">必填</span> <HelpTip title="角色">
|
|
55
|
-
<p><b>admin</b>:管理全局配置与账号;<b>kb_editor</b>:维护知识库;<b>viewer</b
|
|
55
|
+
<p><b>admin</b>:管理全局配置与账号;<b>kb_editor</b>:维护知识库;<b>viewer</b>:只读查看运行记录;<b>usage_operator</b>:管理AI额度;<b>usage_auditor</b>:只读消费明细。用量角色不会获得业务会话正文权限。</p>
|
|
56
56
|
</HelpTip></template>
|
|
57
57
|
<el-select v-model="form.role" style="width: 100%">
|
|
58
58
|
<el-option v-for="r in roles" :key="r" :value="r" :label="r + (ROLE_DESC[r] ? '(' + ROLE_DESC[r] + ')' : '')" />
|
|
@@ -87,7 +87,7 @@ import { copyText, fmtTime } from '../util';
|
|
|
87
87
|
import { useMe } from '../store';
|
|
88
88
|
import HelpTip from '../components/HelpTip.vue';
|
|
89
89
|
|
|
90
|
-
const ROLE_DESC: Record<string, string> = { admin: '全能', kb_editor: '知识库维护', viewer: '只读任务' };
|
|
90
|
+
const ROLE_DESC: Record<string, string> = { admin: '全能', kb_editor: '知识库维护', viewer: '只读任务', usage_operator: '用量管理', usage_auditor: '用量只读' };
|
|
91
91
|
const s = useMe();
|
|
92
92
|
const list = ref<any[]>([]);
|
|
93
93
|
const roles = ref<string[]>(['admin', 'kb_editor', 'viewer']);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<div class="actions"><el-button @click="router.push('/agent-clients')">智能体客户端</el-button><el-button :loading="listLoading" @click="loadTasks()">刷新</el-button><el-button v-if="canWrite" type="primary" @click="openCreate">{{ createAttempt ? '继续原创建' : '创建受控任务' }}</el-button></div>
|
|
6
6
|
</header>
|
|
7
7
|
<el-card shadow="never" class="explanation">
|
|
8
|
-
<div class="explanation-grid"><div><b
|
|
8
|
+
<div class="explanation-grid"><div><b>例如:更新项目资料,再核对执行结果</b><p>明确选定业务系统的原授权、工作空间、本地会话及工具。保留各系统原有权限与审批。</p></div><div><b>累计写预算 ≠ 每分钟限流</b><p>按业务写调用计数,包含待确认的预留;不是处理的数据条数,也不是成功次数。读取不扣写预算,仍受并发限制。</p></div><div><b>暂停只阻止新的派发</b><p>已获许可的调用仍可能完成。继续不补充预算、不执行或重放业务;取消不会撤回已产生的变化。</p></div></div>
|
|
9
9
|
</el-card>
|
|
10
10
|
<el-alert v-if="listError" type="error" :closable="false" :title="listError" show-icon />
|
|
11
11
|
<el-card shadow="never">
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</el-form-item>
|
|
39
39
|
<div class="form-grid">
|
|
40
40
|
<el-form-item label="Agent Session ID"><el-input v-model="member.session_id" :readonly="!member.manual" placeholder="原授权的 UUID" /></el-form-item>
|
|
41
|
-
<el-form-item label="接入方 Client App ID"><el-input v-model="member.client_app_id" :readonly="!member.manual" maxlength="64" placeholder="例如
|
|
41
|
+
<el-form-item label="接入方 Client App ID"><el-input v-model="member.client_app_id" :readonly="!member.manual" maxlength="64" placeholder="例如 business-app" /></el-form-item>
|
|
42
42
|
<el-form-item label="工作空间 Workspace"><el-input v-if="member.manual" v-model="member.workspace" maxlength="64" placeholder="原授权允许的工作空间" /><el-select v-else v-model="member.workspace" placeholder="明确选择工作空间"><el-option v-for="workspace in workspaceChoices(member)" :key="workspace.route" :label="`${workspace.name || workspace.route}(${workspace.route})`" :value="workspace.route" /></el-select></el-form-item>
|
|
43
43
|
<el-form-item label="本地会话 ID"><el-input v-model="member.client_conversation_id" maxlength="128" placeholder="从客户端宿主取得,区分于 Session ID" /></el-form-item>
|
|
44
44
|
</div>
|
|
@@ -52,14 +52,16 @@
|
|
|
52
52
|
</div>
|
|
53
53
|
</template>
|
|
54
54
|
</el-table-column>
|
|
55
|
-
<el-table-column width="
|
|
55
|
+
<el-table-column label="操作" column-key="actions" width="512" fixed="right" align="right">
|
|
56
56
|
<template #default="{ row }">
|
|
57
|
+
<div class="route-actions">
|
|
57
58
|
<el-button link type="primary" @click="router.push({ path: '/agent-clients', query: { workspace: row.route_key } })">本地智能体配置</el-button>
|
|
58
59
|
<el-button link type="primary" @click="openCode(row)">调用代码</el-button>
|
|
59
60
|
<el-button link type="primary" @click="openEdit(row)">编辑</el-button>
|
|
60
61
|
<el-popconfirm title="删除该路由?业务侧再调用会报未知 route。" width="240" @confirm="del(row.route_key)">
|
|
61
62
|
<template #reference><el-button link type="danger">删</el-button></template>
|
|
62
63
|
</el-popconfirm>
|
|
64
|
+
</div>
|
|
63
65
|
</template>
|
|
64
66
|
</el-table-column>
|
|
65
67
|
</el-table>
|
|
@@ -1833,6 +1835,8 @@ onMounted(async () => {
|
|
|
1833
1835
|
|
|
1834
1836
|
<style scoped>
|
|
1835
1837
|
.head { display: flex; align-items: center; gap: 10px; }
|
|
1838
|
+
.route-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; }
|
|
1839
|
+
.route-actions :deep(.el-button) { margin-left: 0; }
|
|
1836
1840
|
.muted { color: var(--el-text-color-secondary); font-size: 12px; }
|
|
1837
1841
|
.mono { font-family: var(--bz-mono); font-size: 12px; }
|
|
1838
1842
|
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|