Skip to content

Commit

Permalink
Merge branch 'develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
MissterHao committed May 17, 2021
2 parents c381181 + 448d972 commit ff89e70
Show file tree
Hide file tree
Showing 63 changed files with 36,822 additions and 81 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Wanna Class 元智選課系統

使用元智 Portal 帳號密碼登入,不須擔心帳號密碼會被盜用或記錄,程式碼完全公開接受開源社群的檢驗,絕對安全。

## 左方列表功能:

+ 首頁
未來將會加入 「portal 通知列表」、「圖書館還書通知」等功能。
+ 課程查詢
快速查詢每學期的課表,點擊列表可以顯示該課程資訊(學分數、上課教室、教授名稱等資訊),列表最右方有「加入選課清單」按鈕可以加入選課任務列表中。
+ 選課任務列表
以列表方式顯示目前每一門課的選課進度(「尚未選到」、「已選到!恭喜!」、「此課程已選過喔!」以及「其他未明狀態 狀態碼 x」),若出現未明狀態可以通知作者喔!
+ 設定
設定選課的階段,根據元智選課方法,需要設定目前需要選課的階段(第一、第二、第三階段)才可選課。

## Future Feature

* [ ] 任務控制鈕
* [ ] 多國語系
* [ ] 首頁顯示 Portal 通知
* [ ] Unit Test
* [ ] Mac application Build
* [ ] Github Action CI
* [ ] Github Action CD
68 changes: 62 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
const { app, BrowserWindow } = require("electron");
const { app, BrowserWindow, ipcMain } = require("electron");
const path = require("path");

const fs = require("fs")

const renderer_dirpath = path.join("./", "renderer")


let MainWindow = null
let SelectCourseWorkerWindow = null
var initConfigSettingJson = {"interval":2, "stage": "1"};

function readOrcreateSettingJson() {
try {
const content = fs.readFileSync("config/settings.json", "utf-8")
} catch (error) {

fs.writeFile("config/settings.json", JSON.stringify(initConfigSettingJson), "utf-8", function (err, data)
{

})

}

}


function createWindow() {
readOrcreateSettingJson()


// 建立 Browser Window
MainWindow = new BrowserWindow({
Expand All @@ -21,21 +37,43 @@ function createWindow() {
// Remove the frame of the window
frame: true, // 控制有沒有外框
webPreferences: {
// preload: path.join(__dirname, 'preload.js'),
nodeIntegration: true,
contextIsolation: false, // 預設為 true 必須設為 false
// preload: path.join(renderer_dirpath, "js", "preload_main.html"),
}
})

MainWindow.loadFile(path.join(renderer_dirpath, "index.html"))
MainWindow.webContents.openDevTools();


// 在主畫面關閉時 關閉 WorkerWindow
MainWindow.on("close", function(){



// 建立選課worker window
SelectCourseWorkerWindow = new BrowserWindow({
width: 1200,
height: 800,
show: true,
webPreferences: {
nodeIntegration: true,
contextIsolation: false, // 預設為 true 必須設為 false
}
})
SelectCourseWorkerWindow.loadFile(path.join(renderer_dirpath, "CourseSelWorker.html"))
SelectCourseWorkerWindow.openDevTools()




// 在主畫面關閉時 關閉 Worker
MainWindow.on("close", function () {
SelectCourseWorkerWindow.close()
})





}


Expand All @@ -62,3 +100,21 @@ app.on('activate', () => {
}
})











// IPC
ipcMain.on("addTaskCourse", (event, data)=>{
SelectCourseWorkerWindow.webContents.send("addTaskCourse", data);
})
// IPC 重讀設定檔
ipcMain.on("regetSettings", (event, data)=>{
SelectCourseWorkerWindow.webContents.send("regetSettings", data);
})
42 changes: 42 additions & 0 deletions assets/Blue Cat-1s-200px.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/ion-home-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/ion-list-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/ion-search-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/ion-send-sharp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/ion-settings-outline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/undraw_education_f8ru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/undraw_programming_2svr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/undraw_schedule_pnbk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ff89e70

Please sign in to comment.