nonebot-plugin-shiro-web-console 0.1.10__py3-none-any.whl → 0.1.11__py3-none-any.whl

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.

Potentially problematic release.


This version of nonebot-plugin-shiro-web-console might be problematic. Click here for more details.

@@ -35,7 +35,7 @@ __plugin_meta__ = PluginMetadata(
35
35
  supported_adapters={"~onebot.v11"},
36
36
  extra={
37
37
  "author": "luojisama",
38
- "version": "0.1.10",
38
+ "version": "0.1.11",
39
39
  "pypi_test": "nonebot-plugin-shiro-web-console",
40
40
  },
41
41
  )
@@ -709,12 +709,26 @@
709
709
  if (!confirm(`确定要${actionText}机器人吗?`)) return;
710
710
 
711
711
  try {
712
- const res = await authorizedFetch('/web_console/api/system/action', {
712
+ // 第一次请求(可能返回需要确认)
713
+ let res = await authorizedFetch('/web_console/api/system/action', {
713
714
  method: 'POST',
714
715
  body: JSON.stringify({ action })
715
716
  });
716
- const data = await res.json();
717
+ let data = await res.json();
717
718
 
719
+ // 如果后端返回需要确认
720
+ if (data.need_confirm) {
721
+ const confirmed = confirm('确定要执行此操作吗?');
722
+ if (!confirmed) return;
723
+
724
+ // 再次发送带确认的请求
725
+ res = await authorizedFetch('/web_console/api/system/action', {
726
+ method: 'POST',
727
+ body: JSON.stringify({ action, confirm: true })
728
+ });
729
+ data = await res.json();
730
+ }
731
+
718
732
  if (data.error) {
719
733
  // 使用更友好的错误显示方式
720
734
  const errorArea = document.createElement('div');
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nonebot-plugin-shiro-web-console
3
- Version: 0.1.10
3
+ Version: 0.1.11
4
4
  Summary: 一个用于 NoneBot2 的网页控制台插件,支持通过浏览器查看日志和发送消息
5
5
  Project-URL: Homepage, https://github.com/luojisama/nonebot-plugin-shiro-web-console
6
6
  Project-URL: Bug Tracker, https://github.com/luojisama/nonebot-plugin-shiro-web-console/issues
@@ -0,0 +1,7 @@
1
+ nonebot_plugin_shiro_web_console/__init__.py,sha256=aBAzhpvaX9BGYCqv1ygLdKkr1baVMnfoeRT1kpmkTf8,41226
2
+ nonebot_plugin_shiro_web_console/config.py,sha256=LqHht8N5CuSMyBbEjzyJgfZtg05cvBlpGn_2MgTjt-g,202
3
+ nonebot_plugin_shiro_web_console/static/index.html,sha256=D8vIYiJRFbSyx23UHQMzQs55oWzO7sdQS_pFVLQZ5hU,81205
4
+ nonebot_plugin_shiro_web_console-0.1.11.dist-info/METADATA,sha256=UpcgaZ21z6RuesVyKoMMz5_uKHn82i9DEo5_pn7uRQU,1980
5
+ nonebot_plugin_shiro_web_console-0.1.11.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
6
+ nonebot_plugin_shiro_web_console-0.1.11.dist-info/licenses/LICENSE,sha256=WedEfsrQQfoZsmbJHIAPn4UY_IcpavYULMV5in_ZPbg,1066
7
+ nonebot_plugin_shiro_web_console-0.1.11.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- nonebot_plugin_shiro_web_console/__init__.py,sha256=Ea03KJC-C2VF1GibNg6JlNujtabq6-5iQ0etzldngEo,41226
2
- nonebot_plugin_shiro_web_console/config.py,sha256=LqHht8N5CuSMyBbEjzyJgfZtg05cvBlpGn_2MgTjt-g,202
3
- nonebot_plugin_shiro_web_console/static/index.html,sha256=X4ii96HJ5mefyUk3OnitcMYsgCdjlbpOvsp6Co7LpiA,80569
4
- nonebot_plugin_shiro_web_console-0.1.10.dist-info/METADATA,sha256=TJ8kOAPygKe9idmz43LoFS5MpgHd4lV4JO305nqW2x4,1980
5
- nonebot_plugin_shiro_web_console-0.1.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
6
- nonebot_plugin_shiro_web_console-0.1.10.dist-info/licenses/LICENSE,sha256=WedEfsrQQfoZsmbJHIAPn4UY_IcpavYULMV5in_ZPbg,1066
7
- nonebot_plugin_shiro_web_console-0.1.10.dist-info/RECORD,,