DinisCruz commited on
Commit
e7c980d
·
1 Parent(s): 6417795

Fixed homepage

Browse files
cbr_athena/Gradio_Test.py CHANGED
@@ -9,11 +9,10 @@ from cbr_athena.api.Open_API import Open_API
9
 
10
 
11
 
12
- TITLE = "# Meet Athena. v0.3.0"
13
 
14
  class Gradio_Test:
15
 
16
-
17
  def __init__(self):
18
  #self.demo = None
19
  pass
@@ -21,36 +20,6 @@ class Gradio_Test:
21
  def title(self):
22
  return TITLE
23
 
24
- def add_great(self):
25
- pass
26
- # chatbot = gr.Chatbot()
27
- # msg = gr.Textbox()
28
- # clear = gr.Button("Clear")
29
- #
30
- # def user(user_message, history):
31
- # print('user_message', user_message)
32
- # print('history', history)
33
- # print('-------')
34
- # return "", history + [[user_message, None]]
35
- #
36
- # def bot(history):
37
- # from random import choice
38
- # from time import sleep
39
- # bot_message = choice(["How are you?", "I like you", "I'm very hungry"])
40
- #
41
- # #sleep(2)
42
- # print('bot_message', bot_message)
43
- # print('history', history)
44
- # history[-1][1] = bot_message + '____'
45
- # #history.append(['from me','to you'])
46
- # print('history', history)
47
- # return history
48
-
49
- # msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
50
- # bot, chatbot, chatbot
51
- # )
52
- # clear.click(lambda: None, None, chatbot, queue=False)
53
-
54
  def add_chat_bot(self):
55
  default_text = "Hi, good morning"
56
  gr.Markdown(self.title())
@@ -60,18 +29,6 @@ class Gradio_Test:
60
 
61
  def create_demo(self):
62
  with gr.Blocks() as demo:
63
- self.add_great()
64
  self.add_chat_bot()
65
-
66
-
67
-
68
-
69
-
70
-
71
  demo.queue()
72
- #self.demo = demo
73
  return demo
74
-
75
- # def launch(self):
76
- # self.demo.queue()
77
- # #self.demo.launch()
 
9
 
10
 
11
 
12
+ TITLE = "# Athena (Cyber Security Advisor)"
13
 
14
  class Gradio_Test:
15
 
 
16
  def __init__(self):
17
  #self.demo = None
18
  pass
 
20
  def title(self):
21
  return TITLE
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  def add_chat_bot(self):
24
  default_text = "Hi, good morning"
25
  gr.Markdown(self.title())
 
29
 
30
  def create_demo(self):
31
  with gr.Blocks() as demo:
 
32
  self.add_chat_bot()
 
 
 
 
 
 
33
  demo.queue()
 
34
  return demo
 
 
 
 
docs/athena/_category_.json DELETED
@@ -1,4 +0,0 @@
1
- {
2
- "label": "Chatbot",
3
- "position": 1
4
- }
 
 
 
 
 
docs/athena/chatbot.md DELETED
@@ -1,11 +0,0 @@
1
- ---
2
- sidebar_position: 1
3
- title: Athena (edited in CI)
4
- pagination_next: null
5
- pagination_prev: null
6
- ---
7
-
8
- import GradioComponent from '@site/src/components/GradioComponent';
9
-
10
-
11
- <GradioComponent />
 
 
 
 
 
 
 
 
 
 
 
 
docs/homepage.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Homepage
3
+ position: 1
4
+ pagination_next: null
5
+ pagination_prev: null
6
+
7
+ ---
8
+
9
+ ![CBR Logo](/img/cbr-logo.jpg)
10
+
11
+ ## Welcome to the CyberBoard room
12
+
13
+ ... add intro text here...
website/docusaurus.config.js CHANGED
@@ -61,11 +61,10 @@ const config = {
61
  label: 'Security Content',
62
  },
63
  {
64
- type: 'doc',
65
- docId: 'athena/chatbot',
66
- position: 'left',
67
- label: 'Athena',
68
- },
69
  ],
70
  },
71
  footer: {
 
61
  label: 'Security Content',
62
  },
63
  {
64
+ to: '/Athena',
65
+ label: 'Athena',
66
+ position: 'left',
67
+ },
 
68
  ],
69
  },
70
  footer: {
website/src/pages/Athena.jsx ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useEffect } from 'react';
2
+ import Layout from "@theme/Layout";
3
+
4
+ function Athena() {
5
+ useEffect(() => {
6
+ const script = document.createElement('script');
7
+ script.src = "https://gradio.s3-us-west-2.amazonaws.com/3.40.1/gradio.js";
8
+ script.type = "module";
9
+ document.body.appendChild(script);
10
+ }, []);
11
+
12
+ return <Layout description="CBR" wrapperClassName="homepage">
13
+ <div className="pad">
14
+ <div className="center homepage-content">
15
+ <gradio-app src="https://the-cbr-cbr-athena.hf.space"></gradio-app>
16
+ </div>
17
+ </div>
18
+
19
+ </Layout>
20
+ }
21
+
22
+ export default Athena;
website/src/pages/index.jsx CHANGED
@@ -2,6 +2,7 @@ import React from "react";
2
  import Layout from "@theme/Layout";
3
  import { useHistory } from "@docusaurus/router";
4
  import { Button } from "antd";
 
5
 
6
  import {
7
  HomepageCard as Card,
@@ -12,42 +13,24 @@ import {
12
 
13
  export default function Homepage() {
14
  const router = useHistory();
15
- console.log("in Home page")
16
 
17
  return (
18
  <Layout description="CBR" wrapperClassName="homepage">
19
  <div className="pad">
20
  <div className="center homepage-content">
21
  <div id="hero">
22
- <h2>Cyber Board Room</h2>
23
- <br />
24
- <p>
25
- CBR website
26
- </p>
27
- <br />
28
- <Button
29
- type="primary"
30
- size="large"
31
- shape="round"
32
- onClick={() =>
33
- router.push(
34
- "/docs/content/cybersecurity-in-the-boardroom"
35
- )
36
- }
37
- >
38
- Start Reading &rarr;
39
- </Button>
40
  </div>
41
-
42
  <Section title="Website areas">
43
  <Card
44
  title="Athena (ChatBot)"
45
- description="Chat Bot."
46
- to="/docs/athena/chatbot"
47
  />
48
  <Card
49
- title="Cyber Security in the Board Room"
50
- description="Guidance and Docs"
51
  to="/docs/content/cybersecurity-in-the-boardroom"
52
  />
53
  </Section>
 
2
  import Layout from "@theme/Layout";
3
  import { useHistory } from "@docusaurus/router";
4
  import { Button } from "antd";
5
+ import Content from '@site/docs/homepage.md';
6
 
7
  import {
8
  HomepageCard as Card,
 
13
 
14
  export default function Homepage() {
15
  const router = useHistory();
16
+ //console.log("in Home page")
17
 
18
  return (
19
  <Layout description="CBR" wrapperClassName="homepage">
20
  <div className="pad">
21
  <div className="center homepage-content">
22
  <div id="hero">
23
+ <Content/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  </div>
 
25
  <Section title="Website areas">
26
  <Card
27
  title="Athena (ChatBot)"
28
+ description="Talk to your Cyber Board room Advisor Athena."
29
+ to="/athena"
30
  />
31
  <Card
32
+ title="Security Content"
33
+ description="Read security guidance relevant to Board Members"
34
  to="/docs/content/cybersecurity-in-the-boardroom"
35
  />
36
  </Section>