Spaces:
Runtime error
Runtime error
Update index.html
Browse files- index.html +39 -147
index.html
CHANGED
@@ -1,153 +1,45 @@
|
|
1 |
-
|
2 |
-
<
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8">
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>GitHub Issue Manager</title>
|
7 |
-
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/full.css" rel="stylesheet" type="text/css" />
|
8 |
-
<script src="https://cdn.tailwindcss.com"></script>
|
9 |
-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
|
10 |
-
<style>
|
11 |
-
/* Add your custom styles here if needed */
|
12 |
-
.bg-gradient-to-br {
|
13 |
-
background: linear-gradient(to bottom right, #121212, #303030);
|
14 |
-
}
|
15 |
-
</style>
|
16 |
-
</head>
|
17 |
-
<body class="bg-gradient-to-br">
|
18 |
-
<div id="app" class="container mx-auto my-8 px-4">
|
19 |
-
<h1 class="text-4xl font-bold text-white mb-8 text-center">GitHub Issue Manager</h1>
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
<div class="form-control">
|
32 |
-
<label class="label">
|
33 |
-
<span class="label-text text-gray-300">Repository Owner</span>
|
34 |
-
</label>
|
35 |
-
<input type="text" placeholder="Enter repository owner username" v-model="githubUsername" class="input input-bordered input-primary w-full" />
|
36 |
-
</div>
|
37 |
-
|
38 |
-
<div class="form-control">
|
39 |
-
<label class="label">
|
40 |
-
<span class="label-text text-gray-300">Repository Name</span>
|
41 |
-
</label>
|
42 |
-
<input type="text" placeholder="Enter repository name" v-model="githubRepo" class="input input-bordered input-primary w-full" />
|
43 |
-
</div>
|
44 |
-
|
45 |
-
<button @click="fetchIssues" class="btn btn-accent w-full mt-4">Fetch Issues</button>
|
46 |
-
|
47 |
-
<div class="form-control mt-4" v-show="issues.length > 0">
|
48 |
-
<label class="label">
|
49 |
-
<span class="label-text text-gray-300">Select Issue</span>
|
50 |
-
</label>
|
51 |
-
<select v-model="selectedIssue" class="select select-primary w-full">
|
52 |
-
<option v-for="(issue, index) in issues" :key="index" :value="issue.number">
|
53 |
-
#{{ issue.number }}: {{ issue.title }}
|
54 |
-
</option>
|
55 |
-
</select>
|
56 |
-
</div>
|
57 |
-
|
58 |
-
<div class="form-control mt-4" v-show="selectedIssue">
|
59 |
-
<label class="label">
|
60 |
-
<span class="label-text text-gray-300">Resolution</span>
|
61 |
-
</label>
|
62 |
-
<textarea v-model="resolution" placeholder="Enter your resolution here..." class="textarea textarea-primary w-full" />
|
63 |
-
</div>
|
64 |
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
70 |
|
71 |
-
|
|
|
|
|
|
|
72 |
</div>
|
|
|
73 |
</div>
|
74 |
-
|
75 |
-
<script>
|
76 |
-
new Vue({
|
77 |
-
el: '#app',
|
78 |
-
data: {
|
79 |
-
githubToken: '',
|
80 |
-
githubUsername: '',
|
81 |
-
githubRepo: '',
|
82 |
-
issues: [],
|
83 |
-
selectedIssue: null,
|
84 |
-
resolution: '',
|
85 |
-
output: null
|
86 |
-
},
|
87 |
-
methods: {
|
88 |
-
async fetchIssues() {
|
89 |
-
if (!this.githubToken || !this.githubUsername || !this.githubRepo) {
|
90 |
-
this.output = 'Please provide all the required fields!';
|
91 |
-
return;
|
92 |
-
}
|
93 |
-
try {
|
94 |
-
const response = await fetch('/fetch_issues', {
|
95 |
-
method: 'POST',
|
96 |
-
headers: {
|
97 |
-
'Content-Type': 'application/json'
|
98 |
-
},
|
99 |
-
body: JSON.stringify({
|
100 |
-
token: this.githubToken,
|
101 |
-
username: this.githubUsername,
|
102 |
-
repo: this.githubRepo
|
103 |
-
})
|
104 |
-
});
|
105 |
-
const data = await response.json();
|
106 |
-
console.log('Fetch Issues Response:', data);
|
107 |
-
if (data.success) {
|
108 |
-
this.issues = data.issues;
|
109 |
-
this.output = null;
|
110 |
-
} else {
|
111 |
-
this.output = data.message || 'Error fetching issues';
|
112 |
-
}
|
113 |
-
} catch (error) {
|
114 |
-
this.output = 'An error occurred while fetching issues';
|
115 |
-
console.error('Error:', error);
|
116 |
-
}
|
117 |
-
},
|
118 |
-
async resolveIssue() {
|
119 |
-
if (!this.selectedIssue || !this.resolution) {
|
120 |
-
this.output = 'Please select an issue and provide the resolution!';
|
121 |
-
return;
|
122 |
-
}
|
123 |
-
try {
|
124 |
-
const response = await fetch('/resolve_issue', {
|
125 |
-
method: 'POST',
|
126 |
-
headers: {
|
127 |
-
'Content-Type': 'application/json'
|
128 |
-
},
|
129 |
-
body: JSON.stringify({
|
130 |
-
token: this.githubToken,
|
131 |
-
username: this.githubUsername,
|
132 |
-
repo: this.githubRepo,
|
133 |
-
issue_number: this.selectedIssue,
|
134 |
-
resolution: this.resolution
|
135 |
-
})
|
136 |
-
});
|
137 |
-
const data = await response.json();
|
138 |
-
console.log('Resolve Issue Response:', data);
|
139 |
-
if (data.success) {
|
140 |
-
this.output = data.message;
|
141 |
-
} else {
|
142 |
-
this.output = data.message || 'Error resolving issue';
|
143 |
-
}
|
144 |
-
} catch (error) {
|
145 |
-
this.output = 'An error occurred while resolving the issue';
|
146 |
-
console.error('Error:', error);
|
147 |
-
}
|
148 |
-
}
|
149 |
-
}
|
150 |
-
});
|
151 |
-
</script>
|
152 |
-
</body>
|
153 |
-
</html>
|
|
|
1 |
+
<div class="container mx-auto p-4">
|
2 |
+
<h1 class="text-4xl md:text-5xl font-extrabold text-white text-center mb-8">GitHub Issue Manager</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
|
4 |
+
<div class="card bg-gray-800 p-8 shadow-lg rounded-xl">
|
5 |
+
<div class="mb-4">
|
6 |
+
<label class="block text-gray-300 font-bold mb-2" for="github-token">GitHub Token</label>
|
7 |
+
<input id="github-token" type="password" class="w-full bg-gray-700 text-white border border-gray-600 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Enter your GitHub Personal Access Token">
|
8 |
+
</div>
|
9 |
+
<div class="mb-4">
|
10 |
+
<label class="block text-gray-300 font-bold mb-2" for="repo-url">Repository URL</label>
|
11 |
+
<input id="repo-url" type="text" class="w-full bg-gray-700 text-white border border-gray-600 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Enter the full GitHub repository URL">
|
12 |
+
</div>
|
13 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
<div class="card bg-gray-800 p-8 shadow-lg rounded-xl">
|
16 |
+
<div class="flex justify-between mb-4">
|
17 |
+
<button id="fetch-issues" class="bg-purple-600 hover:bg-purple-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">Fetch Issues</button>
|
18 |
+
<select id="issue-dropdown" class="select select-bordered w-full max-w-xs bg-gray-700 text-white border border-gray-600 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500">
|
19 |
+
<option selected="" disabled="">Select Issue</option>
|
20 |
+
</select>
|
21 |
+
</div>
|
22 |
+
<div class="mb-4">
|
23 |
+
<label class="block text-gray-300 font-bold mb-2" for="resolution-textarea">Resolution</label>
|
24 |
+
<textarea id="resolution-textarea" class="w-full bg-gray-700 text-white border border-gray-600 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500 h-32 resize-y" placeholder="Enter the resolution details"></textarea>
|
25 |
+
</div>
|
26 |
+
<div class="mb-4">
|
27 |
+
<label class="block text-gray-300 font-bold mb-2" for="forked-repo-url">Forked Repository URL</label>
|
28 |
+
<input id="forked-repo-url" type="text" class="w-full bg-gray-700 text-white border border-gray-600 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="URL to your forked repository (Optional)">
|
29 |
+
</div>
|
30 |
+
<button id="resolve-issue" class="bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">Resolve Issue</button>
|
31 |
+
</div>
|
32 |
|
33 |
+
<div class="card bg-gray-800 p-8 shadow-lg rounded-xl mt-4">
|
34 |
+
<label class="block text-gray-300 font-bold mb-2" for="output-textarea">Output</label>
|
35 |
+
<textarea id="output-textarea" readonly class="w-full bg-gray-700 text-white border border-gray-600 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500 h-48 resize-y"></textarea>
|
36 |
+
</div>
|
37 |
|
38 |
+
<div class="card bg-gray-800 p-8 shadow-lg rounded-xl mt-4">
|
39 |
+
<div class="mb-4">
|
40 |
+
<label class="block text-gray-300 font-bold mb-2" for="url-textbox">URL</label>
|
41 |
+
<input id="url-textbox" type="text" class="w-full bg-gray-700 text-white border border-gray-600 rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" placeholder="Enter a URL to extract information">
|
42 |
</div>
|
43 |
+
<button id="extract-info" class="bg-purple-600 hover:bg-purple-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline">Extract Info</button>
|
44 |
</div>
|
45 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|