Viewing File: /usr/local/cpanel/base/frontend/jupiter/koality/_nuxt/DypQssNj.js

import{_ as p}from"./CPUUPkX6.js";import{u as v}from"./CcxZmWN0.js";import{d as m,O as c,o as a,e as o,b as e,a as n,w as d,k as r,l as b,t as u,p as x,F as y,r as f,D as k}from"./EJiqiqZX.js";import"./D_7mLYJ8.js";const h={class:"container mx-auto p-8"},O={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},w={class:"space-y-4"},_={class:"space-y-4"},C={key:0,class:"p-4 bg-gray-100 dark:bg-gray-800 rounded-lg"},D={key:1,class:"space-y-4"},T={class:"p-4 bg-gray-100 dark:bg-gray-800 rounded-lg"},S={class:"text-sm space-y-1"},A={class:"space-y-2"},E={class:"flex flex-wrap gap-2"},P={class:"flex flex-wrap gap-2"},F={class:"p-4 bg-blue-100 dark:bg-blue-900 rounded-lg"},$={key:0,class:"text-sm text-gray-600 dark:text-gray-300"},B={key:1,class:"space-y-2"},N={class:"flex items-center gap-2"},L={class:"font-mono text-sm"},V=["onClick"],H=m({__name:"test-policy-overrides",setup(G){const s=v();return c({title:"Policy Override Test - SQM"}),(R,t)=>{const i=p;return a(),o("div",h,[t[18]||(t[18]=e("h1",{class:"text-3xl font-bold mb-8"}," Policy Override Test Page ",-1)),e("div",O,[e("div",w,[t[12]||(t[12]=e("h2",{class:"text-xl font-semibold"}," Policy Guard Examples ",-1)),n(i,{"flag-name":"basic-content",debugger:""},{default:d(()=>[...t[7]||(t[7]=[e("div",{class:"p-4 bg-green-100 dark:bg-green-900 rounded-lg"},[e("h3",{class:"font-medium"}," Basic Content Feature "),e("p",{class:"text-sm text-gray-600 dark:text-gray-300"}," This content is controlled by the 'basic-content' policy. ")],-1)])]),_:1}),n(i,{"flag-name":"feature.paid_subscription",debugger:""},{default:d(()=>[...t[8]||(t[8]=[e("div",{class:"p-4 bg-blue-100 dark:bg-blue-900 rounded-lg"},[e("h3",{class:"font-medium"}," Paid Subscription Feature "),e("p",{class:"text-sm text-gray-600 dark:text-gray-300"}," This content is controlled by the 'feature.paid_subscription' policy. ")],-1)])]),_:1}),n(i,{"flag-name":"feature.language_multi",debugger:""},{default:d(()=>[...t[9]||(t[9]=[e("div",{class:"p-4 bg-purple-100 dark:bg-purple-900 rounded-lg"},[e("h3",{class:"font-medium"}," Multi-Language Feature "),e("p",{class:"text-sm text-gray-600 dark:text-gray-300"}," This content is controlled by the 'feature.language_multi' policy. ")],-1)])]),_:1}),n(i,{"flag-name":"nonexistent.feature","default-state":"closed",debugger:""},{default:d(()=>[...t[10]||(t[10]=[e("div",{class:"p-4 bg-red-100 dark:bg-red-900 rounded-lg"},[e("h3",{class:"font-medium"}," Non-existent Feature (Default Closed) "),e("p",{class:"text-sm text-gray-600 dark:text-gray-300"}," This should be hidden by default since the policy doesn't exist. ")],-1)])]),_:1}),n(i,{"flag-name":"test.feature","default-state":"open",debugger:""},{default:d(()=>[...t[11]||(t[11]=[e("div",{class:"p-4 bg-yellow-100 dark:bg-yellow-900 rounded-lg"},[e("h3",{class:"font-medium"}," Test Feature (Default Open) "),e("p",{class:"text-sm text-gray-600 dark:text-gray-300"}," This should be visible by default since the policy doesn't exist but default is open. ")],-1)])]),_:1})]),e("div",_,[t[17]||(t[17]=e("h2",{class:"text-xl font-semibold"}," Override Controls ",-1)),r(s).isOverrideEnabled.value?(a(),o("div",D,[e("div",T,[t[14]||(t[14]=e("h3",{class:"font-medium mb-2"}," Override Statistics ",-1)),e("div",S,[e("p",null,"Total Overrides: "+u(r(s).getOverrideStats.value.total),1),e("p",null,"Enabled: "+u(r(s).getOverrideStats.value.enabled),1),e("p",null,"Disabled: "+u(r(s).getOverrideStats.value.disabled),1)])]),e("div",A,[t[15]||(t[15]=e("h3",{class:"font-medium"}," Quick Override Actions ",-1)),e("div",E,[e("button",{class:"px-3 py-1 bg-green-500 text-white rounded text-sm hover:bg-green-600",onClick:t[0]||(t[0]=l=>r(s).setOverride("basic-content",!0))}," Enable basic-content "),e("button",{class:"px-3 py-1 bg-red-500 text-white rounded text-sm hover:bg-red-600",onClick:t[1]||(t[1]=l=>r(s).setOverride("basic-content",!1))}," Disable basic-content "),e("button",{class:"px-3 py-1 bg-gray-500 text-white rounded text-sm hover:bg-gray-600",onClick:t[2]||(t[2]=l=>r(s).removeOverride("basic-content"))}," Remove basic-content Override ")]),e("div",P,[e("button",{class:"px-3 py-1 bg-green-500 text-white rounded text-sm hover:bg-green-600",onClick:t[3]||(t[3]=l=>r(s).setOverride("test.feature",!0))}," Enable test.feature "),e("button",{class:"px-3 py-1 bg-red-500 text-white rounded text-sm hover:bg-red-600",onClick:t[4]||(t[4]=l=>r(s).setOverride("test.feature",!1))}," Disable test.feature "),e("button",{class:"px-3 py-1 bg-gray-500 text-white rounded text-sm hover:bg-gray-600",onClick:t[5]||(t[5]=l=>r(s).removeOverride("test.feature"))}," Remove test.feature Override ")]),r(s).getOverrideStats.value.total>0?(a(),o("button",{key:0,class:"px-3 py-1 bg-red-600 text-white rounded text-sm hover:bg-red-700",onClick:t[6]||(t[6]=l=>r(s).clearAllOverrides())}," Clear All Overrides ")):x("",!0)]),e("div",F,[t[16]||(t[16]=e("h3",{class:"font-medium mb-2"}," Active Overrides ",-1)),Object.keys(r(s).getAllOverrides.value).length===0?(a(),o("div",$," No active overrides ")):(a(),o("div",B,[(a(!0),o(y,null,f(r(s).getAllOverrides.value,(l,g)=>(a(),o("div",{key:g,class:"flex items-center justify-between p-2 bg-white dark:bg-gray-800 rounded"},[e("div",N,[e("span",L,u(g),1),e("span",{class:k(["px-2 py-1 rounded text-xs",l.enabled?"bg-green-200 text-green-800":"bg-red-200 text-red-800"])},u(l.enabled?"ENABLED":"DISABLED"),3)]),e("button",{class:"px-2 py-1 bg-red-500 text-white rounded text-xs hover:bg-red-600",onClick:j=>r(s).removeOverride(g)}," Remove ",8,V)]))),128))]))])])):(a(),o("div",C,[...t[13]||(t[13]=[e("p",{class:"text-sm text-gray-600 dark:text-gray-300"},[b(" Policy overrides are not available in this environment. "),e("br"),b(" Available in: development, staging, or with ?debug parameter. ")],-1)])]))])]),t[19]||(t[19]=e("div",{class:"mt-8 p-4 bg-gray-100 dark:bg-gray-800 rounded-lg"},[e("h3",{class:"font-medium mb-2"}," Instructions "),e("ol",{class:"text-sm space-y-1 list-decimal list-inside"},[e("li",null,"Open the Debug Tools (press 'D' or use the floating button)"),e("li",null,'Go to the "Policies" tab'),e("li",null,"Find the policies used on this page"),e("li",null,"Use the override buttons to temporarily enable/disable them"),e("li",null,"Watch how the content on this page changes in real-time"),e("li",null,"Overrides are stored in localStorage and persist across page reloads"),e("li",null,"Overrides only work in development and staging environments")])],-1))])}}});export{H as default};
Back to Directory File Manager